I'm trying to define a list of entities inside another entity, and I want the order of the entities to be stored, so I defined the model like this:
Entity DocumentCategory {
scaffold
String name
String defaultTipo nullable
boolean predefined
- @DocumentCategory parent nullable cascade="persist,merge"
- Set<@DocumentCategory> children
- List<@DocumentTemplate> templates <-> category orderColumn
}
Entity DocumentTemplate {
scaffold
databaseTable="DOCUMENTS_TEMPLATE"
String tipo
longblob content
String name
boolean mergeSource
CDSType cdsType nullable
- @DocumentCategory category <-> templates cascade="persist"
- Set<@CDSIdentity> allowedCDS cascade="all-delete-orphan" inverse
}
I thought that by adding orderColumn a column would be added for storing the index, but the resulting hibernate mapping is the same as before adding orderColumn, is there some other condition I'm missing to enable this feature? I've tried to give the order column an explicit name but I got the same result.
I'm using sculptor 3.1.0 with JPA2/Hibernate4.
Thanks.