Package net.sf.mp.demo.conference.domain.admin

Examples of net.sf.mp.demo.conference.domain.admin.Role


    @RequestMapping(method = RequestMethod.GET)
    @Transactional
  @ResponseBody
    public List<Role> findAll () {
    List<Role> r = new ArrayList<Role>();
        List<Role> l = roleDao.searchPrototypeRole(new Role());
    for (Role role : l) {
      r.add(role.flat());
    }
    return r;
    }
View Full Code Here


//MP-MANAGED-UPDATABLE-BEGINNING-DISABLE @FIND_BY_ID-role@
  @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  @ResponseBody
  @Transactional
    public Role findById (@PathVariable ("id") java.lang.Integer id) {
        Role _role = new Role ();
    _role.setId(id);
    _role = roleExtDao.getFirstRole(_role);
    if (_role!=null) return _role.flat();
    return new Role ();
    }
View Full Code Here

  public Role create (
        @RequestParam("id") Integer id,
        @RequestParam("name") String name,
        HttpServletResponse servletResponse
        ) throws IOException {
        Role _role = new Role (
           id,
           name);
        return save(_role);
    }
View Full Code Here

    @RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
    @Transactional(propagation=Propagation.REQUIRED, rollbackFor=Exception.class)
  @ResponseBody
    public String delete (@PathVariable ("id") Integer id) {
        Role role = new Role ();
        role.setId(id);
        roleDao.deleteRole(role);
    return "OK";
    }
View Full Code Here

    public Role save (
        @RequestParam("id") Integer id,
        @RequestParam("name") String name,
        HttpServletResponse servletResponse
        ) throws IOException {
        Role _role = new Role (
           id,
           name);
        return save(_role);
   
View Full Code Here

      return referRoleUseCache (role, false);
   }
         
   public Role referRoleUseCache (Role role, boolean isAssign) {
    String key = getCacheKey(null, role, null, "assignRole");
      Role roleCache = (Role)simpleCache.get(key);
      if (roleCache==null) {
         roleCache = referRole (role, isAssign);
         if (key!=null)
           simpleCache.put(key, roleCache);
      }
View Full Code Here

     BeanUtils.populateBeanObject(role, beanPath, value);
  }
      // to set in super class BEWARE: genericity is only one level!!!!! first level is a copy second level is a reference!!! change to role.clone() instead
  private Role cloneRole (Role role) throws IllegalAccessException, InvocationTargetException, InstantiationException, NoSuchMethodException {
    //return (Role) BeanUtils.cloneBeanObject(role);
     if (role==null) return new Role();
     return role.clone();
  }
View Full Code Here

   private List getFirstResultWhereConditionsAre (Role role) {
      return  partialLoadWithParentRoleQueryResult(getDefaultRoleWhat(), role, null, 1, false)
   }
  
   protected Role getDefaultRoleWhat() {
      Role role = new Role();
      role.setId(Integer.valueOf("-1"));
      return role;
   }
View Full Code Here

    }
     
   private List<Role> convertPartialLoadWithParentRole(List<Object[]> list, Map<Integer, String> beanPath, Role roleWhat) throws IllegalAccessException, InvocationTargetException, InstantiationException, NoSuchMethodException {
     List<Role> resultList = new ArrayList<Role>();
     for (Object[] row : list) {   
        Role role = cloneRole (roleWhat);
        Iterator<Entry<Integer, String>> iter = beanPath.entrySet().iterator()
        while (iter.hasNext()) {
           Entry entry = iter.next();
           populateRole (role, row[(Integer)entry.getKey()], (String)entry.getValue());
        }
View Full Code Here

  
   
   private List<Role> convertPartialLoadWithParentRoleWithOneElementInRow(List<Object> list, Map<Integer, String> beanPath, Role roleWhat) throws IllegalAccessException, InvocationTargetException, InstantiationException, NoSuchMethodException {
     List<Role> resultList = new ArrayList<Role>();
     for (Object row : list) {   
        Role role = cloneRole (roleWhat);
        Iterator<Entry<Integer, String>> iter = beanPath.entrySet().iterator()
        while (iter.hasNext()) {
           Entry entry = iter.next();
           populateRole (role, row, (String)entry.getValue());
        }
View Full Code Here

TOP

Related Classes of net.sf.mp.demo.conference.domain.admin.Role

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.