📄 uservo.java
字号:
//Source file: C:\\Java\\workspace\\MyApps\\src\\cn\\myapps\\core\\user\\ejb\\UserVO.java
package cn.myapps.core.user.ejb;
import java.io.Serializable;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import cn.myapps.base.dao.ValueObject;
import cn.myapps.core.department.ejb.DepartmentVO;
import cn.myapps.core.role.ejb.RoleVO;
/**
* @hibernate.class table="T_USER"
*/
public class UserVO extends ValueObject implements Serializable {
/**
* 主键
*/
private String id;
/**
* 用户姓名
*/
private String name;
/**
* 用户登陆名,UserID
*/
private String loginno;
/**
* 密码,通过MD5加密后然后进行移位运算。
*/
private String loginpwd;
/**
* 用户电子邮件
*/
private String email;
/**
* 状态,表示是否生效。
*/
private int status;
/**
* 所属权限组
*/
private Collection roles;
/**
* 所属部门
*/
private Collection departments;
private Collection permission;
/**
* 语言种类
*/
private int languageType;
/**
* @hibernate.set name="departments" table="T_USER_DEPARTMENT_SET"
* cascade="save-update"
* @hibernate.collection-key column="USERID"
* @hibernate.collection-many-to-many class="cn.myapps.core.department.ejb.DepartmentVO"
* column="DEPARTMENTID"
* @return Returns the deptments.
* @roseuid 44C7A196022D
*/
public Collection getDepartments() {
if (departments == null) {
departments = new HashSet();
}
return departments;
}
public DepartmentVO getDepartmentById(String deptid) {
if (departments != null) {
for (Iterator iter = departments.iterator(); iter.hasNext();) {
DepartmentVO dept = (DepartmentVO) iter.next();
if (dept.getId() != null && dept.getId().equals(deptid))
return dept;
}
}
return null;
}
public RoleVO getRoleById(String roleid) {
Collection roleList = this.getRoles();
for (Iterator iterator = roleList.iterator(); iterator.hasNext();) {
RoleVO role = (RoleVO) iterator.next();
if (role.getId() != null && role.getId().equals(roleid))
return role;
}
return null;
}
/**
* @param deptments
* The deptments to set.
* @param deptments
* @roseuid 44C7A1960241
*/
public void setDepartments(Collection deptments) {
this.departments = deptments;
}
/**
* @hibernate.property column="EMAIL"
* @return Returns the email.
* @roseuid 44C7A1960255
*/
public String getEmail() {
return email;
}
/**
* @param email
* The email to set.
* @param email
* @roseuid 44C7A1960256
*/
public void setEmail(String email) {
this.email = email;
}
/**
* @hibernate.id column="ID" generator-class="assigned"
* @return Returns the id.
* @roseuid 44C7A1960260
*/
public String getId() {
return id;
}
/**
* @param id
* The id to set.
* @param id
* @roseuid 44C7A1960269
*/
public void setId(String id) {
this.id = id;
}
/**
* @hibernate.property column="LOGINNO"
* @return Returns the loginno.
* @roseuid 44C7A1960273
*/
public String getLoginno() {
return loginno;
}
/**
* @param loginno
* The loginno to set.
* @param loginno
* @roseuid 44C7A1960274
*/
public void setLoginno(String loginno) {
this.loginno = loginno;
}
/**
* @hibernate.property column="LOGINPWD"
* @return Returns the loginpwd.
* @roseuid 44C7A196027E
*/
public String getLoginpwd() {
return loginpwd;
}
/**
* @param loginpwd
* The loginpwd to set.
* @param loginpwd
* @roseuid 44C7A1960287
*/
public void setLoginpwd(String loginpwd) {
this.loginpwd = loginpwd;
}
/**
* @hibernate.property column="NAME"
* @return Returns the name.
* @roseuid 44C7A1960291
*/
public String getName() {
return name;
}
/**
* @param name
* The name to set.
* @param name
* @roseuid 44C7A196029B
*/
public void setName(String name) {
this.name = name;
}
/**
* @hibernate.set name="roles" table="T_USER_ROLE_SET" cascade="save-update"
* @hibernate.collection-key column="USERID"
* @hibernate.collection-many-to-many class="cn.myapps.core.role.ejb.RoleVO"
* column="ROLEID"
* @return Returns the roles.
*/
public Collection getRoles() {
if (roles == null) {
roles = new HashSet();
}
return roles;
}
/**
* @param roles
* The roles to set.
* @param roles
* @roseuid 44C7A19602AF
*/
public void setRoles(Collection roles) {
this.roles = roles;
}
/**
* @hibernate.property column="STATUS"
* @return Returns the status.
* @roseuid 44C7A19602C3
*/
public int getStatus() {
return status;
}
/**
* @param status
* The status to set.
* @param status
* @roseuid 44C7A19602CD
*/
public void setStatus(int status) {
this.status = status;
}
/**
* @hibernate.property column="LANGUAGETYPE"
*/
public int getLanguageType() {
return languageType;
}
public void setLanguageType(int languageType) {
this.languageType = languageType;
}
/**
* @hibernate.set name="permission" table="T_PERMISSION" cascade="save-update"
* @hibernate.collection-key column="USER_ID"
* @hibernate.collection-one-to-many class="cn.myapps.core.permission.ejb.PermissionVO"
* @return
*/
public Collection getPermission() {
if (permission == null)
permission = new HashSet();
return permission;
}
public void setPermission(Collection permission) {
this.permission = permission;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -