basefavorites.java

来自「用struts+hibernate+spring做的登录」· Java 代码 · 共 151 行

JAVA
151
字号
package hibernate.base;

import java.io.Serializable;


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

public abstract class BaseFavorites  implements Serializable {

	public static String REF = "Favorites";
	public static String PROP_SID = "Sid";
	public static String PROP_HOBBY = "Hobby";
	public static String PROP_ID = "Id";


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

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

	/**
	 * Constructor for required fields
	 */
	public BaseFavorites (
		java.lang.Integer id,
		hibernate.Admin sid,
		java.lang.String hobby) {

		this.setId(id);
		this.setSid(sid);
		this.setHobby(hobby);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

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

	// fields
	private java.lang.String hobby;

	// many to one
	private hibernate.Admin sid;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="identity"
     *  column="fid"
     */
	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: hobby
	 */
	public java.lang.String getHobby () {
		return hobby;
	}

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



	/**
	 * Return the value associated with the column: id
	 */
	public hibernate.Admin getSid () {
		return sid;
	}

	/**
	 * Set the value related to the column: id
	 * @param sid the id value
	 */
	public void setSid (hibernate.Admin sid) {
		this.sid = sid;
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof hibernate.Favorites)) return false;
		else {
			hibernate.Favorites favorites = (hibernate.Favorites) obj;
			if (null == this.getId() || null == favorites.getId()) return false;
			else return (this.getId().equals(favorites.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 + =
减小字号Ctrl + -
显示快捷键?