KickJava   Java API By Example, From Geeks To Geeks.

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


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

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

29 /**
30  * @hibernate.class
31  * table="jbb_user_group"
32  *
33 */

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

66     public org.javabb.vo.UserGroupPK getComp_id() {
67         return this.comp_id;
68     }
69
70     public void setComp_id(org.javabb.vo.UserGroupPK comp_id) {
71         this.comp_id = comp_id;
72     }
73
74     /**
75      * @hibernate.many-to-one
76      * update="false"
77      * insert="false"
78      *
79      * @hibernate.column
80      * name="group_id"
81      *
82      */

83     public org.javabb.vo.Group getGroup() {
84         return this.group;
85     }
86
87     public void setGroup(org.javabb.vo.Group jbbGroup) {
88         this.group = jbbGroup;
89     }
90
91     /**
92      * @hibernate.many-to-one
93      * update="false"
94      * insert="false"
95      *
96      * @hibernate.column
97      * name="id_user"
98      *
99      */

100     public org.javabb.vo.User getUser() {
101         return this.user;
102     }
103
104     public void setUser(org.javabb.vo.User user) {
105         this.user = user;
106     }
107
108     public String JavaDoc toString() {
109         return new ToStringBuilder(this)
110             .append("comp_id", getComp_id())
111             .toString();
112     }
113
114     public boolean equals(Object JavaDoc other) {
115         if ( !(other instanceof UserGroup) ) return false;
116         UserGroup castOther = (UserGroup) other;
117         return new EqualsBuilder()
118             .append(this.getComp_id(), castOther.getComp_id())
119             .isEquals();
120     }
121
122     public int hashCode() {
123         return new HashCodeBuilder()
124             .append(getComp_id())
125             .toHashCode();
126     }
127
128 }
129
Popular Tags