Package com.github.dactiv.showcase.entity.account

Examples of com.github.dactiv.showcase.entity.account.Group


   
    List<Group> result = new ArrayList<Group>();
   
    for (Group r : list) {
      if (r.getParent() == null) {
        Group temp = new Group();
        BeanUtils.copyProperties(r, temp);
        mergeToParent(list,temp);
        result.add(temp);
      }
    }
View Full Code Here


    parent.setLeaf(false);
   
    for (Group r: list) {
     
      if (StringUtils.equals(r.getParentId(),parent.getId())) {
        Group temp = new Group();
        BeanUtils.copyProperties(r, temp);
        temp.setChildren(null);
        mergeToParent(list,temp);
        parent.getChildren().add(temp);
        parent.setLeaf(true);
      }
     
View Full Code Here

   *
   */
  @ModelAttribute("entity")
  public Group bindingModel(String id) {

    Group group = new Group();

    if (StringUtils.isNotEmpty(id)) {
      group = accountManager.getGroup(id);
    }

View Full Code Here

  private AccountManager accountManager;
 
  @Test
  @Transactional(readOnly=true)
  public void testGetGroup() {
    Group group = accountManager.getGroup("SJDK3849CKMS3849DJCK2039ZMSK0002");
    assertEquals(group.getName(), "超级管理员");
  }
View Full Code Here

  }

  @Test
  @Transactional
  public void testSaveGroup() {
    Group entity = new Group();
    entity.setName("test");
    entity.setRemark("...");
    entity.setType(GroupType.RoleGorup.getValue());
    entity.setState(State.Enable.getValue());
   
    int before = countRowsInTable("tb_group");
    accountManager.saveGroup(entity);
    int after = countRowsInTable("tb_group");
   
    assertEquals(before + 1, after);
    assertFalse(entity.getLeaf());
   
    Group parent = accountManager.getGroup("SJDK3849CKMS3849DJCK2039ZMSK0002");
    entity.setParent(parent);
    accountManager.saveGroup(entity);
    assertTrue(parent.getLeaf());
    entity.setParent(null);
    accountManager.saveGroup(entity);
    assertFalse(entity.getLeaf());
   
  }
View Full Code Here

TOP

Related Classes of com.github.dactiv.showcase.entity.account.Group

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.