ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Abhigyan Agrawal1 <abhigyan_agra...@in.ibm.com>
Subject Re: IBatis - NestedSQLException
Date Wed, 07 Nov 2007 06:36:31 GMT
Hi raveendray,
        It looks like a syntax problem in accounts.xml. Please check the 
format of the mentioned mapped statement. Looks like String is being used 
instead of a Number.

Cheers,
Abhigyan Agrawal





Yerraguntla <raveendray@yahoo.com> 
07/11/2007 11:50
Please respond to
user-java@ibatis.apache.org


To
user-java@ibatis.apache.org
cc

Subject
IBatis - NestedSQLException







I am using IBATIS (with Abator generated DAOs, SQL Map, etc.). I am 
getting
an error on execution on selectByExample method that IBatis generated even
with a singleValue criteria that I am trying to pass. I know I am
communicating ok when I use selectByPrimaryKey().
Please help me in understanding what the problem could be.

My code:
public class LoginBean {

  private DaoManager daoManager = DaoConfig.getDaomanager();
  private List<Accounts> accts = null;
  private AccountsExample query = null;
  private AccountsDAO aDao = null;

                 public LoginBean () {
      super();
      this.daoManager = daoManager;
      this.query = new AccountsExample();
      this.aDao = (AccountsDAO) daoManager.getDao(AccountsDAO.class);

                 } 
 
                 public List<Accounts> getLoginResult(String uName) {   

       daoManager.getDao(AccountsDAO.class);
 
        query.createCriteria().andACCOUNT_NAMEEqualTo("user");
 
        try { 
           accts = (List<Accounts>)aDao.selectByExample(query);
 
          System.out.println("Size of the result set" +
accts.get(0).getACCOUNT_NAME());

        } catch (Exception e) {
            e.printStackTrace();
                   }
 
                    return accts;
                 } 
 
}

When I execute this simple method thru a test program,
I am getting the following error. 

--------------------------------------------
com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in
com/basware/dao/persistence/sqlmapdao/sql/accounts.xml. 
--- The error occurred while preparing the mapped statement for execution. 
 
--- Check the accounts.abatorgenerate_selectByExample. 
--- Check the parameter map. 
--- Cause: com.ibatis.common.beans.ProbeException: Error getting
ordinal list from JavaBean. Cause java.lang.NumberFormatException: For
input string: ""
Caused by: java.lang.NumberFormatException: For input string: ""
Caused by: com.ibatis.common.beans.ProbeException: Error getting
ordinal list from JavaBean. Cause java.lang.NumberFormatException: For
input string: ""
Caused by: java.lang.NumberFormatException: For input string: ""

--------------------------------------------

Really appreciate any help with understanding the issue.

Thanks,
RC
-- 
View this message in context: 
http://www.nabble.com/IBatis---NestedSQLException-tf4762925.html#a13621944
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.



Mime
View raw message