Hi,
How can I set sort order in case of LAZY collection items instead of defining/hardcoding @OrderBy in annotation class.
I have provided @OrderBy currently as:
--------------------------------------
Code:
@Entity
@Table(name="test")
class Test {
@Column(name="ID")
Integer ID;
@OneToMany(fetch=FetchType.LAZY)
@JoinColumn(name="ID", referencedColumnName="ID")
@OrderBy("ID DESC")
List<AnotherTest> anotherTest;
}
--------------------------------------
In DAO, I am calling as
Code:
Test test = criteria.list().get(0);
test.getAnotherTest()
Thanks