Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
33 | PointedEar | 1 | //$Id: OrderBy.java 11282 2007-03-14 22:05:59Z epbernard $ |
2 | //EJB3 Specification Copyright 2004-2006 Sun Microsystems, Inc. |
||
3 | package javax.persistence; |
||
4 | |||
5 | import java.lang.annotation.Retention; |
||
6 | import java.lang.annotation.Target; |
||
7 | import static java.lang.annotation.ElementType.*; |
||
8 | import static java.lang.annotation.RetentionPolicy.*; |
||
9 | |||
10 | /** |
||
11 | * This annotation specifies the ordering of the elements of a collection valued association at the |
||
12 | * point when the association is retrieved. |
||
13 | * |
||
14 | * The syntax of the value ordering element is an orderby_list, as follows: |
||
15 | * <code>orderby_list::= orderby_item [,orderby_item]* |
||
16 | * orderby_item::= property_or_field_name [ASC | DESC]</code> |
||
17 | * |
||
18 | * If ASC or DESC is not specified, ASC (ascending order) is assumed. |
||
19 | * |
||
20 | * If the ordering element is not specified, ordering by the primary key of the associated |
||
21 | * entity is assumed. |
||
22 | * |
||
23 | * The property or field name must correspond to that of a persistent property or field of the |
||
24 | * associated class. The properties or fields used in the ordering must correspond to columns |
||
25 | * for which comparison operators are supported. |
||
26 | * |
||
27 | * @author Emmanuel Bernard |
||
28 | */ |
||
29 | @Target({METHOD, FIELD}) @Retention(RUNTIME) |
||
30 | public @interface OrderBy { |
||
31 | /** |
||
32 | * An orderby_list, specified as follows: |
||
33 | * orderby_list::= orderby_item [,orderby_item]* orderby_item::= property_or_field_name [ASC | DESC] |
||
34 | * |
||
35 | * If ASC or DESC is not specified, ASC (ascending order) is assumed. |
||
36 | * |
||
37 | */ |
||
38 | String value() default ""; |
||
39 | } |