package model;
import java.util.List;
import org.hibernate.LockMode;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
/**
* A data access object (DAO) providing persistence and search support for Bonus
* 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 model.Bonus
* @author MyEclipse Persistence Tools
*/
public class BonusDAO extends HibernateDaoSupport {
private static final Logger log = LoggerFactory.getLogger(BonusDAO.class);
// property constants
protected void initDao() {
// do nothing
}
public void save(Bonus transientInstance) {
log.debug("saving Bonus instance");
try {
getHibernateTemplate().save(transientInstance);
log.debug("save successful");
} catch (RuntimeException re) {
log.error("save failed", re);
throw re;
}
}
public void delete(Bonus persistentInstance) {
log.debug("deleting Bonus instance");
try {
getHibernateTemplate().delete(persistentInstance);
log.debug("delete successful");
} catch (RuntimeException re) {
log.error("delete failed", re);
throw re;
}
}
public Bonus findById(model.BonusId id) {
log.debug("getting Bonus instance with id: " + id);
try {
Bonus instance = (Bonus) getHibernateTemplate().get("model.Bonus",
id);
return instance;
} catch (RuntimeException re) {
log.error("get failed", re);
throw re;
}
}
public List findByExample(Bonus instance) {
log.debug("finding Bonus instance by example");
try {
List results = getHibernateTemplate().findByExample(instance);
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 Bonus instance with property: " + propertyName
+ ", value: " + value);
try {
String queryString = "from Bonus as model where model."
+ propertyName + "= ?";
return getHibernateTemplate().find(queryString, value);
} catch (RuntimeException re) {
log.error("find by property name failed", re);
throw re;
}
}
public List findAll() {
log.debug("finding all Bonus instances");
try {
String queryString = "from Bonus";
return getHibernateTemplate().find(queryString);
} catch (RuntimeException re) {
log.error("find all failed", re);
throw re;
}
}
public Bonus merge(Bonus detachedInstance) {
log.debug("merging Bonus instance");
try {
Bonus result = (Bonus) getHibernateTemplate().merge(
detachedInstance);
log.debug("merge successful");
return result;
} catch (RuntimeException re) {
log.error("merge failed", re);
throw re;
}
}
public void attachDirty(Bonus instance) {
log.debug("attaching dirty Bonus instance");
try {
getHibernateTemplate().saveOrUpdate(instance);
log.debug("attach successful");
} catch (RuntimeException re) {
log.error("attach failed", re);
throw re;
}
}
public void attachClean(Bonus instance) {
log.debug("attaching clean Bonus instance");
try {
getHibernateTemplate().lock(instance, LockMode.NONE);
log.debug("attach successful");
} catch (RuntimeException re) {
log.error("attach failed", re);
throw re;
}
}
public static BonusDAO getFromApplicationContext(ApplicationContext ctx) {
return (BonusDAO) ctx.getBean("BonusDAO");
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
ssh+oracle+myeclipse搭建好的项目框架 (147个子文件)
BonusDAO.class 5KB
HibernateSessionFactory.class 2KB
LoginAction.class 2KB
BonusId.class 2KB
Bonus.class 603B
.classpath 11KB
openjpa-1.2.0.jar 11.17MB
com.springsource.org.jruby-1.4.0.jar 8.12MB
eclipselink.jar 4.28MB
com.springsource.org.codehaus.groovy-1.6.5.jar 3.78MB
toplink-essentials.jar 2.33MB
hibernate3.jar 2.31MB
xwork-2.1.2.jar 2.18MB
com.springsource.org.aspectj.weaver-1.6.8.RELEASE.jar 1.57MB
ojdbc14.jar 1.47MB
org.springframework.js-2.0.8.RELEASE.jar 1.15MB
jbosscache-core-3.1.0.GA.jar 1.1MB
com.springsource.org.testng-5.10.0.jar 857KB
freemarker-2.3.13.jar 850KB
struts2-core-2.1.6.jar 719KB
jboss-cache-1.4.1.GA.jar 690KB
org.springframework.context-3.0.1.RELEASE-A.jar 642KB
com.springsource.com.mchange.v2.c3p0-0.9.1.2.jar 603KB
c3p0-0.9.1.jar 594KB
javassist-3.9.0.GA.jar 583KB
commons-collections-3.2.jar 558KB
commons-collections-3.1.jar 546KB
org.springframework.beans-3.0.1.RELEASE-A.jar 535KB
org.springframework.web.struts-3.0.1.RELEASE-A.jar 524KB
wstx-asl-3.2.7.jar 509KB
org.springframework.webflow-2.0.8.RELEASE.jar 507KB
proxool-0.8.3.jar 465KB
com.springsource.org.quartz-1.6.2.jar 440KB
antlr-2.7.6.jar 433KB
spring-webflow-1.0.jar 397KB
com.springsource.org.apache.taglibs.standard-1.1.2.jar 389KB
org.springframework.web.servlet-3.0.1.RELEASE-A.jar 389KB
com.springsource.org.apache.log4j-1.2.15.jar 387KB
com.springsource.com.ibatis-2.3.4.726.jar 377KB
org.springframework.jdbc-3.0.1.RELEASE-A.jar 369KB
log4j-1.2.14.jar 359KB
jmxri.jar 357KB
org.springframework.web-3.0.1.RELEASE-A.jar 352KB
org.springframework.core-3.0.1.RELEASE-A.jar 347KB
com.springsource.edu.emory.mathcs.backport-3.0.0.jar 324KB
org.springframework.orm-3.0.1.RELEASE-A.jar 324KB
com.springsource.net.sf.cglib-2.2.0.jar 319KB
org.springframework.aop-3.0.1.RELEASE-A.jar 313KB
dom4j-1.6.1.jar 307KB
com.springsource.org.apache.commons.httpclient-3.1.0.jar 301KB
spring-security-core-3.0.2.RELEASE.jar 298KB
com.springsource.com.caucho-3.2.1.jar 287KB
com.springsource.bsh-2.0.0.b4.jar 279KB
hibernate-annotations.jar 273KB
cglib-2.2.jar 272KB
com.springsource.org.codehaus.jackson.mapper-1.0.0.jar 264KB
com.springsource.org.apache.commons.lang-2.4.0.jar 258KB
ldapsdk-4.1.jar 257KB
com.springsource.org.junit-4.7.0.jar 231KB
spring-security-web-3.0.2.RELEASE.jar 230KB
org.springframework.transaction-3.0.1.RELEASE-A.jar 223KB
spring-ldap-core-1.3.0.RELEASE.jar 219KB
ehcache-1.2.3.jar 203KB
commons-lang-2.1.jar 203KB
jmxremote_optional.jar 202KB
serp-1.13.1.jar 201KB
org.springframework.test-3.0.1.RELEASE-A.jar 200KB
org.springframework.jms-3.0.1.RELEASE-A.jar 179KB
jmxremote.jar 172KB
org.springframework.web.portlet-3.0.1.RELEASE-A.jar 169KB
ognl-2.6.11.jar 164KB
spring-security-config-3.0.2.RELEASE.jar 157KB
org.springframework.binding-2.0.8.RELEASE.jar 154KB
org.springframework.expression-3.0.1.RELEASE-A.jar 152KB
jamon-2.7.jar 147KB
com.springsource.javax.jdo-2.1.0.jar 138KB
org.springframework.faces-2.0.8.RELEASE.jar 138KB
jotm.jar 121KB
commons-dbcp.jar 119KB
hibernate-entitymanager.jar 116KB
oscache-2.1.jar 112KB
org.springframework.context.support-3.0.1.RELEASE-A.jar 98KB
com.springsource.org.apache.commons.pool-1.5.3.jar 95KB
xmlunit-1.2.jar 94KB
xapool.jar 90KB
spring-binding-1.0.jar 85KB
spring-security-ldap-3.0.2.RELEASE.jar 82KB
spring-security-acl-3.0.2.RELEASE.jar 76KB
persistence.jar 69KB
hibernate-commons-annotations.jar 65KB
cas-client-core-3.1.10.jar 63KB
hibernate-validator.jar 61KB
commons-pool-1.3.jar 61KB
com.springsource.org.apache.commons.logging-1.1.1.jar 60KB
javax.persistence_1.0.0.jar 58KB
commons-fileupload-1.2.1.jar 56KB
org.springframework.oxm-3.0.1.RELEASE-A.jar 56KB
com.springsource.org.apache.commons.fileupload-1.2.0.jar 53KB
org.springframework.asm-3.0.1.RELEASE-A.jar 52KB
geronimo-jpa_3.0_spec-1.0.jar 51KB
共 147 条
- 1
- 2
mengtianbao
- 粉丝: 6
- 资源: 11
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
前往页