freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

酒店客房管理系統(tǒng)的設(shè)計(jì)實(shí)現(xiàn)畢業(yè)論文-資料下載頁

2025-06-25 06:35本頁面
  

【正文】 最接近于程序員的自然思維。 編寫 PO 類10 個(gè)基本的 PersisentObject 類。分別為:AccountCustomerGoodsHouseHouseCustomerHuiYuanLoginRecordPayForGoodsPcAreaUser下面只給出 House 和 Customer 類,其它的可以參看源代碼。package 。/* * * 酒店房間實(shí)體 * */public class House implements {private String houseid。 //房間id28private String housetype。 //房間類型private Double houseprice。 //房間價(jià)格private String housestate。 //房間狀態(tài)private String mark。 //房間備注public House() {} //空的構(gòu)造方法public House(String houseid, String housetype, Double houseprice,String housestate, String mark) { = houseid。 = housetype。 = houseprice。 = housestate。 = mark。} //構(gòu)造方法,給類中的屬性賦值//省略get和set 訪問器 }————————————————————————————————————————————————————————————————————————————package 。import 。import 。import 。/* * 入住酒店客人信息 * */public class Customer implements {private String customerid。 //入住idprivate String customername。 //客人姓名private String sex。 //客人性別private String inhometype。 //入住類型29private Double budgetmoney。 //預(yù)付款private String personnalcard。 //身份證號private String telephone。 //電話號碼private String address。 //聯(lián)系地址private Timestamp intime。 //入住時(shí)間private Timestamp outtime。 //離開時(shí)間private String currentstate。private Set accounts=new HashSet()。private Set housecustomers=new HashSet()。public Customer() {}public Customer(String customerid, String customername, String sex,String inhometype, Double budgetmoney, String personnalcard,String telephone, String address, Timestamp intime, Timestamp outtime,String currentstate) { = customerid。 = customername。 = sex。 = inhometype。 = budgetmoney。 = personnalcard。 = telephone。 = address。 = intime。 = outtime。 = currentstate。}//省略getter和setter訪問器}30 編寫 PO 的映身配置文件要想完成對數(shù)據(jù)庫的持久化操作,僅有 PO 是不夠的,還必需要增加想應(yīng)的映射文件。當(dāng) PO 增加映射文件后,可以完成 O/R Mapping,從而在某個(gè)特定對象的管理下完成數(shù)據(jù)庫訪問。 因此必須為這個(gè) PO 配上一個(gè)映射文件,通常將這個(gè)映射文件命名為:類名.,并與這個(gè)類放置在同一目錄下。下面以 Customer 為例。,如下:?xml version= encoding=utf8?!DOCTYPE hibernatemapping PUBLIC //Hibernate/Hibernate Mapping DTD ! Mapping file autogenerated by MyEclipse Persistence Toolshibernatemapping class name= table=TB_CUSTOMER schema=dbo catalog=JIUDIANDATABASE id name=customerid type= column name=CUSTOMERID length=20 / generator class=assigned/generator /id property name=customername type= column name=CUSTOMERNAME length=20 / /property property name=sex type= column name=SEX length=4 / /property property name=inhometype type= column name=INHOMETYPE length=10 / /property31 property name=budgetmoney type= column name=BUDGETMONEY precision=53 scale=0 / /property property name=personnalcard type= column name=PERSONNALCARD length=18 / /property property name=telephone type= column name=TELEPHONE length=11 / /property property name=address type= column name=ADDRESS length=100 / /property property name=intime type= column name=INTIME length=23 / /property property name=outtime type= column name=OUTTIME length=23 / /property property name=currentstate type= column name=CURRENTSTATE length=5 / /property set name=accounts key column name=CUSTOMERID length=20 / /key onetomany class= / /set set name=housecustomers key column name=CUSTOMERID length=20 /32 /key onetomany class= / /set /class/hibernatemapping 連接數(shù)據(jù)庫除了前面介紹的 PO 和映射文件之外, Hibernate 知道與哪個(gè)數(shù)據(jù)庫連接,也不知道連接數(shù)據(jù)庫時(shí)需要哪些屬性。因此 Hibernate 控制數(shù)據(jù)庫連接提供了兩種方式:采用 屬性文件。 采用 配置文件。這兩種方式只是形式上的區(qū)別,實(shí)質(zhì)的內(nèi)容沒有任何改變。都需要指定連接數(shù)據(jù)庫的 URL、數(shù)據(jù)庫的驅(qū)動(dòng)、用戶名及密碼等基本信息。如果需要使用連接池,則還應(yīng)確定連接池配置信息。直接 Hibernate 的配置連接直接 Hibernate 的配置連接就是使用 文件。下面是 配置文件的源代碼:?xml version=39。39。 encoding=39。UTF839。?!DOCTYPE hibernateconfiguration PUBLIC //Hibernate/Hibernate Configuration DTD ! Generated by MyEclipse Hibernate Tools. hibernateconfigurationsessionfactoryproperty name=dialect/propertyproperty name=33jdbc:microsoft:/propertyproperty name=sa/propertyproperty name=/propertyproperty name=/propertyproperty name=login/propertyproperty name=show_sqltrue/propertymapping resource=/hibernate/mapings/ /mapping resource=/hibernate/mapings/ /mapping resource=/hibernate/mapings/ /mapping resource=/hibernate/mapings/ /mapping resource=/hibernate/mapings/ /mapping resource=/hibernate/mapings/ /mapping resource=/hibernate/mapings/ /mapping resource=/hibernate/mapings/ /mapping resource=/hibernate/mapings/ /mapping resource=/hibernate/mapings/ //sessionfactory DAO 層業(yè)務(wù)邏輯層組件依賴于持久層組件,而持久層組件則提供數(shù)據(jù)表的基本 CRUD 操作。通過持久層組件,使業(yè)務(wù)邏輯層組件的實(shí)現(xiàn)與特定數(shù)據(jù)庫訪問分離,從而提高系統(tǒng)的解藕。 DAO 的具體實(shí)現(xiàn)以Goods為例子,說明DAO的實(shí)現(xiàn),源代碼如下:34package 。import 。import 。import 。import 。import 。import 。import 。public class GoodsDAO {private Session s = ()。//以下為添加商品public boolean add(Goods goods){Transaction ts = ()。 //hibernate中的Transaction事務(wù)開啟try {(goods)。 //方法save,能實(shí)現(xiàn)與sql語句中添加功能一樣的()。 //提交當(dāng)前事務(wù)return true。} catch (HibernateException e) {()。 //打印異常()。 //回滾} finally {()。 //關(guān)閉Transaction}return false。}//以下為搜索功能,通過ID搜索public List searchByGoodsID(String goodid){Session s = ()。String sql=from Goods。35if(goodid!=nullamp。amp。()!=0){sql+= where goodid=:goodid。} Query query =(sql)。if(goodid!=nullamp。amp。()!=0){(goodid,goodid)。}List listresult = ()。if(listresult!=null){return listresult。}return null。}//以下為搜索功能,通過商品類型搜索public List search(String goods
點(diǎn)擊復(fù)制文檔內(nèi)容
物理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1