java - hibernate annotations: map a list that keeps order -
i want 1 many mapping keeps order. order complex , related business logic , not have single field or simple logic can represent it.
what want load object, swap 2 elements (or more) in list , save , session.update(object)
. expect next time element loaded maintain right order not.
what doing:
@entity public class product { @id @generatedvalue(strategy=generationtype.auto) private long id; @onetomany(fetch=fetchtype.eager) private list<image> images = new arraylist<image>(); blah blah blah }
@ordercolumn
did trick me
java hibernate hibernate-annotations
No comments:
Post a Comment