Page 1 of 1

About Question enthuware.oce-jpad.v6.2.441 :

Posted: Sun Mar 15, 2015 11:07 am
by ikotev
Hello,

Explanation why first answer is wrong is not correct.
One side of the ManyToMany must be made the owner of the relationship by specifying a mappedBy argument.
mappedBy is required only if you wish to have bi-directional mapping. However it is possible to have 2 uni-directional @ManyToMany mappings resulting in two join tables.

First answer is wrong because the targetEntity attribute on items field should point to Items.class not Category.class.

Re: About Question enthuware.oce-jpad.v6.2.441 :

Posted: Sun Mar 15, 2015 9:06 pm
by admin
You are right but I think the mistake in the option that you pointed was unintentional. The explanation is actually correct but misleading. It is correct because the situation presented is a bidirectional relationship and misleading because it doesn't make it clear that it applies only to bidirectional relationship.

I have updated the option and the explanation.
thank you for your feedback!