I would like to have a collection of child objects (here cat-kitten example) that are ordered. And keep their order on adding of new elements.
@Entity publ
@Entity public class Cat { @OneToMany(mappedBy = "cat", cascade = CascadeType.ALL) private Set kittens = new TreeSet<>(); }
No need to write
@OrderBy("name ASC")
Make Sure Kitten Class implements Comparable interface properly.