版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、楊教授大學(xué)堂 精心創(chuàng)作的優(yōu)秀程序員 職業(yè)提升必讀系列資料基于S2SH架構(gòu)的J2EE課程設(shè)計(jì)實(shí)訓(xùn)項(xiàng)目社區(qū)醫(yī)療信息管理系統(tǒng)構(gòu)建出項(xiàng)目的Hibernate框架的開發(fā)環(huán)境1.1.1 構(gòu)建出項(xiàng)目的Hibernate框架的開發(fā)環(huán)境1、在項(xiàng)目中添加Hibernate的系統(tǒng)庫(kù)(1)然后將下面的各個(gè)*.lib庫(kù)文件(總共13文件)在Eclipse中導(dǎo)入放到Web應(yīng)用的/WEB-INF/lib目錄中。antlr-2.7.6.jar、cglib-2.2.jar、commons-collections-3.1.jar、commons-logging-1.0.4.jar (在Struts中已經(jīng)包含有,可以不再需要它)、
2、 javassist-3.9.0.GA.jar、ehcache-1.2.3.jar hibernate3.jar、jta-1.1.jar、dom4j-1.6.1.jar和log4j-1.2.15.jar、slf4j-api-1.5.8.jar和slf4j-simple-1.5.8.jar和c3p0-0.9.1.jar。(2)最后為下面的狀態(tài)2、在項(xiàng)目中添加hibernate.cfg.xml文件(1)創(chuàng)建出Hibernate框架的系統(tǒng)配置文件hibernate.cfg.xml(2)系統(tǒng)配置文件hibernate.cfg.xml的代碼示例 org.hibernate.dialect.MySQLDi
3、alect com.mysql.jdbc.Driver jdbc:mysql:/192.168.0.20:3306/chimsdb root root true 3、在項(xiàng)目中添加工作人員的PO實(shí)體類(1)實(shí)體類名稱為StaffInfoPO,程序包名稱為com.px1987.sshchims.dao.po(2)添加相關(guān)的成員屬性(名稱與數(shù)據(jù)庫(kù)庫(kù)表中的字段名稱保持一致性)private String staffID=null;private String staffName=null;private String staffPassWord=null;private int staffSex=0;
4、private int staffAge=0;private String staffBirth=null;private int department=0;/* * 職務(wù) */private String duty;/* * 職稱 */private String positional_titles;(3)為每個(gè)成員屬性添加get/set方法(4)再添加equals和Hashcode方法(5)StaffInfoPO類最終的代碼示例package com.px1987.sshchims.dao.po;public class StaffInfoPO private String staffID
5、=null;public int hashCode() final int prime = 31;int result = 1;result = prime * result + department;result = prime * result + (duty = null) ? 0 : duty.hashCode();result = prime* result+ (positional_titles = null) ? 0 : positional_titles.hashCode();result = prime * result + staffAge;result = prime *
6、 result+ (staffBirth = null) ? 0 : staffBirth.hashCode();result = prime * result + (staffID = null) ? 0 : staffID.hashCode();result = prime * result+ (staffName = null) ? 0 : staffName.hashCode();result = prime * result+ (staffPassWord = null) ? 0 : staffPassWord.hashCode();result = prime * result +
7、 staffSex;return result;public boolean equals(Object obj) if (this = obj)return true;if (obj = null)return false;if (getClass() != obj.getClass()return false;StaffInfoPO other = (StaffInfoPO) obj;if (department != other.department)return false;if (duty = null) if (other.duty != null)return false; el
8、se if (!duty.equals(other.duty)return false;if (positional_titles = null) if (other.positional_titles != null)return false; else if (!positional_titles.equals(other.positional_titles)return false;if (staffAge != other.staffAge)return false;if (staffBirth = null) if (other.staffBirth != null)return f
9、alse; else if (!staffBirth.equals(other.staffBirth)return false;if (staffID = null) if (other.staffID != null)return false; else if (!staffID.equals(other.staffID)return false;if (staffName = null) if (other.staffName != null)return false; else if (!staffName.equals(other.staffName)return false;if (
10、staffPassWord = null) if (other.staffPassWord != null)return false; else if (!staffPassWord.equals(other.staffPassWord)return false;if (staffSex != other.staffSex)return false;return true;public String getStaffID() return staffID;public void setStaffID(String staffID) this.staffID = staffID;public S
11、tring getStaffName() return staffName;public void setStaffName(String staffName) this.staffName = staffName;public String getStaffPassWord() return staffPassWord;public void setStaffPassWord(String staffPassWord) this.staffPassWord = staffPassWord;public int getStaffSex() return staffSex;public void
12、 setStaffSex(int staffSex) this.staffSex = staffSex;public int getStaffAge() return staffAge;public void setStaffAge(int staffAge) this.staffAge = staffAge;public String getStaffBirth() return staffBirth;public void setStaffBirth(String staffBirth) this.staffBirth = staffBirth;public int getDepartme
13、nt() return department;public void setDepartment(int department) this.department = department;public String getDuty() return duty;public void setDuty(String duty) this.duty = duty;public String getPositional_titles() return positional_titles;public void setPositional_titles(String positionalTitles) positional_titles = positionalTitles;private String staffName=null;private String staffPassWord=null;private int staffSex=0;private int staffAge=0;private String staffBirth=null;private int department=
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 施工日志填寫樣本的格式要求
- 設(shè)計(jì)思維在醫(yī)療技術(shù)創(chuàng)新中的應(yīng)用
- 智能科技在家?;?dòng)中的應(yīng)用與前景展望
- DB4415T 50-2025黑芝麻種植技術(shù)規(guī)程
- 個(gè)人貸款合同協(xié)議書范本
- 親屬間房產(chǎn)贈(zèng)與合同
- 二手建筑設(shè)備買賣合同樣本
- 乒乓球館租賃合同書范本
- 不可撤銷勞動(dòng)合同案例析:勞動(dòng)者權(quán)益保障
- 專業(yè)工作室服務(wù)合作合同樣本
- 數(shù)據(jù)中心運(yùn)維方案
- 小龍蝦啤酒音樂節(jié)活動(dòng)策劃方案課件
- 運(yùn)動(dòng)技能學(xué)習(xí)與控制課件第五章運(yùn)動(dòng)中的中樞控制
- 財(cái)務(wù)部規(guī)范化管理 流程圖
- 蘇教版2023年小學(xué)四年級(jí)數(shù)學(xué)下冊(cè)教學(xué)計(jì)劃+教學(xué)進(jìn)度表
- 小學(xué)作文指導(dǎo)《難忘的一件事》課件
- 斷絕關(guān)系協(xié)議書范文參考(5篇)
- 量子力學(xué)課件1-2章-波函數(shù)-定態(tài)薛定諤方程
- 最新變態(tài)心理學(xué)課件
- 【自考練習(xí)題】石家莊學(xué)院概率論與數(shù)理統(tǒng)計(jì)真題匯總(附答案解析)
- 農(nóng)村集體“三資”管理流程圖
評(píng)論
0/150
提交評(píng)論