Introduction In this article, we are going to how the JPQL DISTINCT keyword behaves depending on the underlying entity query type.
Introduction When executing an entity query (e.g. JPQL, HQL or Criteria API), you can use any SQL function without having to register it as long as the function is passed directly to the WHERE clause of the underlying SQL statement. However, if the SQL function is used in the SELECT clause, and Hibernate has not registered the SQL function (be it a database-specific or user-defined function), you will have to register the function prior to using it in an entity query. In this article, you are going to learn various ways to… Read More
Introduction Every JPQL query must be compiled prior to being executed, and, because this process might be resource intensive, Hibernate provides a QueryPlanCache for this purpose. For entity queries, the query String representation is parsed into an AST (Abstract Syntax Tree). For native queries, the parsing phase cannot compile the query, so it only extracts information about the named parameters and query return type.
Introduction In this article, you are going to find out how to map an immutable entity when using JPA and Hibernate. If your Domain Model requires that a given entity should not be modified by the data access logic, Hibernate can enforce this requirement if the entity is marked with the @Immutable annotation.