-->
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.  [ 1 post ] 
Author Message
 Post subject: Recommended mapping for "special" one-to-one ???
PostPosted: Tue Jan 25, 2005 4:49 am 
Newbie

Joined: Wed Feb 04, 2004 12:33 pm
Posts: 13
Location: Vienna/Austria
Hibernate version:
2.1.7

Mapping documents:
to be written ... ;)

Name and version of the database you are using:
Oracle 9iR2

Hi all,

today I've a question about the recommended mapping for the scenario, described as the following:

I have several tables in my database, all of them have a artificial key (Long)
which is in fact a kind of OID.

So records ids won't be unique per table, but per database instance!

Now I have a special "Object" Table, which should hold some administrative data, e.g.

creationTS
updateTS
creationUser
updateUser
State
deletedFlag
and so on ...

this is designed that way for special staticstic generation - anyway!

my question is, how to map these several unidirectional one-to-one relations properly? I've read the reference manual as well as "HiA",
but I'm still in doubt, whether the base class could have several one-to-one constrained mappings?


<class name="person" table="PERSON">
<id name="id" column="PERSON_ID">
<generator class="foreign">
<param name="property">employee</param>
</generator>
</id>
...
<one-to-one name="employee"
class="Employee"
constrained="true"/>
<one-to-one name="freelancer"
class="Freelancer"
constrained="true"/>
</class>

is something like the above possible and how would it be constrained?
because ...

a freelancer-primary-key is definately one key in person (could be constrained)
but a primary-key in person is either a key in employee or freelancer

getting confused about the backward constraint ...

any hints/ideas are welcome

Thx in advance
K:)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.