-->
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.  [ 3 posts ] 
Author Message
 Post subject: Having an entity mapped to multiple tables
PostPosted: Thu Jun 07, 2007 7:28 pm 
Newbie

Joined: Fri Oct 20, 2006 12:55 pm
Posts: 12
Hello,

I have a case where I have an entity mapped with Hibernate and I need to map it to multiple tables. My use case is this:

I have Entity A that goes through some processing, but before a user can save it on their own, their account must meet certain conditions. So if they can't process Entity A right there, I want to enqueue it for later. This means I'd need one permanent table and one queueing table. How can this be accomplished in Hibernate ?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 08, 2007 12:53 am 
Senior
Senior

Joined: Sat Aug 19, 2006 6:31 pm
Posts: 139
This is not answering your question directly but an alternative to using two tables is having an additional column in the table, say a boolean column called "pending". When set to true it means that it doesn't meet the conditions. Otherwise it's set to false.

_________________
Don't forget to rate the reply if it helps..:)

Budyanto


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 08, 2007 11:33 am 
Newbie

Joined: Fri Oct 20, 2006 12:55 pm
Posts: 12
Hi Budyanto,

That's a good idea, however I can't do this because of certain business requirements and the way our system interacts with some of our partners. Unfortunately, it has to be in another table. Thank you very much for the suggestion nonetheless.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.