📄 basearticle.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 article table.
* Do not modify this class because it will be overwritten if the configuration file
* related to this class is modified.
*
* @hibernate.class
* table="article"
*/
public abstract class BaseArticle implements Serializable {
public static String PROP_ARTICLE_TYPE = "articleType";
public static String PROP_HITS = "hits";
public static String PROP_LAST_UPDATE_BY = "lastUpdateBy";
public static String PROP_CREATE_TIME = "createTime";
public static String PROP_BODY = "body";
public static String PROP_TREE_INDEX = "treeIndex";
public static String PROP_NODE_LEVEL = "nodeLevel";
public static String PROP_ROOT_ID = "rootId";
public static String PROP_BYTES = "bytes";
public static String PROP_PARENT = "parent";
public static String PROP_LAST_UPDATE_TIME = "lastUpdateTime";
public static String PROP_CREATE_BY = "createBy";
public static String PROP_BOARD = "board";
public static String PROP_TITLE = "title";
public static String PROP_ID = "id";
private int hashCode = Integer.MIN_VALUE;
// primary key
private java.lang.Integer _id;
// fields
private java.util.Date _lastUpdateTime;
private java.util.Date _createTime;
private java.lang.String _title;
private int _hits;
private java.lang.Integer _articleType;
private int _bytes;
private java.lang.String _body;
private java.lang.String _treeIndex;
private int _nodeLevel;
private int _rootId;
// many to one
private com.redsaga.hibnatesample.step2.User _createBy;
private com.redsaga.hibnatesample.step2.Article _parent;
private com.redsaga.hibnatesample.step2.Board _board;
private com.redsaga.hibnatesample.step2.User _lastUpdateBy;
// collections
private java.util.Set _childPosts;
// constructors
public BaseArticle () {
initialize();
}
/**
* Constructor for primary key
*/
public BaseArticle (java.lang.Integer _id) {
this.setId(_id);
initialize();
}
/**
* Constructor for required fields
*/
public BaseArticle (
java.lang.Integer _id,
com.redsaga.hibnatesample.step2.User _createBy,
com.redsaga.hibnatesample.step2.Article _parent,
com.redsaga.hibnatesample.step2.Board _board,
com.redsaga.hibnatesample.step2.User _lastUpdateBy,
java.util.Date _lastUpdateTime,
java.util.Date _createTime,
java.lang.String _title,
int _hits,
java.lang.Integer _articleType) {
this.setId(_id);
this.setCreateBy(_createBy);
this.setParent(_parent);
this.setBoard(_board);
this.setLastUpdateBy(_lastUpdateBy);
this.setLastUpdateTime(_lastUpdateTime);
this.setCreateTime(_createTime);
this.setTitle(_title);
this.setHits(_hits);
this.setArticleType(_articleType);
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: last_update_time
*/
public java.util.Date getLastUpdateTime () {
return _lastUpdateTime;
}
/**
* Set the value related to the column: last_update_time
* @param _lastUpdateTime the last_update_time value
*/
public void setLastUpdateTime (java.util.Date _lastUpdateTime) {
this._lastUpdateTime = _lastUpdateTime;
}
/**
* 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: title
*/
public java.lang.String getTitle () {
return _title;
}
/**
* Set the value related to the column: title
* @param _title the title value
*/
public void setTitle (java.lang.String _title) {
this._title = _title;
}
/**
* Return the value associated with the column: hits
*/
public int getHits () {
return _hits;
}
/**
* Set the value related to the column: hits
* @param _hits the hits value
*/
public void setHits (int _hits) {
this._hits = _hits;
}
/**
* Return the value associated with the column: article_type
*/
public java.lang.Integer getArticleType () {
return _articleType;
}
/**
* Set the value related to the column: article_type
* @param _articleType the article_type value
*/
public void setArticleType (java.lang.Integer _articleType) {
this._articleType = _articleType;
}
/**
* Return the value associated with the column: bytes
*/
public int getBytes () {
return _bytes;
}
/**
* Set the value related to the column: bytes
* @param _bytes the bytes value
*/
public void setBytes (int _bytes) {
this._bytes = _bytes;
}
/**
* Return the value associated with the column: body
*/
public java.lang.String getBody () {
return _body;
}
/**
* Set the value related to the column: body
* @param _body the body value
*/
public void setBody (java.lang.String _body) {
this._body = _body;
}
/**
* Return the value associated with the column: tree_index
*/
public java.lang.String getTreeIndex () {
return _treeIndex;
}
/**
* Set the value related to the column: tree_index
* @param _treeIndex the tree_index value
*/
public void setTreeIndex (java.lang.String _treeIndex) {
this._treeIndex = _treeIndex;
}
/**
* Return the value associated with the column: node_level
*/
public int getNodeLevel () {
return _nodeLevel;
}
/**
* Set the value related to the column: node_level
* @param _nodeLevel the node_level value
*/
public void setNodeLevel (int _nodeLevel) {
this._nodeLevel = _nodeLevel;
}
/**
* Return the value associated with the column: root_id
*/
public int getRootId () {
return _rootId;
}
/**
* Set the value related to the column: root_id
* @param _rootId the root_id value
*/
public void setRootId (int _rootId) {
this._rootId = _rootId;
}
/**
* @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.Article 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.Article _parent) {
this._parent = _parent;
}
/**
* @hibernate.property
* column=board_id
* not-null=true
*/
public com.redsaga.hibnatesample.step2.Board getBoard () {
return this._board;
}
/**
* Set the value related to the column: board_id
* @param _board the board_id value
*/
public void setBoard (com.redsaga.hibnatesample.step2.Board _board) {
this._board = _board;
}
/**
* @hibernate.property
* column=last_update_by
* not-null=true
*/
public com.redsaga.hibnatesample.step2.User getLastUpdateBy () {
return this._lastUpdateBy;
}
/**
* Set the value related to the column: last_update_by
* @param _lastUpdateBy the last_update_by value
*/
public void setLastUpdateBy (com.redsaga.hibnatesample.step2.User _lastUpdateBy) {
this._lastUpdateBy = _lastUpdateBy;
}
/** * Return the value associated with the column: childPosts */ public java.util.Set getChildPosts () {
return this._childPosts;
}
/**
* Set the value related to the column: childPosts
* @param _childPosts the childPosts value
*/
public void setChildPosts (java.util.Set _childPosts) {
this._childPosts = _childPosts;
}
public void addToChildPosts (Object obj) {
if (null == this._childPosts) this._childPosts = new java.util.HashSet();
this._childPosts.add(obj);
}
public boolean equals (Object obj) {
if (null == obj) return false;
if (!(obj instanceof com.redsaga.hibnatesample.step2.base.BaseArticle)) return false;
else {
com.redsaga.hibnatesample.step2.base.BaseArticle mObj = (com.redsaga.hibnatesample.step2.base.BaseArticle) 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 + -