KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > enterprise > jsf_jpa_war > Wuser


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the License at
8  * https://javaserverfaces.dev.java.net/CDDL.html or
9  * legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permission and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * your own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * [Name of File] [$Id: Wuser.java,v 1.2 2006/10/12 14:54:39 abadea Exp $] [Date]
22  *
23  * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
24  */

25
26 package enterprise.jsf_jpa_war;
27
28 import java.io.Serializable JavaDoc;
29 import java.util.Date JavaDoc;
30 import javax.persistence.Column;
31 import javax.persistence.Entity;
32 import javax.persistence.GeneratedValue;
33 import javax.persistence.Id;
34 import javax.persistence.NamedQueries;
35 import javax.persistence.NamedQuery;
36 import javax.persistence.Table;
37 import javax.persistence.Temporal;
38 import javax.persistence.TemporalType;
39 import static javax.persistence.GenerationType.IDENTITY;
40
41 /**
42  * <p>This entity provides a very basic representation of a web application
43  * user.</p>
44  *
45  * <p>This code was generated by NetBeans 5.5 DEV.</p>
46  *
47  * @author rlubke
48  */

49 @Entity
50 @Table(name = "WUSER")
51 @NamedQueries( {@NamedQuery(name = "Wuser.findById", query = "SELECT w FROM Wuser w WHERE w.id = :id"), @NamedQuery(name = "Wuser.findByFirstname", query = "SELECT w FROM Wuser w WHERE w.firstname = :firstname"), @NamedQuery(name = "Wuser.findByLastname", query = "SELECT w FROM Wuser w WHERE w.lastname = :lastname"), @NamedQuery(name = "Wuser.findByUsername", query = "SELECT w FROM Wuser w WHERE w.username = :username"), @NamedQuery(name = "Wuser.findByPassword", query = "SELECT w FROM Wuser w WHERE w.password = :password"), @NamedQuery(name = "Wuser.findBySince", query = "SELECT w FROM Wuser w WHERE w.since = :since")})
52 public class Wuser implements Serializable JavaDoc {
53
54     @Id
55     @GeneratedValue(strategy=IDENTITY)
56     @Column(name = "ID", nullable = false)
57     private Integer JavaDoc id;
58
59     @Column(name = "FIRSTNAME", nullable = false)
60     private String JavaDoc firstname;
61
62     @Column(name = "LASTNAME", nullable = false)
63     private String JavaDoc lastname;
64
65     @Column(name = "USERNAME", nullable = false)
66     private String JavaDoc username;
67
68     @Column(name = "PASSWORD", nullable = false)
69     private String JavaDoc password;
70
71     @Column(name = "SINCE")
72     @Temporal(TemporalType.TIMESTAMP)
73     private Date JavaDoc since;
74     
75     /** Creates a new instance of Wuser */
76     public Wuser() {
77     }
78
79     public Wuser(Integer JavaDoc id) {
80         this.id = id;
81     }
82
83     public Wuser(Integer JavaDoc id, String JavaDoc firstname, String JavaDoc lastname, String JavaDoc username, String JavaDoc password) {
84         this.id = id;
85         this.firstname = firstname;
86         this.lastname = lastname;
87         this.username = username;
88         this.password = password;
89     }
90
91     public Integer JavaDoc getId() {
92         return this.id;
93     }
94
95     public void setId(Integer JavaDoc id) {
96         this.id = id;
97     }
98
99     public String JavaDoc getFirstname() {
100         return this.firstname;
101     }
102
103     public void setFirstname(String JavaDoc firstname) {
104         this.firstname = firstname;
105     }
106
107     public String JavaDoc getLastname() {
108         return this.lastname;
109     }
110
111     public void setLastname(String JavaDoc lastname) {
112         this.lastname = lastname;
113     }
114
115     public String JavaDoc getUsername() {
116         return this.username;
117     }
118
119     public void setUsername(String JavaDoc username) {
120         this.username = username;
121     }
122
123     public String JavaDoc getPassword() {
124         return this.password;
125     }
126
127     public void setPassword(String JavaDoc password) {
128         this.password = password;
129     }
130
131     public Date JavaDoc getSince() {
132         return this.since;
133     }
134
135     public void setSince(Date JavaDoc since) {
136         this.since = since;
137     }
138
139     public int hashCode() {
140         int hash = 0;
141         hash += (this.id != null ? this.id.hashCode() : 0);
142         return hash;
143     }
144
145     public boolean equals(Object JavaDoc object) {
146         if (object == null || !this.getClass().equals(object.getClass())) {
147             return false;
148         }
149         Wuser other = (Wuser)object;
150         if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) return false;
151         return true;
152     }
153
154     public String JavaDoc toString() {
155         //TODO change toString() implementation to return a better display name
156
return "" + this.id;
157     }
158     
159 }
160
Popular Tags