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]