-->
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: One object from two different tables
PostPosted: Tue Mar 23, 2004 2:39 pm 
Newbie

Joined: Tue Mar 09, 2004 2:44 pm
Posts: 15
Is there any way to map one object to two different tables? I have an object that has a boolean flag which basically indicates which database table the data came from. I have two standard SQL queries that generate the same information, but from separate tables (one contains verified data, one contains as yet un-verified data).

I could refactor the DB schema and put the flag in the database table, but that causes other complications. The other option is to create two separate classes with the same functionality (and implementing the same interface/extending the same superclass), but I would currently like to avoid that.

I am using version 2.1.2 with SQL Server. I assume that I will have to do one of the two choices above to use hibernate, but would be impressed if there were some way to configure Hibernate to accomodate my current set up.

_________________
Thanks,
CJ


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 23, 2004 7:38 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
It is standard functionality of Hibernate 2.2.

In Hibernate 2.1, you will need to write a custom persister.


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.