ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Prashanth Sukumaran <prashanthsukuma...@yahoo.com>
Subject NestedSQLException
Date Thu, 13 Jan 2005 16:23:59 GMT
Hi,

I am getting the following NestedSQLException.  I think the problem is due to some null values
stored in the database.  Why should there be a Null Pointer Exception while setting the data
into
the bean that i have passed?

Has anybody got a similar error.  I am also pasting the sql definition here.

Thanks a lot

Prashanth

PS:  IBatis is awsome.  I love everything about the way it is done and way it helps me to
write
clean code.  The XML representatioin of the SQL is the best.  I don't like to have SQL in
my Java
Code. Even though you will be adding new enhancements to iBatis, please keep this XML
represenatation of SQL query as it is. Thanks a lot for all the hardwork you guys are putting
and
make our lives easier.


<select id="getShopByShopId" resultMap="shopResult" parameterClass="int">
select 
	SHOPID, SHOPNAME, SHOPSTREETADDRESS1, SHOPSTREETADDRESS2, SHOPCITY, 
	STATEID, SHOPZIPCODE, REGIONID, 
	DECODE(TBLSHOPS.TECHNICIAN,NULL,'', SALESMAN.SALESMAN_LAST_NM || ', ' ||
SALESMAN.SALESMAN_FIRST_NM) SALESMAN_NAME
from TBLSHOPS, SALESMAN 
WHERE TBLSHOPS.SHOPID = #value# AND 
	  TBLSHOPS.active = 'Y' AND
	  TBLSHOPS.TECHNICIAN = SALESMAN.SALESMAN_ID (+)

</select>


Nested Exception is...
com.ibatis.dao.client.DaoException: Failed to execute queryForObject - id [getShopByShopId],
parameterObject [1877].  Cause: com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred in com/wirelessmob/solutions/dataaccess/persistence/sqlmapdao/sql/Shop.xml.
 
--- The error occurred while applying a result map.  
--- Check the Shop.shopResult.  
--- The error happened while setting a property on the result object.  
--- Cause: com.ibatis.common.exception.NestedRuntimeException: Error setting properties of
'com.wirelessmob.solutions.dataaccess.beans.Shop@187d27e'.  Cause: java.lang.NullPointerException
Caused by: java.lang.NullPointerException
Caused by: com.ibatis.common.exception.NestedRuntimeException: Error setting properties of
'com.wirelessmob.solutions.dataaccess.beans.Shop@187d27e'.  Cause: java.lang.NullPointerException
Caused by: java.lang.NullPointerException
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred in com/wirelessmob/solutions/dataaccess/persistence/sqlmapdao/sql/Shop.xml.
 
--- The error occurred while applying a result map.  
--- Check the Shop.shopResult.  
--- The error happened while setting a property on the result object.  
--- Cause: com.ibatis.common.exception.NestedRuntimeException: Error setting properties of
'com.wirelessmob.solutions.dataaccess.beans.Shop@187d27e'.  Cause: java.lang.NullPointerException
Caused by: java.lang.NullPointerException
Caused by: com.ibatis.common.exception.NestedRuntimeException: Error setting properties of
'com.wirelessmob.solutions.dataaccess.beans.Shop@187d27e'.  Cause: java.lang.NullPointerException
Caused by: java.lang.NullPointerException
	at com.ibatis.dao.client.template.SqlMapDaoTemplate.queryForObject(SqlMapDaoTemplate.java:164)


		
__________________________________ 
Do you Yahoo!? 
Read only the mail you want - Yahoo! Mail SpamGuard. 
http://promotions.yahoo.com/new_mail 

Mime
View raw message