Exemplo n.º 1
0
 @Override
 protected final void entityRestoreState() {
   username = usernameOriginal;
   encodedpassword = encodedpasswordOriginal;
   usercode = usercodeOriginal;
   enabled = enabledOriginal;
   userpermissions.restoreState();
   userroles.restoreState();
 }
Exemplo n.º 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());
 }
Exemplo n.º 3
0
 /**
  * Get List of userroles associated with entity.
  *
  * @return list of userroles
  */
 public List<Userrole> getUserroles() {
   return userroles.get();
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 6
0
 /**
  * Add a Userrole to this entity.
  *
  * @param e the userrole
  */
 public void addUserrole(Userrole e) {
   e.linkToParent(this);
   userroles.add(e);
 }
Exemplo n.º 7
0
 /**
  * Remove a Userrole from this entity.
  *
  * @param e the userrole
  */
 public void removeUserrole(Userrole e) {
   e.unlinkFromParent();
   userroles.remove(e);
 }
Exemplo n.º 8
0
 /**
  * Get List of userpermissions associated with entity.
  *
  * @return list of userpermissions
  */
 public List<Userpermission> getUserpermissions() {
   return userpermissions.get();
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 11
0
 /**
  * Remove a Userpermission from this entity.
  *
  * @param e the userpermission
  */
 public void removeUserpermission(Userpermission e) {
   e.unlinkFromParent();
   userpermissions.remove(e);
 }
Exemplo n.º 12
0
 /**
  * Add a Userpermission to this entity.
  *
  * @param e the userpermission
  */
 public void addUserpermission(Userpermission e) {
   e.linkToParent(this);
   userpermissions.add(e);
 }