diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/JdbcMappingContainer.java b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/JdbcMappingContainer.java index e1002ae1c9..2c7fa12e26 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/JdbcMappingContainer.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/JdbcMappingContainer.java @@ -9,7 +9,6 @@ package org.hibernate.metamodel.mapping; import java.util.ArrayList; import java.util.List; -import org.hibernate.NotYetImplementedFor6Exception; import org.hibernate.mapping.IndexedConsumer; /** @@ -44,7 +43,5 @@ public interface JdbcMappingContainer { /** * Visit each JdbcMapping starting from the given offset */ - default int forEachJdbcType(int offset, IndexedConsumer action) { - throw new NotYetImplementedFor6Exception( getClass() ); - } + int forEachJdbcType(int offset, IndexedConsumer action); } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/EntityVersionMappingImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/EntityVersionMappingImpl.java index b52119bcaf..8448afb59c 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/EntityVersionMappingImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/EntityVersionMappingImpl.java @@ -16,6 +16,7 @@ import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.engine.spi.VersionValue; import org.hibernate.mapping.KeyValue; import org.hibernate.mapping.RootClass; +import org.hibernate.mapping.IndexedConsumer; import org.hibernate.metamodel.mapping.EntityMappingType; import org.hibernate.metamodel.mapping.EntityVersionMapping; import org.hibernate.metamodel.mapping.JdbcMapping; @@ -295,4 +296,10 @@ public class EntityVersionMappingImpl implements EntityVersionMapping, FetchOpti SharedSessionContractImplementor session) { return versionBasicType.forEachDisassembledJdbcValue( value, clause, offset, valuesConsumer, session ); } + + @Override + public int forEachJdbcType(int offset, IndexedConsumer action) { + action.accept( offset, getJdbcMapping() ); + return getJdbcTypeCount(); + } } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/model/domain/internal/ArrayTupleType.java b/hibernate-core/src/main/java/org/hibernate/metamodel/model/domain/internal/ArrayTupleType.java index ea43a525e9..4a695a279b 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/model/domain/internal/ArrayTupleType.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/model/domain/internal/ArrayTupleType.java @@ -100,7 +100,11 @@ public class ArrayTupleType implements TupleType, AllowableParameterTy int offset, JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session) { - throw new NotYetImplementedFor6Exception(getClass()); + throw new NotYetImplementedFor6Exception( getClass() ); } + @Override + public int forEachJdbcType(int offset, IndexedConsumer action) { + throw new NotYetImplementedFor6Exception( getClass() ); + } } diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/function/SelfRenderingFunctionSqlAstExpression.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/function/SelfRenderingFunctionSqlAstExpression.java index faad040b37..d2215e1012 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/function/SelfRenderingFunctionSqlAstExpression.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/function/SelfRenderingFunctionSqlAstExpression.java @@ -8,8 +8,10 @@ package org.hibernate.query.sqm.function; import java.util.List; +import org.hibernate.NotYetImplementedFor6Exception; import org.hibernate.dialect.Dialect; import org.hibernate.engine.spi.SessionFactoryImplementor; +import org.hibernate.mapping.IndexedConsumer; import org.hibernate.mapping.Selectable; import org.hibernate.mapping.Table; import org.hibernate.metamodel.mapping.JdbcMapping; @@ -204,4 +206,10 @@ public class SelfRenderingFunctionSqlAstExpression sqlAstCreationState.getCreationContext().getDomainModel().getTypeConfiguration() ); } + + @Override + public int forEachJdbcType( + int offset, IndexedConsumer action) { + throw new NotYetImplementedFor6Exception( getClass() ); + } } diff --git a/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/Collate.java b/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/Collate.java index 4a6ee1787f..a4a2eef47d 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/Collate.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/Collate.java @@ -6,6 +6,7 @@ */ package org.hibernate.sql.ast.tree.expression; +import org.hibernate.mapping.IndexedConsumer; import org.hibernate.metamodel.mapping.JdbcMapping; import org.hibernate.metamodel.mapping.JdbcMappingContainer; import org.hibernate.metamodel.mapping.SqlExpressable; @@ -82,4 +83,10 @@ public class Collate implements Expression, SqlExpressable, SqlAstNode, DomainRe javaTypeDescriptor ); } + + @Override + public int forEachJdbcType(int offset, IndexedConsumer action) { + action.accept( offset, getJdbcMapping() ); + return getJdbcTypeCount(); + } } diff --git a/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/Distinct.java b/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/Distinct.java index 9aca54648d..4d5e5b39ce 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/Distinct.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/Distinct.java @@ -6,6 +6,7 @@ */ package org.hibernate.sql.ast.tree.expression; +import org.hibernate.mapping.IndexedConsumer; import org.hibernate.metamodel.mapping.JdbcMapping; import org.hibernate.metamodel.mapping.JdbcMappingContainer; import org.hibernate.metamodel.mapping.SqlExpressable; @@ -53,4 +54,10 @@ public class Distinct implements Expression, SqlExpressable, SqlAstNode { public void accept(SqlAstWalker sqlTreeWalker) { sqlTreeWalker.visitDistinct( this ); } + + @Override + public int forEachJdbcType(int offset, IndexedConsumer action) { + action.accept( offset, getJdbcMapping() ); + return getJdbcTypeCount(); + } } diff --git a/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/Format.java b/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/Format.java index 414fc08291..66fafd4f9c 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/Format.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/Format.java @@ -6,6 +6,7 @@ */ package org.hibernate.sql.ast.tree.expression; +import org.hibernate.mapping.IndexedConsumer; import org.hibernate.metamodel.mapping.BasicValuedMapping; import org.hibernate.metamodel.mapping.JdbcMapping; import org.hibernate.metamodel.mapping.SqlExpressable; @@ -39,4 +40,10 @@ public class Format implements SqlExpressable, SqlAstNode { public void accept(SqlAstWalker walker) { walker.visitFormat( this ); } + + @Override + public int forEachJdbcType(int offset, IndexedConsumer action) { + action.accept( offset, type.getJdbcMapping() ); + return getJdbcTypeCount(); + } } diff --git a/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/TrimSpecification.java b/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/TrimSpecification.java index ebad7260bb..01f141d990 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/TrimSpecification.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/ast/tree/expression/TrimSpecification.java @@ -6,6 +6,7 @@ */ package org.hibernate.sql.ast.tree.expression; +import org.hibernate.mapping.IndexedConsumer; import org.hibernate.metamodel.mapping.JdbcMapping; import org.hibernate.metamodel.mapping.SqlExpressable; import org.hibernate.query.TrimSpec; @@ -35,4 +36,10 @@ public class TrimSpecification implements SqlExpressable, SqlAstNode { public void accept(SqlAstWalker sqlTreeWalker) { sqlTreeWalker.visitTrimSpecification( this ); } + + @Override + public int forEachJdbcType(int offset, IndexedConsumer action) { + action.accept( offset, getJdbcMapping() ); + return getJdbcTypeCount(); + } } diff --git a/hibernate-core/src/main/java/org/hibernate/sql/results/internal/domain/CircularBiDirectionalFetchImpl.java b/hibernate-core/src/main/java/org/hibernate/sql/results/internal/domain/CircularBiDirectionalFetchImpl.java index 9df9344edd..6db0f5e6dd 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/results/internal/domain/CircularBiDirectionalFetchImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/results/internal/domain/CircularBiDirectionalFetchImpl.java @@ -13,10 +13,12 @@ import org.hibernate.engine.spi.EntityKey; import org.hibernate.engine.spi.EntityUniqueKey; import org.hibernate.engine.spi.PersistenceContext; import org.hibernate.engine.spi.SharedSessionContractImplementor; +import org.hibernate.mapping.IndexedConsumer; import org.hibernate.metamodel.mapping.Association; import org.hibernate.metamodel.mapping.AttributeMapping; import org.hibernate.metamodel.mapping.EntityMappingType; import org.hibernate.metamodel.mapping.ForeignKeyDescriptor; +import org.hibernate.metamodel.mapping.JdbcMapping; import org.hibernate.metamodel.mapping.MappingType; import org.hibernate.metamodel.mapping.ModelPart; import org.hibernate.metamodel.mapping.internal.ToOneAttributeMapping; @@ -197,6 +199,11 @@ public class CircularBiDirectionalFetchImpl implements BiDirectionalFetch, Assoc throw new UnsupportedOperationException(); } + @Override + public int forEachJdbcType(int offset, IndexedConsumer action) { + throw new UnsupportedOperationException(); + } + private static class CircularFetchAssembler implements DomainResultAssembler { private final NavigablePath circularPath; private final JavaType javaTypeDescriptor; diff --git a/hibernate-core/src/main/java/org/hibernate/sql/results/internal/domain/CircularFetchImpl.java b/hibernate-core/src/main/java/org/hibernate/sql/results/internal/domain/CircularFetchImpl.java index fa152c43b5..c520fe22a9 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/results/internal/domain/CircularFetchImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/results/internal/domain/CircularFetchImpl.java @@ -8,10 +8,12 @@ package org.hibernate.sql.results.internal.domain; import org.hibernate.engine.FetchTiming; import org.hibernate.engine.spi.SharedSessionContractImplementor; +import org.hibernate.mapping.IndexedConsumer; import org.hibernate.metamodel.mapping.Association; import org.hibernate.metamodel.mapping.EntityMappingType; import org.hibernate.metamodel.mapping.EntityValuedModelPart; import org.hibernate.metamodel.mapping.ForeignKeyDescriptor; +import org.hibernate.metamodel.mapping.JdbcMapping; import org.hibernate.metamodel.mapping.MappingType; import org.hibernate.metamodel.mapping.internal.ToOneAttributeMapping; import org.hibernate.metamodel.model.domain.NavigableRole; @@ -253,6 +255,11 @@ public class CircularFetchImpl implements BiDirectionalFetch, Association { throw new UnsupportedOperationException(); } + @Override + public int forEachJdbcType(int offset, IndexedConsumer action) { + throw new UnsupportedOperationException(); + } + private static class BiDirectionalFetchAssembler implements DomainResultAssembler { private EntityInitializer initializer; private JavaType assembledJavaTypeDescriptor;