You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Warren <wa...@clarksnutrition.com> on 2006/02/28 03:46:58 UTC
nullValue = Question
I have a ResultMap that calls another select statement to retrive an object.
<resultMap id="scanOrderWithOrdersAndLineItemsResult" class="scanOrder">
...
<result property="orderDog" select="getOrderDog" nullValue="NULL"/>
</resultMap>
<select id="getOrderDog" resultMap="vendorResult">
SELECT col1, col2, ... FROM vendor WHERE ven_vendor_code = '0000 '
</select>
orderDog is an object. I keep getting java.lang.NullPointer Exceptions
related to the orderDog property. How do I get orderDog set to null if
getOrderDog does not return a result?
Thanks,
Warren Bell
Re: nullValue = Question
Posted by Sven Boden <li...@pandora.be>.
I tried something similar in which the query in the "select" part
returns an empty result (without using nullValue), and the property is
properly set to NULL. Can you try the iBATIS version from SVN, and maybe
also post the full stack-trace you get.
Regards,
Sven
Warren wrote:
>I have a ResultMap that calls another select statement to retrive an object.
>
><resultMap id="scanOrderWithOrdersAndLineItemsResult" class="scanOrder">
> ...
> <result property="orderDog" select="getOrderDog" nullValue="NULL"/>
></resultMap>
>
><select id="getOrderDog" resultMap="vendorResult">
> SELECT col1, col2, ... FROM vendor WHERE ven_vendor_code = '0000 '
></select>
>
>orderDog is an object. I keep getting java.lang.NullPointer Exceptions
>related to the orderDog property. How do I get orderDog set to null if
>getOrderDog does not return a result?
>
>Thanks,
>
>Warren Bell
>
>
>
>
>