001: /*
002: * JOSSO: Java Open Single Sign-On
003: *
004: * Copyright 2004-2008, Atricore, Inc.
005: *
006: * This is free software; you can redistribute it and/or modify it
007: * under the terms of the GNU Lesser General Public License as
008: * published by the Free Software Foundation; either version 2.1 of
009: * the License, or (at your option) any later version.
010: *
011: * This software is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this software; if not, write to the Free
018: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
019: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
020: *
021: * author Kurt T Stam
022: */
023: package org.josso.seam.console;
024:
025: import java.util.HashSet;
026: import java.util.Set;
027: import javax.persistence.CascadeType;
028: import javax.persistence.Column;
029: import javax.persistence.Entity;
030: import javax.persistence.FetchType;
031: import javax.persistence.Id;
032: import javax.persistence.OneToMany;
033: import javax.persistence.Table;
034: import org.hibernate.validator.Length;
035: import org.hibernate.validator.NotNull;
036:
037: /**
038: * Username generated by hbm2java
039: */
040: @Entity
041: @Table(name="JOSSO_USER",catalog="PUBLIC")
042: public class Username implements java.io.Serializable {
043:
044: private static final long serialVersionUID = 1L;
045:
046: private String login;
047: private String passwd;
048: private String name;
049: private String description;
050: private Set<UserRole> userRoles = new HashSet<UserRole>(0);
051: private Set<Property> properties = new HashSet<Property>(0);
052:
053: public Username() {
054: }
055:
056: public Username(String login, String passwd) {
057: this .login = login;
058: this .passwd = passwd;
059: }
060:
061: public Username(String login, String passwd, String name,
062: String description, Set<UserRole> userRoles,
063: Set<Property> properties) {
064: this .login = login;
065: this .passwd = passwd;
066: this .name = name;
067: this .description = description;
068: this .userRoles = userRoles;
069: this .properties = properties;
070: }
071:
072: @Id
073: @Column(name="LOGIN",unique=true,nullable=false,length=32)
074: @NotNull
075: @Length(max=32)
076: public String getLogin() {
077: return this .login;
078: }
079:
080: public void setLogin(String login) {
081: this .login = login;
082: }
083:
084: @Column(name="PASSWORD",nullable=false,length=32)
085: @NotNull
086: @Length(max=32)
087: public String getPasswd() {
088: return this .passwd;
089: }
090:
091: public void setPasswd(String passwd) {
092: this .passwd = passwd;
093: }
094:
095: @Column(name="DESCRIPTION",length=64)
096: @Length(max=64)
097: public String getName() {
098: return this .name;
099: }
100:
101: public void setName(String name) {
102: this .name = name;
103: }
104:
105: @Column(name="Description",length=64)
106: @Length(max=64)
107: public String getDescription() {
108: return this .description;
109: }
110:
111: public void setDescription(String description) {
112: this .description = description;
113: }
114:
115: @OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY,mappedBy="username")
116: public Set<UserRole> getUserRoles() {
117: return this .userRoles;
118: }
119:
120: public void setUserRoles(Set<UserRole> userRoles) {
121: this .userRoles = userRoles;
122: }
123:
124: @OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY,mappedBy="username")
125: public Set<Property> getProperties() {
126: return this .properties;
127: }
128:
129: public void setProperties(Set<Property> properties) {
130: this.properties = properties;
131: }
132:
133: }
|