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

📄 basecdept.java

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

import java.io.Serializable;


/**
 * This is an object that contains data related to the c_dept 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_dept"
 */

public abstract class BaseCDept  implements Serializable {

	public static String REF = "CDept";
	public static String PROP_D_NAME = "DName";
	public static String PROP_FLAG = "flag";


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

	/**
	 * Constructor for primary key
	 */
	public BaseCDept (java.lang.Integer dId) {
		this.setDId(dId);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseCDept (
		java.lang.Integer dId,
		java.lang.String dName,
		java.lang.String flag) {

		this.setDId(dId);
		this.setDName(dName);
		this.setFlag(flag);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

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

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

	// collections
	private java.util.Set sClasses;
	private java.util.Set tInfos;



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

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




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

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



	/**
	 * 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: SClasses
	 */
	public java.util.Set getSClasses () {
		return sClasses;
	}

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

	public void addToSClasses (cn.hope.front.pojo.SClass sClass) {
		if (null == getSClasses()) setSClasses(new java.util.HashSet());
		getSClasses().add(sClass);
	}



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

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

	public void addToTInfos (cn.hope.front.pojo.TInfo tInfo) {
		if (null == getTInfos()) setTInfos(new java.util.HashSet());
		getTInfos().add(tInfo);
	}





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

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


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


}

⌨️ 快捷键说明

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