[jboss-user] [EJB 3.0 Users] - Re: SessionBean and the case of RESTRICTIONS for entitquery

nmatrix9 do-not-reply at jboss.com
Mon Oct 26 00:50:46 EDT 2009


@Entity
@Name("users")
@Table(name = "exoshell_users", schema = "public", uniqueConstraints = @UniqueConstraint(columnNames = {
  "username", "emailaddress" }))
public class ExoshellUsers implements java.io.Serializable {

 private int userId;
 private String username;
 private String userpassword;
 private String firstname;
 private String lastname;
 private String emailaddress;
 private String userimage;
 private byte[] picture;
 private Date registered;
 private String gender;
 private Date lastLogin;
 private String ipAddress;
 private boolean accountenabled;
 private Set exoshellUserRoleses = new HashSet(
   0);
   public ExoshellUsers() {
 }

 public ExoshellUsers(String username, String userpassword,
   String firstname, String lastname, String emailaddress,
   Date registered, String gender, Date lastLogin, String ipAddress,
   boolean accountenabled) {
  this.username = username;
  this.userpassword = userpassword;
  this.firstname = firstname;
  this.lastname = lastname;
  this.emailaddress = emailaddress;
  this.registered = registered;
  this.gender = gender;
  this.lastLogin = lastLogin;
  this.ipAddress = ipAddress;
  this.accountenabled = accountenabled;
 }

 public ExoshellUsers(String username, String userpassword,
   String firstname, String lastname, String emailaddress,
   String userimage, Date registered, String gender, Date lastLogin,
   String ipAddress, boolean accountenabled,
   Set exoshellUserRoleses) {
  this.username = username;
  this.userpassword = userpassword;
  this.firstname = firstname;
  this.lastname = lastname;
  this.emailaddress = emailaddress;
  this.userimage = userimage;
  this.registered = registered;
  this.gender = gender;
  this.lastLogin = lastLogin;
  this.ipAddress = ipAddress;
  this.accountenabled = accountenabled;
  this.exoshellUserRoleses = exoshellUserRoleses;
 }

 @Id
 @GeneratedValue(strategy=GenerationType.AUTO)
 @Column(name = "user_id", unique = true, nullable = false)
 @NotNull
 public int getUserId() {
  return this.userId;
 }

 public void setUserId(int userId) {
  this.userId = userId;
 }

 @Column(name = "username", nullable = false, length = 20)
 @NotNull
 @Length(max = 20)
 public String getUsername() {
  return this.username;
 }

 public void setUsername(String username) {
  this.username = username;
 }

 @Column(name = "userpassword", nullable = false, length = 40)
 @NotNull
 @Length(max = 40)
 public String getUserpassword() {
  return this.userpassword;
 }

 public void setUserpassword(String userpassword) {
  this.userpassword = userpassword;
 }

 @Column(name = "firstname", nullable = false, length = 40)
 @NotNull
 @Length(max = 40)
 public String getFirstname() {
  return this.firstname;
 }

 public void setFirstname(String firstname) {
  this.firstname = firstname;
 }

 @Column(name = "lastname", nullable = false, length = 40)
 @NotNull
 @Length(max = 40)
 public String getLastname() {
  return this.lastname;
 }

 public void setLastname(String lastname) {
  this.lastname = lastname;
 }

 @Column(name = "emailaddress", nullable = false)
 @NotNull
 @Email(message="Input is not a valid email")
 public String getEmailaddress() {
  return this.emailaddress;
 }

 public void setEmailaddress(String emailaddress) {
  this.emailaddress = emailaddress;
 }

 @Column(name = "userimage")
 public String getUserimage() {
  return this.userimage;
 }

 public void setUserimage(String userimage) {
  this.userimage = userimage;
 }

 @Temporal(TemporalType.DATE)
 @Column(name = "registered", nullable = false, length = 13)
 @NotNull
 public Date getRegistered() {
  return this.registered;
 }

 public void setRegistered(Date registered) {
  this.registered = registered;
 }

 @Column(name = "gender", nullable = false, length = 6)
 @NotNull
 @Length(max = 6)
 public String getGender() {
  return this.gender;
 }

 public void setGender(String gender) {
  this.gender = gender;
 }

 @Temporal(TemporalType.TIMESTAMP)
 @Column(name = "last_login", nullable = false, length = 29)
 @NotNull
 public Date getLastLogin() {
  return this.lastLogin;
 }

 public void setLastLogin(Date lastLogin) {
  this.lastLogin = lastLogin;
 }

 @Column(name = "ip_address", nullable = false, length = 32)
 @NotNull
 @Length(max = 32)
 public String getIpAddress() {
  return this.ipAddress;
 }

 public void setIpAddress(String ipAddress) {
  this.ipAddress = ipAddress;
 }

 @Column(name = "accountenabled", nullable = false)
 @NotNull
 public boolean isAccountenabled() {
  return this.accountenabled;
 }

 public void setAccountenabled(boolean accountenabled) {
  this.accountenabled = accountenabled;
 }

 @OneToMany(fetch = FetchType.LAZY, mappedBy = "exoshellUsers", cascade = {CascadeType.ALL})
 public Set getExoshellUserRoleses() {
  return this.exoshellUserRoleses;
 }

 public void setExoshellUserRoleses(
   Set exoshellUserRoleses) {
  this.exoshellUserRoleses = exoshellUserRoleses;
 }

 public byte[] getPicture() {
  return picture;
 }

 public void setPicture(byte[] picture) {
  this.picture = picture;
 }
     }


@Entity
@Name("roles")
@Table(name = "exoshell_roles", schema = "public", uniqueConstraints = @UniqueConstraint(columnNames = "role_name"))
public class ExoshellRoles implements java.io.Serializable {

 private int roleId;
 private String roleName;
 private Set exoshellUserRoleses = new HashSet(
   0);

 public ExoshellRoles() {
 }

 public ExoshellRoles(String roleName) {
  this.roleName = roleName;
 }

 public ExoshellRoles(String roleName,
   Set exoshellUserRoleses) {
  this.roleName = roleName;
  this.exoshellUserRoleses = exoshellUserRoleses;
 }

 @Id
 @GeneratedValue(strategy=GenerationType.AUTO)
 @Column(name = "role_id", unique = true, nullable = false)
 @NotNull
 public int getRoleId() {
  return this.roleId;
 }

 public void setRoleId(int roleId) {
  this.roleId = roleId;
 }

 @Column(name = "role_name", unique = true, nullable = false, length = 30)
 @NotNull
 @Length(max = 30)
 public String getRoleName() {
  return this.roleName;
 }

 public void setRoleName(String roleName) {
  this.roleName = roleName;
 }

 @OneToMany(fetch = FetchType.LAZY, mappedBy = "exoshellRoles", cascade = {CascadeType.ALL})
 public Set getExoshellUserRoleses() {
  return this.exoshellUserRoleses;
 }

 public void setExoshellUserRoleses(
   Set exoshellUserRoleses) {
  this.exoshellUserRoleses = exoshellUserRoleses;
 }

}

@Entity
@Name("modules")
@Table(name = "exoshell_modules", schema = "public", uniqueConstraints = @UniqueConstraint(columnNames = "module_name"))
public class ExoshellModules implements java.io.Serializable {

 private int moduleId;
 private ExoshellModuleCategories exoshellModuleCategories;
 private String moduleName;
 private boolean moduleStatus;
 private String moduleImage;
 private Date moduleInstalled;
 private String username;
 private String ipAddress;
 private Set exoshellModContentManagerCategorieses = new HashSet(
   0);
 private Set exoshellUserRoleses = new HashSet(
   0);

 public ExoshellModules() {
 }

 public ExoshellModules(
   ExoshellModuleCategories exoshellModuleCategories,
   String moduleName, boolean moduleStatus, String moduleImage,
   Date moduleInstalled, String username, String ipAddress) {
  this.exoshellModuleCategories = exoshellModuleCategories;
  this.moduleName = moduleName;
  this.moduleStatus = moduleStatus;
  this.moduleImage = moduleImage;
  this.moduleInstalled = moduleInstalled;
  this.username = username;
  this.ipAddress = ipAddress;
 }

 public ExoshellModules(
   ExoshellModuleCategories exoshellModuleCategories,
   String moduleName,
   boolean moduleStatus,
   String moduleImage,
   Date moduleInstalled,
   String username,
   String ipAddress,
   Set exoshellModContentManagerCategorieses,
   Set exoshellUserRoleses) {
  this.exoshellModuleCategories = exoshellModuleCategories;
  this.moduleName = moduleName;
  this.moduleStatus = moduleStatus;
  this.moduleImage = moduleImage;
  this.moduleInstalled = moduleInstalled;
  this.username = username;
  this.ipAddress = ipAddress;
  this.exoshellModContentManagerCategorieses = exoshellModContentManagerCategorieses;
  this.exoshellUserRoleses = exoshellUserRoleses;
 }

 @Id
 @GeneratedValue(strategy=GenerationType.AUTO)
 @Column(name = "module_id", unique = true, nullable = false)
 @NotNull
 public int getModuleId() {
  return this.moduleId;
 }

 public void setModuleId(int moduleId) {
  this.moduleId = moduleId;
 }

 @ManyToOne(fetch = FetchType.LAZY)
 @JoinColumn(name = "module_category_id", nullable = false)
 @NotNull
 public ExoshellModuleCategories getExoshellModuleCategories() {
  return this.exoshellModuleCategories;
 }

 public void setExoshellModuleCategories(
   ExoshellModuleCategories exoshellModuleCategories) {
  this.exoshellModuleCategories = exoshellModuleCategories;
 }

 @Column(name = "module_name", unique = true, nullable = false, length = 40)
 @NotNull
 @Length(max = 40)
 public String getModuleName() {
  return this.moduleName;
 }

 public void setModuleName(String moduleName) {
  this.moduleName = moduleName;
 }

 @Column(name = "module_status", nullable = false)
 @NotNull
 public boolean isModuleStatus() {
  return this.moduleStatus;
 }

 public void setModuleStatus(boolean moduleStatus) {
  this.moduleStatus = moduleStatus;
 }

 @Column(name = "module_image", nullable = false)
 @NotNull
 public String getModuleImage() {
  return this.moduleImage;
 }

 public void setModuleImage(String moduleImage) {
  this.moduleImage = moduleImage;
 }

 @Temporal(TemporalType.DATE)
 @Column(name = "module_installed", nullable = false, length = 13)
 @NotNull
 public Date getModuleInstalled() {
  return this.moduleInstalled;
 }

 public void setModuleInstalled(Date moduleInstalled) {
  this.moduleInstalled = moduleInstalled;
 }

 @Column(name = "username", nullable = false, length = 20)
 @NotNull
 @Length(max = 20)
 public String getUsername() {
  return this.username;
 }

 public void setUsername(String username) {
  this.username = username;
 }

 @Column(name = "ip_address", nullable = false, length = 32)
 @NotNull
 @Length(max = 32)
 public String getIpAddress() {
  return this.ipAddress;
 }

 public void setIpAddress(String ipAddress) {
  this.ipAddress = ipAddress;
 }

 @OneToMany(fetch = FetchType.LAZY, mappedBy = "exoshellModules")
 public Set getExoshellModContentManagerCategorieses() {
  return this.exoshellModContentManagerCategorieses;
 }

 public void setExoshellModContentManagerCategorieses(
   Set exoshellModContentManagerCategorieses) {
  this.exoshellModContentManagerCategorieses = exoshellModContentManagerCategorieses;
 }

 @OneToMany(fetch = FetchType.LAZY, mappedBy = "exoshellModules", cascade = {CascadeType.ALL})
 public Set getExoshellUserRoleses() {
  return this.exoshellUserRoleses;
 }

 public void setExoshellUserRoleses(
   Set exoshellUserRoleses) {
  this.exoshellUserRoleses = exoshellUserRoleses;
 }

}

@Entity
@Name("userRoles")
@Table(name = "exoshell_user_roles", schema = "public", uniqueConstraints = @UniqueConstraint(columnNames = {
  "module_id", "user_id", "role_id" }))
public class ExoshellUserRoles implements java.io.Serializable {

 private int userRolesId;
 private ExoshellUsers exoshellUsers;
 private ExoshellRoles exoshellRoles;
 private ExoshellModules exoshellModules;
 private Set exoshellImageses = new HashSet(
   0);
 private ExoshellUserRolesRules exoshellUserRolesRuleses;
     public ExoshellUserRoles() {
 }

 public ExoshellUserRoles(int userRolesId, ExoshellUsers exoshellUsers,
   ExoshellRoles exoshellRoles) {
  this.userRolesId = userRolesId;
  this.exoshellUsers = exoshellUsers;
  this.exoshellRoles = exoshellRoles;
 }

 public ExoshellUserRoles(int userRolesId, ExoshellUsers exoshellUsers,
   ExoshellRoles exoshellRoles, ExoshellModules exoshellModules,
   Set exoshellImageses,
   ExoshellUserRolesRules exoshellUserRolesRuleses) {
  this.userRolesId = userRolesId;
  this.exoshellUsers = exoshellUsers;
  this.exoshellRoles = exoshellRoles;
  this.exoshellModules = exoshellModules;
  this.exoshellImageses = exoshellImageses;
  this.exoshellUserRolesRuleses = exoshellUserRolesRuleses;
 }

 @Id
 @GeneratedValue(strategy=GenerationType.AUTO)
 @Column(name = "user_roles_id", unique = true, nullable = false)
 @NotNull
 public int getUserRolesId() {
  return this.userRolesId;
 }

 public void setUserRolesId(int userRolesId) {
  this.userRolesId = userRolesId;
 }

 @ManyToOne(fetch = FetchType.EAGER)
 @JoinColumn(name = "user_id", nullable = false)
 @NotNull
 public ExoshellUsers getExoshellUsers() {
  return this.exoshellUsers;
 }

 public void setExoshellUsers(ExoshellUsers exoshellUsers) {
  this.exoshellUsers = exoshellUsers;
 }

 @ManyToOne(fetch = FetchType.LAZY)
 @JoinColumn(name = "role_id", nullable = false)
 @NotNull
 public ExoshellRoles getExoshellRoles() {
  return this.exoshellRoles;
 }

 public void setExoshellRoles(ExoshellRoles exoshellRoles) {
  this.exoshellRoles = exoshellRoles;
 }

 @ManyToOne(fetch = FetchType.LAZY)
 @JoinColumn(name = "module_id", nullable = true)
 public ExoshellModules getExoshellModules() {
  return this.exoshellModules;
 }

 public void setExoshellModules(ExoshellModules exoshellModules) {
  this.exoshellModules = exoshellModules;
 }

 @OneToMany(fetch = FetchType.LAZY, mappedBy = "exoshellUserRoles")
 public Set getExoshellImageses() {
  return exoshellImageses;
 }

 public void setExoshellImageses(Set exoshellImageses) {
  this.exoshellImageses = exoshellImageses;
 }

 @OneToOne(fetch = FetchType.LAZY, mappedBy = "exoshellUserRoles", cascade={CascadeType.ALL})
 public ExoshellUserRolesRules getExoshellUserRolesRuleses() {
  return exoshellUserRolesRuleses;
 }

 public void setExoshellUserRolesRuleses(
   ExoshellUserRolesRules exoshellUserRolesRuleses) {
  this.exoshellUserRolesRuleses = exoshellUserRolesRuleses;
 }
   }


View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4262078#4262078

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4262078



More information about the jboss-user mailing list