/*
 * Generated by XDoclet - Do not edit!
 */
package org.jboss.as.test.integration.ejb.entity.cmp.relationship.oneToOneBidirectionalWithTableMapping;

/**
 * Primary key for Child.
 */
public class ChildPK
   extends java.lang.Object
   implements java.io.Serializable
{

   public java.lang.Integer id;

   public ChildPK()
   {
   }

   public ChildPK( java.lang.Integer id )
   {
      this.id = id;
   }

   public java.lang.Integer getId()
   {
      return id;
   }

   public void setId(java.lang.Integer id)
   {
      this.id = id;
   }

   public int hashCode()
   {
      int _hashCode = 0;
         if (this.id != null) _hashCode += this.id.hashCode();

      return _hashCode;
   }

   public boolean equals(Object obj)
   {
      if( !(obj instanceof org.jboss.as.test.integration.ejb.entity.cmp.relationship.oneToOneBidirectionalWithTableMapping.ChildPK) )
         return false;

      org.jboss.as.test.integration.ejb.entity.cmp.relationship.oneToOneBidirectionalWithTableMapping.ChildPK pk = (org.jboss.as.test.integration.ejb.entity.cmp.relationship.oneToOneBidirectionalWithTableMapping.ChildPK)obj;
      boolean eq = true;

      if( obj == null )
      {
         eq = false;
      }
      else
      {
         if( this.id != null )
         {
            eq = eq && this.id.equals( pk.getId() );
         }
         else  // this.id == null
         {
            eq = eq && ( pk.getId() == null );
         }
      }

      return eq;
   }

   /** @return String representation of this pk in the form of [.field1.field2.field3]. */
   public String toString()
   {
      StringBuffer toStringValue = new StringBuffer("[.");
         toStringValue.append(this.id).append('.');
      toStringValue.append(']');
      return toStringValue.toString();
   }

}
