This annotation specifies the order in which the information is maintained in the collection, when the entity information is acquired.
The applicable targets are method and field.
The following table lists the elements @OrderBy:
Element name | Optional/Required | Element description |
---|
value | Optional | This element is specified when the entities are to be acquired in an order based on the fields or properties other than the primary key. |
The details of attribute for mapping with Cosminexus JPA provider are as follows:
(a) value element
- Type
- String
- Description
- This element is specified when the entities are to be acquired in an order based on the fields or properties other than the primary key. The fields or properties for which the order is to be specified are demarcated by comma (,).
- The order of collection is specified after the fields or properties. The following values can be specified. If the order is not specified, the ascending order is assumed.
- ASC: Ascending order
- DESC: Descending order
- In the fields or properties specified in the value element, specify the column that stores the values for which you can perform the comparative calculation.
- Default value
- Ascending order based on the primary key of the entity class