14.4. Summary

You're now able to write a wide variety of queries in HQL and JPA QL. You learned in this chapter how to prepare and execute queries, and how to bind parameters. We've shown you restriction, projection, joins, subselects, and many other options that you probably already know from SQL.

Table 14.4 shows a summary you can use to compare native Hibernate features and Java Persistence.

Table 14-4. Hibernate and JPA comparison chart for chapter 14
Hibernate CoreJava Persistence and EJB 3.0
Hibernate APIs support query execution with listing, iteration, and scrolling.Java Persistence standardizes query execution with listing.
Hibernate supports named and positional query bind parameters.Java Persistence standardizes named and positional bind parameter options.
Hibernate query APIs support application-level query hints.Java Persistence allows developers to supply arbitrary vendor-specific (Hibernate) query hints.
HQL supports SQL-like restriction, projection, joins, subselects, and function calls.JPA QL supports SQL-like restriction, projection, joins, subselects, and function calls—subset of HQL.

In the next chapter we focus on more advanced query techniques, such as programmatic generation of complex queries with the Criteria API and embedding of native SQL queries. We'll also talk about the query cache and when you should enable it.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.216.144.165