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

📄 basestate.java

📁 网上拍卖系统源代码用java+jsp实现
💻 JAVA
字号:
package org.yeeku.model.base;

import java.lang.Comparable;
import java.io.Serializable;
import java.util.HashSet;

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

public abstract class BaseState  implements Comparable, Serializable {

	public static String REF = "State";
	public static String PROP_STATE_NAME = "StateName";
	public static String PROP_ID = "Id";


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

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

	/**
	 * Constructor for required fields
	 */
	public BaseState (
		java.lang.Integer id,
		java.lang.String stateName){
		this.setId(id);
		this.setStateName(stateName);
		initialize();
	}


	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

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

	// fields
	private java.lang.String stateName;

	// collections
	private java.util.Set items = new HashSet();

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

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


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

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

	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof org.yeeku.model.State)) return false;
		else {
			org.yeeku.model.State state = (org.yeeku.model.State) obj;
			if (null == this.getId() || null == state.getId()) return false;
			else return (this.getId().equals(state.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 int compareTo (Object obj) {
		if (obj.hashCode() > hashCode()) return 1;
		else if (obj.hashCode() < hashCode()) return -1;
		else return 0;
	}

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


}

⌨️ 快捷键说明

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