From: Christopher G. S. II (JIRA) <no...@at...> - 2006-07-06 20:24:03
|
@ManyToMany without mappedBy should be recognized as an error ------------------------------------------------------------- Key: ANN-389 URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-389 Project: Hibernate Annotations Type: Bug Components: binder Versions: 3.2.0.cr1 Reporter: Christopher G. Stach II Instead of letting the user know that something might get hosed, it creates two join tables, one for each direction. I don't know when this would be the preferred behavior. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Christopher G. S. II (JIRA) <no...@at...> - 2006-07-06 20:52:05
|
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-389?page=comments#action_23560 ] Christopher G. Stach II commented on ANN-389: --------------------------------------------- If I wasn't clear enough, this is for bidirectional relationships. > @ManyToMany without mappedBy should be recognized as an error > ------------------------------------------------------------- > > Key: ANN-389 > URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-389 > Project: Hibernate Annotations > Type: Bug > Components: binder > Versions: 3.2.0.cr1 > Reporter: Christopher G. Stach II > > > Instead of letting the user know that something might get hosed, it creates two join tables, one for each direction. I don't know when this would be the preferred behavior. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Emmanuel B. (JIRA) <no...@at...> - 2006-07-06 22:35:59
|
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-389?page=all ] Emmanuel Bernard resolved ANN-389: ---------------------------------- Resolution: Rejected This is a valid mapping. This does make sense in some use cases. > @ManyToMany without mappedBy should be recognized as an error > ------------------------------------------------------------- > > Key: ANN-389 > URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-389 > Project: Hibernate Annotations > Type: Bug > Components: binder > Versions: 3.2.0.cr1 > Reporter: Christopher G. Stach II > > > Instead of letting the user know that something might get hosed, it creates two join tables, one for each direction. I don't know when this would be the preferred behavior. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Christopher G. S. II (JIRA) <no...@at...> - 2006-07-07 15:52:05
|
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-389?page=comments#action_23572 ] Christopher G. Stach II commented on ANN-389: --------------------------------------------- EJB 3.0 Final: 2.1.7 Entity Relationships The following rules apply to bidirectional relationships: * The inverse side of a bidirectional relationship must refer to its owning side by use of the mappedBy element of the OneToOne, OneToMany, or ManyToMany annotation. The mappedBy element designates the property or field in the entity that is the owner of the relationship. [...] * For many-to-many bidirectional relationships either side may be the owning side. I don't think that the second point allows for BOTH sides to be the owning side because that would clearly violate the first point. 9.1.26 ManyToMany Annotation Every many-to-many association has two sides, the owning side and the non-owning, or inverse, side. This does not say "only some many-to-many associations have two sides." Besides the spec saying that it "must" have mappedBy on one of the sides, it's a retarded use case to have duplicate join tables for the same relation. Who does that and why? > @ManyToMany without mappedBy should be recognized as an error > ------------------------------------------------------------- > > Key: ANN-389 > URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-389 > Project: Hibernate Annotations > Type: Bug > Components: binder > Versions: 3.2.0.cr1 > Reporter: Christopher G. Stach II > > > Instead of letting the user know that something might get hosed, it creates two join tables, one for each direction. I don't know when this would be the preferred behavior. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Emmanuel B. (JIRA) <no...@at...> - 2006-07-07 19:39:57
|
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-389?page=comments#action_23574 ] Emmanuel Bernard commented on ANN-389: -------------------------------------- No, I mean that you can have 2 different associations one from A to B and one from B to A where the semantic of the association are completly different let's say User --owner--> Car Car --hasBeenDrivenBy'--> User So in this case I do have 2 different associations with a completly different semantic, none of them are bidirectional (but they could). Sorry, my previous comment wasn't really clear > @ManyToMany without mappedBy should be recognized as an error > ------------------------------------------------------------- > > Key: ANN-389 > URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-389 > Project: Hibernate Annotations > Type: Bug > Components: binder > Versions: 3.2.0.cr1 > Reporter: Christopher G. Stach II > > > Instead of letting the user know that something might get hosed, it creates two join tables, one for each direction. I don't know when this would be the preferred behavior. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Christopher G. S. II (JIRA) <no...@at...> - 2006-07-07 19:46:58
|
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-389?page=comments#action_23575 ] Christopher G. Stach II commented on ANN-389: --------------------------------------------- Okay, that makes complete sense. So, basically, Hibernate is assuming that it has two unidirectional relationships instead of one bidirectional. Thanks. > @ManyToMany without mappedBy should be recognized as an error > ------------------------------------------------------------- > > Key: ANN-389 > URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-389 > Project: Hibernate Annotations > Type: Bug > Components: binder > Versions: 3.2.0.cr1 > Reporter: Christopher G. Stach II > > > Instead of letting the user know that something might get hosed, it creates two join tables, one for each direction. I don't know when this would be the preferred behavior. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |