-->
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: A so particular case of inheritance
PostPosted: Mon Jul 12, 2004 12:10 pm 
Newbie

Joined: Mon Jul 12, 2004 11:54 am
Posts: 1
Hello
I have a so particular case of inheritance and i don't know how to map this with hibernate.

I have an objet Person that have two child objects
NaturalPerson and LegalPerson

I have to map this stuff with three tables

The problem is that person have a unique ID (numeric incremental)
and NaturalPerson and LegalPerson should manage "versions" of the same Person and because of this, that objects have a composite-id with the person code and the version date.

How can i map this inheritance if the parent object have just one key and the child object have two?...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 12, 2004 1:44 pm 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
it's not because your db has a composite id that your business object must has the same id...
you can code a business method that set the date property and use version when setting the "single" id.
You might some workaround but don't "focus" on that, this is only a business problem.

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


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.