资源简介
该系统来自网络的毕设,添加了数据库,可以运行...
代码片段和文件信息
package cn.lee.market.dao;
// default package
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.LockMode;
import org.hibernate.Query;
import org.hibernate.criterion.Example;
import cn.lee.market.model.Area;
/**
* Data access object (DAO) for domain model class Area.
* @see .Area
* @author MyEclipse - Hibernate Tools
*/
public class AreaDAO extends baseHibernateDAO {
private static final Log log = LogFactory.getLog(AreaDAO.class);
//property constants
public static final String AREA_NAME = “area_name“;
public static final String AREA_DESC = “area_desc“;
public void save(Area transientInstance) {
log.debug(“saving Area instance“);
try {
getSession().save(transientInstance);
log.debug(“save successful“);
} catch (RuntimeException re) {
log.error(“save failed“ re);
throw re;
}
}
public void delete(Area persistentInstance) {
log.debug(“deleting Area instance“);
try {
getSession().delete(persistentInstance);
log.debug(“delete successful“);
} catch (RuntimeException re) {
log.error(“delete failed“ re);
throw re;
}
}
public Area findById( java.lang.String id) {
log.debug(“getting Area instance with id: “ + id);
try {
Area instance = (Area) getSession()
.get(Area.class id);
return instance;
} catch (RuntimeException re) {
log.error(“get failed“ re);
throw re;
}
}
public List findByExample(Area instance) {
log.debug(“finding Area instance by example“);
try {
List results = getSession()
.createCriteria(Area.class)
.add(Example.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 Area instance with property: “ + propertyName
+ “ value: “ + value);
try {
String queryString = “from Area as model where model.“
+ propertyName + “= ?“;
Query queryobject = getSession().createQuery(queryString);
queryobject.setParameter(0 value);
return queryobject.list();
} catch (RuntimeException re) {
log.error(“find by property name failed“ re);
throw re;
}
}
public List findByArea_name(object area_name) {
return findByProperty(AREA_NAME area_name);
}
public List findByArea_desc(object are
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2016-02-01 23:04 market\
文件 951 2016-01-31 16:06 market\.classpath
文件 1255 2016-01-31 15:19 market\.project
目录 0 2016-02-01 23:04 market\.settings\
文件 503 2016-01-31 15:14 market\.settings\.jsdtscope
文件 98 2016-01-31 15:15 market\.settings\com.genuitec.eclipse.core.prefs
文件 364 2016-01-31 15:14 market\.settings\org.eclipse.jdt.core.prefs
文件 461 2016-01-31 15:14 market\.settings\org.eclipse.wst.common.component
文件 353 2016-01-31 15:14 market\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2016-01-31 15:14 market\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2016-01-31 15:14 market\.settings\org.eclipse.wst.jsdt.ui.superType.name
目录 0 2016-02-01 23:04 market\build\
目录 0 2016-02-01 23:04 market\build\classes\
目录 0 2016-02-01 23:04 market\build\classes\cn\
目录 0 2016-02-01 23:04 market\build\classes\cn\lee\
目录 0 2016-02-01 23:04 market\build\classes\cn\lee\market\
目录 0 2016-02-01 23:04 market\build\classes\cn\lee\market\dao\
文件 5277 2009-08-07 12:50 market\build\classes\cn\lee\market\dao\AreaDAO.class
文件 5348 2009-08-07 12:50 market\build\classes\cn\lee\market\dao\ArticleDAO.class
文件 511 2009-08-07 12:50 market\build\classes\cn\lee\market\dao\ba
文件 5062 2009-08-07 12:50 market\build\classes\cn\lee\market\dao\ClazzDAO.class
文件 5478 2009-08-07 12:50 market\build\classes\cn\lee\market\dao\CommentDAO.class
文件 5145 2009-08-07 12:50 market\build\classes\cn\lee\market\dao\DepartmentDAO.class
文件 182 2009-08-07 12:50 market\build\classes\cn\lee\market\dao\Iba
文件 9139 2009-08-07 12:50 market\build\classes\cn\lee\market\dao\MessageDAO.class
文件 5073 2009-08-07 12:50 market\build\classes\cn\lee\market\dao\StudentDAO.class
文件 5277 2009-08-07 12:50 market\build\classes\cn\lee\market\dao\TypeDAO.class
文件 7558 2009-08-07 12:50 market\build\classes\cn\lee\market\dao\UserDAO.class
目录 0 2016-02-01 23:04 market\build\classes\cn\lee\market\filter\
文件 2772 2009-08-07 12:50 market\build\classes\cn\lee\market\filter\HibernateFilter.class
目录 0 2016-02-01 23:04 market\build\classes\cn\lee\market\model\
............此处省略429个文件信息
评论
共有 条评论