-->
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: Mapping two tables to a single class using hibernate tools
PostPosted: Thu Sep 18, 2008 8:01 am 
Newbie

Joined: Thu Sep 18, 2008 6:17 am
Posts: 2
Hi everyone,

I have two different tables (say Table1 and Table2) in two different databases (says DB1 and DB2).

The databases are linked though a DB Link object which allows me to only connect to DB1 and select table2(without connecting to DB2).

I created a synonym for table2 on DB1 to make it easier to read the selects.

Table1 has a composite PK composed of an ID and a year.
Table2 has a single value PK composed of an ID.
Both IDs are the same and there is no explicit constraint between those tables.

I need to map some attributes of Table1 and some attributes of Table2 in the same Java class.
Is that possible with Hibernate ?
Is that possible using Hibernate tools ?

Thanks for reading up to here and for any answer :)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 19, 2008 7:48 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Hibernate Tools does not support reverse engineering of these constructs.

Hibernate core does though support the notion of <join> to fetch additional data into a bean.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 19, 2008 8:05 am 
Newbie

Joined: Thu Sep 18, 2008 6:17 am
Posts: 2
thank you very much for such a quick answer


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.