suzie wrote:
Hey batman give me credit as well...
Sorry, I can't. Only the poster (you on this case) has access to the vote... Helpers can only
receive credits. Try to help some others reading their post, you'll that there's nowhere to click like in this thread.
kochcp wrote:
Otherwise your many-to-one could actually return more than one parent.
<many-to-one name="sale "
column="store_id"
column="storeLocId"
class="com.accuserverx.accucharge.dao.hibernate.sale"
not-null="true" />
I totally agree about referencing all the columns of the composite key, but are you sure it's possible to use more than one column attribute? I thought it was not possible, first because XML would not permit it. Well, however I'm sure something like this one would work :
Code:
<many-to-one name="sale" class="com.accuserverx.accucharge.dao.hibernate.sale" not-null="true">
<column name="store_id" />
<column name="storeLocId" />
</many-to-one>
At least, that's the syntax used in the ref doc :
http://www.hibernate.org/hib_docs/v3/re ... ompositeid
HTH