ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick R <ric...@gmail.com>
Subject Re: why is ibatis rolling up for an association, not sure why this isn't flat, or what its rolling up on?
Date Mon, 22 Feb 2010 05:24:39 GMT
On Mon, Feb 22, 2010 at 12:03 AM, Clinton Begin <clinton.begin@gmail.com>wrote:

> The reason is that the rows aren't uniquely identified.  Upon a second
> look, I see that the column I recommended isn't unique.  Which columns
> uniquely identify each parent row?
>
>

They'd be unique by a combination of "parentAttributeID" and
"attributeValueID"

That would make a row unique. So your post led me to try this

<association property="attributeValue"
column="{parentValueID=parentValueID,attributeValue.attributeValueID=attributeValueID}"
- but that would only work I suppose if my property was a composite object
which its not.

Looks like I should stick to not using an association for this (and do it
the ibatis2.0 way?):

<!-- flatten -->
<result property="parentValueID" column="parentValueID" jdbcType="CHAR" />
<result property="attributeValue.attributeValueID" column="attributeValueID"
jdbcType="INTEGER"/>
<result column="value" property="attributeValue.value" jdbcType="VARCHAR"/>

Mime
View raw message