KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > javabb > vo > UserGroupPK


1 package org.javabb.vo;
2
3 import java.io.Serializable JavaDoc;
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 /*
9  * Copyright 2004 JavaFree.org
10  *
11  * Licensed under the Apache License, Version 2.0 (the "License");
12  * you may not use this file except in compliance with the License.
13  * You may obtain a copy of the License at
14  *
15  * http://www.apache.org/licenses/LICENSE-2.0
16  *
17  * Unless required by applicable law or agreed to in writing, software
18  * distributed under the License is distributed on an "AS IS" BASIS,
19  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  * See the License for the specific language governing permissions and
21  * limitations under the License.
22  */

23
24 /**
25  * $Id: UserGroupPK.java,v 1.2.8.2 2006/04/17 17:46:59 daltoncamargo Exp $
26  * @author Dalton Camargo - <a HREF="mailto:dalton@javabb.org">dalton@javabb.org </a> <br>
27  */

28 public class UserGroupPK implements Serializable JavaDoc {
29
30     /** identifier field */
31     private Long JavaDoc groupId;
32
33     /** identifier field */
34     private Long JavaDoc idUser;
35
36     /** full constructor */
37     public UserGroupPK(Long JavaDoc groupId, Long JavaDoc idUser) {
38         this.groupId = groupId;
39         this.idUser = idUser;
40     }
41
42     /** default constructor */
43     public UserGroupPK() {
44     }
45
46     /**
47      * @hibernate.property
48      * column="group_id"
49      *
50      */

51     public Long JavaDoc getGroupId() {
52         return this.groupId;
53     }
54
55     public void setGroupId(Long JavaDoc groupId) {
56         this.groupId = groupId;
57     }
58
59     /**
60      * @hibernate.property
61      * column="id_user"
62      *
63      */

64     public Long JavaDoc getIdUser() {
65         return this.idUser;
66     }
67
68     public void setIdUser(Long JavaDoc idUser) {
69         this.idUser = idUser;
70     }
71
72     public String JavaDoc toString() {
73         return new ToStringBuilder(this)
74             .append("groupId", getGroupId())
75             .append("idUser", getIdUser())
76             .toString();
77     }
78
79     public boolean equals(Object JavaDoc 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