Skip to content

Commit

Permalink
Update Repositories.adoc
Browse files Browse the repository at this point in the history
Renaming AuthorBookRecord to AuthorBookSummary
  • Loading branch information
cunhazera authored Jan 25, 2025
1 parent 3533b77 commit f852d7d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ The JPQL specification provides the `select new` construct for this.

[source,java]
----
@Query("select new AuthorBookRecord(b.isbn, a.ssn, a.name, b.title " +
@Query("select new AuthorBookSummary(b.isbn, a.ssn, a.name, b.title " +
"from Author a join books b " +
"where title like :pattern")
List<AuthorBookSummary> summariesForTitle(@Pattern String pattern);
Expand Down Expand Up @@ -563,4 +563,4 @@ List<Book> books(@By("isbn") String[] ibsns);

Naturally, the name and type of the parameter are still checked at compile time; there's no loss of typesafety here, despite the string.

The `@Param` annotation is significantly less useful, since we can always rename our HQL query parameter to match the method parameter, or, at worst, use an ordinal parameter instead.
The `@Param` annotation is significantly less useful, since we can always rename our HQL query parameter to match the method parameter, or, at worst, use an ordinal parameter instead.

0 comments on commit f852d7d

Please sign in to comment.