public void removeAttribute(GroupAttribute attribute) { GroupAttribute cour = this.find(attribute); if(cour != null) { this.getAttributes().remove(cour); } }
public void updateAttribute(GroupAttribute attribute) { GroupAttribute cour = this.find(attribute); if(cour != null) { cour.setName(attribute.getName()); cour.setValue(attribute.getValue()); } else { this.addAttribute(attribute); } }
public void addMember(Identity member, Group group) throws IDMException { Session session = null; Transaction tx = null; try { session = this.hibernateManager.getSessionFactory().getCurrentSession(); tx = session.beginTransaction(); session.update(group); group.getMembers().add(member); tx.commit(); } catch(Exception e) { log.error(this, e); if(tx != null) { tx.rollback(); } throw new IDMException(e); } }
public void addAttribute(GroupAttribute attribute) { this.getAttributes().add(attribute); }
public GroupAttribute readAttribute(String name) { return this.find(new GroupAttribute(name, null)); }
for(Identity cour: group.getMembers()) group.getMembers().remove(identity);
private GroupAttribute find(GroupAttribute attribute) { GroupAttribute cour = null; Set<GroupAttribute> attributes = this.getAttributes(); for(GroupAttribute loop: attributes) { if(loop.getName().equals(attribute.getName())) { return loop; } } return cour; } }
public void loadMembers(Group group) throws IDMException { Session session = null; Transaction tx = null; try { session = this.hibernateManager.getSessionFactory().getCurrentSession(); tx = session.beginTransaction(); session.update(group); for(Identity identity: group.getMembers()) { Hibernate.initialize(identity); } tx.commit(); } catch(Exception e) { log.error(this, e); if(tx != null) { tx.rollback(); } throw new IDMException(e); } }
for(Identity cour: group.getMembers())