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

正文內(nèi)容

商品的進(jìn)、銷、存系統(tǒng)的網(wǎng)站設(shè)計(jì)-全文預(yù)覽

2025-01-04 10:06 上一頁面

下一頁面
  

【正文】 pesDAO bean name marketOrdersDAO class implOurckMarketOrdersDAOImpl parent abstractDao property name infoService ref goodsInfoService bean name marketOrdersService class kMarketOrdersServiceImpl property name marketOrdersDAO ref marketOrdersDAO bean name stockOrdersDAO class implOurckStockOrdersDAOImpl parent abstractDao property name infoService ref goodsInfoService bean name stockOrdersService class kStockOrdersServiceImpl property name stockOrdersDAO ref stockOrdersDAO 通用類設(shè)計(jì) 通用類也是代碼重用的一種形式他將各個(gè)功能模塊經(jīng)常調(diào)用的方法提取到共用的 Java 類中例如訪問數(shù)據(jù)庫的 Dao 類容納了所有訪問數(shù)據(jù)庫的方法并同時(shí)管理者數(shù)據(jù)庫的連接和關(guān)閉這樣不但實(shí)現(xiàn)了項(xiàng)目代碼的重用還提高了程序的性能和代碼可讀性 通用接口類 package import alizable import 通用 Dao 接口 author Zhang Kaitao param 模型對(duì)象 param 主鍵 public interface IBaseDao M extends Serializable PK extends Serializable 保存模型對(duì)象 param model 模型對(duì)象 return 返回主鍵 public int save M model 保存或更新模型對(duì)象 param model 模型對(duì)象 public void saveOrUpdate M model 更新模型對(duì)象 param model 模型對(duì)象 public void update M model 合并模型對(duì)象狀態(tài)到底層會(huì)話 param model public void merge M model 刪除模型對(duì)象 param id 主鍵 public void delete PK id 根據(jù)主鍵獲取模型對(duì)象 param id 主鍵 return 返回模型對(duì)象 public M get PK id 統(tǒng)計(jì)模型對(duì)象對(duì)應(yīng)數(shù)據(jù)庫表中的記錄數(shù) return 返回?cái)?shù)據(jù)庫表的記錄數(shù) public int countAll return 返回所有模型對(duì)象 public List listAll 分頁獲取所有模型對(duì)象 param pn 頁碼 從 1 開始 param pageSize 每頁記錄數(shù) return public List listAll int pn int pageSize public List list final String hql final Object paramlist Daoimpl 實(shí)現(xiàn)類 package hibernate import alizable import ectParameterizedType import xception import import rnateException import y import ion import saction import springframernrnateDaoSupport import IBaseDao author Zhang Kaitao param 妯〃瀷瀵硅薄 param 涓婚敭 public abstract class BaseHibernateDao M extends Serializable PK extends Serializable extends HibernateDaoSupport implements IBaseDao M PK private Class entityClass private String HQL_LIST_ALL private String HQL_COUNT_ALL SuppressWarnings unchecked public void init 1 通過反射獲取注解 M 即模型對(duì)象的類類型 thisentityClass Class ParameterizedType getClass getGenericSuperclass getActualTypeArguments [0] 2 得到模型對(duì)象的實(shí)體名 String entityName getSessionFactory getClassMetadata thisentityClass getEntityName 3 根據(jù)實(shí)體名生成 HQL HQL_LIST_ALL from entityName HQL_COUNT_ALL select count from entityName protected String getListAllHql return HQL_LIST_ALL protected String getCountAllHql return HQL_COUNT_ALL public int save M model Session session null Transaction tx null int id 0 try session getSession tx sessionbeginTransaction id Integer sessionsave model txmit catch Exception e eprintStackTrace txrollback finally sessionclose return id public void saveOrUpdate M model Session session null Transaction tx null try session getSession tx sessionbeginTransaction sessionsaveOrUpdate model txmit catch Exception e eprintStackTrace txrollback finally sessionclose public void update M model Session session null Transaction tx null try session getSession tx sessionbeginTransaction sessionmerge model txmit catch Exception e eprintStackTrace txrollback finally sessionclose public void merge M model Session session null Transaction tx null try session getSession tx sessionbeginTransaction sessionmerge model txmit catch Exception e eprintStackTrace txrollback finally sessionclose public void delete PK id Session session null Transaction tx null try session getSession tx sessionbeginTransaction sessiondelete get id txmit catch Exception e eprintStackTrace txrollback finally sessionclose public M get PK id Session session null Transaction tx null M model null try session getSession tx sessionbeginTransaction model M sessionget thisentityClass id txmit catch Exception e eprintStackTrace txrollback finally sessionclose return model public int countAll return unique getCountAllHql size public List listAll return list getListAllHql public List listAll int pn int pageSize return list getListAllHql pn pageSize public List list final String hql f
點(diǎn)擊復(fù)制文檔內(nèi)容
研究報(bào)告相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1