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 "Ryan, CatherineO" <Ca...@agriculture.gov.ie> on 2005/03/08 16:37:34 UTC
Complex ResultMap
Hi,
Could you help me the following error :
I get Cause: com.ibatis.sqlmap.client.SqlMapException: Error instantiating collection property for mapping 'room' Cause: java.lang.ClassCastException. Do you know why this is happening?
<sqlMap namespace="HotelInfo">
resultMap id="room" class="roomData" >
<result property="roomNumber" column="ROOM_NO" nullValue="" />
</resultMap>
<resultMap id="hotel" class="hotelData" >
<result property="roomData" resultMap="HotelInfo.room"/>
</resultMap>
<select id="findByPrimaryKey" resultMap="hotel" parameterClass="searchData">
SQL GOES IN HERE
</select>
Regards
Catherine
**********************************************************************
*********** Department of Agriculture and Food ***************
The information contained in this email and in any
attachments is confidential and is designated solely
for the attention and use of the intended recipient(s).
This information may be subject to legal and professional
privilege. If you are not an intended recipient of
this email, you must not use, disclose, copy,
distribute or retain this message or any part of it.
If you have received this email in error, please
notify the sender immediately and delete all copies of
this email from your computer system(s).
**********************************************************************
Re: Complex ResultMap
Posted by Brandon Goodin <br...@gmail.com>.
You will need to provide a more information. Please provide all the
sql in the sqlmap and your dao code. It might also be appropriate to
include your domain objects as well (roomData, hotelData).
Brandon
On Tue, 8 Mar 2005 15:37:34 -0000, Ryan, CatherineO
<Ca...@agriculture.gov.ie> wrote:
> Hi,
>
> Could you help me the following error :
>
> I get Cause: com.ibatis.sqlmap.client.SqlMapException: Error instantiating collection property for mapping 'room' Cause: java.lang.ClassCastException. Do you know why this is happening?
>
> <sqlMap namespace="HotelInfo">
>
> resultMap id="room" class="roomData" >
> <result property="roomNumber" column="ROOM_NO" nullValue="" />
> </resultMap>
>
> <resultMap id="hotel" class="hotelData" >
> <result property="roomData" resultMap="HotelInfo.room"/>
> </resultMap>
>
> <select id="findByPrimaryKey" resultMap="hotel" parameterClass="searchData">
> SQL GOES IN HERE
> </select>
>
> Regards
> Catherine
>
> **********************************************************************
> *********** Department of Agriculture and Food ***************
>
> The information contained in this email and in any
> attachments is confidential and is designated solely
> for the attention and use of the intended recipient(s).
> This information may be subject to legal and professional
> privilege. If you are not an intended recipient of
> this email, you must not use, disclose, copy,
> distribute or retain this message or any part of it.
> If you have received this email in error, please
> notify the sender immediately and delete all copies of
> this email from your computer system(s).
> **********************************************************************
>
>