ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From neilhe...@f2s.com
Subject using result maps within result maps
Date Wed, 19 Oct 2005 09:11:41 GMT
I have a situation where I have several tables with one-to-one relationships.
Each of which has 20 + columns.

As each of them requires to be queried individually I have created result maps
for each one.

We also need to get all the data related to the central table and I would like
to do this in one select statement.

I have done this following the N+1 select user guide so have the correct sql. I
tried to map the result with the following xml node:

<result property="child" resultMap="Child.allValues" javaType="data.Child"/>

Unfortunatly this gives me a class cast exception - when calling the following:

com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.setNestedResultMappingValue(BasicResultMap.java:384)

It is giving me a list!

Is there currently a way to correctly specify the class, so that I don't have to
have lists of sub-classes when I know it is a one to one mapping?

I know I can specify each property as child.propertyName, but as I already have
this specified it seems wastful - also I end up with a result map with
hundereds of properties - most on sub-classes.

Thanks for any help
Neil


Mime
View raw message