List sorting and ordering problem...
So I've resigned myself to not being able to use the order of a List reliably because hibernate reverses it and everyone says don't do it, so I've added a field to my class as position.  I have:

<code>
@Entity
class Procedure {
...
int procedureId;
List<Task> tasks;
...
}

@Entity
class Task {
...
int taskId;
int position;
}
</code>

Now I don't know how to approach interacting with the list.  Should I just sort it by position when I first get it from the db and start working with it, and then I can leave all the user-rearranging code that I've already written and then just reset all the positions on save to the order the list so I can resort when I get back?

SKIP TO ACTUAL QUESTION HERE: 

This seems to be the best approach, but HOW do I sort the List by a property of the Objects in the collection?

Thank you!
Joshua
List sorting and ordering problem...
===

So I've resigned myself to not being able to use the order of a List reliably because hibernate reverses it and everyone says don't do it, so I've added a field to my class as position.  I have:

<code>
@Entity
class Procedure {
...
int procedureId;
List<Task> tasks;
...
}

@Entity
class Task {
...
int taskId;
int position;
}
</code>

Now I don't know how to approach interacting with the list.  Should I just sort it by position when I first get it from the db and start working with it, and then I can leave all the user-rearranging code that I've already written and then just reset all the positions on save to the order the list so I can resort when I get back?

SKIP TO ACTUAL QUESTION HERE: 

This seems to be the best approach, but HOW do I sort the List by a property of the Objects in the collection?

Thank you!
Joshua