[jboss-user] [EJB 3.0 Users] - Re: unidirectional and bidirectional relationship

Wolfgang Knauf do-not-reply at jboss.com
Wed Dec 9 06:18:02 EST 2009


Hi,

assume that you have a relation "Person has many addresses" with two entities "Person" and "Address".

If you declare a bidirectional relationship, your code can navigate from Person to Address, and from Adress to Person.

With a unidirectional relationship, your code can navigate only from one side to the other. E.g. you can get the addresses of a person, but you cannot get the person of an address.

The database representation of the relationship is not affected by your unidirectional/bidirectional decision. This defines only, how the code side looks like.

Hope this helps

Wolfgang

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4269767#4269767

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4269767



More information about the jboss-user mailing list