///////////////////////////////////////////////////////////////////////////////
// File     : EJB_DOCUMENT_PK.java
// Creation : 2002.04.29 (generated by ejen 1.0.0)

package org.ejb.test;

/**
 * Primary key class for the entity bean that maps the DOCUMENT table.
 * <br><i>Ejen EJB 1.1 (BMP) demonstration</i>
 * @version 1.0
 * @author (unknown)
 * @see org.ejb.test.DOCUMENTValues
 * @see org.ejb.test.EJB_DOCUMENTHome
 * @see org.ejb.test.EJB_DOCUMENTBean
 * @see org.ejb.test.EJB_DOCUMENT
 */
public class EJB_DOCUMENT_PK implements java.io.Serializable {

    /** Hash code of this EJB_DOCUMENT_PK */ 
    protected int _hashCode = 0;
    /** Primary key field. */
    protected int _id;

    /** Default constructeur (empty). */
    public EJB_DOCUMENT_PK() {}

    /**
     * Constructor.
     * @param id primary key field.
     */
    public EJB_DOCUMENT_PK(int id) {
        _id = id;
        computeHashCode();
    }

    /**
     * Returns the value of the ID field.
     * @return value of the ID field.
     */
    public int getId() {
        return _id;
    }

    /**
     * Returns a string representation of this EJB_DOCUMENT_PK
     *         in the form of {id=&lt;value&gt;}.
     * @return a string representation of this EJB_DOCUMENT_PK.
     */
    public String toString() {
        return "{id=" + _id + "}";
    }

    /**
     * Compares the specified Object with this EJB_DOCUMENT_PK for equality.
     * @param o the reference object with which to compare.
     * @return true if the specified Object is equal to this EJB_DOCUMENT_PK.
     */
    public boolean equals(Object o) {
        return ((o instanceof EJB_DOCUMENT_PK)
             && (_id == ((EJB_DOCUMENT_PK)o)._id));
    }

    /**
     * Computes the hash code value of this EJB_DOCUMENT_PK.
     */
    protected void computeHashCode() {
        _hashCode = _id;
    }

    /**
     * Returns the hash code value of this EJB_DOCUMENT_PK.
     * @return the hash code value of this EJB_DOCUMENT_PK.
     */
    public int hashCode() {
        return _hashCode;
    }
}

EJB_DOCUMENT_PK.html (HTML view generated by ejen v.1.0.0).