首页>代码>基于ssh的房屋销售管理系统>/shhouse/src/dao/BuyinfoDAO.java
package dao;
// default package

import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.LockMode;
import org.springframework.context.ApplicationContext;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import pojobean.Buyinfo;

/**
 * A data access object (DAO) providing persistence and search support for
 * Buyinfo 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 .Buyinfo
 * @author MyEclipse Persistence Tools
 */

public class BuyinfoDAO extends HibernateDaoSupport {
	private static final Log log = LogFactory.getLog(BuyinfoDAO.class);
 
	protected void initDao() {
		// do nothing
	}

	public void save(Buyinfo transientInstance) {
		log.debug("saving Buyinfo instance");
		try {
			getHibernateTemplate().save(transientInstance);
			log.debug("save successful");
		} catch (RuntimeException re) {
			log.error("save failed", re);
			throw re;
		}
	}

	public void delete(Buyinfo persistentInstance) {
		log.debug("deleting Buyinfo instance");
		try {
			getHibernateTemplate().delete(persistentInstance);
			log.debug("delete successful");
		} catch (RuntimeException re) {
			log.error("delete failed", re);
			throw re;
		}
	}

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

	public List findByExample(Buyinfo instance) {
		log.debug("finding Buyinfo 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 Buyinfo instance with property: " + propertyName
				+ ", value: " + value);
		try {
			String queryString = "from Buyinfo 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 Buyinfo instances");
		try {
			String queryString = "from Buyinfo";
			return getHibernateTemplate().find(queryString);
		} catch (RuntimeException re) {
			log.error("find all failed", re);
			throw re;
		}
	}

	public Buyinfo merge(Buyinfo detachedInstance) {
		log.debug("merging Buyinfo instance");
		try {
			Buyinfo result = (Buyinfo) getHibernateTemplate().merge(
					detachedInstance);
			log.debug("merge successful");
			return result;
		} catch (RuntimeException re) {
			log.error("merge failed", re);
			throw re;
		}
	}

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

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

	public static BuyinfoDAO getFromApplicationContext(ApplicationContext ctx) {
		return (BuyinfoDAO) ctx.getBean("BuyinfoDAO");
	}
}
最近下载更多
cherrylxj  LV3 2024年6月13日
mmmmmmppp  LV10 2022年12月31日
xudong_y  LV4 2022年11月7日
文成1116  LV21 2022年10月25日
yijie110  LV5 2022年9月8日
zhaoyangwfd  LV17 2022年6月21日
testuser1234567  LV24 2022年5月23日
2310573421  LV7 2022年4月23日
wanglinddad  LV55 2022年3月28日
小五12345  LV13 2022年3月18日
最近浏览更多
630328293l  LV2 3月5日
lyt010628  LV4 2024年7月9日
柳咪华沙  LV7 2024年6月29日
cherrylxj  LV3 2024年6月12日
hfffff  LV1 2024年6月3日
zeyang_wang  LV8 2024年5月30日
sunlea  LV20 2024年5月23日
云空城  LV1 2024年5月22日
2602275348  LV12 2024年5月16日
全栈小白  LV35 2024年3月26日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友