/*
 * Generated by XDoclet - Do not edit!
 */
package test.interfaces;

/**
 * Data object for Account.
 * @xdoclet-generated at 16-04-05
 * @copyright The XDoclet Team
 * @author XDoclet
 * @version 1.2.3
 */
public class AccountData
   extends java.lang.Object
   implements java.io.Serializable
{
   private java.lang.Integer id;
   private test.interfaces.Customer owner;
   private float balance;
   private java.util.Date lastModificationDate;
   private java.lang.String accountId;
   private java.util.Date creationDate;

  /* begin value object */
   private test.interfaces.AccountValue AccountValue = null;

   public test.interfaces.AccountValue getAccountValue()
   {
	  if( AccountValue == null )
	  {
          AccountValue = new test.interfaces.AccountValue();
	  }
      try
         {
            AccountValue.setId( getId() );
            AccountValue.setBalance( getBalance() );
                   }
         catch (Exception e)
         {
            throw new javax.ejb.EJBException(e);
         }

	  return AccountValue;
   }

   public void setAccountValue( test.interfaces.AccountValue valueHolder )
   {

	  try
	  {
		 setBalance( valueHolder.getBalance() );
	  }
	  catch (Exception e)
	  {
		 throw new javax.ejb.EJBException(e);
	  }
   }

  /* end value object */

   public AccountData()
   {
   }

   public AccountData( java.lang.Integer id,test.interfaces.Customer owner,float balance,java.util.Date lastModificationDate,java.lang.String accountId,java.util.Date creationDate )
   {
      setId(id);
      setOwner(owner);
      setBalance(balance);
      setLastModificationDate(lastModificationDate);
      this.accountId = accountId;
      setCreationDate(creationDate);
   }

   public AccountData( AccountData otherData )
   {
      setId(otherData.getId());
      setOwner(otherData.getOwner());
      setBalance(otherData.getBalance());
      setLastModificationDate(otherData.getLastModificationDate());
      this.accountId = otherData.accountId;
      setCreationDate(otherData.getCreationDate());

   }

   public test.interfaces.AccountPK getPrimaryKey() {
     test.interfaces.AccountPK pk = new test.interfaces.AccountPK(this.getId());
     return pk;
   }

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

   public test.interfaces.Customer getOwner()
   {
      return this.owner;
   }
   public void setOwner( test.interfaces.Customer owner )
   {
      this.owner = owner;
   }

   public float getBalance()
   {
      return this.balance;
   }
   public void setBalance( float balance )
   {
      this.balance = balance;
   }

   public java.util.Date getLastModificationDate()
   {
      return this.lastModificationDate;
   }
   public void setLastModificationDate( java.util.Date lastModificationDate )
   {
      this.lastModificationDate = lastModificationDate;
   }

   public java.lang.String getAccountId()
   {
      return this.accountId;
   }
   public void setAccountId( java.lang.String accountId )
   {
      this.accountId = accountId;
   }

   public java.util.Date getCreationDate()
   {
      return this.creationDate;
   }
   public void setCreationDate( java.util.Date creationDate )
   {
      this.creationDate = creationDate;
   }

   public String toString()
   {
      StringBuffer str = new StringBuffer("{");

      str.append("id=" + getId() + " " + "owner=" + getOwner() + " " + "balance=" + getBalance() + " " + "lastModificationDate=" + getLastModificationDate() + " " + "accountId=" + getAccountId() + " " + "creationDate=" + getCreationDate());
      str.append('}');

      return(str.toString());
   }

   public boolean equals( Object pOther )
   {
      if( pOther instanceof AccountData )
      {
         AccountData lTest = (AccountData) pOther;
         boolean lEquals = true;

         if( this.id == null )
         {
            lEquals = lEquals && ( lTest.id == null );
         }
         else
         {
            lEquals = lEquals && this.id.equals( lTest.id );
         }
         if( this.owner == null )
         {
            lEquals = lEquals && ( lTest.owner == null );
         }
         else
         {
            lEquals = lEquals && this.owner.equals( lTest.owner );
         }
         lEquals = lEquals && this.balance == lTest.balance;
         if( this.lastModificationDate == null )
         {
            lEquals = lEquals && ( lTest.lastModificationDate == null );
         }
         else
         {
            lEquals = lEquals && this.lastModificationDate.equals( lTest.lastModificationDate );
         }
         if( this.accountId == null )
         {
            lEquals = lEquals && ( lTest.accountId == null );
         }
         else
         {
            lEquals = lEquals && this.accountId.equals( lTest.accountId );
         }
         if( this.creationDate == null )
         {
            lEquals = lEquals && ( lTest.creationDate == null );
         }
         else
         {
            lEquals = lEquals && this.creationDate.equals( lTest.creationDate );
         }

         return lEquals;
      }
      else
      {
         return false;
      }
   }

   public int hashCode()
   {
      int result = 17;

      result = 37*result + ((this.id != null) ? this.id.hashCode() : 0);

      result = 37*result + ((this.owner != null) ? this.owner.hashCode() : 0);

      result = 37*result + Float.floatToIntBits(balance);

      result = 37*result + ((this.lastModificationDate != null) ? this.lastModificationDate.hashCode() : 0);

      result = 37*result + ((this.accountId != null) ? this.accountId.hashCode() : 0);

      result = 37*result + ((this.creationDate != null) ? this.creationDate.hashCode() : 0);

      return result;
   }

}
