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

📄 basettest.java

📁 持久层hibernate技术使用的一个例子
💻 JAVA
字号:
package cn.hope.mana.pojo.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the t_test table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="t_test"
 */

public abstract class BaseTTest  implements Serializable {

	public static String REF = "TTest";
	public static String PROP_FLAG = "flag";
	public static String PROP_T_QUESTIONSPOINT = "TQuestionspoint";


	// constructors
	public BaseTTest () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseTTest (java.lang.Integer tId1) {
		this.setTId1(tId1);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseTTest (
		java.lang.Integer tId1,
		java.lang.String flag,
		java.lang.Integer tQuestionspoint) {

		this.setTId1(tId1);
		this.setFlag(flag);
		this.setTQuestionspoint(tQuestionspoint);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer tId1;

	// fields
	private java.lang.String flag;
	private java.lang.Integer tQuestionspoint;

	// many to one
	private cn.hope.mana.pojo.TTestInfo tTestInfo;
	private cn.hope.mana.pojo.TQuestion tQuestion;

	// collections
	private java.util.Set sResults;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="identity"
     *  column="t_id1"
     */
	public java.lang.Integer getTId1 () {
		return tId1;
	}

	/**
	 * Set the unique identifier of this class
	 * @param tId1 the new ID
	 */
	public void setTId1 (java.lang.Integer tId1) {
		this.tId1 = tId1;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: flag
	 */
	public java.lang.String getFlag () {
		return flag;
	}

	/**
	 * Set the value related to the column: flag
	 * @param flag the flag value
	 */
	public void setFlag (java.lang.String flag) {
		this.flag = flag;
	}



	/**
	 * Return the value associated with the column: t_questionspoint
	 */
	public java.lang.Integer getTQuestionspoint () {
		return tQuestionspoint;
	}

	/**
	 * Set the value related to the column: t_questionspoint
	 * @param tQuestionspoint the t_questionspoint value
	 */
	public void setTQuestionspoint (java.lang.Integer tQuestionspoint) {
		this.tQuestionspoint = tQuestionspoint;
	}



	/**
	 * Return the value associated with the column: t_testid
	 */
	public cn.hope.mana.pojo.TTestInfo getTTestInfo () {
		return tTestInfo;
	}

	/**
	 * Set the value related to the column: t_testid
	 * @param tTestInfo the t_testid value
	 */
	public void setTTestInfo (cn.hope.mana.pojo.TTestInfo tTestInfo) {
		this.tTestInfo = tTestInfo;
	}



	/**
	 * Return the value associated with the column: tq_id
	 */
	public cn.hope.mana.pojo.TQuestion getTQuestion () {
		return tQuestion;
	}

	/**
	 * Set the value related to the column: tq_id
	 * @param tQuestion the tq_id value
	 */
	public void setTQuestion (cn.hope.mana.pojo.TQuestion tQuestion) {
		this.tQuestion = tQuestion;
	}



	/**
	 * Return the value associated with the column: SResults
	 */
	public java.util.Set getSResults () {
		return sResults;
	}

	/**
	 * Set the value related to the column: SResults
	 * @param sResults the SResults value
	 */
	public void setSResults (java.util.Set sResults) {
		this.sResults = sResults;
	}

	public void addToSResults (cn.hope.mana.pojo.SResult sResult) {
		if (null == getSResults()) setSResults(new java.util.HashSet());
		getSResults().add(sResult);
	}





	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof cn.hope.mana.pojo.TTest)) return false;
		else {
			cn.hope.mana.pojo.TTest tTest = (cn.hope.mana.pojo.TTest) obj;
			if (null == this.getTId1() || null == tTest.getTId1()) return false;
			else return (this.getTId1().equals(tTest.getTId1()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getTId1()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getTId1().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}

⌨️ 快捷键说明

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