Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming AuthorBookRecord in documentation #9671

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.