[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5390?page=c...
]
Chris Bredesen updated HHH-5390:
--------------------------------
Description:
The manual correctly warns against trying to map an indexed inverse collection on a List.
However, a configuration containing this invalid mapping builds successfully but causes
null values to be inserted for the index column.
Hibernate should be helpful and, if possible, throw a warning to the user (perhaps an
error?) that explains the invalid combination. Here is an example that would run but
produce invalid results:
{code}
@Entity
public class Parent {
@OneToMany(mappedBy="parent")
@OrderColumn(name="order")
private List<Child> children;
}
@Entity
public class Child {
@ManyToOne
private Parent parent;
}
{code}
The above is a typical one to many with the addition of @OrderColumn. Because Child owns
the relationship, the index column is lost/ignored. Hibernate should warn about this.
was:
The manual correctly warns against trying to map an indexed inverse collection on a List.
However, a configuration containing this invalid mapping builds successfully but causes
null values to be inserted for the index column.
Hibernate should be helpful and, if possible, throw a warning to the user (perhaps an
error?) that explains the invalid combination. Here is an example that would run but
produce invalid results:
@Entity
public class Parent {
@OneToMany(mappedBy="parent")
@OrderColumn(name="order")
private List<Child> children;
}
@Entity
public class Child {
@ManyToOne
private Parent parent;
}
The above is a typical one to many with the addition of @OrderColumn. Because Child owns
the relationship, the index column is lost/ignored. Hibernate should warn about this.
Index column on inverse List should throw a warning
---------------------------------------------------
Key: HHH-5390
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5390
Project: Hibernate Core
Issue Type: Improvement
Components: annotations
Affects Versions: 3.5.3
Reporter: Chris Bredesen
The manual correctly warns against trying to map an indexed inverse collection on a List.
However, a configuration containing this invalid mapping builds successfully but causes
null values to be inserted for the index column.
Hibernate should be helpful and, if possible, throw a warning to the user (perhaps an
error?) that explains the invalid combination. Here is an example that would run but
produce invalid results:
{code}
@Entity
public class Parent {
@OneToMany(mappedBy="parent")
@OrderColumn(name="order")
private List<Child> children;
}
@Entity
public class Child {
@ManyToOne
private Parent parent;
}
{code}
The above is a typical one to many with the addition of @OrderColumn. Because Child owns
the relationship, the index column is lost/ignored. Hibernate should warn about this.
--
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