⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xsorderbillmaindao.java

📁 关于网上汽车销售系统的详细编程项目实战实例
💻 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.XsOrderBillMain;

/**
 * Data access object (DAO) for domain model class XsOrderBillMain.
 * 
 * @see com.company.struts.form.XsOrderBillMain
 * @author MyEclipse Persistence Tools
 */

public class XsOrderBillMainDAO extends DAOAdapter {
	private static final Log log = LogFactory.getLog(XsOrderBillMainDAO.class);

	// property constants
	public static final String ORDER_CODE = "orderCode";

	public static final String QUOTATION_MAIN_ID = "quotationMainId";

	public static final String QUOTATION_CODE = "quotationCode";

	public static final String CONTRACT_MAIN_ID = "contractMainId";

	public static final String CONTRACT_CODE = "contractCode";

	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 SELLER_SIGNER = "sellerSigner";

	public static final String BUYER_SIGNER = "buyerSigner";

	public static final String SIGN_ADDRESS = "signAddress";

	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 ERNEST = "ernest";

	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 REMARK = "remark";

	protected void initDao() {
		// do nothing
	}

	public ActionForm findById(java.lang.Integer id) {
		log.debug("getting XsOrderBillMain instance with id: " + id);
		try {
			XsOrderBillMain instance = (XsOrderBillMain) getHibernateTemplate()
					.get("com.company.struts.form.XsOrderBillMain", id);
			return instance;
		} catch (RuntimeException re) {
			log.error("get failed", re);
			throw re;
		}
	}

	public List findByExample(ActionForm instance) {
		log.debug("finding XsOrderBillMain 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 XsOrderBillMain instance with property: "
				+ propertyName + ", value: " + value);
		try {
			String queryString = "from XsOrderBillMain 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 findByOrderCode(Object orderCode) {
		return findByProperty(ORDER_CODE, orderCode);
	}

	public List findByQuotationMainId(Object quotationMainId) {
		return findByProperty(QUOTATION_MAIN_ID, quotationMainId);
	}

	public List findByQuotationCode(Object quotationCode) {
		return findByProperty(QUOTATION_CODE, quotationCode);
	}

	public List findByContractMainId(Object contractMainId) {
		return findByProperty(CONTRACT_MAIN_ID, contractMainId);
	}

	public List findByContractCode(Object contractCode) {
		return findByProperty(CONTRACT_CODE, contractCode);
	}

	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 findBySellerSigner(Object sellerSigner) {
		return findByProperty(SELLER_SIGNER, sellerSigner);
	}

	public List findByBuyerSigner(Object buyerSigner) {
		return findByProperty(BUYER_SIGNER, buyerSigner);
	}

	public List findBySignAddress(Object signAddress) {
		return findByProperty(SIGN_ADDRESS, signAddress);
	}

	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 findByErnest(Object ernest) {
		return findByProperty(ERNEST, ernest);
	}

	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 findByRemark(Object remark) {
		return findByProperty(REMARK, remark);
	}

	public List findAll() {
		log.debug("finding all XsOrderBillMain instances");
		try {
			String queryString = "from XsOrderBillMain";
			return getHibernateTemplate().find(queryString);
		} catch (RuntimeException re) {
			log.error("find all failed", re);
			throw re;
		}
	}

	public void attachDirty(XsOrderBillMain instance) {
		log.debug("attaching dirty XsOrderBillMain instance");
		try {
			getHibernateTemplate().saveOrUpdate(instance);
			log.debug("attach successful");
		} catch (RuntimeException re) {
			log.error("attach failed", re);
			throw re;
		}
	}

	public void attachClean(XsOrderBillMain instance) {
		log.debug("attaching clean XsOrderBillMain instance");
		try {
			getHibernateTemplate().lock(instance, LockMode.NONE);
			log.debug("attach successful");
		} catch (RuntimeException re) {
			log.error("attach failed", re);
			throw re;
		}
	}

	public static XsOrderBillMainDAO getFromApplicationContext(
			ApplicationContext ctx) {
		return (XsOrderBillMainDAO) ctx.getBean("XsOrderBillMainDAO");
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -