KickJava   Java API By Example, From Geeks To Geeks.

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


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: GroupPermissionPK.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 GroupPermissionPK 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 GroupPermissionPK(Long JavaDoc groupId, Long JavaDoc idForum) {
38         this.groupId = groupId;
39         this.idForum = idForum;
40     }
41
42     /** default constructor */
43     public GroupPermissionPK() {
44     }
45
46     /**
47      * @hibernate.property
48      * column="group_id"
49      * length="8"
50      *
51      */

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

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