Hello, I have the following mappings in User and Role classes:

*** User.validRoles

@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "userroles",
joinColumns = { @JoinColumn(name = "userid", referencedColumnName =
"userid") },
inverseJoinColumns = { @JoinColumn(name = "roleid", referencedColumnName =
"roleid") }
)
private List<Role> validRoles = new ArrayList<Role>(0);

*** Role.validUsers

@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(name = "userroles",
joinColumns = { @JoinColumn(name = "roleid", referencedColumnName =
"roleid") },
inverseJoinColumns = { @JoinColumn(name = "userid", referencedColumnName =
"userid") }
)
private List<User> validUsers = new ArrayList<User>(0);

***

On page 98 of "Pro JPA 2" the author states "Note that no matter which side
is designated as the owner, the other side should include the 'mappedBy'
element; otherwise, the provider will think that both sides are the owner
and that the mappings are separate unidirectional relationships."

With OpenJPA (1.2.1) as the provider, what are the implications of my
mapping (not using mappedBy)? I've had the above mapping in place for a year
or more with no problems that I can see (I am not using L2 cache).

Thanks.


-- 
Daryl Stultz
_____________________________________
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
http://www.opentempo.com
mailto:[email protected]

Reply via email to