what version of iBatis are you using?
try to use the last version, I've encountered the same problem using
iBatis 2.1.x with abator 1.x
hope that helps
--
Yerraguntla ha scritto:
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
|