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