KickJava   Java API By Example, From Geeks To Geeks.

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


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: GroupModeratorPK.java,v 1.2.8.2 2006/04/17 17:46:54 daltoncamargo Exp $
26  * @author Dalton Camargo - <a HREF="mailto:dalton@javabb.org">dalton@javabb.org </a> <br>
27  */

28 public class GroupModeratorPK implements Serializable JavaDoc {
29
30     /** identifier field */
31     private Long JavaDoc groupId;
32
33     /** identifier field */
34     private Long JavaDoc idForum;
35
36     /** full constructor */
37     public GroupModeratorPK(Long JavaDoc groupId, Long JavaDoc idForum) {
38         this.groupId = groupId;
39         this.idForum = idForum;
40     }
41
42     /** default constructor */
43     public GroupModeratorPK() {
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_forum"
62      *
63      */

64     public Long JavaDoc getIdForum() {
65         return this.idForum;
66     }
67
68     public void setIdForum(Long JavaDoc idForum) {
69         this.idForum = idForum;
70     }
71
72     public String JavaDoc toString() {
73         return new ToStringBuilder(this)
74             .append("groupId", getGroupId())
75             .append("idForum", getIdForum())
76             .toString();
77     }
78
79     public boolean equals(Object JavaDoc other) {
80         if ( !(other instanceof GroupModeratorPK) ) return false;
81         GroupModeratorPK castOther = (GroupModeratorPK) other;
82         return new EqualsBuilder()
83             .append(this.getGroupId(), castOther.getGroupId())
84             .append(this.getIdForum(), castOther.getIdForum())
85             .isEquals();
86     }
87
88     public int hashCode() {
89         return new HashCodeBuilder()
90             .append(getGroupId())
91             .append(getIdForum())
92             .toHashCode();
93     }
94
95 }
96
Popular Tags