-->
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.  [ 6 posts ] 
Author Message
 Post subject: Complex hibernate mapping
PostPosted: Tue Apr 22, 2008 3:31 pm 
Beginner
Beginner

Joined: Wed Apr 27, 2005 8:27 am
Posts: 27
Hi everyone,

My application's entity model isn't equal the data model. In some cases, an entity is represented by TWO tables. In others, some fields of a table are mapped in a class and the others, in another entity.

By now, i am using JDBC in the persistence, but I intend to change it to Hibernate. Does anyone know if it is possible to these kind os mappings?

Examples:
- ONE entity represents TWO TABLES:
The entity BeanActivity refers in some cases to table ACTIVITY1 and in other cases to table ACTIVITY2.

-Some fields of a table are presented in an entity1 and the other fields, in entity2.

In the current stage, it's impossible to remake the data model!

I am not asking the solution for this problem. I just wanna know if it's possible with hibernate.

Thanks a lot, Guilherme


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 22, 2008 11:29 pm 
Beginner
Beginner

Joined: Wed Mar 05, 2008 4:57 am
Posts: 22
Location: Bangalore,India
Not possible.

_________________
Naresh Waswani
+91-9986461501


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 22, 2008 11:49 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Of course it's possible.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 23, 2008 7:52 am 
Beginner
Beginner

Joined: Wed Apr 27, 2005 8:27 am
Posts: 27
hum...

one says it's possible, the other no!

christian, how can i do it?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 23, 2008 11:06 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Use logical entity names, read a book.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 23, 2008 2:12 pm 
Beginner
Beginner

Joined: Thu Feb 28, 2008 11:53 am
Posts: 23
Christian could you PLEASE take a look at this post cause no one seems to have any insight on it, thanks.

http://forum.hibernate.org/viewtopic.php?t=986008


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