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: One-to-one value-type mapping across tables?
PostPosted: Mon Jun 20, 2005 9:50 am 
Newbie

Joined: Mon Jun 20, 2005 9:14 am
Posts: 1
Location: Brisbane
Hibernate version: 3.0.5

What I'm trying to do
I'm currently trying to map a legacy schema that I can't change. One of it's quirks is that it has several one-to-one relationships between one particular table, which I've mapped as an entity-type, and other tables which should be mapped as value-types (the primary keys are the same... don't ask me why they aren't in the same table, I don't know). These other tables really should be mapped as value-types because that's what makes sense semantically and I don't want to have to manually assign the natively generated primary key ID from the entity-type object to all the related objects which I think I would have to do if these other tables were mapped as entity-types.

Apology in advance
Now, I'm sure there's a way to do this, I apologise for asking, but I can't find what it is from the reference manual or the tutorial etc.

Options I've considered
The
Code:
component
tag would work if the value types were in the same table as the entity type. But the
Code:
component
tag doesn't seem to have a
Code:
table
attribute for components from other tables.

A
Code:
Set
mapping would work using its
Code:
table
attribute and the
Code:
component-element
tag, only it's a one-to-one relationship, not a one-to-many.

Final plea
Is there any way to do what I'm trying to do?
[/i]

_________________
We're just writing tomorrow's legacy code today.


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.