Package com.narirelays.ems.persistence.orm

Examples of com.narirelays.ems.persistence.orm.Groups


    if(name==null||name=="")
    {
      result.setFailed(GROUP_NAME_IS_NULL);
      return result;
    }
    Groups group = new Groups();
    try{
      BeanUtils.populate(group, properties);
      group.setId(MyUUIDGen.getUUID());
      groupsDAO.merge(group);
      result.setSucceed(group.getId());
    }
    catch(Exception e)
    {
      e.printStackTrace();
      result.setFailed();
View Full Code Here


    if(id==null)
    {
      result.setFailed(GROUP_ID_IS_NULL);
      return result;
    }
    Groups group = groupsDAO.findById(id);
    if(group==null)
    {
      result.setFailed(GROUP_NOT_EXIST);
      return result;
    }
    try{
      BeanUtils.populate(group, properties);
      group.setId(id);
      groupsDAO.merge(group);
      result.setSucceed();
    }
    catch(Exception e)
    {
View Full Code Here

    if(id==null)
    {
      result.setFailed(GROUP_ID_IS_NULL);
      return result;
    }
    Groups group = groupsDAO.findById(id);
    if(group==null)
    {
      result.setFailed(GROUP_NOT_EXIST);
      return result;
    }
    String sql1 = "delete from group_members where group_id=?";
    String sql2 = "delete from group_authorities where group_id=?";
    try{
      jdbcTemplate.update(sql1, id);
      jdbcTemplate.update(sql2, id);
      groupsDAO.delete(group);
      result.setSucceed();
    }
    catch(Exception e)
    {
      e.printStackTrace();
      result.setFailed(e.getMessage());
    }
   
    /**
     * 日志记录删除操作,操作者;
     * */
    UserDetails userDetails = (UserDetails) SecurityContextHolder.getContext()
                  .getAuthentication().getPrincipal();
    String currentUserName = userDetails.getUsername();
    String info = new StringBuffer().append("Group ").append(group.getName()).append(" is delete by")
              .append(currentUserName).toString();
    LOG.info(info);
   
    return result;
  }
View Full Code Here

    if(user==null)
    {
      result.setFailed(USER_NOT_EXIST);
      return result;
    }
    Groups group = groupsDAO.findById(groupID);
    if(group==null)
    {
      result.setFailed(GROUP_NOT_EXIST);
      return result;
    }
View Full Code Here

    if(user==null)
    {
      result.setFailed(USER_NOT_EXIST);
      return result;
    }
    Groups group = groupsDAO.findById(groupID);
    if(group==null)
    {
      result.setFailed(GROUP_NOT_EXIST);
      return result;
    }
View Full Code Here

    {
      //root角色不能被非root用户关联
      result.setFailed(CANNOT_ASSOCIATE_ROOT_AUTHORITY);
      return result;
    }
    Groups group = groupsDAO.findById(groupID);
    if(group==null)
    {
      result.setFailed(GROUP_NOT_EXIST);
      return result;
    }
View Full Code Here

    if(authority==null)
    {
      result.setFailed(AUTHORITY_IS_NULL);
      return result;
    }
    Groups group = groupsDAO.findById(groupID);
    if(group==null)
    {
      result.setFailed(GROUP_NOT_EXIST);
      return result;
    }
View Full Code Here

    if(groupID==null)
    {
      result.setFailed(GROUP_ID_IS_NULL);
      return result;
    }
    Groups group = groupsDAO.findById(groupID);
    if(group==null)
    {
      result.setFailed(GROUP_NOT_EXIST);
      return result;
    }
View Full Code Here

    if(groupID==null)
    {
      result.setFailed(GROUP_ID_IS_NULL);
      return result;
    }
    Groups group = groupsDAO.findById(groupID);
    if(group==null)
    {
      result.setFailed(GROUP_NOT_EXIST);
      return result;
    }
View Full Code Here

TOP

Related Classes of com.narirelays.ems.persistence.orm.Groups

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.