[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4688?page=c...
]
Scott Marlow commented on HHH-4688:
-----------------------------------
Adding @OrderBy to org.hibernate.test.annotations.collectionelement.Boy didn't seem to
work in my testing. Should the following changes have worked?
@ElementCollection
@OrderBy /* THIS IS THE ONLY CHANGE */
@CollectionTable(
name = "BoyFavoriteNumbers",
joinColumns = @JoinColumn(name = "BoyId")
)
@Column(name = "favoriteNumber", nullable = false)
@OrderColumn(name = "nbr_index")
public int[] getFavoriteNumbers() {
return favoriteNumbers;
}
I didn't actually test for the result being ordered, I just visually verified that the
sql is wrong and the returned values (after entity load) are wrong:
select
favoritenu0_.BoyId as BoyId0_,
favoritenu0_.favoriteNumber as favorite2_0_,
favoritenu0_.nbr_index as nbr3_0_
from
BoyFavoriteNumbers favoritenu0_
where
favoritenu0_.BoyId=?
Hibernate:
select
favoritenu0_.BoyId as BoyId0_,
favoritenu0_.favoriteNumber as favorite2_0_,
favoritenu0_.nbr_index as nbr3_0_
from
BoyFavoriteNumbers favoritenu0_
where
favoritenu0_.BoyId=?
Make sure @OrderBy works for @ElementCollection
-----------------------------------------------
Key: HHH-4688
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4688
Project: Hibernate Core
Issue Type: Sub-task
Components: annotations
Reporter: Emmanuel Bernard
Assignee: Scott Marlow
--
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