diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/AltibaseDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/AltibaseDialect.java index 09d6ccbb2877..f1423e5eb9b3 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/AltibaseDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/AltibaseDialect.java @@ -40,7 +40,7 @@ import org.hibernate.internal.util.JdbcExceptionHelper; import org.hibernate.query.sqm.CastType; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.TrimSpec; import org.hibernate.query.sqm.produce.function.FunctionParameterType; import org.hibernate.query.sqm.produce.function.StandardFunctionArgumentTypeResolvers; diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/AltibaseSqlAstTranslator.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/AltibaseSqlAstTranslator.java index 0ab86ef3ef16..5aaf132df138 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/AltibaseSqlAstTranslator.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/AltibaseSqlAstTranslator.java @@ -12,8 +12,8 @@ import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.internal.util.collections.Stack; import org.hibernate.query.sqm.ComparisonOperator; -import org.hibernate.query.sqm.FrameExclusion; -import org.hibernate.query.sqm.FrameKind; +import org.hibernate.query.common.FrameExclusion; +import org.hibernate.query.common.FrameKind; import org.hibernate.sql.ast.Clause; import org.hibernate.sql.ast.SqlAstJoinType; import org.hibernate.sql.ast.spi.AbstractSqlAstTranslator; diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/CUBRIDDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/CUBRIDDialect.java index d73897a57aa6..fcd081d31966 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/CUBRIDDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/CUBRIDDialect.java @@ -26,7 +26,7 @@ import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.query.SemanticException; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.service.ServiceRegistry; import org.hibernate.sql.ast.SqlAstTranslator; import org.hibernate.sql.ast.SqlAstTranslatorFactory; @@ -44,11 +44,11 @@ import jakarta.persistence.TemporalType; -import static org.hibernate.query.sqm.TemporalUnit.HOUR; -import static org.hibernate.query.sqm.TemporalUnit.MINUTE; -import static org.hibernate.query.sqm.TemporalUnit.NANOSECOND; -import static org.hibernate.query.sqm.TemporalUnit.NATIVE; -import static org.hibernate.query.sqm.TemporalUnit.SECOND; +import static org.hibernate.query.common.TemporalUnit.HOUR; +import static org.hibernate.query.common.TemporalUnit.MINUTE; +import static org.hibernate.query.common.TemporalUnit.NANOSECOND; +import static org.hibernate.query.common.TemporalUnit.NATIVE; +import static org.hibernate.query.common.TemporalUnit.SECOND; import static org.hibernate.type.SqlTypes.BINARY; import static org.hibernate.type.SqlTypes.BLOB; import static org.hibernate.type.SqlTypes.BOOLEAN; diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/CacheDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/CacheDialect.java index 49830fe8d8f0..0a0951d52eec 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/CacheDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/CacheDialect.java @@ -42,7 +42,7 @@ import org.hibernate.internal.util.JdbcExceptionHelper; import org.hibernate.persister.entity.EntityPersister; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.sql.ast.SqlAstTranslator; import org.hibernate.sql.ast.SqlAstTranslatorFactory; import org.hibernate.sql.ast.spi.SqlAppender; diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/CockroachLegacyDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/CockroachLegacyDialect.java index eebf2d06edfd..d19d30588483 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/CockroachLegacyDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/CockroachLegacyDialect.java @@ -52,7 +52,7 @@ import org.hibernate.query.SemanticException; import org.hibernate.query.sqm.IntervalType; import org.hibernate.dialect.NullOrdering; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.produce.function.StandardFunctionArgumentTypeResolvers; import org.hibernate.service.ServiceRegistry; import org.hibernate.sql.ast.SqlAstTranslator; @@ -80,9 +80,9 @@ import jakarta.persistence.TemporalType; import static org.hibernate.exception.spi.TemplatedViolatedConstraintNameExtractor.extractUsingTemplate; -import static org.hibernate.query.sqm.TemporalUnit.DAY; -import static org.hibernate.query.sqm.TemporalUnit.EPOCH; -import static org.hibernate.query.sqm.TemporalUnit.NATIVE; +import static org.hibernate.query.common.TemporalUnit.DAY; +import static org.hibernate.query.common.TemporalUnit.EPOCH; +import static org.hibernate.query.common.TemporalUnit.NATIVE; import static org.hibernate.type.SqlTypes.ARRAY; import static org.hibernate.type.SqlTypes.BINARY; import static org.hibernate.type.SqlTypes.BLOB; diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DB2LegacyDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DB2LegacyDialect.java index 08b45c6e1546..8fab3e7d873e 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DB2LegacyDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DB2LegacyDialect.java @@ -71,7 +71,7 @@ import org.hibernate.procedure.internal.DB2CallableStatementSupport; import org.hibernate.procedure.spi.CallableStatementSupport; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.mutation.internal.cte.CteInsertStrategy; import org.hibernate.query.sqm.mutation.internal.cte.CteMutationStrategy; import org.hibernate.query.sqm.mutation.spi.SqmMultiTableInsertStrategy; diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DB2LegacySqlAstTranslator.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DB2LegacySqlAstTranslator.java index 7f516f7e69db..55272c210e2a 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DB2LegacySqlAstTranslator.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DB2LegacySqlAstTranslator.java @@ -15,7 +15,7 @@ import org.hibernate.metamodel.mapping.JdbcMappingContainer; import org.hibernate.query.IllegalQueryOperationException; import org.hibernate.query.sqm.ComparisonOperator; -import org.hibernate.query.sqm.FetchClauseType; +import org.hibernate.query.common.FetchClauseType; import org.hibernate.sql.ast.Clause; import org.hibernate.sql.ast.SqlAstNodeRenderingMode; import org.hibernate.sql.ast.spi.AbstractSqlAstTranslator; diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DB2zLegacyDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DB2zLegacyDialect.java index 6e8315dc0899..5bce6d11a907 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DB2zLegacyDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DB2zLegacyDialect.java @@ -26,7 +26,7 @@ import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.mapping.Column; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.sql.ast.SqlAstTranslator; import org.hibernate.sql.ast.SqlAstTranslatorFactory; import org.hibernate.sql.ast.spi.StandardSqlAstTranslatorFactory; diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DerbyDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DerbyDialect.java index 6f11ecd58a44..7754b37d1b89 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DerbyDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DerbyDialect.java @@ -52,8 +52,8 @@ import org.hibernate.metamodel.spi.RuntimeModelCreationContext; import org.hibernate.query.sqm.CastType; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; -import org.hibernate.query.sqm.mutation.internal.temptable.BeforeUseAction; +import org.hibernate.query.common.TemporalUnit; +import org.hibernate.query.sqm.mutation.spi.BeforeUseAction; import org.hibernate.query.sqm.mutation.internal.temptable.GlobalTemporaryTableMutationStrategy; import org.hibernate.query.sqm.mutation.internal.temptable.LocalTemporaryTableInsertStrategy; import org.hibernate.query.sqm.mutation.internal.temptable.LocalTemporaryTableMutationStrategy; diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DerbyLegacyDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DerbyLegacyDialect.java index 3dadf47cfc25..9a0ecf1cfeeb 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DerbyLegacyDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DerbyLegacyDialect.java @@ -50,8 +50,8 @@ import org.hibernate.metamodel.spi.RuntimeModelCreationContext; import org.hibernate.query.sqm.CastType; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; -import org.hibernate.query.sqm.mutation.internal.temptable.BeforeUseAction; +import org.hibernate.query.common.TemporalUnit; +import org.hibernate.query.sqm.mutation.spi.BeforeUseAction; import org.hibernate.query.sqm.mutation.internal.temptable.GlobalTemporaryTableMutationStrategy; import org.hibernate.query.sqm.mutation.internal.temptable.LocalTemporaryTableInsertStrategy; import org.hibernate.query.sqm.mutation.internal.temptable.LocalTemporaryTableMutationStrategy; diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/FirebirdDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/FirebirdDialect.java index 6f47f288fa0e..a545ba360d47 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/FirebirdDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/FirebirdDialect.java @@ -59,10 +59,10 @@ import org.hibernate.metamodel.mapping.EntityMappingType; import org.hibernate.metamodel.spi.RuntimeModelCreationContext; import org.hibernate.query.sqm.CastType; -import org.hibernate.query.sqm.FetchClauseType; +import org.hibernate.query.common.FetchClauseType; import org.hibernate.query.sqm.IntervalType; import org.hibernate.dialect.NullOrdering; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.function.SqmFunctionRegistry; import org.hibernate.query.sqm.mutation.internal.temptable.GlobalTemporaryTableInsertStrategy; import org.hibernate.query.sqm.mutation.internal.temptable.GlobalTemporaryTableMutationStrategy; diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/H2LegacyDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/H2LegacyDialect.java index 932f4ccf628e..74d07e5270f3 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/H2LegacyDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/H2LegacyDialect.java @@ -49,11 +49,11 @@ import org.hibernate.internal.util.StringHelper; import org.hibernate.metamodel.mapping.EntityMappingType; import org.hibernate.metamodel.spi.RuntimeModelCreationContext; -import org.hibernate.query.sqm.FetchClauseType; +import org.hibernate.query.common.FetchClauseType; import org.hibernate.query.sqm.IntervalType; import org.hibernate.dialect.NullOrdering; -import org.hibernate.query.sqm.TemporalUnit; -import org.hibernate.query.sqm.mutation.internal.temptable.BeforeUseAction; +import org.hibernate.query.common.TemporalUnit; +import org.hibernate.query.sqm.mutation.spi.BeforeUseAction; import org.hibernate.query.sqm.mutation.internal.temptable.LocalTemporaryTableInsertStrategy; import org.hibernate.query.sqm.mutation.internal.temptable.LocalTemporaryTableMutationStrategy; import org.hibernate.query.sqm.mutation.spi.SqmMultiTableInsertStrategy; @@ -87,7 +87,7 @@ import jakarta.persistence.TemporalType; -import static org.hibernate.query.sqm.TemporalUnit.SECOND; +import static org.hibernate.query.common.TemporalUnit.SECOND; import static org.hibernate.type.SqlTypes.ARRAY; import static org.hibernate.type.SqlTypes.BIGINT; import static org.hibernate.type.SqlTypes.BINARY; diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/HSQLLegacyDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/HSQLLegacyDialect.java index 2446f29dd462..eb4190b28eaf 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/HSQLLegacyDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/HSQLLegacyDialect.java @@ -56,9 +56,9 @@ import org.hibernate.query.sqm.CastType; import org.hibernate.query.sqm.IntervalType; import org.hibernate.dialect.NullOrdering; -import org.hibernate.query.sqm.TemporalUnit; -import org.hibernate.query.sqm.mutation.internal.temptable.AfterUseAction; -import org.hibernate.query.sqm.mutation.internal.temptable.BeforeUseAction; +import org.hibernate.query.common.TemporalUnit; +import org.hibernate.query.sqm.mutation.spi.AfterUseAction; +import org.hibernate.query.sqm.mutation.spi.BeforeUseAction; import org.hibernate.query.sqm.mutation.internal.temptable.GlobalTemporaryTableInsertStrategy; import org.hibernate.query.sqm.mutation.internal.temptable.GlobalTemporaryTableMutationStrategy; import org.hibernate.query.sqm.mutation.internal.temptable.LocalTemporaryTableInsertStrategy; diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/InformixDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/InformixDialect.java index 8e59fd9b03e1..167003eb4ad7 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/InformixDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/InformixDialect.java @@ -51,10 +51,10 @@ import org.hibernate.metamodel.spi.RuntimeModelCreationContext; import org.hibernate.query.spi.QueryOptions; import org.hibernate.query.spi.QueryParameterBindings; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.internal.DomainParameterXref; -import org.hibernate.query.sqm.mutation.internal.temptable.AfterUseAction; -import org.hibernate.query.sqm.mutation.internal.temptable.BeforeUseAction; +import org.hibernate.query.sqm.mutation.spi.AfterUseAction; +import org.hibernate.query.sqm.mutation.spi.BeforeUseAction; import org.hibernate.query.sqm.mutation.internal.temptable.LocalTemporaryTableInsertStrategy; import org.hibernate.query.sqm.mutation.internal.temptable.LocalTemporaryTableMutationStrategy; import org.hibernate.query.sqm.mutation.spi.SqmMultiTableInsertStrategy; diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/IngresDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/IngresDialect.java index d7c6ad8145d6..9a1b8c635de6 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/IngresDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/IngresDialect.java @@ -32,9 +32,9 @@ import org.hibernate.metamodel.spi.RuntimeModelCreationContext; import org.hibernate.query.spi.QueryOptions; import org.hibernate.query.spi.QueryParameterBindings; -import org.hibernate.query.sqm.FetchClauseType; +import org.hibernate.query.common.FetchClauseType; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.internal.DomainParameterXref; import org.hibernate.query.sqm.mutation.internal.temptable.GlobalTemporaryTableInsertStrategy; import org.hibernate.query.sqm.mutation.internal.temptable.GlobalTemporaryTableMutationStrategy; diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/MaxDBDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/MaxDBDialect.java index e527bd5baafa..13300fb7548d 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/MaxDBDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/MaxDBDialect.java @@ -17,7 +17,6 @@ import org.hibernate.dialect.function.CommonFunctionFactory; import org.hibernate.dialect.pagination.LimitHandler; import org.hibernate.dialect.pagination.LimitLimitHandler; -import org.hibernate.dialect.pagination.LimitOffsetLimitHandler; import org.hibernate.dialect.sequence.SequenceSupport; import org.hibernate.dialect.temptable.TemporaryTable; import org.hibernate.dialect.temptable.TemporaryTableKind; @@ -26,8 +25,8 @@ import org.hibernate.metamodel.mapping.EntityMappingType; import org.hibernate.metamodel.spi.RuntimeModelCreationContext; import org.hibernate.query.sqm.TrimSpec; -import org.hibernate.query.sqm.mutation.internal.temptable.AfterUseAction; -import org.hibernate.query.sqm.mutation.internal.temptable.BeforeUseAction; +import org.hibernate.query.sqm.mutation.spi.AfterUseAction; +import org.hibernate.query.sqm.mutation.spi.BeforeUseAction; import org.hibernate.query.sqm.mutation.internal.temptable.LocalTemporaryTableInsertStrategy; import org.hibernate.query.sqm.mutation.internal.temptable.LocalTemporaryTableMutationStrategy; import org.hibernate.query.sqm.mutation.spi.SqmMultiTableInsertStrategy; diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/MimerSQLDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/MimerSQLDialect.java index 3da7ba4005a5..5cecd6ef399e 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/MimerSQLDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/MimerSQLDialect.java @@ -22,7 +22,7 @@ import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.query.SemanticException; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.service.ServiceRegistry; import org.hibernate.sql.ast.SqlAstTranslator; import org.hibernate.sql.ast.SqlAstTranslatorFactory; @@ -42,7 +42,6 @@ import static org.hibernate.type.SqlTypes.CHAR; import static org.hibernate.type.SqlTypes.CLOB; import static org.hibernate.type.SqlTypes.LONG32NVARCHAR; -import static org.hibernate.type.SqlTypes.LONG32VARBINARY; import static org.hibernate.type.SqlTypes.LONG32VARCHAR; import static org.hibernate.type.SqlTypes.NCHAR; import static org.hibernate.type.SqlTypes.NCLOB; diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/MySQLLegacyDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/MySQLLegacyDialect.java index 80d960de4d4f..f219dc5436a1 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/MySQLLegacyDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/MySQLLegacyDialect.java @@ -48,10 +48,10 @@ import org.hibernate.query.sqm.CastType; import org.hibernate.query.sqm.IntervalType; import org.hibernate.dialect.NullOrdering; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.function.SqmFunctionRegistry; -import org.hibernate.query.sqm.mutation.internal.temptable.AfterUseAction; -import org.hibernate.query.sqm.mutation.internal.temptable.BeforeUseAction; +import org.hibernate.query.sqm.mutation.spi.AfterUseAction; +import org.hibernate.query.sqm.mutation.spi.BeforeUseAction; import org.hibernate.query.sqm.mutation.internal.temptable.LocalTemporaryTableInsertStrategy; import org.hibernate.query.sqm.mutation.internal.temptable.LocalTemporaryTableMutationStrategy; import org.hibernate.query.sqm.mutation.spi.SqmMultiTableInsertStrategy; diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/OracleLegacyDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/OracleLegacyDialect.java index a85f18f43542..7451e91cea39 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/OracleLegacyDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/OracleLegacyDialect.java @@ -77,9 +77,9 @@ import org.hibernate.query.SemanticException; import org.hibernate.query.spi.QueryOptions; import org.hibernate.query.sqm.CastType; -import org.hibernate.query.sqm.FetchClauseType; +import org.hibernate.query.common.FetchClauseType; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.mutation.internal.temptable.GlobalTemporaryTableInsertStrategy; import org.hibernate.query.sqm.mutation.internal.temptable.GlobalTemporaryTableMutationStrategy; import org.hibernate.query.sqm.mutation.spi.SqmMultiTableInsertStrategy; @@ -118,12 +118,12 @@ import static java.util.regex.Pattern.CASE_INSENSITIVE; import static org.hibernate.exception.spi.TemplatedViolatedConstraintNameExtractor.extractUsingTemplate; -import static org.hibernate.query.sqm.TemporalUnit.DAY; -import static org.hibernate.query.sqm.TemporalUnit.HOUR; -import static org.hibernate.query.sqm.TemporalUnit.MINUTE; -import static org.hibernate.query.sqm.TemporalUnit.MONTH; -import static org.hibernate.query.sqm.TemporalUnit.SECOND; -import static org.hibernate.query.sqm.TemporalUnit.YEAR; +import static org.hibernate.query.common.TemporalUnit.DAY; +import static org.hibernate.query.common.TemporalUnit.HOUR; +import static org.hibernate.query.common.TemporalUnit.MINUTE; +import static org.hibernate.query.common.TemporalUnit.MONTH; +import static org.hibernate.query.common.TemporalUnit.SECOND; +import static org.hibernate.query.common.TemporalUnit.YEAR; import static org.hibernate.type.SqlTypes.ARRAY; import static org.hibernate.type.SqlTypes.BIGINT; import static org.hibernate.type.SqlTypes.BINARY; diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/OracleLegacySqlAstTranslator.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/OracleLegacySqlAstTranslator.java index 1b8af5cc5d6c..1af36ef10722 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/OracleLegacySqlAstTranslator.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/OracleLegacySqlAstTranslator.java @@ -18,9 +18,9 @@ import org.hibernate.metamodel.mapping.JdbcMappingContainer; import org.hibernate.query.IllegalQueryOperationException; import org.hibernate.query.sqm.ComparisonOperator; -import org.hibernate.query.sqm.FetchClauseType; -import org.hibernate.query.sqm.FrameExclusion; -import org.hibernate.query.sqm.FrameKind; +import org.hibernate.query.common.FetchClauseType; +import org.hibernate.query.common.FrameExclusion; +import org.hibernate.query.common.FrameKind; import org.hibernate.sql.ast.Clause; import org.hibernate.sql.ast.spi.AbstractSqlAstTranslator; import org.hibernate.sql.ast.spi.SqlSelection; diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQLLegacyDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQLLegacyDialect.java index 219079710bcf..7a2413e9a7f3 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQLLegacyDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQLLegacyDialect.java @@ -60,9 +60,9 @@ import org.hibernate.procedure.spi.CallableStatementSupport; import org.hibernate.query.SemanticException; import org.hibernate.query.spi.QueryOptions; -import org.hibernate.query.sqm.FetchClauseType; +import org.hibernate.query.common.FetchClauseType; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.mutation.internal.cte.CteInsertStrategy; import org.hibernate.query.sqm.mutation.internal.cte.CteMutationStrategy; import org.hibernate.query.sqm.mutation.spi.SqmMultiTableInsertStrategy; @@ -97,8 +97,8 @@ import jakarta.persistence.TemporalType; import static org.hibernate.exception.spi.TemplatedViolatedConstraintNameExtractor.extractUsingTemplate; -import static org.hibernate.query.sqm.TemporalUnit.DAY; -import static org.hibernate.query.sqm.TemporalUnit.EPOCH; +import static org.hibernate.query.common.TemporalUnit.DAY; +import static org.hibernate.query.common.TemporalUnit.EPOCH; import static org.hibernate.type.SqlTypes.ARRAY; import static org.hibernate.type.SqlTypes.BINARY; import static org.hibernate.type.SqlTypes.BLOB; diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQLLegacySqlAstTranslator.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQLLegacySqlAstTranslator.java index 4dae9260dac3..eb07b9745354 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQLLegacySqlAstTranslator.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgreSQLLegacySqlAstTranslator.java @@ -9,7 +9,7 @@ import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.metamodel.mapping.JdbcMappingContainer; import org.hibernate.query.sqm.ComparisonOperator; -import org.hibernate.query.sqm.FetchClauseType; +import org.hibernate.query.common.FetchClauseType; import org.hibernate.sql.ast.Clause; import org.hibernate.sql.ast.spi.AbstractSqlAstTranslator; import org.hibernate.sql.ast.tree.Statement; diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgresPlusLegacyDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgresPlusLegacyDialect.java index cffaa287db96..228de08ff9fe 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgresPlusLegacyDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/PostgresPlusLegacyDialect.java @@ -13,12 +13,11 @@ import org.hibernate.boot.model.FunctionContributions; import org.hibernate.dialect.DatabaseVersion; -import org.hibernate.dialect.PostgreSQLSqlAstTranslator; import org.hibernate.dialect.function.CommonFunctionFactory; import org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo; import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.query.sqm.CastType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.produce.function.StandardFunctionArgumentTypeResolvers; import org.hibernate.sql.ast.SqlAstTranslator; import org.hibernate.sql.ast.SqlAstTranslatorFactory; diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/RDMSOS2200Dialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/RDMSOS2200Dialect.java index a53cc04e1a00..bff30b98033c 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/RDMSOS2200Dialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/RDMSOS2200Dialect.java @@ -34,7 +34,7 @@ import org.hibernate.internal.CoreMessageLogger; import org.hibernate.persister.entity.EntityPersister; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.TrimSpec; import org.hibernate.sql.ast.SqlAstTranslator; import org.hibernate.sql.ast.SqlAstTranslatorFactory; diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/RDMSOS2200SqlAstTranslator.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/RDMSOS2200SqlAstTranslator.java index 9a1f97109d78..f8caf0956d81 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/RDMSOS2200SqlAstTranslator.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/RDMSOS2200SqlAstTranslator.java @@ -10,7 +10,7 @@ import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.query.sqm.ComparisonOperator; -import org.hibernate.query.sqm.FetchClauseType; +import org.hibernate.query.common.FetchClauseType; import org.hibernate.sql.ast.spi.AbstractSqlAstTranslator; import org.hibernate.sql.ast.spi.SqlSelection; import org.hibernate.sql.ast.tree.Statement; diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SQLServerLegacyDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SQLServerLegacyDialect.java index 924247be2641..c8d0e1e2d641 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SQLServerLegacyDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SQLServerLegacyDialect.java @@ -53,9 +53,9 @@ import org.hibernate.mapping.CheckConstraint; import org.hibernate.mapping.Column; import org.hibernate.query.sqm.CastType; -import org.hibernate.query.sqm.FetchClauseType; +import org.hibernate.query.common.FetchClauseType; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.TrimSpec; import org.hibernate.service.ServiceRegistry; import org.hibernate.sql.ast.SqlAstNodeRenderingMode; @@ -94,7 +94,7 @@ import jakarta.persistence.TemporalType; import static org.hibernate.exception.spi.TemplatedViolatedConstraintNameExtractor.extractUsingTemplate; -import static org.hibernate.query.sqm.TemporalUnit.NANOSECOND; +import static org.hibernate.query.common.TemporalUnit.NANOSECOND; import static org.hibernate.query.sqm.produce.function.FunctionParameterType.INTEGER; import static org.hibernate.type.SqlTypes.*; import static org.hibernate.type.descriptor.DateTimeUtils.appendAsDate; diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SQLServerLegacySqlAstTranslator.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SQLServerLegacySqlAstTranslator.java index 2b744a2b84f6..0a30f9fe0352 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SQLServerLegacySqlAstTranslator.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SQLServerLegacySqlAstTranslator.java @@ -16,16 +16,14 @@ import org.hibernate.metamodel.mapping.JdbcMappingContainer; import org.hibernate.query.IllegalQueryOperationException; import org.hibernate.query.sqm.ComparisonOperator; -import org.hibernate.query.sqm.FetchClauseType; +import org.hibernate.query.common.FetchClauseType; import org.hibernate.sql.ast.Clause; import org.hibernate.sql.ast.SqlAstJoinType; import org.hibernate.sql.ast.spi.AbstractSqlAstTranslator; import org.hibernate.sql.ast.spi.SqlSelection; -import org.hibernate.sql.ast.tree.MutationStatement; import org.hibernate.sql.ast.tree.Statement; import org.hibernate.sql.ast.tree.delete.DeleteStatement; import org.hibernate.sql.ast.tree.expression.BinaryArithmeticExpression; -import org.hibernate.sql.ast.tree.expression.ColumnReference; import org.hibernate.sql.ast.tree.expression.Expression; import org.hibernate.sql.ast.tree.expression.Literal; import org.hibernate.sql.ast.tree.expression.SqlTuple; diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SQLiteDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SQLiteDialect.java index 96139da3a493..84bc0774ed34 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SQLiteDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SQLiteDialect.java @@ -42,7 +42,7 @@ import org.hibernate.query.SemanticException; import org.hibernate.query.sqm.IntervalType; import org.hibernate.dialect.NullOrdering; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.TrimSpec; import org.hibernate.query.sqm.produce.function.StandardFunctionReturnTypeResolvers; import org.hibernate.service.ServiceRegistry; @@ -64,11 +64,11 @@ import jakarta.persistence.TemporalType; import static org.hibernate.exception.spi.TemplatedViolatedConstraintNameExtractor.extractUsingTemplate; -import static org.hibernate.query.sqm.TemporalUnit.DAY; -import static org.hibernate.query.sqm.TemporalUnit.EPOCH; -import static org.hibernate.query.sqm.TemporalUnit.MONTH; -import static org.hibernate.query.sqm.TemporalUnit.QUARTER; -import static org.hibernate.query.sqm.TemporalUnit.YEAR; +import static org.hibernate.query.common.TemporalUnit.DAY; +import static org.hibernate.query.common.TemporalUnit.EPOCH; +import static org.hibernate.query.common.TemporalUnit.MONTH; +import static org.hibernate.query.common.TemporalUnit.QUARTER; +import static org.hibernate.query.common.TemporalUnit.YEAR; import static org.hibernate.query.sqm.produce.function.FunctionParameterType.INTEGER; import static org.hibernate.query.sqm.produce.function.FunctionParameterType.NUMERIC; import static org.hibernate.query.sqm.produce.function.FunctionParameterType.STRING; diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SingleStoreDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SingleStoreDialect.java index 94a3b544ba58..836ed65387f6 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SingleStoreDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SingleStoreDialect.java @@ -69,10 +69,10 @@ import org.hibernate.metamodel.spi.RuntimeModelCreationContext; import org.hibernate.query.sqm.CastType; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.function.SqmFunctionRegistry; -import org.hibernate.query.sqm.mutation.internal.temptable.AfterUseAction; -import org.hibernate.query.sqm.mutation.internal.temptable.BeforeUseAction; +import org.hibernate.query.sqm.mutation.spi.AfterUseAction; +import org.hibernate.query.sqm.mutation.spi.BeforeUseAction; import org.hibernate.query.sqm.mutation.internal.temptable.LocalTemporaryTableInsertStrategy; import org.hibernate.query.sqm.mutation.internal.temptable.LocalTemporaryTableMutationStrategy; import org.hibernate.query.sqm.mutation.spi.SqmMultiTableInsertStrategy; diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SybaseASELegacyDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SybaseASELegacyDialect.java index 230b6d4f1e6a..d4a5549aeb86 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SybaseASELegacyDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SybaseASELegacyDialect.java @@ -30,7 +30,7 @@ import org.hibernate.exception.spi.ViolatedConstraintNameExtractor; import org.hibernate.internal.util.JdbcExceptionHelper; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.service.ServiceRegistry; import org.hibernate.sql.ast.SqlAstTranslator; import org.hibernate.sql.ast.SqlAstTranslatorFactory; diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SybaseLegacyDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SybaseLegacyDialect.java index 1ee36ad947c4..95e1880238ee 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SybaseLegacyDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SybaseLegacyDialect.java @@ -42,8 +42,7 @@ import org.hibernate.query.spi.QueryParameterBindings; import org.hibernate.query.sqm.CastType; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; -import org.hibernate.query.sqm.TrimSpec; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.internal.DomainParameterXref; import org.hibernate.query.sqm.sql.SqmTranslator; import org.hibernate.query.sqm.sql.SqmTranslatorFactory; diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/TeradataDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/TeradataDialect.java index 5d9d2a7cb35c..a1243503b5c6 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/TeradataDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/TeradataDialect.java @@ -38,7 +38,7 @@ import org.hibernate.metamodel.spi.RuntimeModelCreationContext; import org.hibernate.query.spi.QueryOptions; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.mutation.internal.temptable.GlobalTemporaryTableInsertStrategy; import org.hibernate.query.sqm.mutation.internal.temptable.GlobalTemporaryTableMutationStrategy; import org.hibernate.query.sqm.mutation.spi.SqmMultiTableInsertStrategy; diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/TimesTenDialect.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/TimesTenDialect.java index dd2beca9aae2..124763dc2911 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/TimesTenDialect.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/TimesTenDialect.java @@ -35,7 +35,7 @@ import org.hibernate.metamodel.spi.RuntimeModelCreationContext; import org.hibernate.persister.entity.EntityPersister; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.mutation.internal.temptable.GlobalTemporaryTableInsertStrategy; import org.hibernate.query.sqm.mutation.internal.temptable.GlobalTemporaryTableMutationStrategy; import org.hibernate.query.sqm.mutation.spi.SqmMultiTableInsertStrategy; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/AbstractTransactSQLDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/AbstractTransactSQLDialect.java index 43fa656d78da..48869a5c1356 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/AbstractTransactSQLDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/AbstractTransactSQLDialect.java @@ -19,9 +19,9 @@ import org.hibernate.metamodel.mapping.EntityMappingType; import org.hibernate.metamodel.spi.RuntimeModelCreationContext; import org.hibernate.query.sqm.TrimSpec; -import org.hibernate.query.sqm.mutation.internal.temptable.AfterUseAction; +import org.hibernate.query.sqm.mutation.spi.AfterUseAction; import org.hibernate.dialect.temptable.TemporaryTable; -import org.hibernate.query.sqm.mutation.internal.temptable.BeforeUseAction; +import org.hibernate.query.sqm.mutation.spi.BeforeUseAction; import org.hibernate.query.sqm.mutation.internal.temptable.LocalTemporaryTableInsertStrategy; import org.hibernate.query.sqm.mutation.internal.temptable.LocalTemporaryTableMutationStrategy; import org.hibernate.dialect.temptable.TemporaryTableKind; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/CockroachDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/CockroachDialect.java index a0ad847f27bc..4853d0c93d7f 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/CockroachDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/CockroachDialect.java @@ -52,7 +52,7 @@ import org.hibernate.internal.util.config.ConfigurationHelper; import org.hibernate.query.SemanticException; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.produce.function.StandardFunctionArgumentTypeResolvers; import org.hibernate.service.ServiceRegistry; import org.hibernate.sql.ast.SqlAstTranslator; @@ -82,9 +82,9 @@ import static org.hibernate.cfg.DialectSpecificSettings.COCKROACH_VERSION_STRING; import static org.hibernate.exception.spi.TemplatedViolatedConstraintNameExtractor.extractUsingTemplate; -import static org.hibernate.query.sqm.TemporalUnit.DAY; -import static org.hibernate.query.sqm.TemporalUnit.EPOCH; -import static org.hibernate.query.sqm.TemporalUnit.NATIVE; +import static org.hibernate.query.common.TemporalUnit.DAY; +import static org.hibernate.query.common.TemporalUnit.EPOCH; +import static org.hibernate.query.common.TemporalUnit.NATIVE; import static org.hibernate.type.SqlTypes.ARRAY; import static org.hibernate.type.SqlTypes.BINARY; import static org.hibernate.type.SqlTypes.BLOB; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/DB2Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/DB2Dialect.java index 755a7c58b0ef..5873ce0ed69a 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/DB2Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/DB2Dialect.java @@ -62,7 +62,7 @@ import org.hibernate.procedure.internal.DB2CallableStatementSupport; import org.hibernate.procedure.spi.CallableStatementSupport; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.mutation.internal.cte.CteInsertStrategy; import org.hibernate.query.sqm.mutation.internal.cte.CteMutationStrategy; import org.hibernate.query.sqm.mutation.spi.SqmMultiTableInsertStrategy; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/DB2SqlAstTranslator.java b/hibernate-core/src/main/java/org/hibernate/dialect/DB2SqlAstTranslator.java index 7612266186d4..8eef6a88d63a 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/DB2SqlAstTranslator.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/DB2SqlAstTranslator.java @@ -14,7 +14,7 @@ import org.hibernate.metamodel.mapping.JdbcMappingContainer; import org.hibernate.query.IllegalQueryOperationException; import org.hibernate.query.sqm.ComparisonOperator; -import org.hibernate.query.sqm.FetchClauseType; +import org.hibernate.query.common.FetchClauseType; import org.hibernate.sql.ast.Clause; import org.hibernate.sql.ast.SqlAstNodeRenderingMode; import org.hibernate.sql.ast.spi.AbstractSqlAstTranslator; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/DB2zDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/DB2zDialect.java index 3726cc5a9492..28bf94b590b7 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/DB2zDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/DB2zDialect.java @@ -19,7 +19,7 @@ import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.mapping.Column; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.sql.ast.SqlAstTranslator; import org.hibernate.sql.ast.SqlAstTranslatorFactory; import org.hibernate.sql.ast.spi.StandardSqlAstTranslatorFactory; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java index 8501da22141d..d6d2487a209e 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java @@ -124,17 +124,17 @@ import org.hibernate.procedure.internal.StandardCallableStatementSupport; import org.hibernate.procedure.spi.CallableStatementSupport; import org.hibernate.query.Query; +import org.hibernate.query.common.FetchClauseType; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.hql.HqlTranslator; import org.hibernate.query.spi.QueryOptions; import org.hibernate.query.sqm.CastType; -import org.hibernate.query.sqm.FetchClauseType; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; import org.hibernate.query.sqm.TrimSpec; -import org.hibernate.query.sqm.mutation.internal.temptable.AfterUseAction; -import org.hibernate.query.sqm.mutation.internal.temptable.BeforeUseAction; import org.hibernate.query.sqm.mutation.internal.temptable.PersistentTableInsertStrategy; import org.hibernate.query.sqm.mutation.internal.temptable.PersistentTableMutationStrategy; +import org.hibernate.query.sqm.mutation.spi.AfterUseAction; +import org.hibernate.query.sqm.mutation.spi.BeforeUseAction; import org.hibernate.query.sqm.mutation.spi.SqmMultiTableInsertStrategy; import org.hibernate.query.sqm.mutation.spi.SqmMultiTableMutationStrategy; import org.hibernate.query.sqm.mutation.spi.SqmMultiTableMutationStrategyProvider; @@ -651,11 +651,9 @@ protected String castType(int sqlTypeCode) { * @see AnsiSqlKeywords */ protected void registerDefaultKeywords() { - AnsiSqlKeywords keywords = new AnsiSqlKeywords(); - //Not using #registerKeyword as: - // # these are already lowercase - // # better efficiency of addAll as it can pre-size the collections - sqlKeywords.addAll( keywords.sql2003() ); + // Not using #registerKeyword() since these are already lowercase, + // better efficiency with addAll() as it can pre-size the collection + sqlKeywords.addAll( new AnsiSqlKeywords().sql2003() ); } /** @@ -692,13 +690,10 @@ protected DatabaseVersion getMinimumSupportedVersion() { */ protected Integer resolveSqlTypeCode(String columnTypeName, TypeConfiguration typeConfiguration) { final int parenthesisIndex = columnTypeName.lastIndexOf( '(' ); - final String baseTypeName; - if ( parenthesisIndex == -1 ) { - baseTypeName = columnTypeName; - } - else { - baseTypeName = columnTypeName.substring( 0, parenthesisIndex ).trim(); - } + final String baseTypeName = + parenthesisIndex == -1 + ? columnTypeName + : columnTypeName.substring( 0, parenthesisIndex ).trim(); return resolveSqlTypeCode( columnTypeName, baseTypeName, typeConfiguration ); } @@ -812,7 +807,7 @@ public String[] getDropEnumTypeCommand(Class> enumType) { * @return a SQL expression that will occur in a {@code check} constraint */ public String getCheckCondition(String columnName, String[] values) { - StringBuilder check = new StringBuilder(); + final StringBuilder check = new StringBuilder(); check.append( columnName ).append( " in (" ); String separator = ""; boolean nullIsValid = false; @@ -854,7 +849,7 @@ public String getCheckCondition(String columnName, long min, long max) { */ @Deprecated(since="6.5", forRemoval = true) public String getCheckCondition(String columnName, long[] values) { - Long[] boxedValues = new Long[values.length]; + final Long[] boxedValues = new Long[values.length]; for ( int i = 0; i valueSet, JdbcType jdb final boolean isCharacterJdbcType = isCharacterType( jdbcType.getJdbcTypeCode() ); assert isCharacterJdbcType || isIntegral( jdbcType.getJdbcTypeCode() ); - StringBuilder check = new StringBuilder(); + final StringBuilder check = new StringBuilder(); check.append( columnName ).append( " in (" ); String separator = ""; boolean nullIsValid = false; @@ -1546,18 +1541,24 @@ public String castPattern(CastType from, CastType to) { * for the trim character if {@code isWhitespace} * was false. * - * @param specification {@linkplain TrimSpec#LEADING leading}, {@linkplain TrimSpec#TRAILING trailing} + * @param specification + * {@linkplain TrimSpec#LEADING leading}, + * {@linkplain TrimSpec#TRAILING trailing}, * or {@linkplain TrimSpec#BOTH both} - * @param isWhitespace {@code true} if the trim character is a whitespace and can be omitted, - * {@code false} if it must be explicit and a ?2 placeholder should be included in the pattern + * + * @param isWhitespace + * {@code true} if trimming whitespace, and the ?2 + * placeholder for the trim character should be omitted, + * {@code false} if the trim character is explicit and + * the ?2 placeholder must be included in the pattern */ public String trimPattern(TrimSpec specification, boolean isWhitespace) { return "trim(" + specification + ( isWhitespace ? "" : " ?2" ) + " from ?1)"; } /** - * Whether the database supports adding a fractional interval to a timestamp, - * for example {@code timestamp + 0.5 second}. + * Whether the database supports adding a fractional interval + * to a timestamp, for example {@code timestamp + 0.5 second}. */ public boolean supportsFractionalTimestampArithmetic() { return true; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/DialectDelegateWrapper.java b/hibernate-core/src/main/java/org/hibernate/dialect/DialectDelegateWrapper.java index 72704949ca69..09514bc55aec 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/DialectDelegateWrapper.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/DialectDelegateWrapper.java @@ -62,12 +62,12 @@ import org.hibernate.query.hql.HqlTranslator; import org.hibernate.query.spi.QueryOptions; import org.hibernate.query.sqm.CastType; -import org.hibernate.query.sqm.FetchClauseType; +import org.hibernate.query.common.FetchClauseType; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.TrimSpec; -import org.hibernate.query.sqm.mutation.internal.temptable.AfterUseAction; -import org.hibernate.query.sqm.mutation.internal.temptable.BeforeUseAction; +import org.hibernate.query.sqm.mutation.spi.AfterUseAction; +import org.hibernate.query.sqm.mutation.spi.BeforeUseAction; import org.hibernate.query.sqm.mutation.spi.SqmMultiTableInsertStrategy; import org.hibernate.query.sqm.mutation.spi.SqmMultiTableMutationStrategy; import org.hibernate.query.sqm.sql.SqmTranslatorFactory; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/H2Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/H2Dialect.java index 8481dc4081e8..9918088fdd0b 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/H2Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/H2Dialect.java @@ -45,9 +45,9 @@ import org.hibernate.metamodel.mapping.EntityMappingType; import org.hibernate.metamodel.spi.RuntimeModelCreationContext; import org.hibernate.persister.entity.mutation.EntityMutationTarget; -import org.hibernate.query.sqm.FetchClauseType; +import org.hibernate.query.common.FetchClauseType; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.mutation.internal.temptable.GlobalTemporaryTableInsertStrategy; import org.hibernate.query.sqm.mutation.internal.temptable.GlobalTemporaryTableMutationStrategy; import org.hibernate.query.sqm.mutation.spi.SqmMultiTableInsertStrategy; @@ -80,7 +80,7 @@ import jakarta.persistence.TemporalType; -import static org.hibernate.query.sqm.TemporalUnit.SECOND; +import static org.hibernate.query.common.TemporalUnit.SECOND; import static org.hibernate.type.SqlTypes.BIGINT; import static org.hibernate.type.SqlTypes.BINARY; import static org.hibernate.type.SqlTypes.CHAR; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/HANADialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/HANADialect.java index 0d21eb3fb94f..b4886c04523e 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/HANADialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/HANADialect.java @@ -51,7 +51,7 @@ import org.hibernate.procedure.spi.CallableStatementSupport; import org.hibernate.query.sqm.CastType; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.mutation.internal.temptable.GlobalTemporaryTableInsertStrategy; import org.hibernate.query.sqm.mutation.internal.temptable.GlobalTemporaryTableMutationStrategy; import org.hibernate.query.sqm.mutation.spi.SqmMultiTableInsertStrategy; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/HSQLDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/HSQLDialect.java index fa0ca8189f4a..9c29b6685410 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/HSQLDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/HSQLDialect.java @@ -37,9 +37,9 @@ import org.hibernate.metamodel.spi.RuntimeModelCreationContext; import org.hibernate.query.sqm.CastType; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; -import org.hibernate.query.sqm.mutation.internal.temptable.AfterUseAction; -import org.hibernate.query.sqm.mutation.internal.temptable.BeforeUseAction; +import org.hibernate.query.common.TemporalUnit; +import org.hibernate.query.sqm.mutation.spi.AfterUseAction; +import org.hibernate.query.sqm.mutation.spi.BeforeUseAction; import org.hibernate.query.sqm.mutation.internal.temptable.LocalTemporaryTableInsertStrategy; import org.hibernate.query.sqm.mutation.internal.temptable.LocalTemporaryTableMutationStrategy; import org.hibernate.query.sqm.mutation.spi.SqmMultiTableInsertStrategy; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/MySQLDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/MySQLDialect.java index 3c3b846254a9..cecdc9e520cb 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/MySQLDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/MySQLDialect.java @@ -53,10 +53,10 @@ import org.hibernate.metamodel.spi.RuntimeModelCreationContext; import org.hibernate.query.sqm.CastType; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.function.SqmFunctionRegistry; -import org.hibernate.query.sqm.mutation.internal.temptable.AfterUseAction; -import org.hibernate.query.sqm.mutation.internal.temptable.BeforeUseAction; +import org.hibernate.query.sqm.mutation.spi.AfterUseAction; +import org.hibernate.query.sqm.mutation.spi.BeforeUseAction; import org.hibernate.query.sqm.mutation.internal.temptable.LocalTemporaryTableInsertStrategy; import org.hibernate.query.sqm.mutation.internal.temptable.LocalTemporaryTableMutationStrategy; import org.hibernate.query.sqm.mutation.spi.SqmMultiTableInsertStrategy; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/OracleDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/OracleDialect.java index 3ab6edfea87a..0e47a0d632d9 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/OracleDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/OracleDialect.java @@ -61,9 +61,9 @@ import org.hibernate.query.SemanticException; import org.hibernate.query.spi.QueryOptions; import org.hibernate.query.sqm.CastType; -import org.hibernate.query.sqm.FetchClauseType; +import org.hibernate.query.common.FetchClauseType; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.mutation.internal.temptable.GlobalTemporaryTableInsertStrategy; import org.hibernate.query.sqm.mutation.internal.temptable.GlobalTemporaryTableMutationStrategy; import org.hibernate.query.sqm.mutation.spi.SqmMultiTableInsertStrategy; @@ -116,12 +116,12 @@ import static org.hibernate.dialect.OracleJdbcHelper.getNestedTableJdbcTypeConstructor; import static org.hibernate.exception.spi.TemplatedViolatedConstraintNameExtractor.extractUsingTemplate; import static org.hibernate.internal.util.StringHelper.isEmpty; -import static org.hibernate.query.sqm.TemporalUnit.DAY; -import static org.hibernate.query.sqm.TemporalUnit.HOUR; -import static org.hibernate.query.sqm.TemporalUnit.MINUTE; -import static org.hibernate.query.sqm.TemporalUnit.MONTH; -import static org.hibernate.query.sqm.TemporalUnit.SECOND; -import static org.hibernate.query.sqm.TemporalUnit.YEAR; +import static org.hibernate.query.common.TemporalUnit.DAY; +import static org.hibernate.query.common.TemporalUnit.HOUR; +import static org.hibernate.query.common.TemporalUnit.MINUTE; +import static org.hibernate.query.common.TemporalUnit.MONTH; +import static org.hibernate.query.common.TemporalUnit.SECOND; +import static org.hibernate.query.common.TemporalUnit.YEAR; import static org.hibernate.type.SqlTypes.ARRAY; import static org.hibernate.type.SqlTypes.BIGINT; import static org.hibernate.type.SqlTypes.BINARY; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/OracleSqlAstTranslator.java b/hibernate-core/src/main/java/org/hibernate/dialect/OracleSqlAstTranslator.java index 00558358553b..764700818fed 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/OracleSqlAstTranslator.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/OracleSqlAstTranslator.java @@ -16,9 +16,9 @@ import org.hibernate.metamodel.mapping.JdbcMappingContainer; import org.hibernate.query.IllegalQueryOperationException; import org.hibernate.query.sqm.ComparisonOperator; -import org.hibernate.query.sqm.FetchClauseType; -import org.hibernate.query.sqm.FrameExclusion; -import org.hibernate.query.sqm.FrameKind; +import org.hibernate.query.common.FetchClauseType; +import org.hibernate.query.common.FrameExclusion; +import org.hibernate.query.common.FrameKind; import org.hibernate.sql.ast.Clause; import org.hibernate.sql.ast.spi.SqlSelection; import org.hibernate.sql.ast.tree.Statement; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java index 4562863592ec..fd046bb99d9b 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java @@ -58,9 +58,9 @@ import org.hibernate.procedure.spi.CallableStatementSupport; import org.hibernate.query.SemanticException; import org.hibernate.query.spi.QueryOptions; -import org.hibernate.query.sqm.FetchClauseType; +import org.hibernate.query.common.FetchClauseType; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.mutation.internal.cte.CteInsertStrategy; import org.hibernate.query.sqm.mutation.internal.cte.CteMutationStrategy; import org.hibernate.query.sqm.mutation.spi.SqmMultiTableInsertStrategy; @@ -99,8 +99,8 @@ import jakarta.persistence.TemporalType; import static org.hibernate.exception.spi.TemplatedViolatedConstraintNameExtractor.extractUsingTemplate; -import static org.hibernate.query.sqm.TemporalUnit.DAY; -import static org.hibernate.query.sqm.TemporalUnit.EPOCH; +import static org.hibernate.query.common.TemporalUnit.DAY; +import static org.hibernate.query.common.TemporalUnit.EPOCH; import static org.hibernate.type.SqlTypes.ARRAY; import static org.hibernate.type.SqlTypes.BINARY; import static org.hibernate.type.SqlTypes.BLOB; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLSqlAstTranslator.java b/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLSqlAstTranslator.java index 57552d2704d5..501725be3409 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLSqlAstTranslator.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLSqlAstTranslator.java @@ -9,7 +9,7 @@ import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.metamodel.mapping.JdbcMappingContainer; import org.hibernate.query.sqm.ComparisonOperator; -import org.hibernate.query.sqm.FetchClauseType; +import org.hibernate.query.common.FetchClauseType; import org.hibernate.sql.ast.Clause; import org.hibernate.sql.ast.tree.Statement; import org.hibernate.sql.ast.tree.cte.CteMaterialization; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/PostgresPlusDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/PostgresPlusDialect.java index fdb01f593c87..8f08c335bcdf 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/PostgresPlusDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/PostgresPlusDialect.java @@ -16,7 +16,7 @@ import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.persister.entity.mutation.EntityMutationTarget; import org.hibernate.query.sqm.CastType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.produce.function.StandardFunctionArgumentTypeResolvers; import org.hibernate.sql.ast.SqlAstTranslator; import org.hibernate.sql.ast.SqlAstTranslatorFactory; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/SQLServerDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/SQLServerDialect.java index bb7b925ee389..315f574691bf 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/SQLServerDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/SQLServerDialect.java @@ -62,9 +62,9 @@ import org.hibernate.procedure.internal.SQLServerCallableStatementSupport; import org.hibernate.procedure.spi.CallableStatementSupport; import org.hibernate.query.sqm.CastType; -import org.hibernate.query.sqm.FetchClauseType; +import org.hibernate.query.common.FetchClauseType; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.TrimSpec; import org.hibernate.service.ServiceRegistry; import org.hibernate.sql.ast.SqlAstNodeRenderingMode; @@ -96,7 +96,7 @@ import static org.hibernate.cfg.DialectSpecificSettings.SQL_SERVER_COMPATIBILITY_LEVEL; import static org.hibernate.exception.spi.TemplatedViolatedConstraintNameExtractor.extractUsingTemplate; -import static org.hibernate.query.sqm.TemporalUnit.NANOSECOND; +import static org.hibernate.query.common.TemporalUnit.NANOSECOND; import static org.hibernate.query.sqm.produce.function.FunctionParameterType.INTEGER; import static org.hibernate.type.SqlTypes.BLOB; import static org.hibernate.type.SqlTypes.CLOB; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/SQLServerSqlAstTranslator.java b/hibernate-core/src/main/java/org/hibernate/dialect/SQLServerSqlAstTranslator.java index e300ae7f4136..ce0381657e5d 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/SQLServerSqlAstTranslator.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/SQLServerSqlAstTranslator.java @@ -15,7 +15,7 @@ import org.hibernate.metamodel.mapping.JdbcMappingContainer; import org.hibernate.query.IllegalQueryOperationException; import org.hibernate.query.sqm.ComparisonOperator; -import org.hibernate.query.sqm.FetchClauseType; +import org.hibernate.query.common.FetchClauseType; import org.hibernate.sql.ast.Clause; import org.hibernate.sql.ast.SqlAstJoinType; import org.hibernate.sql.ast.spi.SqlSelection; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/SpannerDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/SpannerDialect.java index 64709dde6b95..843b7eb18c28 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/SpannerDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/SpannerDialect.java @@ -37,7 +37,7 @@ import org.hibernate.persister.entity.EntityPersister; import org.hibernate.query.SemanticException; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.sql.ast.SqlAstTranslator; import org.hibernate.sql.ast.SqlAstTranslatorFactory; import org.hibernate.sql.ast.spi.SqlAppender; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/SybaseASEDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/SybaseASEDialect.java index 52d320a52b4f..590de3db5ed9 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/SybaseASEDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/SybaseASEDialect.java @@ -29,7 +29,7 @@ import org.hibernate.internal.util.JdbcExceptionHelper; import org.hibernate.internal.util.config.ConfigurationHelper; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.service.ServiceRegistry; import org.hibernate.sql.ast.SqlAstTranslator; import org.hibernate.sql.ast.SqlAstTranslatorFactory; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/SybaseDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/SybaseDialect.java index d4e0b9836c5a..5d1c213b15a4 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/SybaseDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/SybaseDialect.java @@ -39,7 +39,7 @@ import org.hibernate.query.spi.QueryParameterBindings; import org.hibernate.query.sqm.CastType; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.internal.DomainParameterXref; import org.hibernate.query.sqm.sql.SqmTranslator; import org.hibernate.query.sqm.sql.SqmTranslatorFactory; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/TiDBDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/TiDBDialect.java index 524128640903..90ef19b0554a 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/TiDBDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/TiDBDialect.java @@ -12,7 +12,7 @@ import org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo; import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.sql.ast.SqlAstTranslator; import org.hibernate.sql.ast.SqlAstTranslatorFactory; import org.hibernate.sql.ast.spi.StandardSqlAstTranslatorFactory; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/function/DateTruncEmulation.java b/hibernate-core/src/main/java/org/hibernate/dialect/function/DateTruncEmulation.java index f2f3ca3a6795..3a806ac3e86f 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/function/DateTruncEmulation.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/function/DateTruncEmulation.java @@ -11,7 +11,7 @@ import org.hibernate.query.ReturnableType; import org.hibernate.query.spi.QueryEngine; import org.hibernate.query.sqm.NodeBuilder; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.function.AbstractSqmFunctionDescriptor; import org.hibernate.query.sqm.function.FunctionRenderer; import org.hibernate.query.sqm.function.SelfRenderingSqmFunction; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/function/ExtractFunction.java b/hibernate-core/src/main/java/org/hibernate/dialect/function/ExtractFunction.java index dd4cae71dfaf..4daa7a99fb95 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/function/ExtractFunction.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/function/ExtractFunction.java @@ -9,7 +9,7 @@ import org.hibernate.dialect.Dialect; import org.hibernate.query.ReturnableType; import org.hibernate.query.SemanticException; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.spi.QueryEngine; import org.hibernate.query.sqm.NodeBuilder; import org.hibernate.query.sqm.function.AbstractSqmFunctionDescriptor; @@ -36,7 +36,7 @@ import static java.util.Arrays.asList; import static org.hibernate.query.sqm.BinaryArithmeticOperator.*; -import static org.hibernate.query.sqm.TemporalUnit.*; +import static org.hibernate.query.common.TemporalUnit.*; import static org.hibernate.query.sqm.produce.function.FunctionParameterType.TEMPORAL; import static org.hibernate.query.sqm.produce.function.FunctionParameterType.TEMPORAL_UNIT; import static org.hibernate.usertype.internal.AbstractTimeZoneStorageCompositeUserType.ZONE_OFFSET_NAME; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/function/FormatFunction.java b/hibernate-core/src/main/java/org/hibernate/dialect/function/FormatFunction.java index 7f57d055e7d0..4ae71fd5f221 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/function/FormatFunction.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/function/FormatFunction.java @@ -15,7 +15,7 @@ import org.hibernate.metamodel.mapping.MappingModelExpressible; import org.hibernate.query.ReturnableType; import org.hibernate.query.spi.QueryEngine; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.function.AbstractSqmFunctionDescriptor; import org.hibernate.query.sqm.function.AbstractSqmSelfRenderingFunctionDescriptor; import org.hibernate.query.sqm.function.FunctionRenderer; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/function/IntegralTimestampaddFunction.java b/hibernate-core/src/main/java/org/hibernate/dialect/function/IntegralTimestampaddFunction.java index 727f8599249b..1f536a284fe0 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/function/IntegralTimestampaddFunction.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/function/IntegralTimestampaddFunction.java @@ -9,7 +9,7 @@ import org.hibernate.dialect.Dialect; import org.hibernate.metamodel.mapping.BasicValuedMapping; import org.hibernate.query.ReturnableType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.function.SelfRenderingFunctionSqlAstExpression; import org.hibernate.sql.ast.SqlAstTranslator; import org.hibernate.sql.ast.spi.SqlAppender; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/function/OracleTruncFunction.java b/hibernate-core/src/main/java/org/hibernate/dialect/function/OracleTruncFunction.java index 0aea2a6c0d5e..9ca487f2670a 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/function/OracleTruncFunction.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/function/OracleTruncFunction.java @@ -11,7 +11,7 @@ import org.hibernate.query.ReturnableType; import org.hibernate.query.spi.QueryEngine; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.function.FunctionRenderer; import org.hibernate.query.sqm.function.SelfRenderingSqmFunction; import org.hibernate.query.sqm.produce.function.ArgumentsValidator; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/function/SybaseTruncFunction.java b/hibernate-core/src/main/java/org/hibernate/dialect/function/SybaseTruncFunction.java index 05fcd1e159ca..2e89a25976d3 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/function/SybaseTruncFunction.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/function/SybaseTruncFunction.java @@ -12,7 +12,7 @@ import org.hibernate.query.ReturnableType; import org.hibernate.query.spi.QueryEngine; import org.hibernate.query.sqm.NodeBuilder; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.function.SelfRenderingSqmFunction; import org.hibernate.query.sqm.tree.SqmTypedNode; import org.hibernate.query.sqm.tree.expression.SqmExtractUnit; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/function/TimestampaddFunction.java b/hibernate-core/src/main/java/org/hibernate/dialect/function/TimestampaddFunction.java index 6c1a4566c5ff..a19dbb20ca25 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/function/TimestampaddFunction.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/function/TimestampaddFunction.java @@ -10,7 +10,7 @@ import org.hibernate.dialect.Dialect; import org.hibernate.query.ReturnableType; import org.hibernate.query.sqm.IntervalType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.function.AbstractSqmSelfRenderingFunctionDescriptor; import org.hibernate.query.sqm.function.SelfRenderingFunctionSqlAstExpression; import org.hibernate.query.sqm.produce.function.ArgumentTypesValidator; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/function/TimestampdiffFunction.java b/hibernate-core/src/main/java/org/hibernate/dialect/function/TimestampdiffFunction.java index 37f9b9f89bb1..45c5b82f95e1 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/function/TimestampdiffFunction.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/function/TimestampdiffFunction.java @@ -12,9 +12,8 @@ import org.hibernate.dialect.Dialect; import org.hibernate.metamodel.mapping.BasicValuedMapping; import org.hibernate.metamodel.mapping.JdbcMappingContainer; -import org.hibernate.metamodel.mapping.MappingModelExpressible; import org.hibernate.query.ReturnableType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.function.AbstractSqmSelfRenderingFunctionDescriptor; import org.hibernate.query.sqm.function.SelfRenderingFunctionSqlAstExpression; import org.hibernate.query.sqm.produce.function.ArgumentTypesValidator; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/function/TruncFunction.java b/hibernate-core/src/main/java/org/hibernate/dialect/function/TruncFunction.java index b1be2af649a0..4e797233cc13 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/function/TruncFunction.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/function/TruncFunction.java @@ -12,7 +12,7 @@ import org.hibernate.query.ReturnableType; import org.hibernate.query.spi.QueryEngine; import org.hibernate.query.sqm.NodeBuilder; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.function.AbstractSqmFunctionDescriptor; import org.hibernate.query.sqm.function.FunctionRenderer; import org.hibernate.query.sqm.function.SelfRenderingSqmFunction; diff --git a/hibernate-core/src/main/java/org/hibernate/query/QueryLogging.java b/hibernate-core/src/main/java/org/hibernate/query/QueryLogging.java index e0d2615fd229..b81f1731c5aa 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/QueryLogging.java +++ b/hibernate-core/src/main/java/org/hibernate/query/QueryLogging.java @@ -7,6 +7,7 @@ package org.hibernate.query; import org.hibernate.HibernateException; +import org.hibernate.Internal; import org.hibernate.internal.log.SubSystemLogging; import org.jboss.logging.BasicLogger; @@ -32,6 +33,7 @@ name = QueryLogging.LOGGER_NAME, description = "Logging related to Query processing" ) +@Internal public interface QueryLogging extends BasicLogger { String LOGGER_NAME = SubSystemLogging.BASE + ".query"; diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/FetchClauseType.java b/hibernate-core/src/main/java/org/hibernate/query/common/FetchClauseType.java similarity index 95% rename from hibernate-core/src/main/java/org/hibernate/query/sqm/FetchClauseType.java rename to hibernate-core/src/main/java/org/hibernate/query/common/FetchClauseType.java index b35552c283f8..1910fc9b78a2 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/FetchClauseType.java +++ b/hibernate-core/src/main/java/org/hibernate/query/common/FetchClauseType.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html */ -package org.hibernate.query.sqm; +package org.hibernate.query.common; /** * The kind of fetch to use for the {@code FETCH} clause. diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/FrameExclusion.java b/hibernate-core/src/main/java/org/hibernate/query/common/FrameExclusion.java similarity index 90% rename from hibernate-core/src/main/java/org/hibernate/query/sqm/FrameExclusion.java rename to hibernate-core/src/main/java/org/hibernate/query/common/FrameExclusion.java index 4df33105faa9..ae794806378a 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/FrameExclusion.java +++ b/hibernate-core/src/main/java/org/hibernate/query/common/FrameExclusion.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html */ -package org.hibernate.query.sqm; +package org.hibernate.query.common; /** * @author Christian Beikov diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/FrameKind.java b/hibernate-core/src/main/java/org/hibernate/query/common/FrameKind.java similarity index 91% rename from hibernate-core/src/main/java/org/hibernate/query/sqm/FrameKind.java rename to hibernate-core/src/main/java/org/hibernate/query/common/FrameKind.java index 2f31269629bb..cb6bdb691576 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/FrameKind.java +++ b/hibernate-core/src/main/java/org/hibernate/query/common/FrameKind.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html */ -package org.hibernate.query.sqm; +package org.hibernate.query.common; /** * @author Christian Beikov diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/FrameMode.java b/hibernate-core/src/main/java/org/hibernate/query/common/FrameMode.java similarity index 89% rename from hibernate-core/src/main/java/org/hibernate/query/sqm/FrameMode.java rename to hibernate-core/src/main/java/org/hibernate/query/common/FrameMode.java index 9048aeaeaac7..dc7b2977101e 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/FrameMode.java +++ b/hibernate-core/src/main/java/org/hibernate/query/common/FrameMode.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html */ -package org.hibernate.query.sqm; +package org.hibernate.query.common; /** * @author Christian Beikov diff --git a/hibernate-core/src/main/java/org/hibernate/query/common/JoinType.java b/hibernate-core/src/main/java/org/hibernate/query/common/JoinType.java new file mode 100644 index 000000000000..0920cce29ef2 --- /dev/null +++ b/hibernate-core/src/main/java/org/hibernate/query/common/JoinType.java @@ -0,0 +1,37 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * License: GNU Lesser General Public License (LGPL), version 2.1 or later + * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html + */ +package org.hibernate.query.common; + +/** + * Enumerates the possible kinds of join in HQL and ANSI SQL. + * + * @apiNote This enumeration competes with + * {@link jakarta.persistence.criteria.JoinType}, + * adding {@link #FULL} and {@link #CROSS} joins. + * + * @author Gavin King + * + * @since 7 + * + * @see jakarta.persistence.criteria.JoinType + */ +public enum JoinType { + /** + * @see jakarta.persistence.criteria.JoinType#INNER + */ + INNER, + /** + * @see jakarta.persistence.criteria.JoinType#LEFT + */ + LEFT, + /** + * @see jakarta.persistence.criteria.JoinType#RIGHT + */ + RIGHT, + FULL, + CROSS +} diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/TemporalUnit.java b/hibernate-core/src/main/java/org/hibernate/query/common/TemporalUnit.java similarity index 97% rename from hibernate-core/src/main/java/org/hibernate/query/sqm/TemporalUnit.java rename to hibernate-core/src/main/java/org/hibernate/query/common/TemporalUnit.java index b5aca3a27226..ae2c7dd603e1 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/TemporalUnit.java +++ b/hibernate-core/src/main/java/org/hibernate/query/common/TemporalUnit.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html */ -package org.hibernate.query.sqm; +package org.hibernate.query.common; import org.hibernate.dialect.Dialect; import org.hibernate.query.SemanticException; @@ -30,6 +30,8 @@ * according to capabilities of the database platform. * * @see Dialect#extractPattern(TemporalUnit) + * @see org.hibernate.query.criteria.HibernateCriteriaBuilder#duration(long, TemporalUnit) + * @see org.hibernate.query.criteria.HibernateCriteriaBuilder#durationByUnit(TemporalUnit, jakarta.persistence.criteria.Expression) * * @author Gavin King */ diff --git a/hibernate-core/src/main/java/org/hibernate/query/JpaTuple.java b/hibernate-core/src/main/java/org/hibernate/query/common/package-info.java similarity index 58% rename from hibernate-core/src/main/java/org/hibernate/query/JpaTuple.java rename to hibernate-core/src/main/java/org/hibernate/query/common/package-info.java index 9bb813ab6268..3d4d524c67f5 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/JpaTuple.java +++ b/hibernate-core/src/main/java/org/hibernate/query/common/package-info.java @@ -4,18 +4,14 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html */ -package org.hibernate.query; - -import org.hibernate.Incubating; - -import jakarta.persistence.Tuple; /** - * Hibernate extension to the Jakarta Persistence {@link Tuple} - * contract + * Common APIs used internally, in the SQL tree, + * in the dialects, and in the criteria query API. * - * @author Steve Ebersole + * @see org.hibernate.query.common.TemporalUnit */ @Incubating -public interface JpaTuple extends Tuple { -} +package org.hibernate.query.common; + +import org.hibernate.Incubating; diff --git a/hibernate-core/src/main/java/org/hibernate/query/criteria/CriteriaDefinition.java b/hibernate-core/src/main/java/org/hibernate/query/criteria/CriteriaDefinition.java index dbf134b17f50..c259cd5973b3 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/criteria/CriteriaDefinition.java +++ b/hibernate-core/src/main/java/org/hibernate/query/criteria/CriteriaDefinition.java @@ -17,7 +17,7 @@ import org.hibernate.query.QueryProducer; import org.hibernate.query.SelectionQuery; import org.hibernate.query.criteria.spi.HibernateCriteriaBuilderDelegate; -import org.hibernate.query.sqm.FetchClauseType; +import org.hibernate.query.common.FetchClauseType; import org.hibernate.query.sqm.tree.SqmCopyContext; import org.hibernate.query.sqm.tree.select.SqmSelectStatement; diff --git a/hibernate-core/src/main/java/org/hibernate/query/criteria/HibernateCriteriaBuilder.java b/hibernate-core/src/main/java/org/hibernate/query/criteria/HibernateCriteriaBuilder.java index 734ca8902817..7af9c9452f96 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/criteria/HibernateCriteriaBuilder.java +++ b/hibernate-core/src/main/java/org/hibernate/query/criteria/HibernateCriteriaBuilder.java @@ -23,8 +23,8 @@ import org.hibernate.Incubating; import org.hibernate.query.NullPrecedence; import org.hibernate.query.SortDirection; -import org.hibernate.query.sqm.FrameKind; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.FrameKind; +import org.hibernate.query.common.TemporalUnit; import jakarta.persistence.Tuple; import jakarta.persistence.criteria.AbstractQuery; @@ -527,7 +527,7 @@ default JpaSubQuery except(Subquery query1, Subquery... q * A literal {@link Duration}, for example, "five days" or "30 minutes". * @since 6.3 */ - @Incubating // layer breaker (leaks SQM type) + @Incubating JpaExpression duration(long magnitude, TemporalUnit unit); /** @@ -537,7 +537,7 @@ default JpaSubQuery except(Subquery query1, Subquery... q * @return the magnitude of the duration measured in the given units * @since 6.3 */ - @Incubating // layer breaker (leaks SQM type) + @Incubating JpaExpression durationByUnit(TemporalUnit unit, Expression duration); /** @@ -1200,7 +1200,7 @@ default JpaOrder sort( JpaFunction format(Expression datetime, String pattern); /** - * Extracts the {@link org.hibernate.query.sqm.TemporalUnit#YEAR} of a date, time, or datetime expression. + * Extracts the {@link TemporalUnit#YEAR} of a date, time, or datetime expression. * * @param datetime the date, time, or datetime to extract the value from * @@ -1210,7 +1210,7 @@ default JpaOrder sort( JpaFunction year(Expression datetime); /** - * Extracts the {@link org.hibernate.query.sqm.TemporalUnit#MONTH} of a date, time, or datetime expression. + * Extracts the {@link TemporalUnit#MONTH} of a date, time, or datetime expression. * * @param datetime the date, time, or datetime to extract the value from * @@ -1220,7 +1220,7 @@ default JpaOrder sort( JpaFunction month(Expression datetime); /** - * Extracts the {@link org.hibernate.query.sqm.TemporalUnit#DAY} of a date, time, or datetime expression. + * Extracts the {@link TemporalUnit#DAY} of a date, time, or datetime expression. * * @param datetime the date, time, or datetime to extract the value from * @@ -1230,7 +1230,7 @@ default JpaOrder sort( JpaFunction day(Expression datetime); /** - * Extracts the {@link org.hibernate.query.sqm.TemporalUnit#HOUR} of a date, time, or datetime expression. + * Extracts the {@link TemporalUnit#HOUR} of a date, time, or datetime expression. * * @param datetime the date, time, or datetime to extract the value from * @@ -1240,7 +1240,7 @@ default JpaOrder sort( JpaFunction hour(Expression datetime); /** - * Extracts the {@link org.hibernate.query.sqm.TemporalUnit#MINUTE} of a date, time, or datetime expression. + * Extracts the {@link TemporalUnit#MINUTE} of a date, time, or datetime expression. * * @param datetime the date, time, or datetime to extract the value from * @@ -1250,7 +1250,7 @@ default JpaOrder sort( JpaFunction minute(Expression datetime); /** - * Extracts the {@link org.hibernate.query.sqm.TemporalUnit#SECOND} of a date, time, or datetime expression. + * Extracts the {@link TemporalUnit#SECOND} of a date, time, or datetime expression. * * @param datetime the date, time, or datetime to extract the value from * diff --git a/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaCriteriaQuery.java b/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaCriteriaQuery.java index 9c4283d59c47..e77dd3975c28 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaCriteriaQuery.java +++ b/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaCriteriaQuery.java @@ -9,7 +9,7 @@ import java.util.List; import java.util.Set; -import org.hibernate.query.sqm.FetchClauseType; +import org.hibernate.query.common.FetchClauseType; import jakarta.persistence.criteria.CriteriaQuery; import jakarta.persistence.criteria.Expression; diff --git a/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaCteContainer.java b/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaCteContainer.java index 606fcefd7c0a..b8cc6e3862f4 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaCteContainer.java +++ b/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaCteContainer.java @@ -10,7 +10,6 @@ import java.util.function.Function; import org.hibernate.Incubating; -import org.hibernate.query.sqm.tree.SqmJoinType; import jakarta.persistence.criteria.AbstractQuery; import jakarta.persistence.criteria.CriteriaQuery; @@ -36,7 +35,6 @@ public interface JpaCteContainer extends JpaCriteriaNode { * which can be used for querying. * * @see JpaCriteriaQuery#from(JpaCteCriteria) - * @see JpaFrom#join(JpaCteCriteria, SqmJoinType) */ JpaCteCriteria with(AbstractQuery criteria); @@ -46,7 +44,6 @@ public interface JpaCteContainer extends JpaCriteriaNode { * so that the recursive {@link CriteriaQuery} is able to refer to the CTE again. * * @see JpaCriteriaQuery#from(JpaCteCriteria) - * @see JpaFrom#join(JpaCteCriteria, SqmJoinType) */ JpaCteCriteria withRecursiveUnionAll(AbstractQuery baseCriteria, Function, AbstractQuery> recursiveCriteriaProducer); @@ -56,7 +53,6 @@ public interface JpaCteContainer extends JpaCriteriaNode { * so that the recursive {@link CriteriaQuery} is able to refer to the CTE again. * * @see JpaCriteriaQuery#from(JpaCteCriteria) - * @see JpaFrom#join(JpaCteCriteria, SqmJoinType) */ JpaCteCriteria withRecursiveUnionDistinct(AbstractQuery baseCriteria, Function, AbstractQuery> recursiveCriteriaProducer); diff --git a/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaFrom.java b/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaFrom.java index 0ca649d877d7..bbc7cebbd25d 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaFrom.java +++ b/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaFrom.java @@ -35,10 +35,20 @@ public interface JpaFrom extends JpaPath, JpaFetchParent, From @Override JpaEntityJoin join(Class entityClass, JoinType joinType); + /** + * @deprecated This method is a layer-breaker, leaking the SQM type + * {@link SqmJoinType} onto an API. It will be removed. + * Use {@link #join(Class, org.hibernate.query.common.JoinType)} + */ + @Deprecated(since="7", forRemoval = true) default JpaEntityJoin join(Class entityJavaType, SqmJoinType joinType) { return join( entityJavaType, joinType.getCorrespondingJpaJoinType() ); } + default JpaEntityJoin join(Class entityJavaType, org.hibernate.query.common.JoinType joinType) { + return join( entityJavaType, SqmJoinType.from(joinType) ); + } + @Override JpaJoin join(EntityType entity); @@ -47,29 +57,75 @@ default JpaEntityJoin join(Class entityJavaType, SqmJoinType joinTy JpaEntityJoin join(EntityDomainType entity); + /** + * @deprecated This method is a layer-breaker, leaking the SQM type + * {@link SqmJoinType} onto an API. It will be removed. + * Use {@link #join(EntityDomainType, org.hibernate.query.common.JoinType)} + */ + @Deprecated(since = "7", forRemoval = true) JpaEntityJoin join(EntityDomainType entity, SqmJoinType joinType); + default JpaEntityJoin join(EntityDomainType entity, org.hibernate.query.common.JoinType joinType) { + return join( entity, SqmJoinType.from(joinType) ); + } + @Incubating JpaDerivedJoin join(Subquery subquery); - @Incubating + /** + * @deprecated This method is a layer-breaker, leaking the SQM type + * {@link SqmJoinType} onto an API. It will be removed. + * Use {@link #join(Subquery, org.hibernate.query.common.JoinType)} + */ + @Incubating @Deprecated(since = "7", forRemoval = true) JpaDerivedJoin join(Subquery subquery, SqmJoinType joinType); + default JpaDerivedJoin join(Subquery subquery, org.hibernate.query.common.JoinType joinType) { + return join( subquery, SqmJoinType.from(joinType) ); + } + @Incubating JpaDerivedJoin joinLateral(Subquery subquery); - @Incubating + /** + * @deprecated This method is a layer-breaker, leaking the SQM type + * {@link SqmJoinType} onto an API. It will be removed. + * Use {@link #joinLateral(Subquery, org.hibernate.query.common.JoinType)} + */ + @Incubating @Deprecated(since = "7", forRemoval = true) JpaDerivedJoin joinLateral(Subquery subquery, SqmJoinType joinType); - @Incubating + default JpaDerivedJoin joinLateral(Subquery subquery, org.hibernate.query.common.JoinType joinType) { + return joinLateral( subquery, SqmJoinType.from(joinType) ); + } + + /** + * @deprecated This method is a layer-breaker, leaking the SQM type + * {@link SqmJoinType} onto an API. It will be removed. + * Use {@link #join(Subquery, org.hibernate.query.common.JoinType, boolean)} + */ + @Incubating @Deprecated(since = "7", forRemoval = true) JpaDerivedJoin join(Subquery subquery, SqmJoinType joinType, boolean lateral); + default JpaDerivedJoin join(Subquery subquery, org.hibernate.query.common.JoinType joinType, boolean lateral) { + return join( subquery, SqmJoinType.from(joinType), lateral ); + } + @Incubating JpaJoin join(JpaCteCriteria cte); - @Incubating + /** + * @deprecated This method is a layer-breaker, leaking the SQM type + * {@link SqmJoinType} onto an API. It will be removed. + * Use {@link #join(JpaCteCriteria, org.hibernate.query.common.JoinType)} + */ + @Incubating @Deprecated(since = "7", forRemoval = true) JpaJoin join(JpaCteCriteria cte, SqmJoinType joinType); + default JpaJoin join(JpaCteCriteria cte, org.hibernate.query.common.JoinType joinType) { + return join( cte, SqmJoinType.from(joinType) ); + } + @Incubating JpaCrossJoin crossJoin(Class entityJavaType); diff --git a/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaQueryGroup.java b/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaQueryGroup.java index 6d92730e9dcd..b3b92c1aabe4 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaQueryGroup.java +++ b/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaQueryGroup.java @@ -8,8 +8,7 @@ import java.util.List; -import org.hibernate.query.sqm.FetchClauseType; -import org.hibernate.query.sqm.SetOperator; +import org.hibernate.query.common.FetchClauseType; /** * A query group i.e. query parts connected with a set operator. @@ -20,10 +19,6 @@ public interface JpaQueryGroup extends JpaQueryPart { List> getQueryParts(); - SetOperator getSetOperator(); - - void setSetOperator(SetOperator setOperator); - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Covariant overrides diff --git a/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaQueryPart.java b/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaQueryPart.java index 2a9226aa13d2..767ed92128e8 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaQueryPart.java +++ b/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaQueryPart.java @@ -8,7 +8,7 @@ import java.util.List; -import org.hibernate.query.sqm.FetchClauseType; +import org.hibernate.query.common.FetchClauseType; /** * Models a query part i.e. the commonalities between a query group and a query specification. diff --git a/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaQueryStructure.java b/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaQueryStructure.java index 52a70748c1aa..cf5db1b33174 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaQueryStructure.java +++ b/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaQueryStructure.java @@ -11,7 +11,7 @@ import jakarta.persistence.criteria.Expression; import jakarta.persistence.criteria.Predicate; -import org.hibernate.query.sqm.FetchClauseType; +import org.hibernate.query.common.FetchClauseType; /** * Models a {@code SELECT} query. Used as a delegate in diff --git a/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaSubQuery.java b/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaSubQuery.java index 8ded391baf33..995eceb64dc4 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaSubQuery.java +++ b/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaSubQuery.java @@ -20,7 +20,7 @@ import jakarta.persistence.criteria.SetJoin; import jakarta.persistence.criteria.Subquery; -import org.hibernate.query.sqm.FetchClauseType; +import org.hibernate.query.common.FetchClauseType; /** * @author Steve Ebersole diff --git a/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaWindow.java b/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaWindow.java index ed26ea55061f..17cadc1d5479 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaWindow.java +++ b/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaWindow.java @@ -7,7 +7,7 @@ package org.hibernate.query.criteria; import org.hibernate.Incubating; -import org.hibernate.query.sqm.FrameExclusion; +import org.hibernate.query.common.FrameExclusion; import jakarta.persistence.criteria.Expression; import jakarta.persistence.criteria.Order; diff --git a/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaWindowFrame.java b/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaWindowFrame.java index bce66d279143..d1e6e4a69701 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaWindowFrame.java +++ b/hibernate-core/src/main/java/org/hibernate/query/criteria/JpaWindowFrame.java @@ -7,7 +7,7 @@ package org.hibernate.query.criteria; import org.hibernate.Incubating; -import org.hibernate.query.sqm.FrameKind; +import org.hibernate.query.common.FrameKind; import jakarta.persistence.criteria.Expression; diff --git a/hibernate-core/src/main/java/org/hibernate/query/criteria/spi/HibernateCriteriaBuilderDelegate.java b/hibernate-core/src/main/java/org/hibernate/query/criteria/spi/HibernateCriteriaBuilderDelegate.java index 53dc2282b806..fe74cc5d7cc8 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/criteria/spi/HibernateCriteriaBuilderDelegate.java +++ b/hibernate-core/src/main/java/org/hibernate/query/criteria/spi/HibernateCriteriaBuilderDelegate.java @@ -56,7 +56,7 @@ import org.hibernate.query.criteria.JpaValues; import org.hibernate.query.criteria.JpaWindow; import org.hibernate.query.criteria.JpaWindowFrame; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import jakarta.persistence.Tuple; import jakarta.persistence.criteria.CollectionJoin; diff --git a/hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java b/hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java index f2aafa5671fa..1ceb3ccdba24 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java +++ b/hibernate-core/src/main/java/org/hibernate/query/hql/internal/SemanticQueryBuilder.java @@ -75,10 +75,10 @@ import org.hibernate.query.hql.spi.SqmPathRegistry; import org.hibernate.query.sqm.BinaryArithmeticOperator; import org.hibernate.query.sqm.ComparisonOperator; -import org.hibernate.query.sqm.FetchClauseType; -import org.hibernate.query.sqm.FrameExclusion; -import org.hibernate.query.sqm.FrameKind; -import org.hibernate.query.sqm.FrameMode; +import org.hibernate.query.common.FetchClauseType; +import org.hibernate.query.common.FrameExclusion; +import org.hibernate.query.common.FrameKind; +import org.hibernate.query.common.FrameMode; import org.hibernate.query.sqm.LiteralNumberFormatException; import org.hibernate.query.sqm.NodeBuilder; import org.hibernate.query.sqm.ParsingException; @@ -87,7 +87,7 @@ import org.hibernate.query.sqm.SqmPathSource; import org.hibernate.query.sqm.SqmTreeCreationLogger; import org.hibernate.query.sqm.StrictJpaComplianceViolation; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.TerminalPathException; import org.hibernate.query.sqm.TrimSpec; import org.hibernate.query.sqm.UnaryArithmeticOperator; @@ -251,17 +251,17 @@ import static org.hibernate.internal.util.QuotingHelper.unquoteJavaStringLiteral; import static org.hibernate.internal.util.QuotingHelper.unquoteStringLiteral; import static org.hibernate.query.hql.internal.SqmTreeCreationHelper.extractJpaCompliantAlias; -import static org.hibernate.query.sqm.TemporalUnit.DATE; -import static org.hibernate.query.sqm.TemporalUnit.DAY_OF_MONTH; -import static org.hibernate.query.sqm.TemporalUnit.DAY_OF_WEEK; -import static org.hibernate.query.sqm.TemporalUnit.DAY_OF_YEAR; -import static org.hibernate.query.sqm.TemporalUnit.NANOSECOND; -import static org.hibernate.query.sqm.TemporalUnit.OFFSET; -import static org.hibernate.query.sqm.TemporalUnit.TIME; -import static org.hibernate.query.sqm.TemporalUnit.TIMEZONE_HOUR; -import static org.hibernate.query.sqm.TemporalUnit.TIMEZONE_MINUTE; -import static org.hibernate.query.sqm.TemporalUnit.WEEK_OF_MONTH; -import static org.hibernate.query.sqm.TemporalUnit.WEEK_OF_YEAR; +import static org.hibernate.query.common.TemporalUnit.DATE; +import static org.hibernate.query.common.TemporalUnit.DAY_OF_MONTH; +import static org.hibernate.query.common.TemporalUnit.DAY_OF_WEEK; +import static org.hibernate.query.common.TemporalUnit.DAY_OF_YEAR; +import static org.hibernate.query.common.TemporalUnit.NANOSECOND; +import static org.hibernate.query.common.TemporalUnit.OFFSET; +import static org.hibernate.query.common.TemporalUnit.TIME; +import static org.hibernate.query.common.TemporalUnit.TIMEZONE_HOUR; +import static org.hibernate.query.common.TemporalUnit.TIMEZONE_MINUTE; +import static org.hibernate.query.common.TemporalUnit.WEEK_OF_MONTH; +import static org.hibernate.query.common.TemporalUnit.WEEK_OF_YEAR; import static org.hibernate.query.sqm.internal.SqmUtil.resolveExpressibleJavaTypeClass; import static org.hibernate.type.descriptor.DateTimeUtils.DATE_TIME; import static org.hibernate.type.spi.TypeConfiguration.isJdbcTemporalType; diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/IntervalType.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/IntervalType.java index 911600865bc0..e8a49185aaa5 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/IntervalType.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/IntervalType.java @@ -9,11 +9,16 @@ /** * The different types of intervals that SQL defines. * + * @deprecated This enum still has exactly one member, and was + * placed in a package from which it has no usages. + * It will be removed or moved. + * * @author Christian Beikov */ +@Deprecated(since="7", forRemoval = true) public enum IntervalType { /** * A second based interval. **/ - SECOND; + SECOND } diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/internal/SqmCriteriaNodeBuilder.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/internal/SqmCriteriaNodeBuilder.java index 0ec7285cce6f..ba03916677f6 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/internal/SqmCriteriaNodeBuilder.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/internal/SqmCriteriaNodeBuilder.java @@ -74,13 +74,13 @@ import org.hibernate.query.spi.QueryEngine; import org.hibernate.query.sqm.BinaryArithmeticOperator; import org.hibernate.query.sqm.ComparisonOperator; -import org.hibernate.query.sqm.FrameKind; +import org.hibernate.query.common.FrameKind; import org.hibernate.query.sqm.NodeBuilder; import org.hibernate.query.sqm.SetOperator; import org.hibernate.query.sqm.SqmExpressible; import org.hibernate.query.sqm.SqmPathSource; import org.hibernate.query.sqm.SqmQuerySource; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.TrimSpec; import org.hibernate.query.sqm.UnaryArithmeticOperator; import org.hibernate.query.sqm.function.NamedSqmFunctionDescriptor; diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/AbstractDeleteExecutionDelegate.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/AbstractDeleteExecutionDelegate.java index 5697406d8015..da08f9dfd7d1 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/AbstractDeleteExecutionDelegate.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/AbstractDeleteExecutionDelegate.java @@ -17,6 +17,7 @@ import org.hibernate.query.spi.QueryParameterBindings; import org.hibernate.query.sqm.internal.DomainParameterXref; import org.hibernate.query.sqm.mutation.internal.MultiTableSqmMutationConverter; +import org.hibernate.query.sqm.mutation.spi.AfterUseAction; import org.hibernate.query.sqm.tree.delete.SqmDeleteStatement; /** diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/ExecuteWithTemporaryTableHelper.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/ExecuteWithTemporaryTableHelper.java index 8186a59ba91c..65411a8f1ffc 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/ExecuteWithTemporaryTableHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/ExecuteWithTemporaryTableHelper.java @@ -20,6 +20,8 @@ import org.hibernate.engine.jdbc.spi.JdbcServices; import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.engine.spi.SharedSessionContractImplementor; +import org.hibernate.query.sqm.mutation.spi.AfterUseAction; +import org.hibernate.query.sqm.mutation.spi.BeforeUseAction; import org.hibernate.resource.transaction.spi.IsolationDelegate; import org.hibernate.metamodel.mapping.BasicValuedMapping; import org.hibernate.metamodel.mapping.EntityMappingType; @@ -40,7 +42,6 @@ import org.hibernate.sql.ast.tree.predicate.Predicate; import org.hibernate.sql.ast.tree.select.QuerySpec; import org.hibernate.sql.exec.spi.ExecutionContext; -import org.hibernate.sql.exec.spi.JdbcOperationQueryInsert; import org.hibernate.sql.exec.spi.JdbcOperationQueryMutation; import org.hibernate.sql.exec.spi.JdbcParameterBindings; import org.hibernate.sql.results.internal.SqlSelectionImpl; diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/GlobalTemporaryTableStrategy.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/GlobalTemporaryTableStrategy.java index 3de4bdbd0cca..dbf13172e9f4 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/GlobalTemporaryTableStrategy.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/GlobalTemporaryTableStrategy.java @@ -18,6 +18,7 @@ import org.hibernate.metamodel.mapping.EntityMappingType; import org.hibernate.metamodel.mapping.internal.MappingModelCreationProcess; +import org.hibernate.query.sqm.mutation.spi.AfterUseAction; import org.jboss.logging.Logger; /** diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/InsertExecutionDelegate.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/InsertExecutionDelegate.java index 49b6ff394b89..20012e05c27e 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/InsertExecutionDelegate.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/InsertExecutionDelegate.java @@ -45,10 +45,11 @@ import org.hibernate.query.results.TableGroupImpl; import org.hibernate.query.spi.DomainQueryExecutionContext; import org.hibernate.query.sqm.ComparisonOperator; -import org.hibernate.query.sqm.FetchClauseType; +import org.hibernate.query.common.FetchClauseType; import org.hibernate.query.sqm.internal.DomainParameterXref; import org.hibernate.query.sqm.internal.SqmUtil; import org.hibernate.query.sqm.mutation.internal.MultiTableSqmMutationConverter; +import org.hibernate.query.sqm.mutation.spi.AfterUseAction; import org.hibernate.query.sqm.spi.SqmParameterMappingModelResolutionAccess; import org.hibernate.query.sqm.tree.expression.SqmParameter; import org.hibernate.query.sqm.tree.insert.SqmInsertStatement; @@ -77,7 +78,6 @@ import org.hibernate.sql.exec.spi.JdbcOperationQuerySelect; import org.hibernate.sql.exec.spi.JdbcParameterBindings; import org.hibernate.sql.results.graph.basic.BasicFetch; -import org.hibernate.sql.results.graph.basic.BasicResultAssembler; import org.hibernate.sql.results.internal.SqlSelectionImpl; import org.hibernate.sql.results.spi.ListResultsConsumer; import org.hibernate.type.descriptor.ValueBinder; diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/LocalTemporaryTableInsertStrategy.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/LocalTemporaryTableInsertStrategy.java index b83e3482224e..922e525da79b 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/LocalTemporaryTableInsertStrategy.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/LocalTemporaryTableInsertStrategy.java @@ -10,6 +10,7 @@ import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.query.spi.DomainQueryExecutionContext; import org.hibernate.query.sqm.internal.DomainParameterXref; +import org.hibernate.query.sqm.mutation.spi.AfterUseAction; import org.hibernate.query.sqm.mutation.spi.SqmMultiTableInsertStrategy; import org.hibernate.query.sqm.tree.insert.SqmInsertStatement; diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/LocalTemporaryTableMutationStrategy.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/LocalTemporaryTableMutationStrategy.java index 9892b1a1bfc5..d831716751cd 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/LocalTemporaryTableMutationStrategy.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/LocalTemporaryTableMutationStrategy.java @@ -8,9 +8,9 @@ import org.hibernate.dialect.temptable.TemporaryTable; import org.hibernate.engine.spi.SessionFactoryImplementor; -import org.hibernate.metamodel.mapping.EntityMappingType; import org.hibernate.query.spi.DomainQueryExecutionContext; import org.hibernate.query.sqm.internal.DomainParameterXref; +import org.hibernate.query.sqm.mutation.spi.AfterUseAction; import org.hibernate.query.sqm.mutation.spi.SqmMultiTableMutationStrategy; import org.hibernate.query.sqm.tree.delete.SqmDeleteStatement; import org.hibernate.query.sqm.tree.update.SqmUpdateStatement; diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/PersistentTableStrategy.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/PersistentTableStrategy.java index e3db49d89171..39c299d818f9 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/PersistentTableStrategy.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/PersistentTableStrategy.java @@ -18,6 +18,7 @@ import org.hibernate.metamodel.mapping.EntityMappingType; import org.hibernate.metamodel.mapping.internal.MappingModelCreationProcess; +import org.hibernate.query.sqm.mutation.spi.AfterUseAction; import org.jboss.logging.Logger; /** diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/RestrictedDeleteExecutionDelegate.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/RestrictedDeleteExecutionDelegate.java index 8f02c3de1c0b..8c9a46791cc9 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/RestrictedDeleteExecutionDelegate.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/RestrictedDeleteExecutionDelegate.java @@ -33,6 +33,7 @@ import org.hibernate.query.sqm.internal.SqmUtil; import org.hibernate.query.sqm.mutation.internal.SqmMutationStrategyHelper; import org.hibernate.query.sqm.mutation.internal.TableKeyExpressionCollector; +import org.hibernate.query.sqm.mutation.spi.AfterUseAction; import org.hibernate.query.sqm.spi.SqmParameterMappingModelResolutionAccess; import org.hibernate.query.sqm.tree.delete.SqmDeleteStatement; import org.hibernate.query.sqm.tree.expression.SqmParameter; diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/SoftDeleteExecutionDelegate.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/SoftDeleteExecutionDelegate.java index ea9d3738b0e3..e009775013b6 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/SoftDeleteExecutionDelegate.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/SoftDeleteExecutionDelegate.java @@ -31,6 +31,7 @@ import org.hibernate.query.sqm.internal.SqmUtil; import org.hibernate.query.sqm.mutation.internal.MultiTableSqmMutationConverter; import org.hibernate.query.sqm.mutation.internal.SqmMutationStrategyHelper; +import org.hibernate.query.sqm.mutation.spi.AfterUseAction; import org.hibernate.query.sqm.spi.SqmParameterMappingModelResolutionAccess; import org.hibernate.query.sqm.tree.delete.SqmDeleteStatement; import org.hibernate.query.sqm.tree.expression.SqmParameter; diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/TableBasedDeleteHandler.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/TableBasedDeleteHandler.java index b95a336de631..5340c6d23424 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/TableBasedDeleteHandler.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/TableBasedDeleteHandler.java @@ -15,6 +15,7 @@ import org.hibernate.query.sqm.internal.DomainParameterXref; import org.hibernate.query.sqm.mutation.internal.DeleteHandler; import org.hibernate.query.sqm.mutation.spi.AbstractMutationHandler; +import org.hibernate.query.sqm.mutation.spi.AfterUseAction; import org.hibernate.query.sqm.tree.delete.SqmDeleteStatement; import org.jboss.logging.Logger; diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/TableBasedInsertHandler.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/TableBasedInsertHandler.java index fad762a5c328..d9b491a965b1 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/TableBasedInsertHandler.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/TableBasedInsertHandler.java @@ -28,6 +28,7 @@ import org.hibernate.query.sqm.mutation.internal.InsertHandler; import org.hibernate.query.sqm.mutation.internal.MultiTableSqmMutationConverter; import org.hibernate.query.sqm.mutation.internal.SqmInsertStrategyHelper; +import org.hibernate.query.sqm.mutation.spi.AfterUseAction; import org.hibernate.query.sqm.sql.BaseSqmToSqlAstConverter; import org.hibernate.query.sqm.tree.insert.SqmInsertSelectStatement; import org.hibernate.query.sqm.tree.insert.SqmInsertStatement; diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/TableBasedUpdateHandler.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/TableBasedUpdateHandler.java index 12cefd5658fa..33cb2dbb2451 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/TableBasedUpdateHandler.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/TableBasedUpdateHandler.java @@ -18,6 +18,7 @@ import org.hibernate.query.sqm.mutation.internal.MultiTableSqmMutationConverter; import org.hibernate.query.sqm.mutation.internal.UpdateHandler; import org.hibernate.query.sqm.mutation.spi.AbstractMutationHandler; +import org.hibernate.query.sqm.mutation.spi.AfterUseAction; import org.hibernate.query.sqm.tree.update.SqmUpdateStatement; import org.hibernate.sql.ast.tree.from.TableGroup; import org.hibernate.sql.ast.tree.from.TableReference; diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/UpdateExecutionDelegate.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/UpdateExecutionDelegate.java index 9ad9b985ed48..74f4c297c717 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/UpdateExecutionDelegate.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/UpdateExecutionDelegate.java @@ -34,13 +34,13 @@ import org.hibernate.query.sqm.internal.SqmUtil; import org.hibernate.query.sqm.mutation.internal.MultiTableSqmMutationConverter; import org.hibernate.query.sqm.mutation.internal.TableKeyExpressionCollector; +import org.hibernate.query.sqm.mutation.spi.AfterUseAction; import org.hibernate.query.sqm.spi.SqmParameterMappingModelResolutionAccess; import org.hibernate.query.sqm.tree.expression.SqmParameter; import org.hibernate.sql.ast.SqlAstTranslatorFactory; import org.hibernate.sql.ast.spi.SqlSelection; import org.hibernate.sql.ast.tree.expression.ColumnReference; import org.hibernate.sql.ast.tree.expression.Expression; -import org.hibernate.sql.ast.tree.expression.JdbcParameter; import org.hibernate.sql.ast.tree.expression.QueryLiteral; import org.hibernate.sql.ast.tree.expression.SqlTuple; import org.hibernate.sql.ast.tree.from.NamedTableReference; @@ -58,9 +58,7 @@ import org.hibernate.sql.ast.tree.update.UpdateStatement; import org.hibernate.sql.exec.spi.ExecutionContext; import org.hibernate.sql.exec.spi.JdbcMutationExecutor; -import org.hibernate.sql.exec.spi.JdbcOperationQueryInsert; import org.hibernate.sql.exec.spi.JdbcOperationQueryMutation; -import org.hibernate.sql.exec.spi.JdbcOperationQueryUpdate; import org.hibernate.sql.exec.spi.JdbcParameterBindings; import org.hibernate.sql.results.internal.SqlSelectionImpl; diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/AfterUseAction.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/spi/AfterUseAction.java similarity index 86% rename from hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/AfterUseAction.java rename to hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/spi/AfterUseAction.java index 26741fc79a8a..02aac0a47de6 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/AfterUseAction.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/spi/AfterUseAction.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html */ -package org.hibernate.query.sqm.mutation.internal.temptable; +package org.hibernate.query.sqm.mutation.spi; /** * Actions to perform in regard to a temporary table after each use. diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/BeforeUseAction.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/spi/BeforeUseAction.java similarity index 86% rename from hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/BeforeUseAction.java rename to hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/spi/BeforeUseAction.java index d32bfc78a6d0..68c60b5743e9 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/BeforeUseAction.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/spi/BeforeUseAction.java @@ -4,7 +4,7 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html */ -package org.hibernate.query.sqm.mutation.internal.temptable; +package org.hibernate.query.sqm.mutation.spi; /** * Actions to perform in regards to a temporary table prior to each use. diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/produce/function/FunctionParameterType.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/produce/function/FunctionParameterType.java index 2564f6626448..e6e458383163 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/produce/function/FunctionParameterType.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/produce/function/FunctionParameterType.java @@ -6,7 +6,7 @@ */ package org.hibernate.query.sqm.produce.function; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; /** * A mini-"type system" for HQL function parameters. diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/sql/BaseSqmToSqlAstConverter.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/sql/BaseSqmToSqlAstConverter.java index 4baec0748632..800366729320 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/sql/BaseSqmToSqlAstConverter.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/sql/BaseSqmToSqlAstConverter.java @@ -130,12 +130,12 @@ import org.hibernate.query.sqm.CastType; import org.hibernate.query.sqm.ComparisonOperator; import org.hibernate.query.sqm.DynamicInstantiationNature; -import org.hibernate.query.sqm.FetchClauseType; +import org.hibernate.query.common.FetchClauseType; import org.hibernate.query.sqm.InterpretationException; import org.hibernate.query.sqm.SqmExpressible; import org.hibernate.query.sqm.SqmPathSource; import org.hibernate.query.sqm.SqmQuerySource; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.UnaryArithmeticOperator; import org.hibernate.query.sqm.function.AbstractSqmSelfRenderingFunctionDescriptor; import org.hibernate.query.sqm.function.SelfRenderingAggregateFunctionSqlAstExpression; @@ -440,10 +440,10 @@ import static org.hibernate.query.sqm.BinaryArithmeticOperator.ADD; import static org.hibernate.query.sqm.BinaryArithmeticOperator.MULTIPLY; import static org.hibernate.query.sqm.BinaryArithmeticOperator.SUBTRACT; -import static org.hibernate.query.sqm.TemporalUnit.EPOCH; -import static org.hibernate.query.sqm.TemporalUnit.NANOSECOND; -import static org.hibernate.query.sqm.TemporalUnit.NATIVE; -import static org.hibernate.query.sqm.TemporalUnit.SECOND; +import static org.hibernate.query.common.TemporalUnit.EPOCH; +import static org.hibernate.query.common.TemporalUnit.NANOSECOND; +import static org.hibernate.query.common.TemporalUnit.NATIVE; +import static org.hibernate.query.common.TemporalUnit.SECOND; import static org.hibernate.query.sqm.UnaryArithmeticOperator.UNARY_MINUS; import static org.hibernate.query.sqm.internal.SqmUtil.isFkOptimizationAllowed; import static org.hibernate.sql.ast.spi.SqlAstTreeHelper.combinePredicates; diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/SqmJoinType.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/SqmJoinType.java index b740d553016c..1e542302a5fd 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/SqmJoinType.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/SqmJoinType.java @@ -6,92 +6,102 @@ */ package org.hibernate.query.sqm.tree; +import org.hibernate.query.common.JoinType; import org.hibernate.sql.ast.SqlAstJoinType; /** * Represents a canonical join type. - *

- * Note that currently HQL really only supports inner and left outer joins - * (though cross joins can also be achieved). This is because joins in HQL - * are always defined in relation to a mapped association. However, when we - * start allowing users to specify ad-hoc joins this may need to change to - * allow the full spectrum of join types. Thus the others are provided here - * currently just for completeness and for future expansion. * * @author Steve Ebersole + * + * @see JoinType + * @see SqlAstJoinType */ public enum SqmJoinType { /** * Represents an inner join. */ - INNER( "inner", SqlAstJoinType.INNER, jakarta.persistence.criteria.JoinType.INNER ), + INNER, /** * Represents a left outer join. */ - LEFT( "left outer", SqlAstJoinType.LEFT, jakarta.persistence.criteria.JoinType.LEFT ), + LEFT, /** * Represents a right outer join. */ - RIGHT( "right outer", SqlAstJoinType.RIGHT, jakarta.persistence.criteria.JoinType.RIGHT ), + RIGHT, /** * Represents a cross join (aka a cartesian product). */ - CROSS( "cross", SqlAstJoinType.CROSS, null ), + CROSS, /** * Represents a full join. */ - FULL( "full", SqlAstJoinType.FULL, null ); - - private final String text; - private final SqlAstJoinType correspondingSqlAstJoinType; - private final jakarta.persistence.criteria.JoinType correspondingJpaJoinType; - - SqmJoinType( - String text, - SqlAstJoinType correspondingSqlAstJoinType, - jakarta.persistence.criteria.JoinType correspondingJpaJoinType) { - this.text = text; - this.correspondingSqlAstJoinType = correspondingSqlAstJoinType; - this.correspondingJpaJoinType = correspondingJpaJoinType; - } + FULL; @Override public String toString() { - return text; + return getText(); } public String getText() { - return text; + return switch (this) { + case RIGHT -> "right outer"; + case LEFT -> "left outer"; + case INNER -> "inner"; + case FULL -> "full"; + case CROSS -> "cross"; + }; } public SqlAstJoinType getCorrespondingSqlJoinType() { - return correspondingSqlAstJoinType; + return switch (this) { + case RIGHT -> SqlAstJoinType.RIGHT; + case LEFT -> SqlAstJoinType.LEFT; + case INNER -> SqlAstJoinType.INNER; + case FULL -> SqlAstJoinType.FULL; + case CROSS -> SqlAstJoinType.CROSS; + }; } public jakarta.persistence.criteria.JoinType getCorrespondingJpaJoinType() { - return correspondingJpaJoinType; + return switch (this) { + case RIGHT -> jakarta.persistence.criteria.JoinType.RIGHT; + case LEFT -> jakarta.persistence.criteria.JoinType.LEFT; + case INNER -> jakarta.persistence.criteria.JoinType.INNER; + default -> null; + }; + } + + public JoinType getCorrespondingJoinType() { + return switch (this) { + case RIGHT -> JoinType.RIGHT; + case LEFT -> JoinType.LEFT; + case INNER -> JoinType.INNER; + case FULL -> JoinType.FULL; + case CROSS -> JoinType.CROSS; + }; + } + + public static SqmJoinType from(JoinType joinType) { + return switch ( joinType ) { + case INNER -> INNER; + case LEFT -> LEFT; + case RIGHT -> RIGHT; + case CROSS -> CROSS; + case FULL -> FULL; + }; } - @SuppressWarnings("DuplicateBranchesInSwitch") public static SqmJoinType from(jakarta.persistence.criteria.JoinType jpaJoinType) { - switch ( jpaJoinType ) { - case INNER: { - return INNER; - } - case LEFT: { - return LEFT; - } - case RIGHT: { - return RIGHT; - } - default: { - // generally speaking, the default for JPA JoinType is INNER - return INNER; - } - } + return switch ( jpaJoinType ) { + case INNER -> INNER; + case LEFT -> LEFT; + case RIGHT -> RIGHT; + }; } } diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/expression/Conversion.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/expression/Conversion.java index 857642cefe20..646595b741fb 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/expression/Conversion.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/expression/Conversion.java @@ -8,7 +8,7 @@ import org.hibernate.metamodel.mapping.BasicValuedMapping; import org.hibernate.metamodel.mapping.MappingModelExpressible; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.sql.internal.DomainResultProducer; import org.hibernate.sql.ast.SqlAstWalker; import org.hibernate.sql.ast.spi.SqlAstCreationState; diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/expression/SqmDurationUnit.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/expression/SqmDurationUnit.java index fd714b1667d4..5641dca7cdc0 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/expression/SqmDurationUnit.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/expression/SqmDurationUnit.java @@ -7,7 +7,7 @@ package org.hibernate.query.sqm.tree.expression; import org.hibernate.query.ReturnableType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.NodeBuilder; import org.hibernate.query.sqm.SemanticQueryWalker; import org.hibernate.query.sqm.SqmExpressible; diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/expression/SqmExpressionHelper.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/expression/SqmExpressionHelper.java index 6940e41d7ef1..5fd8138fd091 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/expression/SqmExpressionHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/expression/SqmExpressionHelper.java @@ -23,7 +23,7 @@ import org.hibernate.query.sqm.BinaryArithmeticOperator; import org.hibernate.query.sqm.NodeBuilder; import org.hibernate.query.sqm.SqmExpressible; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.tree.domain.SqmPath; import org.hibernate.type.descriptor.java.JavaTypeHelper; import org.hibernate.type.descriptor.java.JdbcDateJavaType; diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/expression/SqmExtractUnit.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/expression/SqmExtractUnit.java index 285b1ed4c239..3aa5056e7865 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/expression/SqmExtractUnit.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/expression/SqmExtractUnit.java @@ -7,7 +7,7 @@ package org.hibernate.query.sqm.tree.expression; import org.hibernate.query.ReturnableType; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.NodeBuilder; import org.hibernate.query.sqm.SemanticQueryWalker; import org.hibernate.query.sqm.SqmExpressible; diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/expression/SqmOver.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/expression/SqmOver.java index 0decadee7b56..23142ced4bc4 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/expression/SqmOver.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/expression/SqmOver.java @@ -8,9 +8,9 @@ import java.util.List; -import org.hibernate.query.sqm.FrameExclusion; -import org.hibernate.query.sqm.FrameKind; -import org.hibernate.query.sqm.FrameMode; +import org.hibernate.query.common.FrameExclusion; +import org.hibernate.query.common.FrameKind; +import org.hibernate.query.common.FrameMode; import org.hibernate.query.sqm.SemanticQueryWalker; import org.hibernate.query.sqm.SqmExpressible; import org.hibernate.query.sqm.tree.SqmCopyContext; diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/expression/SqmWindow.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/expression/SqmWindow.java index 576dc4738dd3..4e2a2acf4e24 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/expression/SqmWindow.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/expression/SqmWindow.java @@ -12,9 +12,9 @@ import org.hibernate.Incubating; import org.hibernate.query.criteria.JpaWindow; import org.hibernate.query.criteria.JpaWindowFrame; -import org.hibernate.query.sqm.FrameExclusion; -import org.hibernate.query.sqm.FrameKind; -import org.hibernate.query.sqm.FrameMode; +import org.hibernate.query.common.FrameExclusion; +import org.hibernate.query.common.FrameKind; +import org.hibernate.query.common.FrameMode; import org.hibernate.query.sqm.NodeBuilder; import org.hibernate.query.sqm.SemanticQueryWalker; import org.hibernate.query.sqm.tree.AbstractSqmNode; @@ -25,12 +25,12 @@ import jakarta.persistence.criteria.Expression; import jakarta.persistence.criteria.Order; -import static org.hibernate.query.sqm.FrameExclusion.NO_OTHERS; -import static org.hibernate.query.sqm.FrameKind.CURRENT_ROW; -import static org.hibernate.query.sqm.FrameKind.UNBOUNDED_PRECEDING; -import static org.hibernate.query.sqm.FrameMode.GROUPS; -import static org.hibernate.query.sqm.FrameMode.RANGE; -import static org.hibernate.query.sqm.FrameMode.ROWS; +import static org.hibernate.query.common.FrameExclusion.NO_OTHERS; +import static org.hibernate.query.common.FrameKind.CURRENT_ROW; +import static org.hibernate.query.common.FrameKind.UNBOUNDED_PRECEDING; +import static org.hibernate.query.common.FrameMode.GROUPS; +import static org.hibernate.query.common.FrameMode.RANGE; +import static org.hibernate.query.common.FrameMode.ROWS; /** * @author Marco Belladelli diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/expression/SqmWindowFrame.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/expression/SqmWindowFrame.java index b335f2f46b57..b32610b397cd 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/expression/SqmWindowFrame.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/expression/SqmWindowFrame.java @@ -8,7 +8,7 @@ import org.hibernate.Incubating; import org.hibernate.query.criteria.JpaWindowFrame; -import org.hibernate.query.sqm.FrameKind; +import org.hibernate.query.common.FrameKind; import org.hibernate.query.sqm.NodeBuilder; import org.hibernate.query.sqm.tree.AbstractSqmNode; import org.hibernate.query.sqm.tree.SqmCopyContext; diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/select/SqmQueryGroup.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/select/SqmQueryGroup.java index f90c532e59b7..4827ba4dac78 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/select/SqmQueryGroup.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/select/SqmQueryGroup.java @@ -12,7 +12,7 @@ import java.util.List; import org.hibernate.internal.util.collections.CollectionHelper; -import org.hibernate.query.sqm.FetchClauseType; +import org.hibernate.query.common.FetchClauseType; import org.hibernate.query.SemanticException; import org.hibernate.query.sqm.SetOperator; import org.hibernate.query.criteria.JpaExpression; @@ -101,12 +101,10 @@ public List> getQueryParts() { return Collections.unmodifiableList( queryParts ); } - @Override public SetOperator getSetOperator() { return setOperator; } - @Override public void setSetOperator(SetOperator setOperator) { if ( setOperator == null ) { throw new IllegalArgumentException(); diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/select/SqmQueryPart.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/select/SqmQueryPart.java index 230ca8cf1eb6..4957e2ced0ce 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/select/SqmQueryPart.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/select/SqmQueryPart.java @@ -9,7 +9,7 @@ import java.util.Collections; import java.util.List; -import org.hibernate.query.sqm.FetchClauseType; +import org.hibernate.query.common.FetchClauseType; import org.hibernate.query.criteria.JpaExpression; import org.hibernate.query.criteria.JpaOrder; import org.hibernate.query.criteria.JpaQueryPart; diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/select/SqmQuerySpec.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/select/SqmQuerySpec.java index 512e4de37b66..b0b7c3eee286 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/select/SqmQuerySpec.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/select/SqmQuerySpec.java @@ -23,7 +23,7 @@ import org.hibernate.query.criteria.JpaQueryStructure; import org.hibernate.query.criteria.JpaRoot; import org.hibernate.query.criteria.JpaSelection; -import org.hibernate.query.sqm.FetchClauseType; +import org.hibernate.query.common.FetchClauseType; import org.hibernate.query.sqm.NodeBuilder; import org.hibernate.query.sqm.SemanticQueryWalker; import org.hibernate.query.sqm.internal.SqmUtil; diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/select/SqmSelectStatement.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/select/SqmSelectStatement.java index 35c552d36c38..41738abdcc8f 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/select/SqmSelectStatement.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/select/SqmSelectStatement.java @@ -17,7 +17,7 @@ import org.hibernate.query.criteria.JpaCriteriaQuery; import org.hibernate.query.criteria.JpaExpression; import org.hibernate.query.criteria.JpaSelection; -import org.hibernate.query.sqm.FetchClauseType; +import org.hibernate.query.common.FetchClauseType; import org.hibernate.query.sqm.NodeBuilder; import org.hibernate.query.sqm.SemanticQueryWalker; import org.hibernate.query.sqm.SqmQuerySource; diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/select/SqmSubQuery.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/select/SqmSubQuery.java index 33d2458d0bd6..55f4aaa875ac 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/select/SqmSubQuery.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/tree/select/SqmSubQuery.java @@ -24,7 +24,7 @@ import org.hibernate.query.criteria.JpaOrder; import org.hibernate.query.criteria.JpaSelection; import org.hibernate.query.criteria.JpaSubQuery; -import org.hibernate.query.sqm.FetchClauseType; +import org.hibernate.query.common.FetchClauseType; import org.hibernate.query.sqm.NodeBuilder; import org.hibernate.query.sqm.SemanticQueryWalker; import org.hibernate.query.sqm.SqmExpressible; diff --git a/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/AbstractSqlAstTranslator.java b/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/AbstractSqlAstTranslator.java index 01deee81bf66..840b7618d73e 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/AbstractSqlAstTranslator.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/AbstractSqlAstTranslator.java @@ -67,10 +67,10 @@ import org.hibernate.query.spi.QueryOptions; import org.hibernate.query.sqm.BinaryArithmeticOperator; import org.hibernate.query.sqm.ComparisonOperator; -import org.hibernate.query.sqm.FetchClauseType; -import org.hibernate.query.sqm.FrameExclusion; -import org.hibernate.query.sqm.FrameKind; -import org.hibernate.query.sqm.FrameMode; +import org.hibernate.query.common.FetchClauseType; +import org.hibernate.query.common.FrameExclusion; +import org.hibernate.query.common.FrameKind; +import org.hibernate.query.common.FrameMode; import org.hibernate.query.sqm.SetOperator; import org.hibernate.query.sqm.UnaryArithmeticOperator; import org.hibernate.query.sqm.function.AbstractSqmSelfRenderingFunctionDescriptor; @@ -231,7 +231,7 @@ import static org.hibernate.persister.entity.DiscriminatorHelper.jdbcLiteral; import static org.hibernate.query.sqm.BinaryArithmeticOperator.DIVIDE_PORTABLE; -import static org.hibernate.query.sqm.TemporalUnit.NANOSECOND; +import static org.hibernate.query.common.TemporalUnit.NANOSECOND; import static org.hibernate.sql.ast.SqlTreePrinter.logSqlAst; import static org.hibernate.sql.results.graph.DomainResultGraphPrinter.logDomainResultGraph; diff --git a/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/Duration.java b/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/Duration.java index 600e6f5d171d..ce255ae4ffe0 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/Duration.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/Duration.java @@ -7,7 +7,7 @@ package org.hibernate.sql.ast.tree.expression; import org.hibernate.metamodel.mapping.BasicValuedMapping; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.query.sqm.sql.internal.DomainResultProducer; import org.hibernate.query.sqm.tree.expression.Conversion; import org.hibernate.sql.ast.SqlAstWalker; diff --git a/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/DurationUnit.java b/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/DurationUnit.java index 3b27ecf8021b..86beb04188e6 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/DurationUnit.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/DurationUnit.java @@ -7,7 +7,7 @@ package org.hibernate.sql.ast.tree.expression; import org.hibernate.metamodel.mapping.BasicValuedMapping; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.sql.ast.SqlAstWalker; import org.hibernate.sql.ast.tree.SqlAstNode; diff --git a/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/ExtractUnit.java b/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/ExtractUnit.java index 97229db7104d..0d0218132981 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/ExtractUnit.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/ExtractUnit.java @@ -7,7 +7,7 @@ package org.hibernate.sql.ast.tree.expression; import org.hibernate.metamodel.mapping.BasicValuedMapping; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.sql.ast.SqlAstWalker; import org.hibernate.sql.ast.tree.SqlAstNode; diff --git a/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/Over.java b/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/Over.java index 13d4c435ec34..ee3bb6fd8fce 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/Over.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/Over.java @@ -9,9 +9,9 @@ import java.util.List; import org.hibernate.metamodel.mapping.JdbcMappingContainer; -import org.hibernate.query.sqm.FrameExclusion; -import org.hibernate.query.sqm.FrameKind; -import org.hibernate.query.sqm.FrameMode; +import org.hibernate.query.common.FrameExclusion; +import org.hibernate.query.common.FrameKind; +import org.hibernate.query.common.FrameMode; import org.hibernate.query.sqm.sql.internal.DomainResultProducer; import org.hibernate.sql.ast.SqlAstWalker; import org.hibernate.sql.ast.spi.SqlAstCreationState; diff --git a/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/select/QueryPart.java b/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/select/QueryPart.java index e006275a0fb3..22af194f3f31 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/select/QueryPart.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/select/QueryPart.java @@ -11,7 +11,7 @@ import java.util.function.Consumer; import java.util.function.Function; -import org.hibernate.query.sqm.FetchClauseType; +import org.hibernate.query.common.FetchClauseType; import org.hibernate.query.sqm.tree.expression.SqmAliasedNodeRef; import org.hibernate.sql.ast.tree.SqlAstNode; import org.hibernate.sql.ast.tree.expression.Expression; diff --git a/hibernate-core/src/main/java/org/hibernate/sql/results/internal/TupleImpl.java b/hibernate-core/src/main/java/org/hibernate/sql/results/internal/TupleImpl.java index 7869ef50c9a6..b8d00bfeebee 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/results/internal/TupleImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/results/internal/TupleImpl.java @@ -8,9 +8,9 @@ import java.util.Arrays; import java.util.List; -import jakarta.persistence.TupleElement; -import org.hibernate.query.JpaTuple; +import jakarta.persistence.Tuple; +import jakarta.persistence.TupleElement; import static org.hibernate.internal.util.type.PrimitiveWrapperHelper.getDescriptorByPrimitiveType; @@ -19,7 +19,7 @@ * * @author Steve Ebersole */ -public class TupleImpl implements JpaTuple { +public class TupleImpl implements Tuple { private final TupleMetadata tupleMetadata; private final Object[] row; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/component/basic/ComponentTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/component/basic/ComponentTest.java index eaf822864dc2..cdfb689ce86f 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/component/basic/ComponentTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/component/basic/ComponentTest.java @@ -23,7 +23,7 @@ import org.hibernate.mapping.Component; import org.hibernate.mapping.Formula; import org.hibernate.mapping.PersistentClass; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.orm.junit.FailureExpected; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/criteria/CriteriaQualifiedJoinTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/criteria/CriteriaQualifiedJoinTest.java index 222a19adddef..d035b26882bf 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/criteria/CriteriaQualifiedJoinTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/criteria/CriteriaQualifiedJoinTest.java @@ -11,6 +11,7 @@ import java.util.List; import org.hibernate.Session; +import org.hibernate.query.common.JoinType; import org.hibernate.query.criteria.HibernateCriteriaBuilder; import org.hibernate.query.criteria.JpaCriteriaQuery; import org.hibernate.query.criteria.JpaCrossJoin; @@ -20,9 +21,7 @@ import org.hibernate.query.criteria.JpaPath; import org.hibernate.query.criteria.JpaRoot; import org.hibernate.query.criteria.JpaSubQuery; -import org.hibernate.query.sqm.tree.SqmJoinType; -import org.hibernate.testing.orm.junit.DialectFeatureCheck; import org.hibernate.testing.orm.junit.DialectFeatureChecks; import org.hibernate.testing.orm.junit.EntityManagerFactoryScope; import org.hibernate.testing.orm.junit.Jira; @@ -97,7 +96,7 @@ public void testEntityJoin(EntityManagerFactoryScope scope) { final HibernateCriteriaBuilder cb = entityManager.unwrap( Session.class ).getCriteriaBuilder(); final JpaCriteriaQuery query = cb.createTupleQuery(); final JpaRoot root = query.from( Primary.class ); - final JpaEntityJoin entityJoin = root.join( Secondary.class, SqmJoinType.INNER ); + final JpaEntityJoin entityJoin = root.join( Secondary.class, JoinType.INNER ); final JpaPath id = root.get( "id" ); entityJoin.on( cb.equal( id, entityJoin.get( "id" ) ) ); final JpaPath name = entityJoin.get( "name" ); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/criteria/basic/ExpressionsTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/criteria/basic/ExpressionsTest.java index 069666bd4bea..5e9d0aae07b8 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/criteria/basic/ExpressionsTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/criteria/basic/ExpressionsTest.java @@ -29,7 +29,7 @@ import org.hibernate.query.criteria.JpaCriteriaQuery; import org.hibernate.query.criteria.JpaDerivedRoot; import org.hibernate.query.criteria.JpaSubQuery; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.orm.junit.Jira; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/pagination/OraclePaginationWithLocksTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/pagination/OraclePaginationWithLocksTest.java index e70802b55592..f2b9590f4a5e 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/pagination/OraclePaginationWithLocksTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/pagination/OraclePaginationWithLocksTest.java @@ -11,7 +11,7 @@ import org.hibernate.LockOptions; import org.hibernate.dialect.OracleDialect; import org.hibernate.engine.spi.SessionImplementor; -import org.hibernate.query.sqm.FetchClauseType; +import org.hibernate.query.common.FetchClauseType; import org.hibernate.resource.jdbc.spi.StatementInspector; import org.hibernate.testing.TestForIssue; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromEmbeddedIdTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromEmbeddedIdTests.java index 334d953a950d..c44179572325 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromEmbeddedIdTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromEmbeddedIdTests.java @@ -8,14 +8,13 @@ import java.util.function.Consumer; +import org.hibernate.query.common.JoinType; import org.hibernate.query.criteria.HibernateCriteriaBuilder; import org.hibernate.query.criteria.JpaCriteriaQuery; import org.hibernate.query.criteria.JpaDerivedJoin; import org.hibernate.query.criteria.JpaRoot; import org.hibernate.query.criteria.JpaSubQuery; import org.hibernate.query.spi.QueryImplementor; -import org.hibernate.query.sqm.tree.SqmJoinType; -import org.hibernate.query.sqm.tree.from.SqmAttributeJoin; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.orm.junit.DialectFeatureChecks; @@ -67,7 +66,7 @@ public void testEntity(SessionFactoryScope scope) { subquery.orderBy( cb.asc( alternativeContact.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); cq.multiselect( root.get( "name" ), a.get( "contact" ).get( "id" ) ); cq.orderBy( cb.asc( root.get( "id" ) ) ); @@ -117,7 +116,7 @@ public void testEntityJoin(SessionFactoryScope scope) { subquery.orderBy( cb.desc( alternativeContact.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); final Join alt = a.join( "contact" ); cq.multiselect( root.get( "name" ), alt.get( "name" ) ); @@ -165,7 +164,7 @@ public void testEntityImplicit(SessionFactoryScope scope) { subquery.orderBy( cb.desc( alternativeContact.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); cq.multiselect( root.get( "name" ), a.get( "contact" ).get( "name" ) ); cq.orderBy( cb.asc( root.get( "id" ) ) ); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromIdClassTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromIdClassTests.java index 027f54e678f5..95ffe3a3d829 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromIdClassTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromIdClassTests.java @@ -8,14 +8,13 @@ import java.util.function.Consumer; +import org.hibernate.query.common.JoinType; import org.hibernate.query.criteria.HibernateCriteriaBuilder; import org.hibernate.query.criteria.JpaCriteriaQuery; import org.hibernate.query.criteria.JpaDerivedJoin; import org.hibernate.query.criteria.JpaRoot; import org.hibernate.query.criteria.JpaSubQuery; import org.hibernate.query.spi.QueryImplementor; -import org.hibernate.query.sqm.tree.SqmJoinType; -import org.hibernate.query.sqm.tree.from.SqmAttributeJoin; import org.hibernate.testing.orm.junit.DialectFeatureChecks; import org.hibernate.testing.orm.junit.DomainModel; @@ -65,7 +64,7 @@ public void testEntity(SessionFactoryScope scope) { subquery.orderBy( cb.asc( alternativeContact.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); cq.multiselect( root.get( "name" ), a.get( "contact" ).get( "id1" ), a.get( "contact" ).get( "id2" ) ); cq.orderBy( cb.asc( root.get( "id1" ) ) ); @@ -116,7 +115,7 @@ public void testEntityJoin(SessionFactoryScope scope) { subquery.orderBy( cb.desc( alternativeContact.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); final Join alt = a.join( "contact" ); cq.multiselect( root.get( "name" ), alt.get( "name" ) ); @@ -164,7 +163,7 @@ public void testEntityImplicit(SessionFactoryScope scope) { subquery.orderBy( cb.desc( alternativeContact.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); cq.multiselect( root.get( "name" ), a.get( "contact" ).get( "name" ) ); cq.orderBy( cb.asc( root.get( "id1" ) ) ); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromInverseOneEmbeddedIdTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromInverseOneEmbeddedIdTests.java index fcb74b8a123d..ee9cd0dfcbb6 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromInverseOneEmbeddedIdTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromInverseOneEmbeddedIdTests.java @@ -8,14 +8,13 @@ import java.util.function.Consumer; +import org.hibernate.query.common.JoinType; import org.hibernate.query.criteria.HibernateCriteriaBuilder; import org.hibernate.query.criteria.JpaCriteriaQuery; import org.hibernate.query.criteria.JpaDerivedJoin; import org.hibernate.query.criteria.JpaRoot; import org.hibernate.query.criteria.JpaSubQuery; import org.hibernate.query.spi.QueryImplementor; -import org.hibernate.query.sqm.tree.SqmJoinType; -import org.hibernate.query.sqm.tree.from.SqmAttributeJoin; import org.hibernate.testing.orm.junit.DialectFeatureChecks; import org.hibernate.testing.orm.junit.DomainModel; @@ -66,7 +65,7 @@ public void testEntity(SessionFactoryScope scope) { subquery.orderBy( cb.asc( alternativeContact.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); cq.multiselect( root.get( "name" ), a.get( "contact" ).get( "id" ) ); cq.orderBy( cb.asc( root.get( "id" ) ) ); @@ -116,7 +115,7 @@ public void testEntityJoin(SessionFactoryScope scope) { subquery.orderBy( cb.desc( alternativeContact.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); final Join alt = a.join( "contact" ); cq.multiselect( root.get( "name" ), alt.get( "name" ) ); @@ -164,7 +163,7 @@ public void testEntityImplicit(SessionFactoryScope scope) { subquery.orderBy( cb.desc( alternativeContact.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); cq.multiselect( root.get( "name" ), a.get( "contact" ).get( "name" ) ); cq.orderBy( cb.asc( root.get( "id" ) ) ); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromInverseOneIdClassTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromInverseOneIdClassTests.java index d8a23fe88486..6a759c6b14fd 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromInverseOneIdClassTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromInverseOneIdClassTests.java @@ -8,14 +8,13 @@ import java.util.function.Consumer; +import org.hibernate.query.common.JoinType; import org.hibernate.query.criteria.HibernateCriteriaBuilder; import org.hibernate.query.criteria.JpaCriteriaQuery; import org.hibernate.query.criteria.JpaDerivedJoin; import org.hibernate.query.criteria.JpaRoot; import org.hibernate.query.criteria.JpaSubQuery; import org.hibernate.query.spi.QueryImplementor; -import org.hibernate.query.sqm.tree.SqmJoinType; -import org.hibernate.query.sqm.tree.from.SqmAttributeJoin; import org.hibernate.testing.orm.junit.DialectFeatureChecks; import org.hibernate.testing.orm.junit.DomainModel; @@ -65,7 +64,7 @@ public void testEntity(SessionFactoryScope scope) { subquery.orderBy( cb.asc( alternativeContact.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); cq.multiselect( root.get( "name" ), a.get( "contact" ).get( "id1" ), a.get( "contact" ).get( "id2" ) ); cq.orderBy( cb.asc( root.get( "id1" ) ) ); @@ -116,7 +115,7 @@ public void testEntityJoin(SessionFactoryScope scope) { subquery.orderBy( cb.desc( alternativeContact.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); final Join alt = a.join( "contact" ); cq.multiselect( root.get( "name" ), alt.get( "name" ) ); @@ -164,7 +163,7 @@ public void testEntityImplicit(SessionFactoryScope scope) { subquery.orderBy( cb.desc( alternativeContact.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); cq.multiselect( root.get( "name" ), a.get( "contact" ).get( "name" ) ); cq.orderBy( cb.asc( root.get( "id1" ) ) ); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromInverseOneTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromInverseOneTests.java index f754a2c6061f..82696fa51bbf 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromInverseOneTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromInverseOneTests.java @@ -8,14 +8,13 @@ import java.util.function.Consumer; +import org.hibernate.query.common.JoinType; import org.hibernate.query.criteria.HibernateCriteriaBuilder; import org.hibernate.query.criteria.JpaCriteriaQuery; import org.hibernate.query.criteria.JpaDerivedJoin; import org.hibernate.query.criteria.JpaRoot; import org.hibernate.query.criteria.JpaSubQuery; import org.hibernate.query.spi.QueryImplementor; -import org.hibernate.query.sqm.tree.SqmJoinType; -import org.hibernate.query.sqm.tree.from.SqmAttributeJoin; import org.hibernate.testing.orm.junit.DialectFeatureChecks; import org.hibernate.testing.orm.junit.DomainModel; @@ -65,7 +64,7 @@ public void testEntity(SessionFactoryScope scope) { subquery.orderBy( cb.asc( alternativeContact.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); cq.multiselect( root.get( "name" ), a.get( "contact" ).get( "id" ) ); cq.orderBy( cb.asc( root.get( "id" ) ) ); @@ -113,7 +112,7 @@ public void testEntityJoin(SessionFactoryScope scope) { subquery.orderBy( cb.desc( alternativeContact.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); final Join alt = a.join( "contact" ); cq.multiselect( root.get( "name" ), alt.get( "name" ) ); @@ -161,7 +160,7 @@ public void testEntityImplicit(SessionFactoryScope scope) { subquery.orderBy( cb.desc( alternativeContact.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); cq.multiselect( root.get( "name" ), a.get( "contact" ).get( "name" ) ); cq.orderBy( cb.asc( root.get( "id" ) ) ); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromManyToManyEmbeddedIdTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromManyToManyEmbeddedIdTests.java index 28045cf7018e..8fed221a8e2b 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromManyToManyEmbeddedIdTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromManyToManyEmbeddedIdTests.java @@ -9,14 +9,13 @@ import java.util.Set; import java.util.function.Consumer; +import org.hibernate.query.common.JoinType; import org.hibernate.query.criteria.HibernateCriteriaBuilder; import org.hibernate.query.criteria.JpaCriteriaQuery; import org.hibernate.query.criteria.JpaDerivedJoin; import org.hibernate.query.criteria.JpaRoot; import org.hibernate.query.criteria.JpaSubQuery; import org.hibernate.query.spi.QueryImplementor; -import org.hibernate.query.sqm.tree.SqmJoinType; -import org.hibernate.query.sqm.tree.from.SqmAttributeJoin; import org.hibernate.testing.orm.junit.DialectFeatureChecks; import org.hibernate.testing.orm.junit.DomainModel; @@ -68,7 +67,7 @@ public void testEntity(SessionFactoryScope scope) { subquery.orderBy( cb.asc( alternativeContacts.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); cq.multiselect( root.get( "name" ), a.get( "contact" ).get( "id" ) ); cq.orderBy( cb.asc( root.get( "id" ) ) ); @@ -118,7 +117,7 @@ public void testEntityJoin(SessionFactoryScope scope) { subquery.orderBy( cb.desc( alternativeContacts.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); final Join alt = a.join( "contact" ); cq.multiselect( root.get( "name" ), alt.get( "name" ) ); @@ -166,7 +165,7 @@ public void testEntityImplicit(SessionFactoryScope scope) { subquery.orderBy( cb.desc( alternativeContacts.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); cq.multiselect( root.get( "name" ), a.get( "contact" ).get( "name" ) ); cq.orderBy( cb.asc( root.get( "id" ) ) ); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromManyToManyIdClassTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromManyToManyIdClassTests.java index 794f095d580b..6c542323bfb3 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromManyToManyIdClassTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromManyToManyIdClassTests.java @@ -9,14 +9,13 @@ import java.util.Set; import java.util.function.Consumer; +import org.hibernate.query.common.JoinType; import org.hibernate.query.criteria.HibernateCriteriaBuilder; import org.hibernate.query.criteria.JpaCriteriaQuery; import org.hibernate.query.criteria.JpaDerivedJoin; import org.hibernate.query.criteria.JpaRoot; import org.hibernate.query.criteria.JpaSubQuery; import org.hibernate.query.spi.QueryImplementor; -import org.hibernate.query.sqm.tree.SqmJoinType; -import org.hibernate.query.sqm.tree.from.SqmAttributeJoin; import org.hibernate.testing.orm.junit.DialectFeatureChecks; import org.hibernate.testing.orm.junit.DomainModel; @@ -68,7 +67,7 @@ public void testEntity(SessionFactoryScope scope) { subquery.orderBy( cb.asc( alternativeContacts.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); cq.multiselect( root.get( "name" ), a.get( "contact" ).get( "id1" ), a.get( "contact" ).get( "id2" ) ); cq.orderBy( cb.asc( root.get( "id1" ) ) ); @@ -119,7 +118,7 @@ public void testEntityJoin(SessionFactoryScope scope) { subquery.orderBy( cb.desc( alternativeContacts.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); final Join alt = a.join( "contact" ); cq.multiselect( root.get( "name" ), alt.get( "name" ) ); @@ -167,7 +166,7 @@ public void testEntityImplicit(SessionFactoryScope scope) { subquery.orderBy( cb.desc( alternativeContacts.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); cq.multiselect( root.get( "name" ), a.get( "contact" ).get( "name" ) ); cq.orderBy( cb.asc( root.get( "id1" ) ) ); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromManyToManyTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromManyToManyTests.java index 115dce557440..28877bee4430 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromManyToManyTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromManyToManyTests.java @@ -9,14 +9,13 @@ import java.util.Set; import java.util.function.Consumer; +import org.hibernate.query.common.JoinType; import org.hibernate.query.criteria.HibernateCriteriaBuilder; import org.hibernate.query.criteria.JpaCriteriaQuery; import org.hibernate.query.criteria.JpaDerivedJoin; import org.hibernate.query.criteria.JpaRoot; import org.hibernate.query.criteria.JpaSubQuery; import org.hibernate.query.spi.QueryImplementor; -import org.hibernate.query.sqm.tree.SqmJoinType; -import org.hibernate.query.sqm.tree.from.SqmAttributeJoin; import org.hibernate.testing.orm.junit.DialectFeatureChecks; import org.hibernate.testing.orm.junit.DomainModel; @@ -68,7 +67,7 @@ public void testEntity(SessionFactoryScope scope) { subquery.orderBy( cb.asc( alternativeContacts.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); cq.multiselect( root.get( "name" ), a.get( "contact" ).get( "id" ) ); cq.orderBy( cb.asc( root.get( "id" ) ) ); @@ -116,7 +115,7 @@ public void testEntityJoin(SessionFactoryScope scope) { subquery.orderBy( cb.desc( alternativeContacts.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); final Join alt = a.join( "contact" ); cq.multiselect( root.get( "name" ), alt.get( "name" ) ); @@ -164,7 +163,7 @@ public void testEntityImplicit(SessionFactoryScope scope) { subquery.orderBy( cb.desc( alternativeContacts.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); cq.multiselect( root.get( "name" ), a.get( "contact" ).get( "name" ) ); cq.orderBy( cb.asc( root.get( "id" ) ) ); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromOneToManyEmbeddedIdTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromOneToManyEmbeddedIdTests.java index 173da2ff9f5f..9583cf7719b6 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromOneToManyEmbeddedIdTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromOneToManyEmbeddedIdTests.java @@ -9,14 +9,13 @@ import java.util.Set; import java.util.function.Consumer; +import org.hibernate.query.common.JoinType; import org.hibernate.query.criteria.HibernateCriteriaBuilder; import org.hibernate.query.criteria.JpaCriteriaQuery; import org.hibernate.query.criteria.JpaDerivedJoin; import org.hibernate.query.criteria.JpaRoot; import org.hibernate.query.criteria.JpaSubQuery; import org.hibernate.query.spi.QueryImplementor; -import org.hibernate.query.sqm.tree.SqmJoinType; -import org.hibernate.query.sqm.tree.from.SqmAttributeJoin; import org.hibernate.testing.orm.junit.DialectFeatureChecks; import org.hibernate.testing.orm.junit.DomainModel; @@ -67,7 +66,7 @@ public void testEntity(SessionFactoryScope scope) { subquery.orderBy( cb.asc( alternativeContacts.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); cq.multiselect( root.get( "name" ), a.get( "contact" ).get( "id" ) ); cq.orderBy( cb.asc( root.get( "id" ) ) ); @@ -117,7 +116,7 @@ public void testEntityJoin(SessionFactoryScope scope) { subquery.orderBy( cb.desc( alternativeContacts.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); final Join alt = a.join( "contact" ); cq.multiselect( root.get( "name" ), alt.get( "name" ) ); @@ -165,7 +164,7 @@ public void testEntityImplicit(SessionFactoryScope scope) { subquery.orderBy( cb.desc( alternativeContacts.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); cq.multiselect( root.get( "name" ), a.get( "contact" ).get( "name" ) ); cq.orderBy( cb.asc( root.get( "id" ) ) ); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromOneToManyIdClassTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromOneToManyIdClassTests.java index 448b04497248..abad1c73eaf2 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromOneToManyIdClassTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromOneToManyIdClassTests.java @@ -9,14 +9,13 @@ import java.util.Set; import java.util.function.Consumer; +import org.hibernate.query.common.JoinType; import org.hibernate.query.criteria.HibernateCriteriaBuilder; import org.hibernate.query.criteria.JpaCriteriaQuery; import org.hibernate.query.criteria.JpaDerivedJoin; import org.hibernate.query.criteria.JpaRoot; import org.hibernate.query.criteria.JpaSubQuery; import org.hibernate.query.spi.QueryImplementor; -import org.hibernate.query.sqm.tree.SqmJoinType; -import org.hibernate.query.sqm.tree.from.SqmAttributeJoin; import org.hibernate.testing.orm.junit.DialectFeatureChecks; import org.hibernate.testing.orm.junit.DomainModel; @@ -67,7 +66,7 @@ public void testEntity(SessionFactoryScope scope) { subquery.orderBy( cb.asc( alternativeContacts.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); cq.multiselect( root.get( "name" ), a.get( "contact" ).get( "id1" ), a.get( "contact" ).get( "id2" ) ); cq.orderBy( cb.asc( root.get( "id1" ) ) ); @@ -118,7 +117,7 @@ public void testEntityJoin(SessionFactoryScope scope) { subquery.orderBy( cb.desc( alternativeContacts.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); final Join alt = a.join( "contact" ); cq.multiselect( root.get( "name" ), alt.get( "name" ) ); @@ -166,7 +165,7 @@ public void testEntityImplicit(SessionFactoryScope scope) { subquery.orderBy( cb.desc( alternativeContacts.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); cq.multiselect( root.get( "name" ), a.get( "contact" ).get( "name" ) ); cq.orderBy( cb.asc( root.get( "id1" ) ) ); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromOneToManyTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromOneToManyTests.java index 3a1320840df5..741f6cbf888a 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromOneToManyTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromOneToManyTests.java @@ -9,14 +9,13 @@ import java.util.Set; import java.util.function.Consumer; +import org.hibernate.query.common.JoinType; import org.hibernate.query.criteria.HibernateCriteriaBuilder; import org.hibernate.query.criteria.JpaCriteriaQuery; import org.hibernate.query.criteria.JpaDerivedJoin; import org.hibernate.query.criteria.JpaRoot; import org.hibernate.query.criteria.JpaSubQuery; import org.hibernate.query.spi.QueryImplementor; -import org.hibernate.query.sqm.tree.SqmJoinType; -import org.hibernate.query.sqm.tree.from.SqmAttributeJoin; import org.hibernate.testing.orm.junit.DialectFeatureChecks; import org.hibernate.testing.orm.junit.DomainModel; @@ -67,7 +66,7 @@ public void testEntity(SessionFactoryScope scope) { subquery.orderBy( cb.asc( alternativeContacts.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); cq.multiselect( root.get( "name" ), a.get( "contact" ).get( "id" ) ); cq.orderBy( cb.asc( root.get( "id" ) ) ); @@ -115,7 +114,7 @@ public void testEntityJoin(SessionFactoryScope scope) { subquery.orderBy( cb.desc( alternativeContacts.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); final Join alt = a.join( "contact" ); cq.multiselect( root.get( "name" ), alt.get( "name" ) ); @@ -163,7 +162,7 @@ public void testEntityImplicit(SessionFactoryScope scope) { subquery.orderBy( cb.desc( alternativeContacts.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); cq.multiselect( root.get( "name" ), a.get( "contact" ).get( "name" ) ); cq.orderBy( cb.asc( root.get( "id" ) ) ); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromTests.java index 4acccacb252a..8798f2893b4b 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/SubQueryInFromTests.java @@ -10,6 +10,7 @@ import java.util.List; import java.util.function.Consumer; +import org.hibernate.query.common.JoinType; import org.hibernate.query.criteria.HibernateCriteriaBuilder; import org.hibernate.query.criteria.JpaCriteriaQuery; import org.hibernate.query.criteria.JpaDerivedJoin; @@ -18,8 +19,6 @@ import org.hibernate.query.criteria.JpaSubQuery; import org.hibernate.query.spi.QueryImplementor; import org.hibernate.query.sqm.InterpretationException; -import org.hibernate.query.sqm.tree.SqmJoinType; -import org.hibernate.query.sqm.tree.from.SqmAttributeJoin; import org.hibernate.testing.orm.junit.Jira; import org.hibernate.testing.orm.junit.RequiresDialectFeature; @@ -37,7 +36,6 @@ import jakarta.persistence.Tuple; import jakarta.persistence.criteria.Join; import jakarta.persistence.criteria.Root; -import org.assertj.core.api.Assertions; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -147,7 +145,7 @@ public void testBasic(SessionFactoryScope scope) { subquery.orderBy( cb.asc( address.get( "line1" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.INNER ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.INNER ); cq.multiselect( root.get( "name" ), a.get( "address" ) ); @@ -234,7 +232,7 @@ public void testEmbedded(SessionFactoryScope scope) { subquery.orderBy( cb.asc( address.get( "line1" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.INNER ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.INNER ); cq.multiselect( root.get( "name" ), a.get( "zip" ) ); @@ -317,7 +315,7 @@ public void testEntity(SessionFactoryScope scope) { subquery.orderBy( cb.asc( alternativeContact.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); cq.multiselect( root.get( "name" ), a.get( "contact" ).get( "id" ) ); cq.where( cb.equal( root.get( "id" ), 1 ) ); @@ -363,7 +361,7 @@ public void testEntityJoin(SessionFactoryScope scope) { subquery.orderBy( cb.desc( alternativeContact.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); final Join alt = a.join( "contact" ); cq.multiselect( root.get( "name" ), alt.get( "name" ) ); @@ -411,7 +409,7 @@ public void testEntityImplicit(SessionFactoryScope scope) { subquery.orderBy( cb.desc( alternativeContact.get( "name" ).get( "first" ) ) ); subquery.fetch( 1 ); - final JpaDerivedJoin a = root.joinLateral( subquery, SqmJoinType.LEFT ); + final JpaDerivedJoin a = root.joinLateral( subquery, JoinType.LEFT ); cq.multiselect( root.get( "name" ), a.get( "contact" ).get( "name" ) ); cq.where( cb.equal( root.get( "id" ), 1 ) ); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/criteria/BasicCriteriaExecutionTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/criteria/BasicCriteriaExecutionTests.java index d2a43d9a76e7..9533f98b46b0 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/criteria/BasicCriteriaExecutionTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/criteria/BasicCriteriaExecutionTests.java @@ -12,10 +12,10 @@ import org.hibernate.community.dialect.DerbyDialect; import org.hibernate.dialect.H2Dialect; +import org.hibernate.query.common.JoinType; import org.hibernate.query.criteria.HibernateCriteriaBuilder; import org.hibernate.query.criteria.JpaCriteriaQuery; import org.hibernate.query.criteria.JpaRoot; -import org.hibernate.query.sqm.tree.SqmJoinType; import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.orm.domain.gambit.BasicEntity; @@ -159,7 +159,7 @@ public void testCriteriaEntityJoin(SessionFactoryScope scope) { final JpaCriteriaQuery criteria = criteriaBuilder.createQuery(); final JpaRoot root = criteria.from( BasicEntity.class ); - root.join( BasicEntity.class, SqmJoinType.CROSS ); + root.join( BasicEntity.class, JoinType.CROSS ); criteria.select( root ); session.createQuery( criteria ).list(); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/criteria/CriteriaBuilderNonStandardFunctionsTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/criteria/CriteriaBuilderNonStandardFunctionsTest.java index 25f321002347..b97e91b3a696 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/criteria/CriteriaBuilderNonStandardFunctionsTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/criteria/CriteriaBuilderNonStandardFunctionsTest.java @@ -22,7 +22,7 @@ import org.hibernate.dialect.PostgreSQLDialect; import org.hibernate.query.criteria.HibernateCriteriaBuilder; import org.hibernate.query.criteria.JpaExpression; -import org.hibernate.query.sqm.TemporalUnit; +import org.hibernate.query.common.TemporalUnit; import org.hibernate.testing.orm.domain.StandardDomainModel; import org.hibernate.testing.orm.domain.gambit.EntityOfBasics; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/criteria/CriteriaGetJoinsTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/criteria/CriteriaGetJoinsTest.java index 4e19b917a053..c8ed658f75c4 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/criteria/CriteriaGetJoinsTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/criteria/CriteriaGetJoinsTest.java @@ -5,7 +5,6 @@ import org.hibernate.query.criteria.HibernateCriteriaBuilder; import org.hibernate.query.criteria.JpaCriteriaQuery; import org.hibernate.query.criteria.JpaRoot; -import org.hibernate.query.sqm.tree.SqmJoinType; import org.hibernate.testing.orm.junit.DomainModel; import org.hibernate.testing.orm.junit.JiraKey; @@ -38,10 +37,10 @@ public void testGetJoinsFiltersEntityJoin(SessionFactoryScope scope) { scope.inTransaction( session -> { HibernateCriteriaBuilder cb = session.getCriteriaBuilder(); - JpaCriteriaQuery cq = cb.createQuery(); + JpaCriteriaQuery cq = cb.createQuery(); JpaRoot root = cq.from( MyEntity.class ); root.join( "secondEntity", JoinType.LEFT ); - root.join( MyEntity.class, SqmJoinType.LEFT ); + root.join( MyEntity.class, org.hibernate.query.common.JoinType.LEFT ); Set> joins = root.getJoins(); /* SqmEntityJoin does not implement jakarta.persistence.criteria.Join, iterating through the @@ -49,7 +48,7 @@ public void testGetJoinsFiltersEntityJoin(SessionFactoryScope scope) { */ assertThat( joins.size() ).isEqualTo( 1 ); - joins.forEach( join -> join.getJoinType() ); + joins.forEach( Join::getJoinType ); } ); } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/DeleteJoinTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/DeleteJoinTests.java index d1fbfeb8f4b2..eb9bfda8d0cb 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/DeleteJoinTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/DeleteJoinTests.java @@ -8,11 +8,11 @@ import java.time.LocalDate; +import org.hibernate.query.common.JoinType; import org.hibernate.query.criteria.HibernateCriteriaBuilder; import org.hibernate.query.criteria.JpaCriteriaDelete; import org.hibernate.query.criteria.JpaEntityJoin; import org.hibernate.query.criteria.JpaRoot; -import org.hibernate.query.sqm.tree.SqmJoinType; import org.hibernate.testing.orm.domain.StandardDomainModel; import org.hibernate.testing.orm.domain.contacts.Contact; @@ -82,7 +82,7 @@ public void testDeleteWithJoinCriteria(SessionFactoryScope scope) { final HibernateCriteriaBuilder cb = session.getCriteriaBuilder(); final JpaCriteriaDelete criteriaDelete = cb.createCriteriaDelete( BasicEntity.class ); final JpaRoot b = criteriaDelete.from( BasicEntity.class ); - final JpaEntityJoin c = b.join( Contact.class, SqmJoinType.LEFT ); + final JpaEntityJoin c = b.join( Contact.class, JoinType.LEFT ); c.on( b.get( "id" ).equalTo( c.get( "id" ) ) ); criteriaDelete.where( c.get( "id" ).isNotNull() ); int updated = session.createMutationQuery( criteriaDelete ).executeUpdate(); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/UpdateJoinTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/UpdateJoinTests.java index 5a73005fe2fa..c4ddce52047b 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/UpdateJoinTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/UpdateJoinTests.java @@ -8,11 +8,11 @@ import java.time.LocalDate; +import org.hibernate.query.common.JoinType; import org.hibernate.query.criteria.HibernateCriteriaBuilder; import org.hibernate.query.criteria.JpaCriteriaUpdate; import org.hibernate.query.criteria.JpaEntityJoin; import org.hibernate.query.criteria.JpaRoot; -import org.hibernate.query.sqm.tree.SqmJoinType; import org.hibernate.testing.orm.domain.StandardDomainModel; import org.hibernate.testing.orm.domain.contacts.Contact; @@ -83,7 +83,7 @@ public void testUpdateWithJoinCriteria(SessionFactoryScope scope) { final HibernateCriteriaBuilder cb = session.getCriteriaBuilder(); final JpaCriteriaUpdate criteriaUpdate = cb.createCriteriaUpdate( BasicEntity.class ); final JpaRoot b = criteriaUpdate.from( BasicEntity.class ); - final JpaEntityJoin c = b.join( Contact.class, SqmJoinType.LEFT ); + final JpaEntityJoin c = b.join( Contact.class, JoinType.LEFT ); c.on( b.get( "id" ).equalTo( c.get( "id" ) ) ); criteriaUpdate.set( b.get( "data" ), c.get( "name" ).get( "first" ) ); criteriaUpdate.where( c.get( "id" ).isNotNull() ); diff --git a/hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/DialectFeatureChecks.java b/hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/DialectFeatureChecks.java index 08b61f6ff59a..ebc5f500962d 100644 --- a/hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/DialectFeatureChecks.java +++ b/hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/DialectFeatureChecks.java @@ -31,7 +31,7 @@ import org.hibernate.dialect.TimeZoneSupport; import org.hibernate.mapping.AggregateColumn; import org.hibernate.mapping.Column; -import org.hibernate.query.sqm.FetchClauseType; +import org.hibernate.query.common.FetchClauseType; import org.hibernate.sql.ast.spi.StringBuilderSqlAppender; import org.hibernate.type.SqlTypes;