-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Questions on forumulas
PostPosted: Fri Mar 04, 2005 11:54 am 
Regular
Regular

Joined: Fri Feb 13, 2004 10:02 pm
Posts: 90
Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp


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


Code:
<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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.