-->
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.  [ 5 posts ] 
Author Message
 Post subject: How model a domain object with data scattered
PostPosted: Wed Oct 03, 2007 6:05 am 
Newbie

Joined: Tue Mar 06, 2007 9:09 am
Posts: 10
Hi guru, we are trying to create a domain model with a not normalized database
Data from the same entity are scattered among different table, this is due to a bad specifie of er.
For example we have an employee table, and empl_detatails1, empl_details2 table an so on.
From a java point of view we would like to solve this proble and we would like to have only one object emp with all attributes from employee table, and empl_detatails1 and so on.
As far as I Know I can specify only one table in metadata xml configuration file.
Any Idea?
Thanks in advance
Marco


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 03, 2007 6:15 am 
Regular
Regular

Joined: Sun Sep 30, 2007 7:51 pm
Posts: 93
Why not having corresponding model for the employee?

employee, employee.details1, employee.details2
(e.g. other entities for empl_details1, and empl_details2 etc...)

You can have the details lazy loaded, you could safe selects if you don't need them always. You will have the data structured.

Regards,
Pavol


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 03, 2007 8:00 am 
Newbie

Joined: Tue Mar 06, 2007 9:09 am
Posts: 10
we think that the domain model must be free from relation database schema. Of course we can follow database schema structure but, as an execise, we are wondering if we can really choose or if, because of hibernate limitations, we have a limitated freedom.
Your idea is good, but is the only one?
In other word using composition I can avoid an hibernate limitation ( for every domain object only one table). isn't it?.
Thanks
Marco


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 03, 2007 8:12 am 
Regular
Regular

Joined: Sun Sep 30, 2007 7:51 pm
Posts: 93
See

http://www.jdocs.com/javaee/5.0.0/javax ... Table.html

Hope it helps,
Pavol


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 03, 2007 8:26 am 
Newbie

Joined: Tue Mar 06, 2007 9:09 am
Posts: 10
Yes! very usefull. Exactly what we are looking for!
Thank!
Marco


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