1 4 package org.jboss.test.cmp2.fkmapping.ejb; 5 6 9 public class InstitutePK 10 extends java.lang.Object 11 implements java.io.Serializable 12 { 13 private int _hashCode = 0; 14 private StringBuffer _toStringValue = null; 15 16 public java.lang.String instituteId; 17 18 public InstitutePK() 19 { 20 } 21 22 public InstitutePK( java.lang.String instituteId ) 23 { 24 this.instituteId = instituteId; 25 } 26 27 public java.lang.String getInstituteId() 28 { 29 return instituteId; 30 } 31 32 public void setInstituteId(java.lang.String instituteId) 33 { 34 this.instituteId = instituteId; 35 _hashCode = 0; 36 } 37 38 public int hashCode() 39 { 40 if( _hashCode == 0 ) 41 { 42 if (this.instituteId != null) _hashCode += this.instituteId.hashCode(); 43 } 44 45 return _hashCode; 46 } 47 48 public boolean equals(Object obj) 49 { 50 if( !(obj instanceof org.jboss.test.cmp2.fkmapping.ejb.InstitutePK) ) 51 return false; 52 53 org.jboss.test.cmp2.fkmapping.ejb.InstitutePK pk = (org.jboss.test.cmp2.fkmapping.ejb.InstitutePK)obj; 54 boolean eq = true; 55 56 if( obj == null ) 57 { 58 eq = false; 59 } 60 else 61 { 62 if( this.instituteId == null && ((org.jboss.test.cmp2.fkmapping.ejb.InstitutePK)obj).getInstituteId() == null ) 63 { 64 eq = true; 65 } 66 else 67 { 68 if( this.instituteId == null || ((org.jboss.test.cmp2.fkmapping.ejb.InstitutePK)obj).getInstituteId() == null ) 69 { 70 eq = false; 71 } 72 else 73 { 74 eq = eq && this.instituteId.equals( pk.instituteId ); 75 } 76 } 77 } 78 79 return eq; 80 } 81 82 83 public String toString() 84 { 85 if( _toStringValue == null ) 86 { 87 _toStringValue = new StringBuffer ("[."); 88 _toStringValue.append(this.instituteId).append('.'); 89 _toStringValue.append(']'); 90 } 91 92 return _toStringValue.toString(); 93 } 94 95 } 96 | Popular Tags |