1 package org.javabb.vo; 2 3 import java.io.Serializable ; 4 import org.apache.commons.lang.builder.EqualsBuilder; 5 import org.apache.commons.lang.builder.HashCodeBuilder; 6 import org.apache.commons.lang.builder.ToStringBuilder; 7 8 23 24 28 public class UserGroupPK implements Serializable { 29 30 31 private Long groupId; 32 33 34 private Long idUser; 35 36 37 public UserGroupPK(Long groupId, Long idUser) { 38 this.groupId = groupId; 39 this.idUser = idUser; 40 } 41 42 43 public UserGroupPK() { 44 } 45 46 51 public Long getGroupId() { 52 return this.groupId; 53 } 54 55 public void setGroupId(Long groupId) { 56 this.groupId = groupId; 57 } 58 59 64 public Long getIdUser() { 65 return this.idUser; 66 } 67 68 public void setIdUser(Long idUser) { 69 this.idUser = idUser; 70 } 71 72 public String toString() { 73 return new ToStringBuilder(this) 74 .append("groupId", getGroupId()) 75 .append("idUser", getIdUser()) 76 .toString(); 77 } 78 79 public boolean equals(Object other) { 80 if ( !(other instanceof UserGroupPK) ) return false; 81 UserGroupPK castOther = (UserGroupPK) other; 82 return new EqualsBuilder() 83 .append(this.getGroupId(), castOther.getGroupId()) 84 .append(this.getIdUser(), castOther.getIdUser()) 85 .isEquals(); 86 } 87 88 public int hashCode() { 89 return new HashCodeBuilder() 90 .append(getGroupId()) 91 .append(getIdUser()) 92 .toHashCode(); 93 } 94 95 } 96 | Popular Tags |