歡迎來到裝配圖網(wǎng)! | 幫助中心 裝配圖網(wǎng)zhuangpeitu.com!
裝配圖網(wǎng)
ImageVerifierCode 換一換
首頁 裝配圖網(wǎng) > 資源分類 > DOC文檔下載  

基于J2EE Struts框架的課程設(shè)計實訓(xùn)項目——BBS論壇系統(tǒng)——構(gòu)建系統(tǒng)持久層中各個實體PO類第1部分

  • 資源ID:34531069       資源大小:486.02KB        全文頁數(shù):31頁
  • 資源格式: DOC        下載積分:10積分
快捷下載 游客一鍵下載
會員登錄下載
微信登錄下載
三方登錄下載: 微信開放平臺登錄 支付寶登錄   QQ登錄   微博登錄  
二維碼
微信掃一掃登錄
下載資源需要10積分
郵箱/手機(jī):
溫馨提示:
用戶名和密碼都是您填寫的郵箱或者手機(jī)號,方便查詢和重復(fù)下載(系統(tǒng)自動生成)
支付方式: 支付寶    微信支付   
驗證碼:   換一換

 
賬號:
密碼:
驗證碼:   換一換
  忘記密碼?
    
友情提示
2、PDF文件下載后,可能會被瀏覽器默認(rèn)打開,此種情況可以點擊瀏覽器菜單,保存網(wǎng)頁到桌面,就可以正常下載了。
3、本站不支持迅雷下載,請使用電腦自帶的IE瀏覽器,或者360瀏覽器、谷歌瀏覽器下載即可。
4、本站資源下載后的文檔和圖紙-無水印,預(yù)覽文檔經(jīng)過壓縮,下載后原文更清晰。
5、試題試卷類文檔,如果標(biāo)題沒有明確說明有答案則都視為沒有答案,請知曉。

基于J2EE Struts框架的課程設(shè)計實訓(xùn)項目——BBS論壇系統(tǒng)——構(gòu)建系統(tǒng)持久層中各個實體PO類第1部分

楊教授大學(xué)堂 精心創(chuàng)作的優(yōu)秀程序員 職業(yè)提升必讀系列資料基于J2EE Struts框架的課程設(shè)計實訓(xùn)項目BBS論壇系統(tǒng)構(gòu)建系統(tǒng)持久層中各個實體PO類(第1/2部分)1.1.1 構(gòu)造出本W(wǎng)eb項目中的DAO層的各個實體PO類組件1、本項目中的各個PO的類圖2、在數(shù)據(jù)訪問層中添加各個PO類建立UserInfoBasePO實體類(1)UserInfoBasePO基類,包名稱為com.px1987.webbbs.dao,并實現(xiàn)java.io.Serializable接口(2)添加下面的各個成員屬性private String id;private String userName;private String userPassWord;private int userType;private String aliaoName;private String passWordAsk;private String userImage;private String registerTime;private String passWordAnswer;private String userMail;private int userSex;private String userBirthDay;private String userComeFrom;private String userResume;(3)并為這些成員屬性提供get/set方法(4)最后產(chǎn)生出下面的代碼package com.px1987.webbbs.dao;public class UserInfoBasePO implements java.io.Serializable private static final long serialVersionUID = 1L;private String id;private String userName;private String userPassWord;private int userType;private String aliaoName;private String passWordAsk;private String userImage;private String registerTime;private String passWordAnswer;private String userMail;private int userSex;private String userBirthDay;private String userComeFrom;private String userResume;public UserInfoBasePO() public String getAliaoName() return aliaoName;public void setAliaoName(String aliaoName) this.aliaoName = aliaoName;public String getId() return id;public void setId(String id) this.id = id;public String getPassWordAnswer() return passWordAnswer;public void setPassWordAnswer(String passWordAnswer) this.passWordAnswer = passWordAnswer;public String getPassWordAsk() return passWordAsk;public void setPassWordAsk(String passWordAsk) this.passWordAsk = passWordAsk;public String getRegisterTime() return registerTime;public void setRegisterTime(String registerTime) this.registerTime = registerTime;public String getUserBirthDay() return userBirthDay;public void setUserBirthDay(String userBirthDay) this.userBirthDay = userBirthDay;public String getUserComeFrom() return userComeFrom;public void setUserComeFrom(String userComeFrom) this.userComeFrom = userComeFrom;public String getUserImage() return userImage;public void setUserImage(String userImage) this.userImage = userImage;public String getUserMail() return userMail;public void setUserMail(String userMail) this.userMail = userMail;public String getUserName() return userName;public void setUserName(String userName) this.userName = userName;public String getUserPassWord() return userPassWord;public void setUserPassWord(String userPassWord) this.userPassWord = userPassWord;public String getUserResume() return userResume;public void setUserResume(String userResume) this.userResume = userResume;public int getUserSex() return userSex;public void setUserSex(int userSex) this.userSex = userSex;public int getUserType() return userType;public void setUserType(int userType) this.userType = userType;Overridepublic int hashCode() final int PRIME = 31;int result = 1;result = PRIME * result + (aliaoName = null) ? 0 : aliaoName.hashCode();result = PRIME * result + (id = null) ? 0 : id.hashCode();result = PRIME * result + (passWordAnswer = null) ? 0 : passWordAnswer.hashCode();result = PRIME * result + (passWordAsk = null) ? 0 : passWordAsk.hashCode();result = PRIME * result + (registerTime = null) ? 0 : registerTime.hashCode();result = PRIME * result + (userBirthDay = null) ? 0 : userBirthDay.hashCode();result = PRIME * result + (userComeFrom = null) ? 0 : userComeFrom.hashCode();result = PRIME * result + (userImage = null) ? 0 : userImage.hashCode();result = PRIME * result + (userMail = null) ? 0 : userMail.hashCode();result = PRIME * result + (userName = null) ? 0 : userName.hashCode();result = PRIME * result + (userPassWord = null) ? 0 : userPassWord.hashCode();result = PRIME * result + (userResume = null) ? 0 : userResume.hashCode();result = PRIME * result + userSex;result = PRIME * result + userType;return result;Overridepublic boolean equals(Object obj) if (this = obj)return true;if (obj = null)return false;if (getClass() != obj.getClass()return false;final UserInfoBasePO other = (UserInfoBasePO) obj;if (aliaoName = null) if (other.aliaoName != null)return false; else if (!aliaoName.equals(other.aliaoName)return false;if (id = null) if (other.id != null)return false; else if (!id.equals(other.id)return false;if (passWordAnswer = null) if (other.passWordAnswer != null)return false; else if (!passWordAnswer.equals(other.passWordAnswer)return false;if (passWordAsk = null) if (other.passWordAsk != null)return false; else if (!passWordAsk.equals(other.passWordAsk)return false;if (registerTime = null) if (other.registerTime != null)return false; else if (!registerTime.equals(other.registerTime)return false;if (userBirthDay = null) if (other.userBirthDay != null)return false; else if (!userBirthDay.equals(other.userBirthDay)return false;if (userComeFrom = null) if (other.userComeFrom != null)return false; else if (!userComeFrom.equals(other.userComeFrom)return false;if (userImage = null) if (other.userImage != null)return false; else if (!userImage.equals(other.userImage)return false;if (userMail = null) if (other.userMail != null)return false; else if (!userMail.equals(other.userMail)return false;if (userName = null) if (other.userName != null)return false; else if (!userName.equals(other.userName)return false;if (userPassWord = null) if (other.userPassWord != null)return false; else if (!userPassWord.equals(other.userPassWord)return false;if (userResume = null) if (other.userResume != null)return false; else if (!userResume.equals(other.userResume)return false;if (userSex != other.userSex)return false;if (userType != other.userType)return false;return true;3、在數(shù)據(jù)訪問層中添加各個PO類建立UserInfoPO實體類(1)UserInfoPO類,包名稱為com.px1987.webbbs.dao并繼承于com.px1987.webbbs.dao.UserInfoBasePO基類(2)添加下面的各個成員屬性private Map contactMethod = new HashMap();private String userSign;private int emailVisible;private int acceptAdvise;(3)并為這些成員屬性提供get/set方法(4)最后產(chǎn)生出下面的代碼package com.px1987.webbbs.dao;import java.util.ArrayList;import java.util.HashMap;import java.util.HashSet;import java.util.Map;import java.util.Set;public class UserInfoPO extends UserInfoBasePO private Map contactMethod = new HashMap();private String userSign;private int emailVisible;private int acceptAdvise;public UserInfoPO() public int getAcceptAdvise() return acceptAdvise;public void setAcceptAdvise(int acceptAdvise) this.acceptAdvise = acceptAdvise;public Map getContactMethod() return contactMethod;public void setContactMethod(Map contactMethod) this.contactMethod = contactMethod;public int getEmailVisible() return emailVisible;public void setEmailVisible(int emailVisible) this.emailVisible = emailVisible;public String getUserSign() return userSign;public void setUserSign(String userSign) this.userSign = userSign;public void addOneContactMethod(String oneContactMethodKey,String oneContactMethodValue) /該方法為“幫助方法”contactMethod.put(oneContactMethodKey,oneContactMethodValue);public String getOneContactMethod(String oneContactMethodKey) /該方法為“幫助方法”return (String)contactMethod.get(oneContactMethodKey);/在“一”端(UserInfo)的PO類中增加一個“多”端(BBSInfo)的集合對象的屬性private Set bbsInfos = new HashSet();public Set getBbsInfos()return bbsInfos;public void setBbsInfos(Set bbsInfos) this.bbsInfos = bbsInfos;public ArrayList getBBSInfoSByUser() /利用該方法可以獲得該用戶所發(fā)表的BBS信息ArrayList allBBSInfosByOneUser=null;allBBSInfosByOneUser=new ArrayList();java.util.Iterator allBBSInfoItemIterator = getBbsInfos().iterator();while(allBBSInfoItemIterator.hasNext()BBSInfoPO oneBBSInfo=(BBSInfoPO)allBBSInfoItemIterator.next();allBBSInfosByOneUser.add(oneBBSInfo);return allBBSInfosByOneUser;Overridepublic int hashCode() final int PRIME = 31;int result = super.hashCode();result = PRIME * result + acceptAdvise;result = PRIME * result + (bbsInfos = null) ? 0 : bbsInfos.hashCode();result = PRIME * result + (contactMethod = null) ? 0 : contactMethod.hashCode();result = PRIME * result + emailVisible;result = PRIME * result + (userSign = null) ? 0 : userSign.hashCode();return result;Overridepublic boolean equals(Object obj) if (this = obj)return true;if (!super.equals(obj)return false;if (getClass() != obj.getClass()return false;final UserInfoPO other = (UserInfoPO) obj;if (acceptAdvise != other.acceptAdvise)return false;if (bbsInfos = null) if (other.bbsInfos != null)return false; else if (!bbsInfos.equals(other.bbsInfos)return false;if (contactMethod = null) if (other.contactMethod != null)return false; else if (!contactMethod.equals(other.contactMethod)return false;if (emailVisible != other.emailVisible)return false;if (userSign = null) if (other.userSign != null)return false; else if (!userSign.equals(other.userSign)return false;return true;4、在數(shù)據(jù)訪問層中添加各個PO類建立AdminUserInfoPO實體類(1)AdminUserInfoPO類,包名稱為com.px1987.webbbs.dao并且也繼承于com.px1987.webbbs.dao.UserInfoBasePO類(2)添加下面的成員屬性private String workUnit;private String studyHistory;private String studySchool;private String idCardNo;(3)并這些成員屬性提供get/set方法(4)最后產(chǎn)生出下面的代碼package com.px1987.webbbs.dao;public class AdminUserInfoPO extends UserInfoBasePO private String workUnit;private String studyHistory;private String studySchool;private String idCardNo;public AdminUserInfoPO() public String getIdCardNo() return idCardNo;public void setIdCardNo(String idCardNo) this.idCardNo = idCardNo;public String getStudyHistory() return studyHistory;public void setStudyHistory(String studyHistory) this.studyHistory = studyHistory;public String getStudySchool() return studySchool;public void setStudySchool(String studySchool) this.studySchool = studySchool;public String getWorkUnit() return workUnit;public void setWorkUnit(String workUnit) this.workUnit = workUnit;Overridepublic int hashCode() final int PRIME = 31;int result = super.hashCode();result = PRIME * result + (idCardNo = null) ? 0 : idCardNo.hashCode();result = PRIME * result + (studyHistory = null) ? 0 : studyHistory.hashCode();result = PRIME * result + (studySchool = null) ? 0 : studySchool.hashCode();result = PRIME * result + (workUnit = null) ? 0 : workUnit.hashCode();return result;Overridepublic boolean equals(Object obj) if (this = obj)return true;if (!super.equals(obj)return false;if (getClass() != obj.getClass()return false;final AdminUserInfoPO other = (AdminUserInfoPO) obj;if (idCardNo = null) if (other.idCardNo != null)return false; else if (!idCardNo.equals(other.idCardNo)return false;if (studyHistory = null) if (other.studyHistory != null)return false; else if (!studyHistory.equals(other.studyHistory)return false;if (studySchool = null) if (other.studySchool != null)return false; else if (!studySchool.equals(other.studySchool)return false;if (workUnit = null) if (other.workUnit != null)return false; else if (!workUnit.equals(other.workUnit)return false;return true;5、在數(shù)據(jù)訪問層中添加各個PO類建立BBSInfoPO實體類(1)BBSInfoPO類,包名稱為com.px1987.webbbs.dao,并實現(xiàn)java.io.Serializable接口(2)添加下面的成員屬性private String author; private String title; private int replay; private int hits; private String sendInfoTime; private String content;/private Clob content; private int mailto; private String abstractText; private String lastUpdateTime; private int bbsIconID; private int bbsTypeID; private int bbsTitleID; private String userID; private Integer id;(3)并為這些成員屬性提供get/set方法(4)最后產(chǎn)生出下面的代碼package com.px1987.webbbs.dao;import java.sql.*;import java.util.*;public class BBSInfoPO implements java.io.Serializableprivate String author;private String title;private int replay;private int hits;private String sendInfoTime;private String content;/private Clob content;private int mailto;private String abstractText;private String lastUpdateTime;private int bbsIconID;private int bbsTypeID;private int bbsTitleID;private String userID;private int bbsID;public BBSInfoPO()public String getAbstractText() return abstractText;public void setAbstractText(String abstractText) this.abstractText = abstractText;public String getAuthor() return author;public void setAuthor(String author) this.author = author;public int getBbsIconID() return bbsIconID;public void setBbsIconID(int bbsIconID) this.bbsIconID = bbsIconID;public int getBbsTitleID() return bbsTitleID;public void setBbsTitleID(int bbsTitleID) this.bbsTitleID = bbsTitleID;public int getBbsTypeID() return bbsTypeID;public void setBbsTypeID(int bbsTypeID) this.bbsTypeID = bbsTypeID;public String getContent() return content;public void setContent(String content) this.content = content;public int getHits() return hits;public void setHits(int hits) this.hits = hits;public String getLastUpdateTime() return lastUpdateTime;public void setLastUpdateTime(String lastUpdateTime) this.lastUpdateTime = lastUpdateTime;public int getMailto() return mailto;public void setMailto(int mailto) this.mailto = mailto;public int getReplay() return replay;public void setReplay(int replay) this.replay = replay;public String getSendInfoTime() return sendInfoTime;public void setSendInfoTime(String sendInfoTime) this.sendInfoTime = sendInfoTime;public String getTitle() return title;public void setTitle(String title) this.title = title;public String getUserID() return userID;public void setUserID(String userID) this.userID = userID;private Set bbsReplyInfos = new HashSet();public Set getBbsReplyInfos()return bbsReplyInfos;public void setBbsReplyInfos(Set bbsReplyInfos)this.bbsReplyInfos = bbsReplyInfos;public ArrayList getBbsReplyInfosByBBS() /利用該方法可以獲得該分類下的所有BBS信息ArrayList allBbsReplyInfosByOneBBS=null;allBbsReplyInfosByOneBBS=new ArrayList();java.util.Iterator allBBSReplyInfoItemIterator = getBbsReplyInfos().iterator();while(allBBSReplyInfoItemIterator.hasNext()BBSReplyInfoPO oneBBSReplyInfo=(BBSReplyInfoPO)allBBSReplyInfoItemIterator.next();allBbsReplyInfosByOneBBS.add(oneBBSReplyInfo);return allBbsReplyInfosByOneBBS;public int getBbsID() return bbsID;public void setBbsID(int bbsID) this.bbsID = bbsID;Overridepublic int hashCode() final int PRIME = 31;int result = 1;result = PRIME * result + (abstractText = null) ? 0 : abstractText.hashCode();result = PRIME * result + (author = null) ? 0 : author.hashCode();result = PRIME * result + bbsID;result = PRIME * result + bbsIconID;result = PRIME * result + (bbsReplyInfos = null) ? 0 : bbsReplyInfos.hashCode();result = PRIME * result + bbsTitleID;result = PRIME * result + bbsTypeID;result = PRIME * result + (content = null) ? 0 : content.hashCode();result = PRIME * result + hits;result = PRIME * result + (lastUpdateTime = null) ? 0 : lastUpdateTime.hashCode();result = PRIME * result + mailto;result = PRIME * result + replay;result = PRIME * result + (sendInfoTime = null) ? 0 : sendInfoTime.hashCode();result = PRIME * result + (title = null) ? 0 : title.hashCode();result = PRIME * result + (userID = null) ? 0 : userID.hashCode();return result;Overridepublic boolean equals(Object obj) if (this = obj)return true;if (obj = null)return false;if (getClass() != obj.getClass()return false;final BBSInfoPO other = (BBSInfoPO) obj;if (abstractText = null) if (other.abstractText != null)return false; else if (!abstractText.equals(other.abstractText)return false;if (author = null) if (other.author != null)return false; else if (!author.equals(other.author)return false;if (bbsID != other.bbsID)return false;if (bbsIconID != other.bbsIconID)return false;if (bbsReplyInfos = null) if (other.bbsReplyInfos != null)return false; else if (!bbsReplyInfos.equals(other.bbsReplyInfos)return false;if (bbsTitleID != other.bbsTitleID)return false;if (bbsTypeID != other.bbsTypeID)return false;if (content = null) if (other.content != null)return false; else if (!content.equals(other.content)return false;if (hits != other.hits)return false;if (lastUpdateTime = null) if (other.lastUpdateTime != null)return false; else if (!lastUpdateTime.equals(other.lastUpdateTime)return false;if (mailto != other.mailto)return false;if (replay != other.replay)return false;if (sendInfoTime = null) if (other.sendInfoTime != null)return false; else if (!sendInfoTime.equals(other.sendInfoTime)return false;if (title = null) if (other.title != null)return false; else if (!title.equals(other.title)return false;if (userID = null) if (other.userID != null)return false; else if (!userID.equals(other.userID)return false;return true;楊教授大學(xué)堂,版權(quán)所有,盜版必究。 31/31頁

注意事項

本文(基于J2EE Struts框架的課程設(shè)計實訓(xùn)項目——BBS論壇系統(tǒng)——構(gòu)建系統(tǒng)持久層中各個實體PO類第1部分)為本站會員(仙***)主動上傳,裝配圖網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對上載內(nèi)容本身不做任何修改或編輯。 若此文所含內(nèi)容侵犯了您的版權(quán)或隱私,請立即通知裝配圖網(wǎng)(點擊聯(lián)系客服),我們立即給予刪除!

溫馨提示:如果因為網(wǎng)速或其他原因下載失敗請重新下載,重復(fù)下載不扣分。




關(guān)于我們 - 網(wǎng)站聲明 - 網(wǎng)站地圖 - 資源地圖 - 友情鏈接 - 網(wǎng)站客服 - 聯(lián)系我們

copyright@ 2023-2025  zhuangpeitu.com 裝配圖網(wǎng)版權(quán)所有   聯(lián)系電話:18123376007

備案號:ICP2024067431-1 川公網(wǎng)安備51140202000466號


本站為文檔C2C交易模式,即用戶上傳的文檔直接被用戶下載,本站只是中間服務(wù)平臺,本站所有文檔下載所得的收益歸上傳人(含作者)所有。裝配圖網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對上載內(nèi)容本身不做任何修改或編輯。若文檔所含內(nèi)容侵犯了您的版權(quán)或隱私,請立即通知裝配圖網(wǎng),我們立即給予刪除!