June 2017
Beginner
1296 pages
69h 23m
English
The next example demonstrates two named queries that were autogenerated when you created the books database’s persistence unit in Section 29.3.5. For discussion purposes we split the program into Figs. 29.2 and 29.3, each showing the corresponding portion of the program’s output. Once again, we use lambdas and streams capabilities to display the results. As you’ll see, we use the relationships between the Authors and Titles entities to display information from both database tables.
NamedQuery to get the list of Authors, then display the Authors with their titles.
1 // Fig. 29.2: DisplayQueryResults.java
2 // Display the results of various queries.
3
4 package com.deitel.jhtp.jpa; ...Read now
Unlock full access