- All Superinterfaces:
Prototype.Api
- All Known Implementing Classes:
Order.BuilderBase.OrderImpl
Single rule of the dynamic ordering of the query result.
Order
class is the single item of the List
stored in Sort
.
It represents single ordering rule. E.g. in JPQL query
SELECT t FROM Type t WHERE t.name = :name ORDER BY t.name DESC, t.id
this is the
t.name DESC
and t.id
as two separate Order
instances.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
Fluent API builder forOrder
.static class
Order.BuilderBase<BUILDER extends Order.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends Order> Fluent API builder base forOrder
. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Order.Builder
builder()
Create a new fluent API builder to customize configuration.static Order.Builder
Create a new fluent API builder from an existing instance.boolean
Whether ordering is case-sensitive.static Order
create()
Create a new instance with default values.static Order
Create new instance of order definition with default direction and case-sensitivity.static Order
create
(String property, OrderDirection direction) Create new instance of order definition with default case-sensitivity.static Order
create
(String property, OrderDirection direction, boolean caseSensitive) Create new instance of order definition.Direction of the ordering.property()
Entity property used for ordering.
-
Field Details
-
UNSORTED
Query result ordering with no rules set (unsorted).
-
-
Method Details
-
builder
Create a new fluent API builder to customize configuration.- Returns:
- a new builder
-
builder
Create a new fluent API builder from an existing instance.- Parameters:
instance
- an existing instance used as a base for the builder- Returns:
- a builder based on an instance
-
create
Create a new instance with default values.- Returns:
- a new instance
-
create
Create new instance of order definition with default direction and case-sensitivity. Default direction isOrderDirection.ASC
and default value ofcaseSensitive()
istrue
.- Parameters:
property
- entity property- Returns:
- new order definition instance
-
create
Create new instance of order definition with default case-sensitivity. Default value ofcaseSensitive()
istrue
.- Parameters:
property
- entity propertydirection
- direction of the ordering- Returns:
- new order definition instance
-
create
Create new instance of order definition.- Parameters:
property
- entity propertydirection
- direction of the orderingcaseSensitive
- value oftrue
for case-sensitive orfalse
for case-sensitive ordering- Returns:
- new order definition instance
-
property
String property()Entity property used for ordering.E.g. this is the path expression in Jakarta Persistence API. In following JPQL query:
SELECT t FROM Type t WHERE t.name = :name ORDER BY t.name
the entity property is thet.name
path expression afterORDER
BY keyword.- Returns:
- entity property
-
direction
OrderDirection direction()Direction of the ordering. Default value isOrderDirection.ASC
.- Returns:
- direction of the ordering
-
caseSensitive
boolean caseSensitive()Whether ordering is case-sensitive. Default value istrue
.- Returns:
- value of
true
when ordering is case-sensitive orfalse
otherwise
-