Package org.apache.commons.beanutils

Examples of org.apache.commons.beanutils.LazyDynaBean


          }else{
            List<ProductMeasure> pms = productMeasureDAO.getHibernateTemplate().find(productMeasureQuery, product_id,process_id,start_time,end_time);
//            List<ProductMeasure> pms = productMeasureDAO.getHibernateTemplate().find(productMeasureQuery, product_id,process_id);
            List<LazyDynaBean> beans = new ArrayList<LazyDynaBean>();
            for(ProductMeasure pm:pms){
              LazyDynaBean bean = new LazyDynaBean();
              bean.set("value", pm.getValue());
              bean.set("time_id", pm.getId().getTimeId());
              bean.set("product_id", pm.getId().getProductId());
              bean.set("process_id", pm.getId().getProcessId());
              beans.add(bean);
            }
            result.setSucceed();
            result.setData(beans);
          }
View Full Code Here


    OperResult result = new OperResult();
    List<Users>users = usersDAO.findAll();
    ArrayList<LazyDynaBean>beans = new ArrayList<LazyDynaBean>();
    for(Users user:users)
    {
      LazyDynaBean bean = new LazyDynaBean();
//      不能将密码等信息暴露,故手动设置bean
      bean.set("id",user.getId());
      bean.set("name", user.getName());
      bean.set("enabled", user.getEnabled());
      beans.add(bean);
    }
    result.setData(beans);
    result.setSucceed();
    return result;
View Full Code Here

      @Override
      public LazyDynaBean mapRow(ResultSet rs, int rowNum)
          throws SQLException {
        // TODO Auto-generated method stub
        LazyDynaBean bean = new LazyDynaBean();
        bean.set("id", rs.getString(1));
        String name = rs.getString(2);
        String desc = rs.getString(3);
        if(desc==null) desc = "";
        String text = new StringBuffer().append(name).append("(").append(desc).append(")").toString();
        bean.set("text", text);
        bean.set("type", "user");
        bean.set("leaf", "true");
        return bean;
      }     
    });
    Collections.sort(beans, new Comparator<LazyDynaBean>(){
      @Override
View Full Code Here

  {
    OperResult result = new OperResult();
    Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
    String name = authentication.getName();//获取当前用户名
    List<Users> users = usersDAO.findByName(name);
    LazyDynaBean bean = null;
    if(users!=null&&users.size()>0)
    {
      Users user = users.get(0);
      UserInfo userInfo = userInfoDAO.findById(user.getId());
      if(userInfo!=null)
        bean = ObjectListConvert2DynaBeanList.convert(userInfo);
      else bean = new LazyDynaBean();
//      不能将密码等信息暴露,故手动设置bean
      bean.set("name", user.getName());
      bean.set("enabled", user.getEnabled());
     
    }
    result.setData(bean);
    result.setSucceed();
    return result;
View Full Code Here

    OperResult result = new OperResult();
    List<Groups>groups = groupsDAO.findAll();
    ArrayList<LazyDynaBean>beans = new ArrayList<LazyDynaBean>();
    for(Groups group:groups)
    {
      LazyDynaBean bean = new LazyDynaBean();
      ObjectListConvert2DynaBeanList.convert(bean,group);
      beans.add(bean);
    }
    result.setData(beans);
    result.setSucceed();
View Full Code Here

  {
    List<Groups>groups = groupsDAO.findAll();
    ArrayList<LazyDynaBean>beans = new ArrayList<LazyDynaBean>();
    for(Groups group:groups)
    {
      LazyDynaBean bean = new LazyDynaBean();
      ObjectListConvert2DynaBeanList.convert(bean,group);
      bean.set("text", group.getName());
      bean.set("type", "group");
      bean.set("leaf", "true");
      beans.add(bean);
    }
    return beans;
  }
View Full Code Here

      List<LazyDynaBean>beans = jdbcTemplate.query(sql, new RowMapper<LazyDynaBean>(){
        @Override
        public LazyDynaBean mapRow(ResultSet rs, int rowNum)
            throws SQLException {
          // TODO Auto-generated method stub
          LazyDynaBean bean = new LazyDynaBean();
          String id = rs.getString(1);
          String name = rs.getString(2);
          bean.set("id", id);
          bean.set("name", name);
          return bean;
        }     
      }, name);
      result.setData(beans);
      result.setSucceed();
View Full Code Here

      List<LazyDynaBean>beans = jdbcTemplate.query(sql, new RowMapper<LazyDynaBean>(){
        @Override
        public LazyDynaBean mapRow(ResultSet rs, int rowNum)
            throws SQLException {
          // TODO Auto-generated method stub
          LazyDynaBean bean = new LazyDynaBean();
          String id = rs.getString(1);
          String name = rs.getString(2);
          bean.set("id", id);
          bean.set("name", name);
          return bean;
        }     
      }, userID);
      result.setData(beans);
      result.setSucceed();
View Full Code Here

    List<Groups> groups = groupsDAO.findAll();//获取所有组
   
    List<LazyDynaBean>result = new ArrayList<LazyDynaBean>();
    for(Groups group:groups)
    {
      LazyDynaBean bean = new LazyDynaBean();
      ObjectListConvert2DynaBeanList.convert(bean, group);
      if(groupIDs.contains(group.getId()))//判断该组是否与该用户关联     
        bean.set("signal", true);
      else
        bean.set("signal", false);
      result.add(bean);
    }
   
    return result;
  }
View Full Code Here

      List<LazyDynaBean>beans = jdbcTemplate.query(sql, new RowMapper<LazyDynaBean>(){
        @Override
        public LazyDynaBean mapRow(ResultSet rs, int rowNum)
            throws SQLException {
          // TODO Auto-generated method stub
          LazyDynaBean bean = new LazyDynaBean();
          String id = rs.getString(1);
          String name = rs.getString(2);
          bean.set("id", id);
          bean.set("name", name);
          return bean;
        }     
      }, groupID);
      result.setData(beans);
      result.setSucceed();
View Full Code Here

TOP

Related Classes of org.apache.commons.beanutils.LazyDynaBean

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.