Package org.openxava.annotations
Annotation Type XOrderBy
-
@Retention(RUNTIME) @Target({FIELD,METHOD}) public @interface XOrderByThe eXtended version of@OrderBy.Applies to collections.
The
@OrderByof JPA does not allow to use qualified properties (properties of references).
OpenXava has its own version of@OrderBy, this@XOrderByto allow it. Example:@OneToMany (mappedBy="invoice", cascade=CascadeType.REMOVE) @ListProperties("product.description, quantity, unitPrice, amount") @XOrderBy("product.description desc") private Collection<InvoiceDetail> details;You can note asproduct.descriptioncan be used for ordering the collection.
In order to use a qualified property, it must be included in the@, as in this case withListPropertiesproduct.description.The order in
@XOrderByhas only effect at visual level, when you access programmatically to the collection, the collection is ordered as indicated by the JPA@OrderByor by its default order.- Author:
- Javier Paniza
-
-
Required Element Summary
Required Elements Modifier and Type Required Element Description java.lang.StringvalueThe order using the syntax of JPA@OrderBybut allowing qualified properties with any level of indirection.
-