📄 syfxb1zzssytjdao.java
字号:
package com.syfxapp.dao;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.Query;
import org.hibernate.criterion.Example;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import com.syfxapp.pojo.SyfxB1ZzsSytj;
import com.syfxapp.pojo.SyfxB1ZzsSytjId;
/**
* A data access object (DAO) providing persistence and search support for
* SyfxB1ZzsSytj 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.syfxapp.hibernate.dao.SyfxB1ZzsSytj
* @author MyEclipse Persistence Tools
*/
public class SyfxB1ZzsSytjDAO extends HibernateDaoSupport{
private static final Log log = LogFactory.getLog(SyfxB1ZzsSytjDAO.class);
// property constants
public static final String XM = "xm";
public static final String L0 = "l0";
public static final String L1 = "l1";
public static final String L2 = "l2";
public static final String L3 = "l3";
public static final String L4 = "l4";
public static final String L5 = "l5";
public static final String L6 = "l6";
public static final String L7 = "l7";
public static final String L8 = "l8";
public static final String L9 = "l9";
public static final String L10 = "l10";
public static final String L11 = "l11";
public void save(SyfxB1ZzsSytj transientInstance) {
log.debug("saving SyfxB1ZzsSytj instance");
try {
getSession().save(transientInstance);
log.debug("save successful");
} catch (RuntimeException re) {
log.error("save failed", re);
throw re;
}
}
public void delete(SyfxB1ZzsSytj persistentInstance) {
log.debug("deleting SyfxB1ZzsSytj instance");
try {
getSession().delete(persistentInstance);
log.debug("delete successful");
} catch (RuntimeException re) {
log.error("delete failed", re);
throw re;
}
}
public SyfxB1ZzsSytj findById(SyfxB1ZzsSytjId id) {
log.debug("getting SyfxB1ZzsSytj instance with id: " + id);
try {
SyfxB1ZzsSytj instance = (SyfxB1ZzsSytj) getSession().get(
"com.syfxapp.pojo.SyfxB1ZzsSytj", id);
return instance;
} catch (RuntimeException re) {
log.error("get failed", re);
throw re;
}
}
public List findByNy(String ny){
try {
String queryString = "from SyfxB1ZzsSytj where ny='"+ny+"'";
return getHibernateTemplate().find(queryString);
} catch (RuntimeException re) {
log.error("find all failed", re);
throw re;
}
}
public List findByExample(SyfxB1ZzsSytj instance) {
log.debug("finding SyfxB1ZzsSytj instance by example");
try {
List results = getSession().createCriteria(
"com.syfxapp.hibernate.dao.SyfxB1ZzsSytj").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 SyfxB1ZzsSytj instance with property: "
+ propertyName + ", value: " + value);
try {
String queryString = "from SyfxB1ZzsSytj 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 findByXm(Object xm) {
return findByProperty(XM, xm);
}
public List findByL0(Object l0) {
return findByProperty(L0, l0);
}
public List findByL1(Object l1) {
return findByProperty(L1, l1);
}
public List findByL2(Object l2) {
return findByProperty(L2, l2);
}
public List findByL3(Object l3) {
return findByProperty(L3, l3);
}
public List findByL4(Object l4) {
return findByProperty(L4, l4);
}
public List findByL5(Object l5) {
return findByProperty(L5, l5);
}
public List findByL6(Object l6) {
return findByProperty(L6, l6);
}
public List findByL7(Object l7) {
return findByProperty(L7, l7);
}
public List findByL8(Object l8) {
return findByProperty(L8, l8);
}
public List findByL9(Object l9) {
return findByProperty(L9, l9);
}
public List findByL10(Object l10) {
return findByProperty(L10, l10);
}
public List findByL11(Object l11) {
return findByProperty(L11, l11);
}
public List findAll() {
log.debug("finding all SyfxB1ZzsSytj instances");
try {
String queryString = "from SyfxB1ZzsSytj";
Query queryObject = getSession().createQuery(queryString);
return queryObject.list();
} catch (RuntimeException re) {
log.error("find all failed", re);
throw re;
}
}
public SyfxB1ZzsSytj merge(SyfxB1ZzsSytj detachedInstance) {
log.debug("merging SyfxB1ZzsSytj instance");
try {
SyfxB1ZzsSytj result = (SyfxB1ZzsSytj) getSession().merge(
detachedInstance);
log.debug("merge successful");
return result;
} catch (RuntimeException re) {
log.error("merge failed", re);
throw re;
}
}
public void attachDirty(SyfxB1ZzsSytj instance) {
log.debug("attaching dirty SyfxB1ZzsSytj instance");
try {
getSession().saveOrUpdate(instance);
log.debug("attach successful");
} catch (RuntimeException re) {
log.error("attach failed", re);
throw re;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -