Examples of queryForObject()


Examples of com.alibaba.druid.support.ibatis.SqlMapClientWrapper.queryForObject()

                error = ex;
            }
            Assert.assertNotNull(error);
        }

        Assert.assertNotNull((User) wrapper.queryForObject("User.select"));
        Assert.assertNotNull((User) wrapper.queryForObject("User.select", Collections.emptyMap()));
        Assert.assertNotNull((User) wrapper.queryForObject("User.select", Collections.emptyMap(), new User()));

        Assert.assertEquals(1, wrapper.queryForList("User.select").size());
        Assert.assertEquals(1, wrapper.queryForList("User.select", Collections.emptyMap()).size());
View Full Code Here

Examples of com.alibaba.druid.support.ibatis.SqlMapExecutorWrapper.queryForObject()

                error = ex;
            }
            Assert.assertNotNull(error);
        }

        Assert.assertNotNull((User) wrapper.queryForObject("User.select"));
        Assert.assertNotNull((User) wrapper.queryForObject("User.select", Collections.emptyMap()));
        Assert.assertNotNull((User) wrapper.queryForObject("User.select", Collections.emptyMap(), new User()));

        Assert.assertEquals(1, wrapper.queryForList("User.select").size());
        Assert.assertEquals(1, wrapper.queryForList("User.select", Collections.emptyMap()).size());
View Full Code Here

Examples of com.ibatis.sqlmap.client.SqlMapClient.queryForObject()

        Object in = exchange.getIn().getBody();
        if (in != null) {
            if (LOG.isTraceEnabled()) {
                LOG.trace("QueryForObject: " + in + "  using statement: " + statement);
            }
            result = client.queryForObject(statement, in);
        } else {
            if (LOG.isTraceEnabled()) {
                LOG.trace("QueryForObject using statement: " + statement);
            }
            result = client.queryForObject(statement);
View Full Code Here

Examples of com.ibatis.sqlmap.client.SqlMapClient.queryForObject()

            result = client.queryForObject(statement, in);
        } else {
            if (LOG.isTraceEnabled()) {
                LOG.trace("QueryForObject using statement: " + statement);
            }
            result = client.queryForObject(statement);
        }

        doProcessResult(exchange, result);
    }
View Full Code Here

Examples of com.ibatis.sqlmap.client.SqlMapClient.queryForObject()

        Object in = exchange.getIn().getBody();
        if (in != null) {
            if (LOG.isTraceEnabled()) {
                LOG.trace("QueryForObject: " + in + "  using statement: " + statement);
            }
            result = client.queryForObject(statement, in);
        } else {
            if (LOG.isTraceEnabled()) {
                LOG.trace("QueryForObject using statement: " + statement);
            }
            result = client.queryForObject(statement);
View Full Code Here

Examples of com.ibatis.sqlmap.client.SqlMapClient.queryForObject()

            result = client.queryForObject(statement, in);
        } else {
            if (LOG.isTraceEnabled()) {
                LOG.trace("QueryForObject using statement: " + statement);
            }
            result = client.queryForObject(statement);
        }

        doProcessResult(exchange, result);
    }
View Full Code Here

Examples of com.ibatis.sqlmap.client.SqlMapClient.queryForObject()

  public String execute() throws Exception {
    //TODO  检测username and password,如果出错的话,返回error,交由struts2.0进行处理;
    // 如果正确的话,就会redirect到 EasyJ的原框架进行处理.
    SqlMapClient client = Utils.getMapClient();
    Object user = client.queryForObject("user.getUserByUserName",userName);
    if(user == null){
      System.out.println(userName+" 不存在");
      return ActionSupport.ERROR;
    }else{
      System.out.println(userName+"正确");
View Full Code Here

Examples of com.ibatis.sqlmap.client.SqlMapClient.queryForObject()

  public static int VALIDATE_OK  =  0 ;
  public static int login(String username, String passwd) throws Exception
  {
    SqlMapClient client = Utils.getMapClient();
    SysUser user = null;   
    user = (SysUser)client.queryForObject("user.getUserByUserName", username);   
    if(user == null) return LOGIN_ERROR;   
    if(user.getPassword().equals(passwd))
    {
      ActionContext.getContext().getSession().put("user", user);
      return user.getUserId().intValue();
View Full Code Here

Examples of com.ibatis.sqlmap.client.SqlMapClient.queryForObject()

    else return LOGIN_ERROR;
  }
  public static int validateName(String username)throws Exception{
    SqlMapClient client = Utils.getMapClient();
    SysUser user = null;
    user = (SysUser)client.queryForObject("user.getUserByUserName",username);
    if(user != null) return VALIDATE_FAIL;
    return VALIDATE_OK;
  }
  public static void main(String []args){
    try{
View Full Code Here

Examples of com.ibatis.sqlmap.client.SqlMapClient.queryForObject()

    System.out.println(userName);
    return ActionSupport.SUCCESS;
  }
  public static void main(String []args)throws Exception{
    SqlMapClient client = Utils.getMapClient();
    Object user = client.queryForObject("user.getUserByUserName","admin");
   
  }

}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.