/* * Generated by XDoclet - Do not edit! */ package org.jboss.test.cmp2.fkmapping.ejb; /** * Primary key for Student. */ public class StudentPK extends java.lang.Object implements java.io.Serializable { private int _hashCode = 0; private StringBuffer _toStringValue = null; public java.lang.String departmentCode; public java.lang.String departmentCode2; public java.lang.String lastName; public StudentPK() { } public StudentPK( java.lang.String departmentCode,java.lang.String departmentCode2,java.lang.String lastName ) { this.departmentCode = departmentCode; this.departmentCode2 = departmentCode2; this.lastName = lastName; } public java.lang.String getDepartmentCode() { return departmentCode; } public java.lang.String getDepartmentCode2() { return departmentCode2; } public java.lang.String getLastName() { return lastName; } public void setDepartmentCode(java.lang.String departmentCode) { this.departmentCode = departmentCode; _hashCode = 0; } public void setDepartmentCode2(java.lang.String departmentCode2) { this.departmentCode2 = departmentCode2; _hashCode = 0; } public void setLastName(java.lang.String lastName) { this.lastName = lastName; _hashCode = 0; } public int hashCode() { if( _hashCode == 0 ) { if (this.departmentCode != null) _hashCode += this.departmentCode.hashCode(); if (this.departmentCode2 != null) _hashCode += this.departmentCode2.hashCode(); if (this.lastName != null) _hashCode += this.lastName.hashCode(); } return _hashCode; } public boolean equals(Object obj) { if( !(obj instanceof org.jboss.test.cmp2.fkmapping.ejb.StudentPK) ) return false; org.jboss.test.cmp2.fkmapping.ejb.StudentPK pk = (org.jboss.test.cmp2.fkmapping.ejb.StudentPK)obj; boolean eq = true; if( obj == null ) { eq = false; } else { if( this.departmentCode == null && ((org.jboss.test.cmp2.fkmapping.ejb.StudentPK)obj).getDepartmentCode() == null ) { eq = true; } else { if( this.departmentCode == null || ((org.jboss.test.cmp2.fkmapping.ejb.StudentPK)obj).getDepartmentCode() == null ) { eq = false; } else { eq = eq && this.departmentCode.equals( pk.departmentCode ); } } if( this.departmentCode2 == null && ((org.jboss.test.cmp2.fkmapping.ejb.StudentPK)obj).getDepartmentCode2() == null ) { eq = true; } else { if( this.departmentCode2 == null || ((org.jboss.test.cmp2.fkmapping.ejb.StudentPK)obj).getDepartmentCode2() == null ) { eq = false; } else { eq = eq && this.departmentCode2.equals( pk.departmentCode2 ); } } if( this.lastName == null && ((org.jboss.test.cmp2.fkmapping.ejb.StudentPK)obj).getLastName() == null ) { eq = true; } else { if( this.lastName == null || ((org.jboss.test.cmp2.fkmapping.ejb.StudentPK)obj).getLastName() == null ) { eq = false; } else { eq = eq && this.lastName.equals( pk.lastName ); } } } return eq; } /** @return String representation of this pk in the form of [.field1.field2.field3]. */ public String toString() { if( _toStringValue == null ) { _toStringValue = new StringBuffer("[."); _toStringValue.append(this.departmentCode).append('.'); _toStringValue.append(this.departmentCode2).append('.'); _toStringValue.append(this.lastName).append('.'); _toStringValue.append(']'); } return _toStringValue.toString(); } }