baseinterest.java

来自「《精通Spring》源代码」· Java 代码 · 共 115 行

JAVA
115
字号
package com.openv.spring.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 interest table. Do not
 * modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 * 
 * @hibernate.class table="interest"
 */
public abstract class BaseInterest implements Serializable {

    public static String PROP_NAME = "Name";

    public static String PROP_ID = "Id";

    private int hashCode = Integer.MIN_VALUE;

    // primary key
    private java.lang.String _id;

    // fields
    private java.lang.String _name;

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

    /**
     * Constructor for primary key
     */
    public BaseInterest(java.lang.String _id) {
        this.setId(_id);
        initialize();
    }

    protected void initialize() {
    }

    /**
     * Return the unique identifier of this class
     * 
     * @hibernate.id generator-class="vm" 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: 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;
    }

    public boolean equals(Object obj) {
        if (null == obj)
            return false;
        if (!(obj instanceof com.openv.spring.base.BaseInterest))
            return false;
        else {
            com.openv.spring.base.BaseInterest mObj = (com.openv.spring.base.BaseInterest) 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 + -
显示快捷键?