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

📄 basevoteoption.java

📁 hibernate框架例子程序
💻 JAVA
字号:
package com.redsaga.hibernatesample.step3.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 vote_option table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="vote_option"
 */
public abstract class BaseVoteOption  implements Serializable {

	public static String PROP_OPTION_TEXT = "optionText";
	public static String PROP_POLL = "poll";
	public static String PROP_AGREE_NUMBER = "agreeNumber";
	public static String PROP_ID = "id";


	private int hashCode = Integer.MIN_VALUE;

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

	// fields
	private int _agreeNumber;
	private java.lang.String _optionText;

	// many to one
	private com.redsaga.hibernatesample.step3.Vote _poll;


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

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

	/**
	 * Constructor for required fields
	 */
	public BaseVoteOption (
		java.lang.Integer _id,
		com.redsaga.hibernatesample.step3.Vote _poll) {

		this.setId(_id);
		this.setPoll(_poll);
		initialize();
	}

	protected void initialize () {}



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="vm"
     *  column="option_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: agree_number
	 */
	public int getAgreeNumber () {
		return _agreeNumber;
	}

	/**
	 * Set the value related to the column: agree_number
	 * @param _agreeNumber the agree_number value
	 */
	public void setAgreeNumber (int _agreeNumber) {
		this._agreeNumber = _agreeNumber;
	}


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

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


	/**
     * @hibernate.property
     *  column=poll_id
	 * not-null=true
	 */
	public com.redsaga.hibernatesample.step3.Vote getPoll () {
		return this._poll;
	}

	/**
	 * Set the value related to the column: poll_id
	 * @param _poll the poll_id value
	 */
	public void setPoll (com.redsaga.hibernatesample.step3.Vote _poll) {
		this._poll = _poll;
	}


	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.redsaga.hibernatesample.step3.base.BaseVoteOption)) return false;
		else {
			com.redsaga.hibernatesample.step3.base.BaseVoteOption mObj = (com.redsaga.hibernatesample.step3.base.BaseVoteOption) 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 + -