/*
* Copyright 2008 CAMSoft Limited. All Rights Reserved.
*
* This software is the proprietary information of CAMSoft Limited. Use is
* subject to license terms.
*
* Workfile: Users.java
* Revision: #1
* Author: Manju
* Date: Jul 9, 2008
*
*/
package com.camsoft.camera.administration.user.entity;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;
import org.hibernate.validator.Pattern;
import org.jboss.seam.annotations.Name;
import com.camsoft.camera.administration.userrole.entity.UserRoles;
/**
* Users generated by hbm2java
*/
@Entity
@Name("users")
@Table(name = "AD_USERS", schema = "public", uniqueConstraints = {
@UniqueConstraint(columnNames = {"tenant_id", "user_name"}),
@UniqueConstraint(columnNames = {"tenant_id", "id"})})
public class Users implements java.io.Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
private int id;
private Users users;
private int tenantId;
private Date creationDate;
private String createdBy;
private Date updateDate;
private String updatedBy;
private String userName;
private int userTypeId;
private String firstName;
private String lastName;
private Long departmentId;
private Long jobTitleId;
private String encryptedUserPassword;
private Date passwordDate;
private Short passwordLifespanAccesses;
private Short passwordAccessesLeft;
private Short passwordLifespanDays;
private String email;
private String phone1;
private String phone2;
private String fax;
private char enabledFlag;
private Set<UserRoles> adUserRoleses = new HashSet<UserRoles>(0);
private Set<Users> userses = new HashSet<Users>(0);
public Users() {
}
public Users(int id, int tenantId, Date creationDate, String createdBy,
Date updateDate, String updatedBy, String userName,
int userTypeId, String encryptedUserPassword, char enabledFlag) {
this.id = id;
this.tenantId = tenantId;
this.creationDate = creationDate;
this.createdBy = createdBy;
this.updateDate = updateDate;
this.updatedBy = updatedBy;
this.userName = userName;
this.userTypeId = userTypeId;
this.encryptedUserPassword = encryptedUserPassword;
this.enabledFlag = enabledFlag;
}
public Users(int id, Users users, int tenantId, Date creationDate,
String createdBy, Date updateDate, String updatedBy,
String userName, int userTypeId, String firstName,
String lastName, Long departmentId, Long jobTitleId,
String encryptedUserPassword, Date passwordDate,
Short passwordLifespanAccesses, Short passwordAccessesLeft,
Short passwordLifespanDays, String email, String phone1,
String phone2, String fax, char enabledFlag,
Set<UserRoles> adUserRoleses, Set<Users> userses) {
this.id = id;
this.users = users;
this.tenantId = tenantId;
this.creationDate = creationDate;
this.createdBy = createdBy;
this.updateDate = updateDate;
this.updatedBy = updatedBy;
this.userName = userName;
this.userTypeId = userTypeId;
this.firstName = firstName;
this.lastName = lastName;
this.departmentId = departmentId;
this.jobTitleId = jobTitleId;
this.encryptedUserPassword = encryptedUserPassword;
this.passwordDate = passwordDate;
this.passwordLifespanAccesses = passwordLifespanAccesses;
this.passwordAccessesLeft = passwordAccessesLeft;
this.passwordLifespanDays = passwordLifespanDays;
this.email = email;
this.phone1 = phone1;
this.phone2 = phone2;
this.fax = fax;
this.enabledFlag = enabledFlag;
this.adUserRoleses = adUserRoleses;
this.userses = userses;
}
@Id
@SequenceGenerator(name="identifier", sequenceName="ad_users_id_seq", allocationSize=1)
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "identifier")
@Column(name = "id", unique = true, nullable = false)
@NotNull
public int getId() {
return this.id;
}
public void setId(int id) {
this.id = id;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "supervisor_id")
public Users getUsers() {
return this.users;
}
public void setUsers(Users users) {
this.users = users;
}
@Column(name = "tenant_id", nullable = false)
@NotNull
public int getTenantId() {
return this.tenantId;
}
public void setTenantId(int tenantId) {
this.tenantId = tenantId;
}
@Temporal(TemporalType.DATE)
@Column(name = "creation_date", nullable = false, length = 13)
@NotNull
public Date getCreationDate() {
return this.creationDate;
}
public void setCreationDate(Date creationDate) {
this.creationDate = creationDate;
}
@Column(name = "created_by", nullable = false)
@NotNull
public String getCreatedBy() {
return this.createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
@Temporal(TemporalType.DATE)
@Column(name = "update_date", nullable = false, length = 13)
@NotNull
public Date getUpdateDate() {
return this.updateDate;
}
public void setUpdateDate(Date updateDate) {
this.updateDate = updateDate;
}
@Column(name = "updated_by", nullable = false)
@NotNull
public String getUpdatedBy() {
return this.updatedBy;
}
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
@Column(name = "user_name", nullable = false, length = 100)
@NotNull
@Length(max = 100)
public String getUserName() {
return this.userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
@Column(name = "user_type_id", nullable = false)
@NotNull
public int getUserTypeId() {
return this.userTypeId;
}
public void setUserTypeId(int userTypeId) {
this.userTypeId = userTypeId;
}
@Column(name = "first_name", length = 80)
@Length(max = 80)
public String getFirstName() {
return this.firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
@Column(name = "last_name", length = 80)
@Length(max = 80)
public String getLastName() {
return this.lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
@Column(name = "department_id", precision = 15, scale = 0)
public Long getDepartmentId() {
return this.departmentId;
}
public void setDepartmentId(Long departmentId) {
this.departmentId = departmentId;
}
@Column(name = "job_title_id", precision = 15, scale = 0)
public Long getJobTitleId() {
return this.jobTitleId;
}
public void setJobTitleId(Long jobTitleId) {
this.jobTitleId = jobTitleId;
}
@Column(name = "encrypted_user_password", nullable = false, length = 100)
@NotNull
@Length(max = 100)
public String getEncryptedUserPassword() {
return this.encryptedUserPassword;
}
public void setEncryptedUserPassword(String encryptedUserPassword) {
this.encryptedUserPassword = encryptedUserPassword;
}
@Temporal(TemporalType.DATE)
@Column(name = "password_date", length = 13)
public Date getPasswordDate() {
return this.passwordDate;
}
public void setPasswordDate(Date passwordDate) {
this.passwordDate = passwordDate;
}
@Column(name = "password_lifespan_accesses", precision = 3, scale = 0)
public Short getPasswordLifespanAccesses() {
return this.passwordLifespanAccesses;
}
public void setPasswordLifespanAccesses(Short passwordLifespanAccesses) {
this.passwordLifespanAccesses = passwordLifespanAccesses;
}
@Column(name = "password_accesses_left", precision = 3, scale = 0)
public Short getPasswordAccessesLeft() {
return this.passwordAccessesLeft;
}
public void setPasswordAccessesLeft(Short passwordAccessesLeft) {
this.passwordAccessesLeft = passwordAccessesLeft;
}
@Column(name = "password_lifespan_days", precision = 3, scale = 0)
public Short getPasswordLifespanDays() {
return this.passwordLifespanDays;
}
public void setPasswordLifespanDays(Short passwordLifespanDays) {
this.passwordLifespanDays = passwordLifespanDays;
}
@Column(name = "email", length = 40)
@Length(max = 40)
@Pattern(regex=".+@.+\\.[a-z]{2,6}+", message="#{messages['validator.email']}")
public String getEmail() {
return this.email;
}
public void setEmail(String email) {
this.email = email;
}
@Column(name = "phone1", length = 40)
@Length(max = 40)
public String getPhone1() {
return this.phone1;
}
public void setPhone1(String phone1) {
this.phone1 = phone1;
}
@Column(name = "phone2", length = 40)
@Length(max = 40)
public String getPhone2() {
return this.phone2;
}
public void setPhone2(String phone2) {
this.phone2 = phone2;
}
@Column(name = "fax", length = 40)
@Length(max = 40)
public String getFax() {
return this.fax;
}
public void setFax(String fax) {
this.fax = fax;
}
@Column(name = "enabled_flag", nullable = false, length = 1)
@NotNull
public char getEnabledFlag() {
return this.enabledFlag;
}
public void setEnabledFlag(char enabledFlag) {
this.enabledFlag = enabledFlag;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "users")
public Set<UserRoles> getAdUserRoleses() {
return this.adUserRoleses;
}
public void setAdUserRoleses(Set<UserRoles> adUserRoleses) {
this.adUserRoleses = adUserRoleses;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "users")
public Set<Users> getUserses() {
return this.userses;
}
public void setUserses(Set<Users> userses) {
this.userses = userses;
}
}
Table Key is id
|