Package com.isfasiel.util.data

Examples of com.isfasiel.util.data.Data


  protected void addListQuery(String query, HashMap<String, Object> param) {
    addQuery(TYPE_LIST, query, param);
  }
 
  protected void addQuery(String type, String query, HashMap<String, Object> param) {
    if(queryList == null) {queryList = new Data();}
    int current = queryList.size();
    queryList.add(current, TYPE_DATA_TYPE, type);
    queryList.add(current, TYPE_DATA_QUERY, query);
    queryList.add(current, TYPE_DATA_PARAM, param);
  }
View Full Code Here


  protected SqlMapClientTemplate getSqlMapClientTemplate() {
    return this.baseSqlMapClient.getSqlMapClientTemplate();
  }
 
  protected Data select(String queryName) {
    return new Data((HashMap<String, Object>)this.getSqlMapClientTemplate().queryForObject(queryName));
  }
View Full Code Here

  protected Data select(String queryName) {
    return new Data((HashMap<String, Object>)this.getSqlMapClientTemplate().queryForObject(queryName));
  }
 
  protected Data select(String queryName, Data data) {
    return new Data((HashMap<String, Object>)this.getSqlMapClientTemplate().queryForObject(queryName, data.getRecord(0)));
  }
View Full Code Here

  protected Data select(String queryName, Data data) {
    return new Data((HashMap<String, Object>)this.getSqlMapClientTemplate().queryForObject(queryName, data.getRecord(0)));
  }
 
  protected Data list(String queryName) {
    return new Data(this.getSqlMapClientTemplate().queryForList(queryName));
  }
View Full Code Here

  protected Data list(String queryName, Data data) throws Exception{
    return list(queryName, data.getRecord(0));
  }
 
  protected Data list(String queryName, HashMap<String, Object> param) throws Exception{
    return new Data(this.getSqlMapClientTemplate().queryForList(queryName, param));
  }
View Full Code Here

 
  protected Object execute() throws Exception {
    return execute(queryList);
  }
  protected Data execute(final Data cQueryList) throws Exception {
    Data result = getSqlMapClientTemplate().execute(
        new SqlMapClientCallback<Data>() {
          @Override
          public Data doInSqlMapClient(SqlMapExecutor executor) throws SQLException {
           
            int size = cQueryList.size();
            executor.startBatch();
            for(int i =0; i < size; i++) {
              String query = cQueryList.getString(i,TYPE_DATA_QUERY);
              String type = cQueryList.getString(i, TYPE_DATA_TYPE);
              HashMap<String, Object> param = (HashMap<String, Object>)cQueryList.get(i, TYPE_DATA_PARAM);
              if(type.equals(TYPE_LIST)) {
                Data result = new Data();
                result.add(executor.queryForList(query, param));
                cQueryList.add(i, TYPE_DATA_RESULT, result);
              } else if(type.equals(TYPE_INT)) {
                Integer result = (Integer)executor.queryForObject(query, param);
                cQueryList.add(i, TYPE_DATA_RESULT, result);
              } else if(type.equals(TYPE_STRING)) {
View Full Code Here

 
  private String path = "content/xml";
 
  @RequestMapping(value="/delete/{contentId}")
  public String deleteContent(Model model, @PathVariable long contentId) throws Exception {
    Data result = new Data();
    User user = getUser();
    if(user != null) {
      try {
        Data param = getParam();
        param.add(0, "userIdx", user.getId());
        param.add(0, "contentId", contentId);
        jobService.delete(param);
        result.add(0,"result", "OK");
        Data files = uploadFiles(request, contentId);
        System.out.println(files);
      } catch (Exception e) {
        result.add(0,"result", "NO");
      }
    } else {
View Full Code Here

    return path;
  }
 
  @RequestMapping(value="/create.do")
  public String createContent(Model model) throws Exception {
    Data result = new Data();
    User user = getUser();
    if(user != null) {
     
   
      try {
        Data param = getParam();
       
        param.add(0, "contentType", "J");
        param.add(0, "userIdx", user.getId());
        param.add(0, "ipAddr", getRemoteIP());
        System.out.println(param);
        jobService.insert(param);
        result.add(0,"result", "OK");
       
      } catch (Exception e) {
View Full Code Here

    return path;
  }
 
  @RequestMapping(value="/update.do")
  public String updateContent(Model model) throws Exception {
    Data result = new Data();
    User user = getUser();
    if(user != null) {
      try {
        Data param = getParam();
        param.add(0, "userIdx", user.getId());
        System.out.println(param);
        jobService.update(param);
        result.add(0,"result", "OK");
       
      } catch (Exception e) {
View Full Code Here

  }
 
  @RequestMapping(value="/list/{pageNumber}")
  public String listContent(@PathVariable("pageNumber") int pageNumber, Model model) throws Exception {
   
    Data param = getPageParam(pageNumber, pageSize);
    System.out.println(param);
    Data result = jobService.list(param);
    addXML(model, "result", result, "content");
    param = null;
    return path;
  }
View Full Code Here

TOP

Related Classes of com.isfasiel.util.data.Data

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.