Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Unidirectional one-to-many with join table

389129Apr 16 2012 — edited Apr 18 2012
According to http://docs.jboss.org/hibernate/orm/3.5/reference/en-US/html/associations.html#assoc-unidirectional-12m "A unidirectional one-to-many association on a foreign key is an unusual case, and is not recommended", instead they recommend using a join table, e.g.

create table Person ( personId bigint not null primary key )
create table PersonAddress ( personId not null, addressId bigint not null primary key )
create table Address ( addressId bigint not null primary key )

However if doing this, when using SQLDeveloper the Address table does not appear as a child table of Person, which it should be as a unidirectional one-to-many meaning that I can't create a cache group for Person and subsequently Person.

Is this something that can be worked around as I'm using a legacy schema created from Hibernate/JPA and the implications of changing are quite substantial?

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 16 2012
Added on Apr 16 2012
3 comments
356 views