01: /*
02: * JOSSO: Java Open Single Sign-On
03: *
04: * Copyright 2004-2008, Atricore, Inc.
05: *
06: * This is free software; you can redistribute it and/or modify it
07: * under the terms of the GNU Lesser General Public License as
08: * published by the Free Software Foundation; either version 2.1 of
09: * the License, or (at your option) any later version.
10: *
11: * This software is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this software; if not, write to the Free
18: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
19: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
20: *
21: * author Kurt T Stam
22: */
23: package org.josso.seam.console;
24:
25: import static javax.persistence.GenerationType.IDENTITY;
26: import javax.persistence.*;
27:
28: import org.hibernate.validator.NotNull;
29:
30: /**
31: * UserRole generated by hbm2java
32: */
33: @Entity
34: @Table(name="JOSSO_USER_ROLE",catalog="PUBLIC")
35: public class UserRole implements java.io.Serializable {
36:
37: private static final long serialVersionUID = 1L;
38:
39: private Integer id;
40: private Username username;
41: private Role role;
42:
43: public UserRole() {
44: }
45:
46: public UserRole(Username username, Role role) {
47: this .username = username;
48: this .role = role;
49: }
50:
51: @Id
52: @GeneratedValue(strategy=GenerationType.TABLE)
53: @Column(name="ID",unique=true,nullable=false)
54: public Integer getId() {
55: return this .id;
56: }
57:
58: public void setId(Integer id) {
59: this .id = id;
60: }
61:
62: @ManyToOne(fetch=FetchType.LAZY)
63: @JoinColumn(name="LOGIN",nullable=false)
64: @NotNull
65: public Username getUsername() {
66: return this .username;
67: }
68:
69: public void setUsername(Username username) {
70: this .username = username;
71: }
72:
73: @ManyToOne(fetch=FetchType.LAZY)
74: @JoinColumn(name="ROLE",nullable=false)
75: @NotNull
76: public Role getRole() {
77: return this .role;
78: }
79:
80: public void setRole(Role role) {
81: this.role = role;
82: }
83:
84: }
|