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

📄 basecsubject.java

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

import java.io.Serializable;


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

public abstract class BaseCSubject  implements Serializable {

	public static String REF = "CSubject";
	public static String PROP_FLAG = "flag";
	public static String PROP_S_SBNAME = "SSbname";


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

	/**
	 * Constructor for primary key
	 */
	public BaseCSubject (java.lang.Integer sSid) {
		this.setSSid(sSid);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseCSubject (
		java.lang.Integer sSid,
		java.lang.String flag,
		java.lang.String sSbname) {

		this.setSSid(sSid);
		this.setFlag(flag);
		this.setSSbname(sSbname);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

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

	// fields
	private java.lang.String flag;
	private java.lang.String sSbname;

	// collections
	private java.util.Set tHomeworks;
	private java.util.Set tQuestions;
	private java.util.Set tTestInfos;
	private java.util.Set teaches;



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

	/**
	 * Set the unique identifier of this class
	 * @param sSid the new ID
	 */
	public void setSSid (java.lang.Integer sSid) {
		this.sSid = sSid;
		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: s_sbname
	 */
	public java.lang.String getSSbname () {
		return sSbname;
	}

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



	/**
	 * Return the value associated with the column: THomeworks
	 */
	public java.util.Set getTHomeworks () {
		return tHomeworks;
	}

	/**
	 * Set the value related to the column: THomeworks
	 * @param tHomeworks the THomeworks value
	 */
	public void setTHomeworks (java.util.Set tHomeworks) {
		this.tHomeworks = tHomeworks;
	}

	public void addToTHomeworks (cn.hope.front.pojo.THomework tHomework) {
		if (null == getTHomeworks()) setTHomeworks(new java.util.HashSet());
		getTHomeworks().add(tHomework);
	}



	/**
	 * Return the value associated with the column: TQuestions
	 */
	public java.util.Set getTQuestions () {
		return tQuestions;
	}

	/**
	 * Set the value related to the column: TQuestions
	 * @param tQuestions the TQuestions value
	 */
	public void setTQuestions (java.util.Set tQuestions) {
		this.tQuestions = tQuestions;
	}

	public void addToTQuestions (cn.hope.front.pojo.TQuestion tQuestion) {
		if (null == getTQuestions()) setTQuestions(new java.util.HashSet());
		getTQuestions().add(tQuestion);
	}



	/**
	 * Return the value associated with the column: TTestInfos
	 */
	public java.util.Set getTTestInfos () {
		return tTestInfos;
	}

	/**
	 * Set the value related to the column: TTestInfos
	 * @param tTestInfos the TTestInfos value
	 */
	public void setTTestInfos (java.util.Set tTestInfos) {
		this.tTestInfos = tTestInfos;
	}

	public void addToTTestInfos (cn.hope.front.pojo.TTestInfo tTestInfo) {
		if (null == getTTestInfos()) setTTestInfos(new java.util.HashSet());
		getTTestInfos().add(tTestInfo);
	}



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

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

	public void addToteaches (cn.hope.front.pojo.Teach teach) {
		if (null == getTeaches()) setTeaches(new java.util.HashSet());
		getTeaches().add(teach);
	}





	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof cn.hope.front.pojo.CSubject)) return false;
		else {
			cn.hope.front.pojo.CSubject cSubject = (cn.hope.front.pojo.CSubject) obj;
			if (null == this.getSSid() || null == cSubject.getSSid()) return false;
			else return (this.getSSid().equals(cSubject.getSSid()));
		}
	}

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


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


}

⌨️ 快捷键说明

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