Using hibernate with annotations, i want a one-many relationship to be sorted

Posted by Chris on Stack Overflow See other posts from Stack Overflow or by Chris
Published on 2010-05-25T06:46:49Z Indexed on 2010/05/25 6:51 UTC
Read the original article Hit count: 158

Filed under:
|
|

Using hibernate with annotations, i want a one-many relationship to be sorted by the 'created' field on the 'many' table.

So far i've got this, which always ends up in a random order:

// The notes 
@OneToMany
@JoinColumn(name="task_id")
Set<TaskNote> notes;
public Set<TaskNote> getNotes() {return notes;}
public void setNotes(Set<TaskNote> notes) {this.notes = notes;} 

© Stack Overflow or respective owner

Related posts about java

Related posts about hibernate