예제 #1
0
 @Override
 protected final void entityRestoreState() {
   username = usernameOriginal;
   encodedpassword = encodedpasswordOriginal;
   usercode = usercodeOriginal;
   enabled = enabledOriginal;
   userpermissions.restoreState();
   userroles.restoreState();
 }
예제 #2
0
 /**
  * Constructor - User.
  *
  * @param id the unique id for this entity
  * @param em - the entity manager for this entity type
  */
 public User(int id, User.EM em) {
   super("User[" + Integer.toString(id) + "]", "user", em);
   this.id = id;
   root = UserRoot.get();
   addRule(usernameRules, new UsernameMinRule());
   addRule(usernameRules, new UsernameMaxRule());
   addRule(usernameRules, new UsernameUniqueRule());
   addRule(encodedpasswordRules, new EncodedpasswordMinRule());
   addRule(encodedpasswordRules, new EncodedpasswordMaxRule());
   addRule(usercodeRules, new UsercodeMinRule());
   addRule(usercodeRules, new UsercodeMaxRule());
   addRule(usercodeRules, new UsercodeUniqueRule());
   userpermissions =
       new EntityReferenceFilterSet<>(
           instanceDescription() + ">Userpermissions", "user", getId(), Userpermission.EM.class);
   userpermissions.load();
   userroles =
       new EntityReferenceFilterSet<>(
           instanceDescription() + ">Userroles", "user", getId(), Userrole.EM.class);
   userroles.load();
   checkRulesAtLoad(new StringBuilder());
 }
예제 #3
0
 /**
  * Get List of userroles associated with entity.
  *
  * @return list of userroles
  */
 public List<Userrole> getUserroles() {
   return userroles.get();
 }
예제 #4
0
 /**
  * Add set listener to userroles collections
  *
  * @param listener the set change listener to add
  */
 public void addUserroleSetChangeListener(Listener<SetChangeEventParams> listener) {
   userroles.addSetListener(listener);
 }
예제 #5
0
 /**
  * remove set listener to userroles collections
  *
  * @param listener the set change listener to add
  */
 public void removeUserroleSetChangeListener(Listener<SetChangeEventParams> listener) {
   userroles.removeSetListener(listener);
 }
예제 #6
0
 /**
  * Add a Userrole to this entity.
  *
  * @param e the userrole
  */
 public void addUserrole(Userrole e) {
   e.linkToParent(this);
   userroles.add(e);
 }
예제 #7
0
 /**
  * Remove a Userrole from this entity.
  *
  * @param e the userrole
  */
 public void removeUserrole(Userrole e) {
   e.unlinkFromParent();
   userroles.remove(e);
 }
예제 #8
0
 /**
  * Get List of userpermissions associated with entity.
  *
  * @return list of userpermissions
  */
 public List<Userpermission> getUserpermissions() {
   return userpermissions.get();
 }
예제 #9
0
 /**
  * remove set listener to userpermissions collections
  *
  * @param listener the set change listener to add
  */
 public void removeUserpermissionSetChangeListener(Listener<SetChangeEventParams> listener) {
   userpermissions.removeSetListener(listener);
 }
예제 #10
0
 /**
  * Add set listener to userpermissions collections
  *
  * @param listener the set change listener to add
  */
 public void addUserpermissionSetChangeListener(Listener<SetChangeEventParams> listener) {
   userpermissions.addSetListener(listener);
 }
예제 #11
0
 /**
  * Remove a Userpermission from this entity.
  *
  * @param e the userpermission
  */
 public void removeUserpermission(Userpermission e) {
   e.unlinkFromParent();
   userpermissions.remove(e);
 }
예제 #12
0
 /**
  * Add a Userpermission to this entity.
  *
  * @param e the userpermission
  */
 public void addUserpermission(Userpermission e) {
   e.linkToParent(this);
   userpermissions.add(e);
 }