/*
 * JBoss, the OpenSource J2EE webOS
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package org.jboss.ejb3.test.composite;

import javax.persistence.AccessType;
import javax.persistence.Embeddable;
import javax.persistence.AccessType;

/**
 * Comment
 *
 * @author <a href="mailto:bill@jboss.org">Bill Burke</a>
 * @version $Revision: 1.2.6.4 $
 */
@Embeddable(access = AccessType.FIELD)
public class FieldCustomerPK implements java.io.Serializable
{
   public long id;
   public String name;


   public FieldCustomerPK()
   {
   }

   public FieldCustomerPK(long id, String name)
   {
      this.id = id;
      this.name = name;
   }

   public int hashCode()
   {
      return (int) id + name.hashCode();
   }

   public boolean equals(Object obj)
   {
      if (obj == this) return true;
      if (!(obj instanceof FieldCustomerPK)) return false;
      if (obj == null) return false;
      FieldCustomerPK pk = (FieldCustomerPK) obj;
      return pk.id == id && pk.name.equals(name);
   }
}
