I have a class I am not sure how to annotate properly.
My goal for Holder::data:
- List should maintain order not by comparator but by the natural ordering of the elements in the array. (Which can be an ndx column if that is helpful.)
- Holder will have the only reference to data, so Cascade all is probably applicable as well.
I am also open to a different design that removes the map, if that would make for a cleaner design.
@Entity
public class Holder extends DomainObject {
private Map<Enum,List<Element>> data;
}
@Entity
public class Element extends DomainObject {
private long valueId;
private int otherData;
}
@Mappedsuperclass
public class DomainObject {
// provides id
// optimistic locking
// create and update date
}