File tree Expand file tree Collapse file tree 3 files changed +39
-4
lines changed
hibernate-core/src/main/java/org/hibernate/query Expand file tree Collapse file tree 3 files changed +39
-4
lines changed Original file line number Diff line number Diff line change 47
47
* }
48
48
* </pre>
49
49
*
50
+ * @apiNote This class is similar to {@code jakarta.data.page.CursoredPage},
51
+ * and is used by Hibernate Data Repositories to implement
52
+ * Jakarta Data query methods.
53
+ *
50
54
* @since 6.5
51
55
*
52
56
* @see KeyedPage
Original file line number Diff line number Diff line change 20
20
* <p>
21
21
* This is a convenience class which allows query result ordering
22
22
* rules to be passed around the system before being applied to
23
- * a {@link Query} by calling {@link SelectionQuery#setOrder}.
23
+ * a {@link Query} by calling {@link SelectionQuery#setOrder(Order)}.
24
+ * <pre>
25
+ * session.createSelectionQuery("from Book b join b.authors a where a.name = :name", Book.class)
26
+ * .setParameter("name", authorName)
27
+ * .setOrder(asc(Book_.publicationDate))
28
+ * .getResultList();
29
+ * </pre>
30
+ * <p>
31
+ * {@code Order}s may be stacked using {@link List#of} and
32
+ * {@link SelectionQuery#setOrder(List)}.
33
+ * <pre>
34
+ * session.createSelectionQuery("from Book b join b.authors a where a.name = :name", Book.class)
35
+ * .setParameter("name", authorName)
36
+ * .setOrder(List.of(asc(Book_.publicationDate), desc(Book_.ssn)))
37
+ * .getResultList();
38
+ * </pre>
24
39
* <p>
25
40
* A parameter of a {@linkplain org.hibernate.annotations.processing.Find
26
41
* finder method} or {@linkplain org.hibernate.annotations.processing.HQL
30
45
*
31
46
* @param <X> The result type of the query to be sorted
32
47
*
48
+ * @apiNote This class is similar to {@code jakarta.data.Sort}, and is
49
+ * used by Hibernate Data Repositories to implement Jakarta Data
50
+ * query methods.
51
+ *
33
52
* @see SelectionQuery#setOrder(Order)
34
53
* @see SelectionQuery#setOrder(java.util.List)
35
54
*
Original file line number Diff line number Diff line change 10
10
11
11
/**
12
12
* Identifies a page of query results by {@linkplain #size page size}
13
- * and {@linkplain #number page number}.
13
+ * and {@linkplain #number page number}. This is an alternative to the
14
+ * use of the JPA-defined operations {@link SelectionQuery#setFirstResult}
15
+ * and {@link SelectionQuery#setMaxResults}.
16
+ * <pre>
17
+ * session.createSelectionQuery("from Book b join b.authors a where a.name = :name", Book.class)
18
+ * .setParameter("name", authorName)
19
+ * .setPage(Page.first(100))
20
+ * .getResultList();
21
+ * </pre>
14
22
* <p>
15
23
* This is a convenience class which allows a reference to a page of
16
- * results to be passed around the system before being applied to
17
- * a {@link Query} by calling {@link Query#setPage(Page)}.
24
+ * results to be passed around the system before being applied to a
25
+ * {@link Query} by calling {@link Query#setPage(Page)}.
18
26
* <p>
19
27
* A parameter of a {@linkplain org.hibernate.annotations.processing.Find
20
28
* finder method} or {@linkplain org.hibernate.annotations.processing.HQL
23
31
* For key-based pagination, call {@link #keyedBy(Order)} to obtain a
24
32
* {@link KeyedPage}.
25
33
*
34
+ * @apiNote This class is similar to {@code jakarta.data.page.PageRequest},
35
+ * and is used by Hibernate Data Repositories to implement
36
+ * Jakarta Data query methods.
37
+ *
26
38
* @see SelectionQuery#setPage(Page)
27
39
*
28
40
* @since 6.3
You can’t perform that action at this time.
0 commit comments