?? basestate.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 + -