+ * public Page fetchUsers() {
+ * return SqlPaginatedQuery
+ * .fromQuery(
+ * this.transactionManagerQuerydsl.selectQuery()
+ * .select(QUser.user)
+ * .from(QUser.user)
+ * )
+ * .withSort(QUser.user.name, Order.DESC)
+ * .fetchPage(1, 10);
+ * }
+ *
+ */
+public class SqlPaginatedQuery {
+
+ private final SQLQuery sqlQuery;
+
+ private SqlPaginatedQuery(SQLQuery sqlQuery) {
+ this.sqlQuery = sqlQuery;
+ }
+
+ public static SqlPaginatedQuery fromQuery(SQLQuery sqlQuery) {
+ return new SqlPaginatedQuery<>(sqlQuery);
+ }
+
+ @Nonnull
+ public
+ * public Page fetchUsers() {
+ * return this.userService.fetchPage(1, 10).map(user -> new UserUpdated(user));
+ * }
+ *
+ */
+ public Page map(@Nonnull Function
+ * public Page fetchUsers() {
+ * return this.userService.fetchSlice(1, 10).map(user -> new UserUpdated(user));
+ * }
+ *
+ */
+ public Slice map(@Nonnull Function