資源簡介
這是一個二手商城,包括前臺的上傳商品信息,購物車管理,商品評論,用戶個人信息管理,下訂單,實時支付等,后臺包括商品管理,上傳下載商品信息,菜單管理,權限管理,庫存管理(可看加權平均價,商品價格根據庫存進價實時變動),數據庫為sql ,運用觸發器進行數據的基本處理。
這個項目為我畢業時的作品,已完全像淘寶一樣可以購物下單的功能。
對畢業生這是一個很好的例子。

代碼片段和文件信息
package?com.web.dao;
import?java.util.List;
import?org.hibernate.LockOptions;
import?org.hibernate.Query;
import?org.hibernate.Session;
import?org.hibernate.SessionFactory;
import?static?org.hibernate.criterion.Example.create;
import?org.slf4j.Logger;
import?org.slf4j.LoggerFactory;
import?org.springframework.context.ApplicationContext;
import?org.springframework.stereotype.Repository;
import?org.springframework.transaction.annotation.Transactional;
import?com.web.entity.Authority;
import?com.web.dao.AuthorityDAO;
/**
?*?A?data?access?object?(DAO)?providing?persistence?and?search?support?for
?*?Authority?entities.?Transaction?control?of?the?save()?update()?and?delete()
?*?operations?can?directly?support?Spring?container-managed?transactions?or?they
?*?can?be?augmented?to?handle?user-managed?Spring?transactions.?Each?of?these
?*?methods?provides?additional?information?for?how?to?configure?it?for?the
?*?desired?type?of?transaction?control.
?*?
?*?@see?com.web.dao.Authority
?*?@author?MyEclipse?Persistence?Tools
?*/
@Transactional
@Repository
public?class?AuthorityDAO?{
private?static?final?Logger?log?=?LoggerFactory
.getLogger(AuthorityDAO.class);
//?property?constants
private?SessionFactory?sessionFactory;
public?void?setSessionFactory(SessionFactory?sessionFactory)?{
this.sessionFactory?=?sessionFactory;
}
private?Session?getCurrentSession()?{
return?sessionFactory.getCurrentSession();
}
protected?void?initDao()?{
//?do?nothing
}
public?void?save(Authority?transientInstance)?{
log.debug(“saving?Authority?instance“);
try?{
getCurrentSession().save(transientInstance);
log.debug(“save?successful“);
}?catch?(RuntimeException?re)?{
log.error(“save?failed“?re);
throw?re;
}
}
public?void?delete(Authority?persistentInstance)?{
log.debug(“deleting?Authority?instance“);
try?{
getCurrentSession().delete(persistentInstance);
log.debug(“delete?successful“);
}?catch?(RuntimeException?re)?{
log.error(“delete?failed“?re);
throw?re;
}
}?
public?Authority?findById(java.lang.Integer?id)?{
log.debug(“getting?Authority?instance?with?id:?“?+?id);
try?{
Authority?instance?=?(Authority)?getCurrentSession().get(
“com.web.entity.Authority“?id);
return?instance;
}?catch?(RuntimeException?re)?{
log.error(“get?failed“?re);
throw?re;
}
}
public?List?findByExample(Authority?instance)?{
log.debug(“finding?Authority?instance?by?example“);
try?{
List?results?=?(List)?getCurrentSession()
.createCriteria(“com.web.entity.Authority“)
.add(create(instance)).list();
log.debug(“find?by?example?successful?result?size:?“
+?results.size());
return?results;
}?catch?(RuntimeException?re)?{
log.error(“find?by?example?failed“?re);
throw?re;
}
}
public?List?findByProperty(String?propertyName?object?value)?{
log.debug(“finding?Authority?instance?with?property:?“?+?propertyName
+?“?value:?“?+?value);
try
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2016-05-27?23:04??畢業設計系統\
?????目錄???????????0??2016-04-14?20:26??畢業設計系統\WEBSHOPPING\
?????文件????????1474??2016-04-17?14:46??畢業設計系統\WEBSHOPPING\.classpath
?????文件?????????475??2016-04-10?17:11??畢業設計系統\WEBSHOPPING\.myhibernatedata
?????文件????????1544??2016-04-12?19:50??畢業設計系統\WEBSHOPPING\.project
?????目錄???????????0??2016-04-14?20:26??畢業設計系統\WEBSHOPPING\.settings\
?????文件?????????522??2016-04-10?17:01??畢業設計系統\WEBSHOPPING\.settings\.jsdtscope
?????文件?????????179??2016-04-14?20:32??畢業設計系統\WEBSHOPPING\.settings\com.genuitec.runtime.libraries.xm
?????文件??????????98??2016-04-17?16:21??畢業設計系統\WEBSHOPPING\.settings\org.eclipse.core.resources.prefs
?????文件?????????598??2016-05-10?12:24??畢業設計系統\WEBSHOPPING\.settings\org.eclipse.jdt.core.prefs
?????文件?????????106??2016-04-10?17:35??畢業設計系統\WEBSHOPPING\.settings\org.eclipse.ltk.core.refactoring.prefs
?????文件?????????492??2016-04-10?17:01??畢業設計系統\WEBSHOPPING\.settings\org.eclipse.wst.common.component
?????文件?????????588??2016-04-10?17:02??畢業設計系統\WEBSHOPPING\.settings\org.eclipse.wst.common.project.facet.core.prefs.xm
?????文件?????????513??2016-04-10?17:03??畢業設計系統\WEBSHOPPING\.settings\org.eclipse.wst.common.project.facet.core.xm
?????文件??????????49??2016-04-10?17:01??畢業設計系統\WEBSHOPPING\.settings\org.eclipse.wst.jsdt.ui.superType.container
?????文件???????????6??2016-04-10?17:01??畢業設計系統\WEBSHOPPING\.settings\org.eclipse.wst.jsdt.ui.superType.name
?????文件?????????425??2016-04-10?17:03??畢業設計系統\WEBSHOPPING\.springBeans
?????目錄???????????0??2016-05-26?12:57??畢業設計系統\WEBSHOPPING\WebRoot\
?????文件?????????221??2016-02-25?20:40??畢業設計系統\WEBSHOPPING\WebRoot\1.jsp
?????文件?????????213??2016-02-25?20:40??畢業設計系統\WEBSHOPPING\WebRoot\2.jsp
?????文件????????8908??2016-05-17?16:02??畢業設計系統\WEBSHOPPING\WebRoot\AllGoods.jsp
?????文件????????6776??2016-04-18?23:14??畢業設計系統\WEBSHOPPING\WebRoot\Allindetail.jsp
?????目錄???????????0??2016-04-14?20:26??畢業設計系統\WEBSHOPPING\WebRoot\me
?????文件??????????39??2016-04-10?17:01??畢業設計系統\WEBSHOPPING\WebRoot\me
?????目錄???????????0??2016-04-17?16:32??畢業設計系統\WEBSHOPPING\WebRoot\WEB-INF\
?????目錄???????????0??2016-05-27?23:23??畢業設計系統\WEBSHOPPING\WebRoot\WEB-INF\classes\
?????文件????????6651??2016-05-15?19:04??畢業設計系統\WEBSHOPPING\WebRoot\WEB-INF\classes\applicationContext.xm
?????目錄???????????0??2016-05-27?23:23??畢業設計系統\WEBSHOPPING\WebRoot\WEB-INF\classes\com\
?????目錄???????????0??2016-05-27?23:23??畢業設計系統\WEBSHOPPING\WebRoot\WEB-INF\classes\com\web\
?????目錄???????????0??2016-05-27?23:23??畢業設計系統\WEBSHOPPING\WebRoot\WEB-INF\classes\com\web\dao\
?????文件????????6627??2016-05-27?23:23??畢業設計系統\WEBSHOPPING\WebRoot\WEB-INF\classes\com\web\dao\AuthorityDAO.class
............此處省略1900個文件信息
評論
共有 條評論