/*
 * Generated by XDoclet - Do not edit!
 */
package org.jboss.test.cmp2.fkmapping.ejb;

/**
 * Primary key for Examenation.
 */
public class ExamenationPK
   extends java.lang.Object
   implements java.io.Serializable
{
   private int _hashCode = 0;
   private StringBuffer _toStringValue = null;

   public java.lang.String examId;

   public ExamenationPK()
   {
   }

   public ExamenationPK( java.lang.String examId )
   {
      this.examId = examId;
   }

   public java.lang.String getExamId()
   {
      return examId;
   }

   public void setExamId(java.lang.String examId)
   {
      this.examId = examId;
      _hashCode = 0;
   }

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

      return _hashCode;
   }

   public boolean equals(Object obj)
   {
      if( !(obj instanceof org.jboss.test.cmp2.fkmapping.ejb.ExamenationPK) )
         return false;

      org.jboss.test.cmp2.fkmapping.ejb.ExamenationPK pk = (org.jboss.test.cmp2.fkmapping.ejb.ExamenationPK)obj;
      boolean eq = true;

      if( obj == null )
      {
         eq = false;
      }
      else
      {
         if( this.examId == null && ((org.jboss.test.cmp2.fkmapping.ejb.ExamenationPK)obj).getExamId() == null )
         {
            eq = true;
         }
         else
         {
            if( this.examId == null || ((org.jboss.test.cmp2.fkmapping.ejb.ExamenationPK)obj).getExamId() == null )
            {
               eq = false;
            }
            else
            {
               eq = eq && this.examId.equals( pk.examId );
            }
         }
      }

      return eq;
   }

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

      return _toStringValue.toString();
   }

}
