View Javadoc

1   /*
2    * Copyright 2002-2004 the original author or authors.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */ 
16  
17  package net.sf.fridaymvc.sample.hibernate;
18  
19  import java.io.Serializable;
20  import java.util.HashSet;
21  import java.util.Set;
22  
23  import net.sf.fridaymvc.security.accesscontroller.AbstractUser;
24  
25  /***
26   * @author <a href="mailto:arto.pastinen@ofw.fi">Arto Pastinen</a>
27   * @version $Id: HibernateUser.java,v 1.1.1.1 2004/11/23 09:36:44 artsi Exp $
28   * @hibernate.class
29   * 		table = "users"
30   */
31  
32  public class HibernateUser extends AbstractUser implements Serializable {
33      protected Integer userUid;
34      protected String username;
35      protected String password;
36      protected String email;
37      protected String firstName;
38      protected String surName;
39      protected String phoneNumber;
40      
41      
42      /***
43       * @return Returns the userUid.
44       * @hibernate.id
45       * 		column = "user_uid"
46       * 		generator-class = "native"
47       * 		unsaved-value = "null"
48       */
49      public Integer getUserUid() {
50          return this.userUid;
51      }
52      /***
53       * @param userUid The userUid to set.
54       */
55      public void setUserUid(Integer userUid) {
56          this.userUid = userUid;
57      }
58      
59      /***
60       * 
61       * 
62       * 
63       * @hibernate.set
64       * 		cascade = "all"
65       * 		table = "join_users_roles"
66       *  
67       * @hibernate.collection-key
68       * 		column = "role_uid"
69       * 		
70       * @hibernate.collection-many-to-many 
71       * 		class = "net.sf.fridaymvc.sample.hibernate.HibernateRole"
72       * 		column = "user_uid"     
73       */
74      public Set getRoles() {
75           Set roles = super.getRoles();
76           if(roles == null) setRoles(new HashSet(1));
77           return roles;
78      }   
79      /***
80       * @return Returns the email.
81       * @hibernate.property 
82       * 		column = "email"
83       * 		length = "100"
84       * 		not-null = "true"
85       * 
86       */
87      public String getEmail() {
88          return this.email;
89      }
90      /***
91       * @param email The email to set.
92       */
93      public void setEmail(String email) {
94          this.email = email;
95      }
96      /***
97       * @return Returns the firstName.
98       * @hibernate.property 
99       * 		column = "firstname"
100      * 		length = "32"
101      * 		not-null = "true"
102      */
103     public String getFirstName() {
104         return this.firstName;
105     }
106     /***
107      * @param firstName The firstName to set.
108      */
109     public void setFirstName(String firstName) {
110         this.firstName = firstName;
111     }
112     /***
113      * @return Returns the password.
114      * @hibernate.property
115      * 		column = "password"
116      * 		length = "32"
117      * 		not-null = "true"
118      */
119     public String getPassword() {
120         return this.password;
121     }
122     /***
123      * @param password The password to set.
124      */
125     public void setPassword(String password) {
126         this.password = password;
127     }
128     /***
129      * @return Returns the surName.
130      * @hibernate.property 
131      * 		column = "surname"
132      * 		not-null = "true"
133      * 		length = "100"
134      */
135     public String getSurName() {
136         return this.surName;
137     }
138     /***
139      * @param surName The surName to set.
140      */
141     public void setSurName(String surName) {
142         this.surName = surName;
143     }
144     /***
145      * @return Returns the username.
146      * @hibernate.property 
147      * 		column = "username"
148      * 		not-null = "true"
149      * 		length = "32"
150      * 		unique = "true"
151      */
152     public String getUsername() {
153         return this.username;
154     }
155     /***
156      * @param username The username to set.
157      */
158     public void setUsername(String username) {
159         this.username = username;
160     }
161     /***
162      * @return Returns the phoneNumber.
163      * @hibernate.property 
164      * 		column = "phonenumber"
165      * 		not-null = "true"
166      * 		length = "32"
167      */
168     public String getPhoneNumber() {
169         return phoneNumber;
170     }
171     /***
172      * @param phoneNumber The phoneNumber to set.
173      */
174     public void setPhoneNumber(String phoneNumber) {
175         this.phoneNumber = phoneNumber;
176     }
177 }