|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||
@Retention(value=RUNTIME)
@Target(value={FIELD,METHOD})
public @interface XOrderBy
The eXtended version of @OrderBy.
Applies to collections.
The @OrderBy of JPA does not allow to use qualified properties
(properties of references).
OpenXava has its own version of @OrderBy, this @XOrderBy
to 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 as product.description can be used for ordering the collection.@ListProperties,
as in this case with product.description.
The order in @XOrderBy has only effect at visual level, when
you access programmatically to the collection, the collection is ordered as
indicated by the JPA @OrderBy or by its default order.
| Required Element Summary | |
|---|---|
java.lang.String |
value
The order using the syntax of JPA @OrderBy but allowing
qualified properties with any level of indirection. |
| Element Detail |
|---|
public abstract java.lang.String value
@OrderBy but allowing
qualified properties with any level of indirection.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||