-->
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.  [ 2 posts ] 
Author Message
 Post subject: Mapping twice
PostPosted: Sat Oct 27, 2007 10:54 am 
Newbie

Joined: Sat Oct 27, 2007 10:44 am
Posts: 1
Hi,

Anyone knows if it's possible to map a class instances as lists for other 2 class instances?

For instance, I have 3 tables - one with jobs(projects), one with workers and one with hours. On each job I may have workers working a number of hours at different pay rates at different moment in times. I'd like to be able to retrieve the list of hours for a job (as a collection) but at the same time I'd like to be able to retrieve the list of hours for an worker. All to be done by mapping and not queries. I was successful in doing the mapping but either only for jobs or only for workers - if I try to map hours twice I get errors (objects of type Hour cannot be added to 2 collections).

Is there a work around ? How can this be done ?

Thanks, Don


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 29, 2007 7:42 am 
Regular
Regular

Joined: Mon Jan 22, 2007 10:32 am
Posts: 101
You can map one of the mappings as readonly by using the insert="false" and udate="false".

_________________
Please rate this post if you find it helpful


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

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.