fix whitespace in userguide test

This commit is contained in:
Gavin King 2022-11-09 11:44:44 +01:00
parent cd425e3502
commit 90e6a8b698
1 changed files with 7 additions and 7 deletions

View File

@ -376,13 +376,13 @@ public class SQLTest extends BaseEntityManagerFunctionalTestCase {
Session session = entityManager.unwrap(Session.class);
//tag::sql-hibernate-entity-associations-query-many-to-one-join-tuple-transformer-example[]
List<Phone> phones = session.createNativeQuery(
"SELECT {ph.*}, {pr.*} " +
"FROM Phone ph " +
"JOIN Person pr ON ph.person_id = pr.id")
.addEntity("ph", Phone.class)
.addJoin("pr", "ph.person")
.setTupleTransformer( (TupleTransformer<Phone>) (tuple, aliases) -> (Phone) tuple[0] )
.list();
"SELECT {ph.*}, {pr.*} " +
"FROM Phone ph " +
"JOIN Person pr ON ph.person_id = pr.id")
.addEntity("ph", Phone.class)
.addJoin("pr", "ph.person")
.setTupleTransformer( (TupleTransformer<Phone>) (tuple, aliases) -> (Phone) tuple[0] )
.list();
for (Phone person : phones) {
person.getPerson();