📄 xsquotationmaindao.java
字号:
package com.company.hib.dao.impl;
import java.util.Date;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts.action.ActionForm;
import org.hibernate.LockMode;
import org.springframework.context.ApplicationContext;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import com.company.hib.dao.DAOAdapter;
import com.company.struts.form.XsQuotationMain;
/**
* Data access object (DAO) for domain model class XsQuotationMain.
*
* @see com.company.struts.form.XsQuotationMain
* @author MyEclipse Persistence Tools
*/
public class XsQuotationMainDAO extends DAOAdapter {
private static final Log log = LogFactory.getLog(XsQuotationMainDAO.class);
// property constants
public static final String QUOTATION_CODE = "quotationCode";
public static final String KJ_YEAR = "kjYear";
public static final String PERIOD = "period";
public static final String CUS_CODE = "cusCode";
public static final String CONSIGN_ADDRESS = "consignAddress";
public static final String DEPT_CODE = "deptCode";
public static final String PERSON_CODE = "personCode";
public static final String PAY_CODE = "payCode";
public static final String FOREIGN_CURR_CODE = "foreignCurrCode";
public static final String EXCH_RATE = "exchRate";
public static final String SELL_TYPE_CODE = "sellTypeCode";
public static final String MAKER = "maker";
public static final String CHECKER = "checker";
public static final String CLOSER = "closer";
public static final String CLOSE_CAUSE = "closeCause";
public static final String CONVER_FLAG = "converFlag";
public static final String CONTACT_PERSON = "contactPerson";
public static final String CONTACT_TYPE = "contactType";
public static final String REMARK = "remark";
protected void initDao() {
// do nothing
}
public ActionForm findById(java.lang.Integer id) {
log.debug("getting XsQuotationMain instance with id: " + id);
try {
XsQuotationMain instance = (XsQuotationMain) getHibernateTemplate()
.get("com.company.struts.form.XsQuotationMain", id);
return instance;
} catch (RuntimeException re) {
log.error("get failed", re);
throw re;
}
}
public List findByExample(ActionForm instance) {
log.debug("finding XsQuotationMain 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 XsQuotationMain instance with property: "
+ propertyName + ", value: " + value);
try {
String queryString = "from XsQuotationMain 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 findByQuotationCode(Object quotationCode) {
return findByProperty(QUOTATION_CODE, quotationCode);
}
public List findByKjYear(Object kjYear) {
return findByProperty(KJ_YEAR, kjYear);
}
public List findByPeriod(Object period) {
return findByProperty(PERIOD, period);
}
public List findByCusCode(Object cusCode) {
return findByProperty(CUS_CODE, cusCode);
}
public List findByConsignAddress(Object consignAddress) {
return findByProperty(CONSIGN_ADDRESS, consignAddress);
}
public List findByDeptCode(Object deptCode) {
return findByProperty(DEPT_CODE, deptCode);
}
public List findByPersonCode(Object personCode) {
return findByProperty(PERSON_CODE, personCode);
}
public List findByPayCode(Object payCode) {
return findByProperty(PAY_CODE, payCode);
}
public List findByForeignCurrCode(Object foreignCurrCode) {
return findByProperty(FOREIGN_CURR_CODE, foreignCurrCode);
}
public List findByExchRate(Object exchRate) {
return findByProperty(EXCH_RATE, exchRate);
}
public List findBySellTypeCode(Object sellTypeCode) {
return findByProperty(SELL_TYPE_CODE, sellTypeCode);
}
public List findByMaker(Object maker) {
return findByProperty(MAKER, maker);
}
public List findByChecker(Object checker) {
return findByProperty(CHECKER, checker);
}
public List findByCloser(Object closer) {
return findByProperty(CLOSER, closer);
}
public List findByCloseCause(Object closeCause) {
return findByProperty(CLOSE_CAUSE, closeCause);
}
public List findByConverFlag(Object converFlag) {
return findByProperty(CONVER_FLAG, converFlag);
}
public List findByContactPerson(Object contactPerson) {
return findByProperty(CONTACT_PERSON, contactPerson);
}
public List findByContactType(Object contactType) {
return findByProperty(CONTACT_TYPE, contactType);
}
public List findByRemark(Object remark) {
return findByProperty(REMARK, remark);
}
public List findAll() {
log.debug("finding all XsQuotationMain instances");
try {
String queryString = "from XsQuotationMain";
return getHibernateTemplate().find(queryString);
} catch (RuntimeException re) {
log.error("find all failed", re);
throw re;
}
}
public void attachDirty(XsQuotationMain instance) {
log.debug("attaching dirty XsQuotationMain instance");
try {
getHibernateTemplate().saveOrUpdate(instance);
log.debug("attach successful");
} catch (RuntimeException re) {
log.error("attach failed", re);
throw re;
}
}
public void attachClean(XsQuotationMain instance) {
log.debug("attaching clean XsQuotationMain instance");
try {
getHibernateTemplate().lock(instance, LockMode.NONE);
log.debug("attach successful");
} catch (RuntimeException re) {
log.error("attach failed", re);
throw re;
}
}
public static XsQuotationMainDAO getFromApplicationContext(
ApplicationContext ctx) {
return (XsQuotationMainDAO) ctx.getBean("XsQuotationMainDAO");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -