Bi-directional relationships with multiple endpoints shouldn't be allowed
-------------------------------------------------------------------------
Key: HHH-3253
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3253
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.6
Reporter: Paul Benedict
I unwittingly had a configuration, in which I mapped a bi-directional association with two
inversed ends.
class StockingShelf {
@OneToOne(mappedBy="shelf")
private Item special;
@OneToMany(mappedBy="shelf")
private List<Item> items;
}
class Item {
@ManyToOne(optional=false)
private Shelf shelf;
}
No errors or warnings were thrown or logged, but I am pretty sure this configuration
should be invalid. All Hibernate books and articles imply that a bi-directional
relationship contains one and only one endpoint for each side of the relationship.
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira