📄 baseboard.java
字号:
package com.redsaga.hibnatesample.step2.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 board table.
* Do not modify this class because it will be overwritten if the configuration file
* related to this class is modified.
*
* @hibernate.class
* table="board"
*/
public abstract class BaseBoard implements Serializable {
public static String PROP_REMARK = "remark";
public static String PROP_CREATE_TIME = "createTime";
public static String PROP_PARENT = "parent";
public static String PROP_CREATE_BY = "createBy";
public static String PROP_NAME = "name";
public static String PROP_ID = "id";
private int hashCode = Integer.MIN_VALUE;
// primary key
private java.lang.Integer _id;
// fields
private java.util.Date _createTime;
private java.lang.String _remark;
private java.lang.String _name;
// many to one
private com.redsaga.hibnatesample.step2.User _createBy;
private com.redsaga.hibnatesample.step2.Board _parent;
// collections
private java.util.Set _articles;
private java.util.Set _childBoards;
// constructors
public BaseBoard () {
initialize();
}
/**
* Constructor for primary key
*/
public BaseBoard (java.lang.Integer _id) {
this.setId(_id);
initialize();
}
/**
* Constructor for required fields
*/
public BaseBoard (
java.lang.Integer _id,
com.redsaga.hibnatesample.step2.User _createBy,
com.redsaga.hibnatesample.step2.Board _parent,
java.util.Date _createTime,
java.lang.String _name) {
this.setId(_id);
this.setCreateBy(_createBy);
this.setParent(_parent);
this.setCreateTime(_createTime);
this.setName(_name);
initialize();
}
protected void initialize () {}
/**
* Return the unique identifier of this class
* @hibernate.id
* generator-class="increment"
* column="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: create_time
*/
public java.util.Date getCreateTime () {
return _createTime;
}
/**
* Set the value related to the column: create_time
* @param _createTime the create_time value
*/
public void setCreateTime (java.util.Date _createTime) {
this._createTime = _createTime;
}
/**
* Return the value associated with the column: remark
*/
public java.lang.String getRemark () {
return _remark;
}
/**
* Set the value related to the column: remark
* @param _remark the remark value
*/
public void setRemark (java.lang.String _remark) {
this._remark = _remark;
}
/**
* Return the value associated with the column: name
*/
public java.lang.String getName () {
return _name;
}
/**
* Set the value related to the column: name
* @param _name the name value
*/
public void setName (java.lang.String _name) {
this._name = _name;
}
/**
* @hibernate.property
* column=create_by
* not-null=true
*/
public com.redsaga.hibnatesample.step2.User getCreateBy () {
return this._createBy;
}
/**
* Set the value related to the column: create_by
* @param _createBy the create_by value
*/
public void setCreateBy (com.redsaga.hibnatesample.step2.User _createBy) {
this._createBy = _createBy;
}
/**
* @hibernate.property
* column=parent_id
* not-null=true
*/
public com.redsaga.hibnatesample.step2.Board getParent () {
return this._parent;
}
/**
* Set the value related to the column: parent_id
* @param _parent the parent_id value
*/
public void setParent (com.redsaga.hibnatesample.step2.Board _parent) {
this._parent = _parent;
}
/** * Return the value associated with the column: articles */ public java.util.Set getArticles () {
return this._articles;
}
/**
* Set the value related to the column: articles
* @param _articles the articles value
*/
public void setArticles (java.util.Set _articles) {
this._articles = _articles;
}
public void addToArticles (Object obj) {
if (null == this._articles) this._articles = new java.util.HashSet();
this._articles.add(obj);
}
/** * Return the value associated with the column: childBoards */ public java.util.Set getChildBoards () {
return this._childBoards;
}
/**
* Set the value related to the column: childBoards
* @param _childBoards the childBoards value
*/
public void setChildBoards (java.util.Set _childBoards) {
this._childBoards = _childBoards;
}
public void addToChildBoards (Object obj) {
if (null == this._childBoards) this._childBoards = new java.util.HashSet();
this._childBoards.add(obj);
}
public boolean equals (Object obj) {
if (null == obj) return false;
if (!(obj instanceof com.redsaga.hibnatesample.step2.base.BaseBoard)) return false;
else {
com.redsaga.hibnatesample.step2.base.BaseBoard mObj = (com.redsaga.hibnatesample.step2.base.BaseBoard) 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 + -