Jonne Jyrylä (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5a72dc8...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiYzYwMjEyOWRk...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-17039?atlOrigin=eyJpIjoiYzYwMj...
) HHH-17039 (
https://hibernate.atlassian.net/browse/HHH-17039?atlOrigin=eyJpIjoiYzYwMj...
) Variable name confusion in documentation (
https://hibernate.atlassian.net/browse/HHH-17039?atlOrigin=eyJpIjoiYzYwMj...
)
Issue Type: Bug Assignee: Unassigned Components: documentation Created: 07/Aug/2023 03:02
AM Priority: Minor Reporter: Jonne Jyrylä (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5a72dc8...
)
The documentation at
https://docs.jboss.org/hibernate/orm/6.3/introduction/html_single/Hiberna...
has a code sample that declares the lambda method argument session , but the method body
uses entityManager , which is not declared.
This is the sample code in its entirety:
@Path( "/" ) @Produces( "application/json" )
public class BookResource {
private static final RESULTS_PER_PAGE = 20;
@GET @Path( "books/{titlePattern}/{page:\\d+}" )
public List<Book> findBooks( String titlePattern, int page) {
var books = sessionFactory.fromTransaction(session -> {
return entityManager.createQuery( "from Book where title like ?1 order by
title" , Book.class)
.setParameter(1, titlePattern)
.setPage(Page.page(RESULTS_PER_PAGE, page))
.getResultList();
});
return books.isEmpty() ? Response.status(404).build() : books;
}
}
(
https://hibernate.atlassian.net/browse/HHH-17039#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-17039#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100233- sha1:2faa3a6 )