fix broken code example
Signed-off-by: Gavin King <gavin@hibernate.org>
This commit is contained in:
parent
c03076885c
commit
45ca8f24b0
|
@ -533,8 +533,8 @@ Whatever the case, the code which orchestrates a unit of work usually just calls
|
||||||
[source,java]
|
[source,java]
|
||||||
----
|
----
|
||||||
@GET
|
@GET
|
||||||
@Path("books/{titlePattern}")
|
@Path("books/{titlePattern}/{page:\\d+}")
|
||||||
public List<Book> findBooks(String titlePattern) {
|
public List<Book> findBooks(String titlePattern, int page) {
|
||||||
var books = sessionFactory.fromTransaction(session ->
|
var books = sessionFactory.fromTransaction(session ->
|
||||||
Queries.findBooksByTitleWithPagination(session, titlePattern,
|
Queries.findBooksByTitleWithPagination(session, titlePattern,
|
||||||
Page.page(RESULTS_PER_PAGE, page));
|
Page.page(RESULTS_PER_PAGE, page));
|
||||||
|
@ -565,8 +565,8 @@ We can call it just like we called our handwritten version:
|
||||||
[source,java]
|
[source,java]
|
||||||
----
|
----
|
||||||
@GET
|
@GET
|
||||||
@Path("books/{titlePattern}")
|
@Path("books/{titlePattern}/{page:\\d+}")
|
||||||
public List<Book> findBooks(String titlePattern) {
|
public List<Book> findBooks(String titlePattern, int page) {
|
||||||
var books = sessionFactory.fromTransaction(session ->
|
var books = sessionFactory.fromTransaction(session ->
|
||||||
Queries_.findBooksByTitleWithPagination(session, titlePattern,
|
Queries_.findBooksByTitleWithPagination(session, titlePattern,
|
||||||
Page.page(RESULTS_PER_PAGE, page));
|
Page.page(RESULTS_PER_PAGE, page));
|
||||||
|
|
Loading…
Reference in New Issue