[
https://hibernate.onjira.com/browse/HHH-5732?page=com.atlassian.jira.plug...
]
Alexander Kunkel edited comment on HHH-5732 at 3/21/12 11:43 AM:
-----------------------------------------------------------------
I would prefer annotate @OrderColumn at the owning side, but i think this violates the
specification. Currently it also doesn't work.
Class S_List_Person:
{code}
@OneToMany(cascade = CascadeType.ALL, mappedBy="person")
public List<S_List_Telefon> getTelefonNummern() {
if (telefonNummern == null) {
telefonNummern = new ArrayList<S_List_Telefon>();
}
return telefonNummern;
}
{code}
Class S_List_Telefon:
{code}
@ManyToOne
@JoinColumn
@OrderColumn
public S_List_Person getPerson() {
return person;
}
{code}
was (Author: minjaman):
I would better annotate @OrderColumn at the owning side, but i think this violates the
specification. Currently it also doesn't work.
Class S_List_Person:
{code}
@OneToMany(cascade = CascadeType.ALL, mappedBy="person")
public List<S_List_Telefon> getTelefonNummern() {
if (telefonNummern == null) {
telefonNummern = new ArrayList<S_List_Telefon>();
}
return telefonNummern;
}
{code}
Class S_List_Telefon:
{code}
@ManyToOne
@JoinColumn
@OrderColumn
public S_List_Person getPerson() {
return person;
}
{code}
@OrderColumn not updated if @OneToMany has mappedby defined
-----------------------------------------------------------
Key: HHH-5732
URL:
https://hibernate.onjira.com/browse/HHH-5732
Project: Hibernate ORM
Issue Type: Bug
Components: entity-manager
Affects Versions: 3.6.0
Reporter: Jaroslaw Lewandowski
Assignee: Steve Ebersole
Attachments: Screen shot 2011-01-10 at 21.41.27.png, TestOrderColumn.zip
Time Spent: 32m
As I'm not able to reopen HHH-5378 I'm creating a new one. There is nothing said
in JPA2.0 documentation that with @OrderColumn are any limitations regarding of usage
mappedBy attribute on @OneToMany annotation. As I mentioned in the comments of that issue
- even Hibernate documentation
http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html/collections...
uses example which fails when executed with 3.6.0.Final version.
Test case attached.
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira