[
https://hibernate.onjira.com/browse/HHH-5732?page=com.atlassian.jira.plug...
]
Alexander Kunkel commented on HHH-5732:
---------------------------------------
I tried it with 4.1.0: Hibernate stores only 'null' into the index column.
Class S_List_Person:
{code}
@OneToMany(cascade = CascadeType.ALL, mappedBy="person")
@OrderColumn
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
public S_List_Person getPerson() {
return person;
}
{code}
Table S_LIST_PERSON:
||ID||NAME||
|1|Goofy|
|2|Mickey|
Table S_LIST_TELEFON:
||NUMMER||BEMERKUNK||PERSON_ID||TELEFONNUMMERN_ORDER||
|0123451|mobile|1|null|
|07567|private|1|null|
@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
Attachments: Screen shot 2011-01-10 at 21.41.27.png, TestOrderColumn.zip
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