Given a mapping long the lines of
<class name="xxx">
<composite-id class="CompositeKey">
<key-many-to-one name="ParentA" column="parentID_A" />
<key-many-to-one name="ParentB" column="parentID_B" />
</composite-id>
<property name="SomeProperty" />
<loader query-ref="loadXXX" />
</class>
<sql-query name="loadXXX" >
<return class="xxx" />
<!CDATA[
select parentID_A, parentID_B, SomeProperty from xxx
where xxx.parentID_A=? and xxx.parentID_B=?
]]>
</sql-query>
how do I need to phrase the where clause in the loader query please?
Using two positional parameters results in an error that there weren't
sufficient supplied (makes sense, it got a single ID parameter); I've
tried various attempts to extract the properties from the ID eg
?.ParentA, :id.ParentA, {:id.ParentA} etc without any success.
Presumably there's a syntax to achieve it but I've not figured it out!
There are good reasons both for using a composite ID and for using a
custom loader in this particular case!
Thanks,
Pete Appleton
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.