Hi,
I've got to make the Hibernate mapping for an existing Oracle DB schema.
It contains a one-to-one relationship between the instances of the same type, however it's been done the way many-to-many relations are:
There's a table for the entity instances, let's call it ENTITY, it has an id field and several property fields. There's another table called ENTITY_REL which contains two fields for the two ends of the relation, so each of them is a foreign key if ENTITY's id field. ENTITY_REL has also some other properties.
Again this lineup looks like a basic many-to-many relation mapping however, I know it's one-to-one. I would like to know if it's possible to let Hibernate know, it's a one-to-one relation, i.e. to create the appropriate Hibernate mapping. I currently have a many-to-many mapping, but not too happy with it..
Regards,
Zoltan
|