1 4 package org.jboss.test.cmp2.fkmapping.ejb; 5 6 9 public class GroupPK 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 departmentCode; 17 public java.lang.String departmentCode2; 18 public long groupNumber; 19 20 public GroupPK() 21 { 22 } 23 24 public GroupPK( java.lang.String departmentCode,java.lang.String departmentCode2,long groupNumber ) 25 { 26 this.departmentCode = departmentCode; 27 this.departmentCode2 = departmentCode2; 28 this.groupNumber = groupNumber; 29 } 30 31 public java.lang.String getDepartmentCode() 32 { 33 return departmentCode; 34 } 35 public java.lang.String getDepartmentCode2() 36 { 37 return departmentCode2; 38 } 39 public long getGroupNumber() 40 { 41 return groupNumber; 42 } 43 44 public void setDepartmentCode(java.lang.String departmentCode) 45 { 46 this.departmentCode = departmentCode; 47 _hashCode = 0; 48 } 49 public void setDepartmentCode2(java.lang.String departmentCode2) 50 { 51 this.departmentCode2 = departmentCode2; 52 _hashCode = 0; 53 } 54 public void setGroupNumber(long groupNumber) 55 { 56 this.groupNumber = groupNumber; 57 _hashCode = 0; 58 } 59 60 public int hashCode() 61 { 62 if( _hashCode == 0 ) 63 { 64 if (this.departmentCode != null) _hashCode += this.departmentCode.hashCode(); 65 if (this.departmentCode2 != null) _hashCode += this.departmentCode2.hashCode(); 66 _hashCode += (int)this.groupNumber; 67 } 68 69 return _hashCode; 70 } 71 72 public boolean equals(Object obj) 73 { 74 if( !(obj instanceof org.jboss.test.cmp2.fkmapping.ejb.GroupPK) ) 75 return false; 76 77 org.jboss.test.cmp2.fkmapping.ejb.GroupPK pk = (org.jboss.test.cmp2.fkmapping.ejb.GroupPK)obj; 78 boolean eq = true; 79 80 if( obj == null ) 81 { 82 eq = false; 83 } 84 else 85 { 86 if( this.departmentCode == null && ((org.jboss.test.cmp2.fkmapping.ejb.GroupPK)obj).getDepartmentCode() == null ) 87 { 88 eq = true; 89 } 90 else 91 { 92 if( this.departmentCode == null || ((org.jboss.test.cmp2.fkmapping.ejb.GroupPK)obj).getDepartmentCode() == null ) 93 { 94 eq = false; 95 } 96 else 97 { 98 eq = eq && this.departmentCode.equals( pk.departmentCode ); 99 } 100 } 101 if( this.departmentCode2 == null && ((org.jboss.test.cmp2.fkmapping.ejb.GroupPK)obj).getDepartmentCode2() == null ) 102 { 103 eq = true; 104 } 105 else 106 { 107 if( this.departmentCode2 == null || ((org.jboss.test.cmp2.fkmapping.ejb.GroupPK)obj).getDepartmentCode2() == null ) 108 { 109 eq = false; 110 } 111 else 112 { 113 eq = eq && this.departmentCode2.equals( pk.departmentCode2 ); 114 } 115 } 116 eq = eq && this.groupNumber == pk.groupNumber; 117 } 118 119 return eq; 120 } 121 122 123 public String toString() 124 { 125 if( _toStringValue == null ) 126 { 127 _toStringValue = new StringBuffer ("[."); 128 _toStringValue.append(this.departmentCode).append('.'); 129 _toStringValue.append(this.departmentCode2).append('.'); 130 _toStringValue.append(this.groupNumber).append('.'); 131 _toStringValue.append(']'); 132 } 133 134 return _toStringValue.toString(); 135 } 136 137 } 138 | Popular Tags |