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

📄 baseuser.java

📁 hibernate框架例子程序
💻 JAVA
字号:
package com.redsaga.hibnatesample.step1.synchronizer.base;

import java.io.Serializable;


/**
 * This class has been automatically generated by Hibernate Synchronizer. * For more information or documentation, visit The Hibernate Synchronizer page * at http://www.binamics.com/hibernatesync or contact Joe Hudson at joe@binamics.com. * * This is an object that contains data related to the user table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="user"
 */
public abstract class BaseUser  implements Serializable {

	public static String PROP_PWD = "pwd";
	public static String PROP_NAME = "name";
	public static String PROP_ID = "id";


	private int hashCode = Integer.MIN_VALUE;

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

	// fields
	private java.lang.String _name;
	private java.lang.String _pwd;

	// collections
	private java.util.Set _articleSetByCreateBy;
	private java.util.Set _articleSetByLastUpdateBy;
	private java.util.Set _boardSet;


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

	/**
	 * Constructor for primary key
	 */
	public BaseUser (java.lang.Integer _id) {
		this.setId(_id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseUser (
		java.lang.Integer _id,
		java.lang.String _name,
		java.lang.String _pwd) {

		this.setId(_id);
		this.setName(_name);
		this.setPwd(_pwd);
		initialize();
	}

	protected void initialize () {}



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

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


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

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


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

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


	/**	 * Return the value associated with the column: articleSetByCreateBy	 */	public java.util.Set getArticleSetByCreateBy () {
		return this._articleSetByCreateBy;
	}

	/**
	 * Set the value related to the column: articleSetByCreateBy
	 * @param _articleSetByCreateBy the articleSetByCreateBy value
	 */
	public void setArticleSetByCreateBy (java.util.Set _articleSetByCreateBy) {
		this._articleSetByCreateBy = _articleSetByCreateBy;
	}
	
	public void addToArticleSetByCreateBy (Object obj) {
		if (null == this._articleSetByCreateBy) this._articleSetByCreateBy = new java.util.HashSet();
		this._articleSetByCreateBy.add(obj);
	}



	/**	 * Return the value associated with the column: articleSetByLastUpdateBy	 */	public java.util.Set getArticleSetByLastUpdateBy () {
		return this._articleSetByLastUpdateBy;
	}

	/**
	 * Set the value related to the column: articleSetByLastUpdateBy
	 * @param _articleSetByLastUpdateBy the articleSetByLastUpdateBy value
	 */
	public void setArticleSetByLastUpdateBy (java.util.Set _articleSetByLastUpdateBy) {
		this._articleSetByLastUpdateBy = _articleSetByLastUpdateBy;
	}
	
	public void addToArticleSetByLastUpdateBy (Object obj) {
		if (null == this._articleSetByLastUpdateBy) this._articleSetByLastUpdateBy = new java.util.HashSet();
		this._articleSetByLastUpdateBy.add(obj);
	}



	/**	 * Return the value associated with the column: boardSet	 */	public java.util.Set getBoardSet () {
		return this._boardSet;
	}

	/**
	 * Set the value related to the column: boardSet
	 * @param _boardSet the boardSet value
	 */
	public void setBoardSet (java.util.Set _boardSet) {
		this._boardSet = _boardSet;
	}
	
	public void addToBoardSet (Object obj) {
		if (null == this._boardSet) this._boardSet = new java.util.HashSet();
		this._boardSet.add(obj);
	}



	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.redsaga.hibnatesample.step1.synchronizer.base.BaseUser)) return false;
		else {
			com.redsaga.hibnatesample.step1.synchronizer.base.BaseUser mObj = (com.redsaga.hibnatesample.step1.synchronizer.base.BaseUser) obj;
			if (null == this.getId() || null == mObj.getId()) return false;
			else return (this.getId().equals(mObj.getId()));
		}
	}


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


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

}

⌨️ 快捷键说明

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