Hibernate version:
3.0rc1
Hi Anthony,
I'm back again, and I need some more help. We are beginning development with Hibernate 3, and I will wait for Spring to release 1.2 with Hibernate 3 support. I have the following object scenario
-> = Excends
#> = Foregin Key to primary key.
Object setup
Application -> Document
Application has many ApplicationEntityRoles
Database setup
Application #> Document (joined sublcass by document id, that part is easy)
ApplicationEntityRole #> Application.
NOTE: Application has is own primary key, and this is required by legacy apps!
You mentioned in your earlier posts that a column and a formula could be used. I've reviewed the documentation, and it is not clear to me how to utilize this. Is there an example somewhere? Also, from my understanding of Hibernate, if I map a Set of AppliationEntityRoles into the Appliation mapping, it will be default use the primary key in Document correct?
Take the following mapping within the application joined sublcass mapping
<set name="appEntityRoles" table="APPENTITYROLE" inverse="true" lazy="false" cascade="all">
<key column="ApplicationID"/>
<one-to-many class="com.llic.data.ApplicationEntityRole"/>
</set>
When the sql is generated, won't this join APPENTITYROLE.ApplicationID = Document.DocumentID? Is there any way around this? I have used hibernate quite a bit, but it has always been on a new project. I'm not sure what I should do here to resolve the issue. If this is possible, what is the best way to do this?
Thanks,
Todd
|