CHAPTER 11

image

Advanced Queries

At this point, most of you will know enough about queries from what you have learned so far that you will likely not need any of the material from this chapter. In fact, roughly half of this chapter deals with using queries that will couple your application to a target database, so they should be used with some degree of planning and caution in any case.

We will start by going through the JPA support for native SQL queries and show how the results can be mapped to entities, non-entities, or simple data projection results. We will then move on to stored procedure queries and explain how a stored procedure can be invoked ...

Get Pro JPA 2, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.