Joined: Tue Apr 25, 2006 2:08 am Posts: 7
|
Hi All,
I have 2 objects. A Language Object and a User Object.
I want a one-to-one unidirectional mapping. The User has an instance of Language but not the other way around. So in short User knows about Language but NOT the other way around.
I want to map it like this:
<one-to-one
name="language"
class="test.Language"
cascade="none"
outer-join="auto"
constrained="false"
/>
This should be more than enough but when I re-create the database structure I can't find any evidence of any form of relation. The User table should have a column called abreviation (The name of the key of language) that is a reference to the language table.
I've seen solutions where people add a User object to the Language class but this is unacceptable. Language whould never ever know about User.
Is it true what I've read that Hibernate fails miserably when it come to one-to-ne unidirectional mapping?
Has anybody got a solution?
|
|