Package org.hibernate.query.sqm
@Incubating(since="6.2")
package org.hibernate.query.sqm
This package defines a semantic model of HQL queries.
defines an AST representing
SQL. To generate SQL from SQM, we must transform the SQM tree to a
SQL AST tree. This process is described
here, and is handled by a
Semantic Query Model (SQM)
An SQM is a tree representing the semantic interpretation of a query. It's "semantic" in the sense that it contains more information than a simple syntax tree.HQL
HQL is interpreted as an SQM with the help of an ANTRL-generated parser. The classSemanticQueryBuilder
is responsible for visiting the syntax tree produced by the parser and
building an SQM.
Criteria queries
The SQM tree nodes directly implement the JPA criteria query contracts. For example,SqmFrom implements
From.
Our implementation of the JPA
CriteriaBuilder interface is
SqmCriteriaNodeBuilder.
It instantiates SQM nodes and arranges them into SQM tree using the
standard operations for building a JPA criteria query.
Transforming SQM to SQL
The packageinvalid reference
org.hibernate.sql.ast
StandardSqmTranslator
and a SqlAstTranslator.- API Note:
- This entire package is in an incubating state.
-
ClassDescriptionOccurs when the HQL query declares a duplicate identification variable in the
fromclause, or a duplicate result column alias in theselectclause.Enumeration of standard binary arithmetic operatorsDefines the set of basic types which should be accepted by thecast()function on every platform.Enumerates the binary comparison operators.Indicates that a reference to an entity, that is, a given entity name or Java class object, did not resolve to a known mapped entity type.Represents a generic unhandled problem which occurred while translating HQL/JPQL.Occurs when an unexpected condition is encountered while interpreting the output of the HQL parser.Indicates that an element of a path did not resolve to a mapped program element.The SQL set operators.Indicates violations of strict JPQL syntax while strict JPQL syntax checking was enabled.Indicates an attempt to dereference a terminal path (usually a path referring to something of basic type)Indicates a problem with a TREAT usageVariations of thetrim()function.Enumerates the unary prefix operators.Indicates a failure to resolve an entity name in HQL to a known mapped entity type.Indicates a failure to resolve an element of a path expression in HQL/JPQL.