Chapter 9. Querying with Criteria and Example
In the previous chapter, you saw how to use Hibernate Query Language (HQL) and Java Persistence Query Language (JPA QL). HQL forces you to interact with the database using SQL-like syntax. You must have some knowledge of SQL to create complex queries, which makes it difficult to develop applications that use multicriteria queries.
With HQL and JPA QL, it's easy to make mistakes with string concatenation and SQL syntax. Sometimes, errors occur due to the simple fact that there is no space between two clauses in SQL. Because these errors are uncovered only at runtime, if you have no unit test, you must go through the long process of build and deployment on an application server to catch them.
Unlike HQL, ...
Get Hibernate Recipes: A Problem-Solution Approach 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.