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

📄 membermessagedao.java

📁 在eclipse平台下写的
💻 JAVA
字号:
package com.internetshop.hibernate.member_message;

import java.util.Date;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.LockMode;
import org.hibernate.Query;
import org.hibernate.criterion.Example;

/**
 * Data access object (DAO) for domain model class MemberMessage.
 * 
 * @see com.internetshop.hibernate.member_message.MemberMessage
 * @author MyEclipse Persistence Tools
 */

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

	// property constants
	public static final String _ME_MEMBER_NAME = "ME_memberName";

	public static final String _ME_EMAIL = "ME_email";

	public static final String _ME_MEMBER_PASSWORD = "ME_memberPassword";

	public static final String _ME_QUESTION = "ME_question";

	public static final String _ME_ANSWER = "ME_answer";

	public static final String _ME_LOGIN_COUNT = "ME_loginCount";

	public static final String _ME_ORDER_NAME = "ME_orderName";

	public static final String _ME_CITY = "ME_city";

	public static final String _ME_ADDRESS = "ME_address";

	public static final String _ME_POST_NUMBER = "ME_postNumber";

	public static final String _ME_TELEPHONE = "ME_telephone";

	public static final String _ME_RRADE_TYPE = "ME_rradeType";

	public static final String _ME_TRANSPORT_TYPE = "ME_transportType";

	public static final String _ME_SEX = "ME_sex";

	public static final String _ME_REAL_NAME = "ME_realName";

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

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

	public MemberMessage findById(java.lang.Long id) {
		log.debug("getting MemberMessage instance with id: " + id);
		try {
			MemberMessage instance = (MemberMessage) getSession().get(
					"com.internetshop.hibernate.member_message.MemberMessage",
					id);
			return instance;
		} catch (RuntimeException re) {
			log.error("get failed", re);
			throw re;
		}
	}

	public List findByExample(MemberMessage instance) {
		log.debug("finding MemberMessage instance by example");
		try {
			List results = getSession().createCriteria(
					"com.internetshop.hibernate.member_message.MemberMessage")
					.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 MemberMessage instance with property: "
				+ propertyName + ", value: " + value);
		try {
			String queryString = "from MemberMessage 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 findByME_memberName(Object ME_memberName) {
		return findByProperty(_ME_MEMBER_NAME, ME_memberName);
	}

	public List findByME_email(Object ME_email) {
		return findByProperty(_ME_EMAIL, ME_email);
	}

	public List findByME_memberPassword(Object ME_memberPassword) {
		return findByProperty(_ME_MEMBER_PASSWORD, ME_memberPassword);
	}

	public List findByME_question(Object ME_question) {
		return findByProperty(_ME_QUESTION, ME_question);
	}

	public List findByME_answer(Object ME_answer) {
		return findByProperty(_ME_ANSWER, ME_answer);
	}

	public List findByME_loginCount(Object ME_loginCount) {
		return findByProperty(_ME_LOGIN_COUNT, ME_loginCount);
	}

	public List findByME_orderName(Object ME_orderName) {
		return findByProperty(_ME_ORDER_NAME, ME_orderName);
	}

	public List findByME_city(Object ME_city) {
		return findByProperty(_ME_CITY, ME_city);
	}

	public List findByME_address(Object ME_address) {
		return findByProperty(_ME_ADDRESS, ME_address);
	}

	public List findByME_postNumber(Object ME_postNumber) {
		return findByProperty(_ME_POST_NUMBER, ME_postNumber);
	}

	public List findByME_telephone(Object ME_telephone) {
		return findByProperty(_ME_TELEPHONE, ME_telephone);
	}

	public List findByME_rradeType(Object ME_rradeType) {
		return findByProperty(_ME_RRADE_TYPE, ME_rradeType);
	}

	public List findByME_transportType(Object ME_transportType) {
		return findByProperty(_ME_TRANSPORT_TYPE, ME_transportType);
	}

	public List findByME_sex(Object ME_sex) {
		return findByProperty(_ME_SEX, ME_sex);
	}

	public List findByME_realName(Object ME_realName) {
		return findByProperty(_ME_REAL_NAME, ME_realName);
	}

	public List findAll() {
		log.debug("finding all MemberMessage instances");
		try {
			String queryString = "from MemberMessage";
			Query queryObject = getSession().createQuery(queryString);
			return queryObject.list();
		} catch (RuntimeException re) {
			log.error("find all failed", re);
			throw re;
		}
	}

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

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

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

⌨️ 快捷键说明

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