KickJava   Java API By Example, From Geeks To Geeks.

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


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

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

30 /**
31  * @hibernate.class
32  * table="jbb_group_permission"
33  *
34 */

35 public class GroupPermission implements Serializable JavaDoc {
36
37     /** identifier field */
38     private org.javabb.vo.GroupPermissionPK comp_id;
39
40     /** nullable persistent field */
41     private Long JavaDoc permissionType;
42
43     /** nullable persistent field */
44     private org.javabb.vo.Forum forum;
45
46     /** nullable persistent field */
47     private org.javabb.vo.Group group;
48
49     /** full constructor */
50     public GroupPermission(org.javabb.vo.GroupPermissionPK comp_id, Long JavaDoc permissionType, org.javabb.vo.Forum forum, org.javabb.vo.Group jbbGroup) {
51         this.comp_id = comp_id;
52         this.permissionType = permissionType;
53         this.forum = forum;
54         this.group = jbbGroup;
55     }
56
57     /** default constructor */
58     public GroupPermission() {
59     }
60
61     /** minimal constructor */
62     public GroupPermission(org.javabb.vo.GroupPermissionPK comp_id) {
63         this.comp_id = comp_id;
64     }
65
66     /**
67      * @hibernate.id
68      * generator-class="assigned"
69      *
70      */

71     public org.javabb.vo.GroupPermissionPK getComp_id() {
72         return this.comp_id;
73     }
74
75     public void setComp_id(org.javabb.vo.GroupPermissionPK comp_id) {
76         this.comp_id = comp_id;
77     }
78
79     /**
80      * @hibernate.property
81      * column="permission_type"
82      * length="8"
83      *
84      */

85     public Long JavaDoc getPermissionType() {
86         return this.permissionType;
87     }
88
89     public void setPermissionType(Long JavaDoc permissionType) {
90         this.permissionType = permissionType;
91     }
92
93     /**
94      * @hibernate.many-to-one
95      * update="false"
96      * insert="false"
97      *
98      * @hibernate.column
99      * name="id_forum"
100      *
101      */

102     public org.javabb.vo.Forum getForum() {
103         return this.forum;
104     }
105
106     public void setForum(org.javabb.vo.Forum forum) {
107         this.forum = forum;
108     }
109
110     /**
111      * @hibernate.many-to-one
112      * update="false"
113      * insert="false"
114      *
115      * @hibernate.column
116      * name="group_id"
117      *
118      */

119     public org.javabb.vo.Group getGroup() {
120         return this.group;
121     }
122
123     public void setGroup(org.javabb.vo.Group jbbGroup) {
124         this.group = jbbGroup;
125     }
126
127     public String JavaDoc toString() {
128         return new ToStringBuilder(this)
129             .append("comp_id", getComp_id())
130             .toString();
131     }
132
133     public boolean equals(Object JavaDoc other) {
134         if ( !(other instanceof GroupPermission) ) return false;
135         GroupPermission castOther = (GroupPermission) other;
136         return new EqualsBuilder()
137             .append(this.getComp_id(), castOther.getComp_id())
138             .isEquals();
139     }
140
141     public int hashCode() {
142         return new HashCodeBuilder()
143             .append(getComp_id())
144             .toHashCode();
145     }
146
147 }
148
Popular Tags