Is there a Hibernate configuration (hopefully an annotation on a classes mapped @Column field) that would let me sort a collection of entities associated with the loaded entity by a given column of that entity when a session.load(Entity.class, Id) is called?
For example if I had an EntityA that contained a OneToMany association to an EntityB.
@Entity
public class EntityA {
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY)
private Set<EntityB> headlines = new TreeSet<Entity>();
}
I want EntityB to be sorted in the Set that is returned from Hibernate.