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

📄 xsmoneywaredao.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.XsMoneyWare;

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

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

	// property constants
	public static final String MONEY_WARE_SUB_ID = "moneyWareSubId";

	public static final String MONEY_WARE_CODE = "moneyWareCode";

	public static final String KJ_YEAR = "kjYear";

	public static final String PERIOR = "perior";

	public static final String BILL_TYPE = "billType";

	public static final String BILL_ID = "billId";

	public static final String BILL_CODE = "billCode";

	public static final String CUS_CODE = "cusCode";

	public static final String WARE_CODE = "wareCode";

	public static final String USED_MONEY = "usedMoney";

	public static final String CAPITAL_USED_MONEY = "capitalUsedMoney";

	public static final String SETTLEALL_FLAG = "settleallFlag";

	public static final String VERIFIER = "verifier";

	public static final String ACCOUNT_OPT = "accountOpt";

	protected void initDao() {
		// do nothing
	}

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

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

	public List findByMoneyWareCode(Object moneyWareCode) {
		return findByProperty(MONEY_WARE_CODE, moneyWareCode);
	}

	public List findByKjYear(Object kjYear) {
		return findByProperty(KJ_YEAR, kjYear);
	}

	public List findByPerior(Object perior) {
		return findByProperty(PERIOR, perior);
	}

	public List findByBillType(Object billType) {
		return findByProperty(BILL_TYPE, billType);
	}

	public List findByBillId(Object billId) {
		return findByProperty(BILL_ID, billId);
	}

	public List findByBillCode(Object billCode) {
		return findByProperty(BILL_CODE, billCode);
	}

	public List findByCusCode(Object cusCode) {
		return findByProperty(CUS_CODE, cusCode);
	}

	public List findByWareCode(Object wareCode) {
		return findByProperty(WARE_CODE, wareCode);
	}

	public List findByUsedMoney(Object usedMoney) {
		return findByProperty(USED_MONEY, usedMoney);
	}

	public List findByCapitalUsedMoney(Object capitalUsedMoney) {
		return findByProperty(CAPITAL_USED_MONEY, capitalUsedMoney);
	}

	public List findBySettleallFlag(Object settleallFlag) {
		return findByProperty(SETTLEALL_FLAG, settleallFlag);
	}

	public List findByVerifier(Object verifier) {
		return findByProperty(VERIFIER, verifier);
	}

	public List findByAccountOpt(Object accountOpt) {
		return findByProperty(ACCOUNT_OPT, accountOpt);
	}

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

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

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

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

⌨️ 快捷键说明

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