package com.apatcher.zbq.hibernate;
import java.util.Date;
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;
/**
* A data access object (DAO) providing persistence and search support for
* TblFwxx 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.apatcher.zbq.hibernate.TblFwxx
* @author MyEclipse Persistence Tools
*/
public class TblFwxxDAO extends BaseHibernateDAO {
private static final Log log = LogFactory.getLog(TblFwxxDAO.class);
// property constants
public static final String JDID = "jdid";
public static final String LXID = "lxid";
public static final String SHI = "shi";
public static final String TING = "ting";
public static final String FWXX = "fwxx";
public static final String ZJ = "zj";
public static final String TITLE = "title";
public static final String TELEPHONE = "telephone";
public static final String LXR = "lxr";
public void save(TblFwxx transientInstance) {
log.debug("saving TblFwxx instance");
try {
getSession().save(transientInstance);
log.debug("save successful");
} catch (RuntimeException re) {
log.error("save failed", re);
throw re;
}
}
public void delete(TblFwxx persistentInstance) {
log.debug("deleting TblFwxx instance");
try {
getSession().delete(persistentInstance);
log.debug("delete successful");
} catch (RuntimeException re) {
log.error("delete failed", re);
throw re;
}
}
public TblFwxx findById(java.lang.Integer id) {
log.debug("getting TblFwxx instance with id: " + id);
try {
TblFwxx instance = (TblFwxx) getSession().get(
"com.apatcher.zbq.hibernate.TblFwxx", id);
return instance;
} catch (RuntimeException re) {
log.error("get failed", re);
throw re;
}
}
public List findByExample(TblFwxx instance) {
log.debug("finding TblFwxx instance by example");
try {
List results = getSession().createCriteria(
"com.apatcher.zbq.hibernate.TblFwxx").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 TblFwxx instance with property: " + propertyName
+ ", value: " + value);
try {
String queryString = "from TblFwxx 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 findByJdid(Object jdid) {
return findByProperty(JDID, jdid);
}
public List findByLxid(Object lxid) {
return findByProperty(LXID, lxid);
}
public List findByShi(Object shi) {
return findByProperty(SHI, shi);
}
public List findByTing(Object ting) {
return findByProperty(TING, ting);
}
public List findByFwxx(Object fwxx) {
return findByProperty(FWXX, fwxx);
}
public List findByZj(Object zj) {
return findByProperty(ZJ, zj);
}
public List findByTitle(Object title) {
return findByProperty(TITLE, title);
}
public List findByTelephone(Object telephone) {
return findByProperty(TELEPHONE, telephone);
}
public List findByLxr(Object lxr) {
return findByProperty(LXR, lxr);
}
public List findAll() {
log.debug("finding all TblFwxx instances");
try {
String queryString = "from TblFwxx";
Query queryObject = getSession().createQuery(queryString);
return queryObject.list();
} catch (RuntimeException re) {
log.error("find all failed", re);
throw re;
}
}
public TblFwxx merge(TblFwxx detachedInstance) {
log.debug("merging TblFwxx instance");
try {
TblFwxx result = (TblFwxx) getSession().merge(detachedInstance);
log.debug("merge successful");
return result;
} catch (RuntimeException re) {
log.error("merge failed", re);
throw re;
}
}
public void attachDirty(TblFwxx instance) {
log.debug("attaching dirty TblFwxx instance");
try {
getSession().saveOrUpdate(instance);
log.debug("attach successful");
} catch (RuntimeException re) {
log.error("attach failed", re);
throw re;
}
}
public void attachClean(TblFwxx instance) {
log.debug("attaching clean TblFwxx instance");
try {
getSession().lock(instance, LockMode.NONE);
log.debug("attach successful");
} catch (RuntimeException re) {
log.error("attach failed", re);
throw re;
}
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
很经典的ssh框架项目
共107个文件
jar:57个
java:12个
class:12个
3星 · 超过75%的资源 需积分: 6 33 下载量 63 浏览量
2010-11-13
07:06:25
上传
评论
收藏 13.61MB RAR 举报
温馨提示
很不错的ssh项目 Struts1.2 + hibernate3.1.+spring2.0 不错
资源推荐
资源详情
资源评论
收起资源包目录
很经典的ssh框架项目 (107个子文件)
TblFwxxDAO.class 7KB
TblUserDAO.class 6KB
TblFwxx.class 3KB
HibernateSessionFactory.class 2KB
FwxxAction.class 2KB
FwxxDaoimpl.class 2KB
TblUser.class 2KB
FwxxDaoimplbiz.class 1KB
BaseHibernateDAO.class 546B
FwxxForm.class 308B
FwxxDao.class 307B
IBaseHibernateDAO.class 191B
.classpath 6KB
openjpa-0.9.7-incubating.jar 2.3MB
toplink-essentials.jar 2.03MB
jasperreports-1.3.3.jar 1.42MB
itext-1.3.jar 1.08MB
xerces-2.6.2.jar 966KB
poi-2.5.1.jar 682KB
mysql-connector-java-5.1.5-bin.jar 661KB
jxl.jar 520KB
struts.jar 479KB
antlr-2.7.6rc1.jar 425KB
velocity-1.5.jar 337KB
ibatis-2.3.0.677.jar 323KB
log4j-1.2.14.jar 320KB
log4j-1.2.11.jar 305KB
dom4j-1.6.1.jar 257KB
commons-lang.jar 203KB
spring-jdbc.jar 198KB
jaxen-1.1-beta-7.jar 194KB
ehcache-1.2.4.jar 182KB
serp-1.12.1.jar 171KB
commons-collections-2.1.1.jar 169KB
commons-collections.jar 160KB
spring-core.jar 154KB
xml-apis.jar 117KB
spring-dao.jar 113KB
commons-dbcp.jar 102KB
commons-beanutils.jar 100KB
spring-portlet.jar 100KB
jaas.jar 99KB
commons-dbcp-1.1.jar 98KB
hibernate-entitymanager.jar 98KB
spring-hibernate3.jar 93KB
velocity-tools-view-1.3.jar 92KB
spring-jpa.jar 86KB
xapool.jar 77KB
jakarta-oro.jar 62KB
jakarta-oro-2.0.8.jar 62KB
spring-jdo.jar 55KB
persistence.jar 52KB
cos.jar 47KB
commons-logging.jar 46KB
toplink-api.jar 45KB
ehcache-1.1.jar 41KB
commons-codec.jar 40KB
commons-validator.jar 40KB
commons-pool-1.1.jar 39KB
asm-util-2.2.3.jar 34KB
commons-logging-1.0.4.jar 33KB
asm.jar 25KB
spring-struts.jar 21KB
spring-ibatis.jar 21KB
asm-attrs.jar 16KB
asm-commons-2.2.3.jar 15KB
portlet-api.jar 15KB
jboss-archive-browsing.jar 12KB
struts-legacy.jar 9KB
aopalliance.jar 4KB
TblFwxxDAO.java 5KB
TblUserDAO.java 4KB
HibernateSessionFactory.java 3KB
TblFwxx.java 3KB
FwxxAction.java 2KB
TblUser.java 1KB
FwxxDaoimpl.java 830B
FwxxDaoimplbiz.java 615B
FwxxForm.java 339B
BaseHibernateDAO.java 323B
FwxxDao.java 265B
IBaseHibernateDAO.java 237B
index.jsp 821B
.struts-config.mex 845B
MANIFEST.MF 39B
.myhibernatedata 543B
.mymetadata 291B
.mystrutsdata 254B
org.eclipse.jdt.core.prefs 334B
.project 2KB
ApplicationResources.properties 81B
ApplicationResources.properties 81B
.springBeans 469B
struts-html.tld 72KB
struts-nested.tld 70KB
struts-logic.tld 14KB
struts-bean.tld 9KB
struts-tiles.tld 8KB
validator-rules.xml 13KB
TblFwxx.hbm.xml 2KB
共 107 条
- 1
- 2
资源评论
- sds2d2012-11-15经典,不过我跑起来错误很多
- nxvan2014-08-11用处不大··报错,版本问题
zhuzhangzhaoyang
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功