basestudent.java
来自「Hibernate开发及整合应用大全 蔡雪焘编著 本书用典型的示例剖析Hiber」· Java 代码 · 共 149 行
JAVA
149 行
package model.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 student table.
* Do not modify this class because it will be overwritten if the configuration file
* related to this class is modified.
*
* @hibernate.class
* table="student"
*/
public abstract class BaseStudent implements Serializable {
public static String PROP_STU_NAME = "StuName";
public static String PROP_CARD_ID = "CardId";
public static String PROP_AGE = "Age";
public static String PROP_ID = "Id";
private int hashCode = Integer.MIN_VALUE;
// primary key
private java.lang.String _id;
// fields
private java.lang.String _age;
private java.lang.String _cardId;
private java.lang.String _stuName;
// constructors
public BaseStudent () {
initialize();
}
/**
* Constructor for primary key
*/
public BaseStudent (java.lang.String _id) {
this.setId(_id);
initialize();
}
protected void initialize () {}
/**
* Return the unique identifier of this class
* @hibernate.id
* generator-class="uuid.hex"
* column="id"
*/
public java.lang.String getId () {
return _id;
}
/**
* Set the unique identifier of this class
* @param _id the new ID
*/
public void setId (java.lang.String _id) {
this._id = _id;
this.hashCode = Integer.MIN_VALUE;
}
/**
* Return the value associated with the column: age
*/
public java.lang.String getAge () {
return _age;
}
/**
* Set the value related to the column: age
* @param _age the age value
*/
public void setAge (java.lang.String _age) {
this._age = _age;
}
/**
* Return the value associated with the column: cardId
*/
public java.lang.String getCardId () {
return _cardId;
}
/**
* Set the value related to the column: cardId
* @param _cardId the cardId value
*/
public void setCardId (java.lang.String _cardId) {
this._cardId = _cardId;
}
/**
* Return the value associated with the column: stuName
*/
public java.lang.String getStuName () {
return _stuName;
}
/**
* Set the value related to the column: stuName
* @param _stuName the stuName value
*/
public void setStuName (java.lang.String _stuName) {
this._stuName = _stuName;
}
public boolean equals (Object obj) {
if (null == obj) return false;
if (!(obj instanceof model.base.BaseStudent)) return false;
else {
model.base.BaseStudent mObj = (model.base.BaseStudent) 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 + =
减小字号Ctrl + -
显示快捷键?