From 075b268280869f49fdc61c66bed1f9a7e18511c3 Mon Sep 17 00:00:00 2001 From: Gavin Date: Sat, 3 Dec 2022 14:37:39 +0100 Subject: [PATCH] HHH-15800 create .generator and .binder packages and move new interfaces to them --- .../annotations/AttributeAccessor.java | 2 +- .../annotations/AttributeBinderType.java | 2 +- .../annotations/CreationTimestamp.java | 2 +- .../annotations/CurrentTimestamp.java | 4 +- .../org/hibernate/annotations/Generated.java | 4 +- .../annotations/GeneratedColumn.java | 4 +- .../annotations/GenericGenerator.java | 2 +- .../annotations/IdGeneratorType.java | 5 +- .../org/hibernate/annotations/Source.java | 2 +- .../org/hibernate/annotations/TenantId.java | 4 +- .../annotations/UpdateTimestamp.java | 2 +- .../annotations/ValueGenerationType.java | 11 +++-- .../{tuple => binder}/AttributeBinder.java | 2 +- .../internal}/AttributeAccessorBinder.java | 3 +- .../internal}/TenantIdBinder.java | 3 +- .../InFlightMetadataCollectorImpl.java | 2 +- .../source/internal/hbm/ModelBinder.java | 6 +-- .../org/hibernate/cfg/AnnotationBinder.java | 2 +- .../cfg/annotations/PropertyBinder.java | 18 ++++--- .../dialect/temptable/TemporaryTable.java | 4 +- .../engine/internal/Nullability.java | 2 +- .../spi/SessionFactoryDelegatingImpl.java | 2 +- .../engine/spi/SessionFactoryImplementor.java | 2 +- .../internal/AbstractSaveEventListener.java | 4 +- .../AnnotationBasedGenerator.java | 2 +- .../{tuple => generator}/Generator.java | 3 +- .../GeneratorCreationContext.java | 2 +- .../InDatabaseGenerator.java | 2 +- .../InMemoryGenerator.java | 3 +- .../internal}/CurrentTimestampGeneration.java | 47 ++++++++++++------- .../internal/GeneratedAlwaysGeneration.java} | 8 ++-- .../internal/GeneratedGeneration.java} | 12 +++-- .../internal}/SourceGeneration.java | 11 +++-- .../internal}/TenantIdGeneration.java | 7 ++- ...lkInsertionCapableIdentifierGenerator.java | 2 +- .../org/hibernate/id/IdentifierGenerator.java | 2 +- .../org/hibernate/id/IdentityGenerator.java | 2 +- .../id/PostInsertIdentifierGenerator.java | 2 +- .../org/hibernate/id/SelectGenerator.java | 3 +- .../factory/IdentifierGeneratorFactory.java | 4 +- .../internal/IdentifierGeneratorUtil.java | 2 +- .../StandardIdentifierGeneratorFactory.java | 2 +- .../spi/CustomIdGeneratorCreationContext.java | 2 +- .../id/factory/spi/StandardGenerator.java | 4 +- .../id/insert/BasicSelectingDelegate.java | 2 +- .../id/insert/GetGeneratedKeysDelegate.java | 2 +- .../InsertGeneratedIdentifierDelegate.java | 7 +-- .../id/insert/InsertReturningDelegate.java | 2 +- .../id/insert/InsertSelectIdentityInsert.java | 2 +- .../org/hibernate/id/uuid/UuidGenerator.java | 2 +- .../internal/SessionFactoryImpl.java | 2 +- .../org/hibernate/internal/SessionImpl.java | 3 +- .../internal/StatelessSessionImpl.java | 5 +- .../java/org/hibernate/mapping/Component.java | 4 +- .../hibernate/mapping/GeneratorCreator.java | 4 +- .../mapping/IdentifierGeneratorCreator.java | 2 +- .../java/org/hibernate/mapping/KeyValue.java | 3 +- .../java/org/hibernate/mapping/Property.java | 4 +- .../org/hibernate/mapping/SimpleValue.java | 2 +- .../metamodel/mapping/AttributeMapping.java | 2 +- .../mapping/GeneratedValueResolver.java | 4 -- .../InMemoryGeneratedValueResolver.java | 2 +- .../AbstractSingularAttributeMapping.java | 2 +- .../internal/GeneratedValuesProcessor.java | 9 ++-- .../internal/PluralAttributeMappingImpl.java | 2 +- .../AbstractCollectionPersister.java | 4 +- .../collection/CollectionPersister.java | 2 +- .../entity/AbstractEntityPersister.java | 4 +- .../persister/entity/EntityPersister.java | 2 +- .../mutation/AbstractMutationCoordinator.java | 2 +- .../entity/mutation/InsertCoordinator.java | 6 +-- .../mutation/UpdateCoordinatorStandard.java | 6 +-- .../query/sqm/internal/QuerySqmImpl.java | 3 +- .../internal/cte/CteInsertHandler.java | 3 +- .../temptable/InsertExecutionDelegate.java | 8 ++-- .../temptable/TableBasedInsertHandler.java | 3 +- .../sqm/sql/BaseSqmToSqlAstConverter.java | 4 +- .../main/java/org/hibernate/sql/Insert.java | 2 +- .../tuple/AnnotationValueGeneration.java | 3 ++ .../tuple/CreationTimestampGeneration.java | 2 +- .../hibernate/tuple/IdentifierAttribute.java | 1 + .../hibernate/tuple/IdentifierProperty.java | 2 +- .../org/hibernate/tuple/PropertyFactory.java | 1 + .../tuple/UpdateTimestampGeneration.java | 2 +- .../org/hibernate/tuple/ValueGeneration.java | 3 ++ .../hibernate/tuple/VmValueGeneration.java | 3 +- .../tuple/entity/EntityMetamodel.java | 6 +-- .../org/hibernate/type/ComponentType.java | 2 +- .../orm/test/hql/BulkManipulationTest.java | 2 +- .../mapping/attributebinder/YesNoBinder.java | 2 +- .../temporals/GeneratedUuidTests.java | 2 +- .../orm/test/tenantid/TenantIdTest.java | 2 +- .../test/tenantlongid/TenantLongIdTest.java | 2 +- .../orm/test/tenantuuid/TenantUuidTest.java | 2 +- .../metadata/AuditMetadataGenerator.java | 6 +-- 95 files changed, 201 insertions(+), 174 deletions(-) rename hibernate-core/src/main/java/org/hibernate/{tuple => binder}/AttributeBinder.java (98%) rename hibernate-core/src/main/java/org/hibernate/{tuple => binder/internal}/AttributeAccessorBinder.java (93%) rename hibernate-core/src/main/java/org/hibernate/{tuple => binder/internal}/TenantIdBinder.java (97%) rename hibernate-core/src/main/java/org/hibernate/{tuple => generator}/AnnotationBasedGenerator.java (98%) rename hibernate-core/src/main/java/org/hibernate/{tuple => generator}/Generator.java (97%) rename hibernate-core/src/main/java/org/hibernate/{tuple => generator}/GeneratorCreationContext.java (95%) rename hibernate-core/src/main/java/org/hibernate/{tuple => generator}/InDatabaseGenerator.java (99%) rename hibernate-core/src/main/java/org/hibernate/{tuple => generator}/InMemoryGenerator.java (96%) rename hibernate-core/src/main/java/org/hibernate/{tuple => generator/internal}/CurrentTimestampGeneration.java (68%) rename hibernate-core/src/main/java/org/hibernate/{tuple/GeneratedAlwaysValueGeneration.java => generator/internal/GeneratedAlwaysGeneration.java} (79%) rename hibernate-core/src/main/java/org/hibernate/{tuple/GeneratedValueGeneration.java => generator/internal/GeneratedGeneration.java} (80%) rename hibernate-core/src/main/java/org/hibernate/{tuple => generator/internal}/SourceGeneration.java (93%) rename hibernate-core/src/main/java/org/hibernate/{tuple => generator/internal}/TenantIdGeneration.java (90%) diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/AttributeAccessor.java b/hibernate-core/src/main/java/org/hibernate/annotations/AttributeAccessor.java index 7e309543ca..43f6ec0fe9 100644 --- a/hibernate-core/src/main/java/org/hibernate/annotations/AttributeAccessor.java +++ b/hibernate-core/src/main/java/org/hibernate/annotations/AttributeAccessor.java @@ -7,7 +7,7 @@ package org.hibernate.annotations; import org.hibernate.property.access.spi.PropertyAccessStrategy; -import org.hibernate.tuple.AttributeAccessorBinder; +import org.hibernate.binder.internal.AttributeAccessorBinder; import java.lang.annotation.Retention; import java.lang.annotation.Target; diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/AttributeBinderType.java b/hibernate-core/src/main/java/org/hibernate/annotations/AttributeBinderType.java index ff1928f3b5..8be772e139 100644 --- a/hibernate-core/src/main/java/org/hibernate/annotations/AttributeBinderType.java +++ b/hibernate-core/src/main/java/org/hibernate/annotations/AttributeBinderType.java @@ -7,7 +7,7 @@ package org.hibernate.annotations; import org.hibernate.Incubating; -import org.hibernate.tuple.AttributeBinder; +import org.hibernate.binder.AttributeBinder; import java.lang.annotation.Retention; import java.lang.annotation.Target; diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/CreationTimestamp.java b/hibernate-core/src/main/java/org/hibernate/annotations/CreationTimestamp.java index 3160d777ec..e124e9d44c 100644 --- a/hibernate-core/src/main/java/org/hibernate/annotations/CreationTimestamp.java +++ b/hibernate-core/src/main/java/org/hibernate/annotations/CreationTimestamp.java @@ -13,7 +13,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; import java.lang.annotation.Retention; import java.lang.annotation.Target; -import org.hibernate.tuple.CurrentTimestampGeneration; +import org.hibernate.generator.internal.CurrentTimestampGeneration; /** * Specifies that the annotated field of property is a generated creation timestamp. diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/CurrentTimestamp.java b/hibernate-core/src/main/java/org/hibernate/annotations/CurrentTimestamp.java index c101f9f17b..0f78abb639 100644 --- a/hibernate-core/src/main/java/org/hibernate/annotations/CurrentTimestamp.java +++ b/hibernate-core/src/main/java/org/hibernate/annotations/CurrentTimestamp.java @@ -10,7 +10,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.Target; import org.hibernate.Remove; -import org.hibernate.tuple.CurrentTimestampGeneration; +import org.hibernate.generator.internal.CurrentTimestampGeneration; import org.hibernate.tuple.GenerationTiming; import static java.lang.annotation.ElementType.ANNOTATION_TYPE; @@ -68,7 +68,7 @@ public @interface CurrentTimestamp { * Determines when the timestamp is generated. But default, it is updated * when any SQL {@code insert} or {@code update} statement is executed. * If it should be generated just once, on the initial SQL {@code insert}, - * explicitly specify {@link GenerationTime#INSERT time = INSERT}. + * explicitly specify {@link GenerationTime#INSERT event = INSERT}. */ GenerationTime event() default GenerationTime.INSERT_OR_UPDATE; diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/Generated.java b/hibernate-core/src/main/java/org/hibernate/annotations/Generated.java index 52a9e9e8d0..be21c0b8ea 100644 --- a/hibernate-core/src/main/java/org/hibernate/annotations/Generated.java +++ b/hibernate-core/src/main/java/org/hibernate/annotations/Generated.java @@ -11,7 +11,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.hibernate.tuple.GeneratedValueGeneration; +import org.hibernate.generator.internal.GeneratedGeneration; /** * Specifies that the value of the annotated property is generated by the @@ -51,7 +51,7 @@ import org.hibernate.tuple.GeneratedValueGeneration; * @see ColumnDefault * @see GeneratedColumn */ -@ValueGenerationType( generatedBy = GeneratedValueGeneration.class ) +@ValueGenerationType( generatedBy = GeneratedGeneration.class ) @Target({ElementType.FIELD, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) public @interface Generated { diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/GeneratedColumn.java b/hibernate-core/src/main/java/org/hibernate/annotations/GeneratedColumn.java index 597ba4ddc2..97c96fde33 100644 --- a/hibernate-core/src/main/java/org/hibernate/annotations/GeneratedColumn.java +++ b/hibernate-core/src/main/java/org/hibernate/annotations/GeneratedColumn.java @@ -6,7 +6,7 @@ */ package org.hibernate.annotations; -import org.hibernate.tuple.GeneratedAlwaysValueGeneration; +import org.hibernate.generator.internal.GeneratedAlwaysGeneration; import java.lang.annotation.Retention; import java.lang.annotation.Target; @@ -29,7 +29,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; */ @Target( {FIELD, METHOD} ) @Retention( RUNTIME ) -@ValueGenerationType(generatedBy = GeneratedAlwaysValueGeneration.class) +@ValueGenerationType(generatedBy = GeneratedAlwaysGeneration.class) public @interface GeneratedColumn { /** * The expression to include in the generated DDL. diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/GenericGenerator.java b/hibernate-core/src/main/java/org/hibernate/annotations/GenericGenerator.java index 119b48944e..12ed1c575d 100644 --- a/hibernate-core/src/main/java/org/hibernate/annotations/GenericGenerator.java +++ b/hibernate-core/src/main/java/org/hibernate/annotations/GenericGenerator.java @@ -6,7 +6,7 @@ */ package org.hibernate.annotations; -import org.hibernate.tuple.InMemoryGenerator; +import org.hibernate.generator.InMemoryGenerator; import java.lang.annotation.Repeatable; import java.lang.annotation.Retention; diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/IdGeneratorType.java b/hibernate-core/src/main/java/org/hibernate/annotations/IdGeneratorType.java index 48475f65f9..023ddf046a 100644 --- a/hibernate-core/src/main/java/org/hibernate/annotations/IdGeneratorType.java +++ b/hibernate-core/src/main/java/org/hibernate/annotations/IdGeneratorType.java @@ -10,7 +10,8 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.hibernate.tuple.Generator; +import org.hibernate.generator.AnnotationBasedGenerator; +import org.hibernate.generator.Generator; import static java.lang.annotation.ElementType.ANNOTATION_TYPE; import static java.lang.annotation.RetentionPolicy.RUNTIME; @@ -58,7 +59,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; * {@link RetentionPolicy#RUNTIME}. * * @see Generator - * @see org.hibernate.tuple.AnnotationBasedGenerator + * @see AnnotationBasedGenerator * * @since 6.0 */ diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/Source.java b/hibernate-core/src/main/java/org/hibernate/annotations/Source.java index 50235c5f8b..7dfc10dc5a 100644 --- a/hibernate-core/src/main/java/org/hibernate/annotations/Source.java +++ b/hibernate-core/src/main/java/org/hibernate/annotations/Source.java @@ -7,7 +7,7 @@ package org.hibernate.annotations; import org.hibernate.Remove; -import org.hibernate.tuple.SourceGeneration; +import org.hibernate.generator.internal.SourceGeneration; import java.lang.annotation.Retention; import java.lang.annotation.Target; diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/TenantId.java b/hibernate-core/src/main/java/org/hibernate/annotations/TenantId.java index 5fe074cc8e..e3892d056c 100644 --- a/hibernate-core/src/main/java/org/hibernate/annotations/TenantId.java +++ b/hibernate-core/src/main/java/org/hibernate/annotations/TenantId.java @@ -6,8 +6,8 @@ */ package org.hibernate.annotations; -import org.hibernate.tuple.TenantIdBinder; -import org.hibernate.tuple.TenantIdGeneration; +import org.hibernate.binder.internal.TenantIdBinder; +import org.hibernate.generator.internal.TenantIdGeneration; import java.lang.annotation.Retention; import java.lang.annotation.Target; diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/UpdateTimestamp.java b/hibernate-core/src/main/java/org/hibernate/annotations/UpdateTimestamp.java index 12f80fe919..175b20ba40 100644 --- a/hibernate-core/src/main/java/org/hibernate/annotations/UpdateTimestamp.java +++ b/hibernate-core/src/main/java/org/hibernate/annotations/UpdateTimestamp.java @@ -13,7 +13,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; import java.lang.annotation.Retention; import java.lang.annotation.Target; -import org.hibernate.tuple.CurrentTimestampGeneration; +import org.hibernate.generator.internal.CurrentTimestampGeneration; /** * Specifies that the annotated field of property is a generated update timestamp. diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/ValueGenerationType.java b/hibernate-core/src/main/java/org/hibernate/annotations/ValueGenerationType.java index f0ce35b5e0..79201744ca 100644 --- a/hibernate-core/src/main/java/org/hibernate/annotations/ValueGenerationType.java +++ b/hibernate-core/src/main/java/org/hibernate/annotations/ValueGenerationType.java @@ -10,10 +10,11 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.hibernate.tuple.AnnotationBasedGenerator; -import org.hibernate.tuple.Generator; -import org.hibernate.tuple.InDatabaseGenerator; -import org.hibernate.tuple.InMemoryGenerator; +import org.hibernate.generator.AnnotationBasedGenerator; +import org.hibernate.generator.Generator; +import org.hibernate.generator.InDatabaseGenerator; +import org.hibernate.generator.InMemoryGenerator; +import org.hibernate.generator.internal.TenantIdGeneration; import static java.lang.annotation.ElementType.ANNOTATION_TYPE; import static java.lang.annotation.RetentionPolicy.RUNTIME; @@ -61,7 +62,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; *

* There are several excellent examples of the use of this machinery right * here in this package. {@link TenantId} and its corresponding generator - * {@link org.hibernate.tuple.TenantIdGeneration} are a good place to start. + * {@link TenantIdGeneration} are a good place to start. *

* A {@code @ValueGenerationType} annotation must have retention policy * {@link RetentionPolicy#RUNTIME}. diff --git a/hibernate-core/src/main/java/org/hibernate/tuple/AttributeBinder.java b/hibernate-core/src/main/java/org/hibernate/binder/AttributeBinder.java similarity index 98% rename from hibernate-core/src/main/java/org/hibernate/tuple/AttributeBinder.java rename to hibernate-core/src/main/java/org/hibernate/binder/AttributeBinder.java index 827a8da849..c5537ca68d 100644 --- a/hibernate-core/src/main/java/org/hibernate/tuple/AttributeBinder.java +++ b/hibernate-core/src/main/java/org/hibernate/binder/AttributeBinder.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 . */ -package org.hibernate.tuple; +package org.hibernate.binder; import org.hibernate.Incubating; import org.hibernate.boot.spi.MetadataBuildingContext; diff --git a/hibernate-core/src/main/java/org/hibernate/tuple/AttributeAccessorBinder.java b/hibernate-core/src/main/java/org/hibernate/binder/internal/AttributeAccessorBinder.java similarity index 93% rename from hibernate-core/src/main/java/org/hibernate/tuple/AttributeAccessorBinder.java rename to hibernate-core/src/main/java/org/hibernate/binder/internal/AttributeAccessorBinder.java index 1fc56a33db..ce445e0875 100644 --- a/hibernate-core/src/main/java/org/hibernate/tuple/AttributeAccessorBinder.java +++ b/hibernate-core/src/main/java/org/hibernate/binder/internal/AttributeAccessorBinder.java @@ -4,10 +4,11 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.tuple; +package org.hibernate.binder.internal; import org.hibernate.AnnotationException; import org.hibernate.annotations.AttributeAccessor; +import org.hibernate.binder.AttributeBinder; import org.hibernate.boot.spi.MetadataBuildingContext; import org.hibernate.mapping.PersistentClass; import org.hibernate.mapping.Property; diff --git a/hibernate-core/src/main/java/org/hibernate/tuple/TenantIdBinder.java b/hibernate-core/src/main/java/org/hibernate/binder/internal/TenantIdBinder.java similarity index 97% rename from hibernate-core/src/main/java/org/hibernate/tuple/TenantIdBinder.java rename to hibernate-core/src/main/java/org/hibernate/binder/internal/TenantIdBinder.java index 8b141d8316..6aafdc60d7 100644 --- a/hibernate-core/src/main/java/org/hibernate/tuple/TenantIdBinder.java +++ b/hibernate-core/src/main/java/org/hibernate/binder/internal/TenantIdBinder.java @@ -4,10 +4,11 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.tuple; +package org.hibernate.binder.internal; import org.hibernate.MappingException; import org.hibernate.annotations.TenantId; +import org.hibernate.binder.AttributeBinder; import org.hibernate.boot.spi.InFlightMetadataCollector; import org.hibernate.boot.spi.MetadataBuildingContext; import org.hibernate.engine.spi.FilterDefinition; diff --git a/hibernate-core/src/main/java/org/hibernate/boot/internal/InFlightMetadataCollectorImpl.java b/hibernate-core/src/main/java/org/hibernate/boot/internal/InFlightMetadataCollectorImpl.java index 2f9eea9e06..1275cf0b7f 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/internal/InFlightMetadataCollectorImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/internal/InFlightMetadataCollectorImpl.java @@ -103,7 +103,7 @@ import org.hibernate.metamodel.CollectionClassification; import org.hibernate.metamodel.spi.EmbeddableInstantiator; import org.hibernate.query.named.NamedObjectRepository; import org.hibernate.query.sqm.function.SqmFunctionDescriptor; -import org.hibernate.tuple.Generator; +import org.hibernate.generator.Generator; import org.hibernate.type.descriptor.java.JavaType; import org.hibernate.type.descriptor.jdbc.JdbcType; import org.hibernate.type.spi.TypeConfiguration; diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/source/internal/hbm/ModelBinder.java b/hibernate-core/src/main/java/org/hibernate/boot/model/source/internal/hbm/ModelBinder.java index 90712ce798..a971a12394 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/source/internal/hbm/ModelBinder.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/source/internal/hbm/ModelBinder.java @@ -19,7 +19,7 @@ import java.util.Properties; import org.hibernate.AssertionFailure; import org.hibernate.FetchMode; import org.hibernate.annotations.Source; -import org.hibernate.tuple.SourceGeneration; +import org.hibernate.generator.internal.SourceGeneration; import org.hibernate.annotations.SourceType; import org.hibernate.boot.MappingException; import org.hibernate.boot.jaxb.Origin; @@ -149,7 +149,7 @@ import org.hibernate.mapping.UniqueKey; import org.hibernate.mapping.Value; import org.hibernate.resource.beans.spi.ManagedBean; import org.hibernate.resource.beans.spi.ManagedBeanRegistry; -import org.hibernate.tuple.GeneratedValueGeneration; +import org.hibernate.generator.internal.GeneratedGeneration; import org.hibernate.tuple.GenerationTiming; import org.hibernate.type.AbstractSingleColumnStandardBasicType; import org.hibernate.type.BasicType; @@ -2548,7 +2548,7 @@ public class ModelBinder { ); } if ( timing != GenerationTiming.NEVER ) { - property.setValueGeneratorCreator( context -> new GeneratedValueGeneration( timing.getEquivalent() ) ); + property.setValueGeneratorCreator( context -> new GeneratedGeneration( timing.getEquivalent() ) ); // generated properties can *never* be insertable... if ( property.isInsertable() && timing.includesInsert() ) { diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/AnnotationBinder.java b/hibernate-core/src/main/java/org/hibernate/cfg/AnnotationBinder.java index 327a389f4f..16581b8a87 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/AnnotationBinder.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/AnnotationBinder.java @@ -93,7 +93,7 @@ import org.hibernate.property.access.internal.PropertyAccessStrategyMixedImpl; import org.hibernate.property.access.spi.PropertyAccessStrategy; import org.hibernate.resource.beans.spi.ManagedBean; import org.hibernate.resource.beans.spi.ManagedBeanRegistry; -import org.hibernate.tuple.InMemoryGenerator; +import org.hibernate.generator.InMemoryGenerator; import org.hibernate.type.BasicType; import org.hibernate.type.CustomType; import org.hibernate.type.descriptor.java.BasicJavaType; diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/annotations/PropertyBinder.java b/hibernate-core/src/main/java/org/hibernate/cfg/annotations/PropertyBinder.java index 4a1dfdde5c..c848af4d61 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/annotations/PropertyBinder.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/annotations/PropertyBinder.java @@ -46,13 +46,12 @@ import org.hibernate.mapping.ToOne; import org.hibernate.mapping.Value; import org.hibernate.metamodel.spi.EmbeddableInstantiator; import org.hibernate.property.access.spi.PropertyAccessStrategy; -import org.hibernate.tuple.AnnotationBasedGenerator; -import org.hibernate.tuple.Generator; -import org.hibernate.tuple.AttributeBinder; -import org.hibernate.tuple.GeneratorCreationContext; -import org.hibernate.tuple.GenerationTiming; -import org.hibernate.tuple.InDatabaseGenerator; -import org.hibernate.tuple.InMemoryGenerator; +import org.hibernate.generator.AnnotationBasedGenerator; +import org.hibernate.generator.Generator; +import org.hibernate.binder.AttributeBinder; +import org.hibernate.generator.GeneratorCreationContext; +import org.hibernate.generator.InDatabaseGenerator; +import org.hibernate.generator.InMemoryGenerator; import org.jboss.logging.Logger; import java.lang.annotation.Annotation; @@ -63,7 +62,6 @@ import java.util.Map; import static org.hibernate.cfg.BinderHelper.getMappedSuperclassOrNull; import static org.hibernate.cfg.annotations.HCANNHelper.findContainingAnnotation; import static org.hibernate.internal.util.StringHelper.qualify; -import static org.hibernate.tuple.GenerationTiming.INSERT; /** * @author Emmanuel Bernard @@ -243,9 +241,9 @@ public class PropertyBinder { private void callAttributeBinders(Property prop) { final Annotation containingAnnotation = findContainingAnnotation( property, AttributeBinderType.class); if ( containingAnnotation != null ) { - final AttributeBinderType binderAnn = containingAnnotation.annotationType().getAnnotation( AttributeBinderType.class ); + final AttributeBinderType binderType = containingAnnotation.annotationType().getAnnotation( AttributeBinderType.class ); try { - final AttributeBinder binder = binderAnn.binder().newInstance(); + final AttributeBinder binder = binderType.binder().newInstance(); binder.bind( containingAnnotation, buildingContext, entityBinder.getPersistentClass(), prop ); } catch (Exception e) { diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/temptable/TemporaryTable.java b/hibernate-core/src/main/java/org/hibernate/dialect/temptable/TemporaryTable.java index a912773933..4713f4d0c5 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/temptable/TemporaryTable.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/temptable/TemporaryTable.java @@ -19,7 +19,6 @@ import org.hibernate.boot.model.relational.QualifiedTableName; import org.hibernate.boot.model.relational.SqlStringGenerationContext; import org.hibernate.dialect.Dialect; import org.hibernate.id.OptimizableGenerator; -import org.hibernate.id.PostInsertIdentifierGenerator; import org.hibernate.id.enhanced.Optimizer; import org.hibernate.internal.CoreLogging; import org.hibernate.internal.CoreMessageLogger; @@ -41,8 +40,7 @@ import org.hibernate.metamodel.mapping.PluralAttributeMapping; import org.hibernate.metamodel.spi.RuntimeModelCreationContext; import org.hibernate.persister.entity.EntityPersister; import org.hibernate.persister.entity.SingleTableEntityPersister; -import org.hibernate.tuple.Generator; -import org.hibernate.tuple.InMemoryGenerator; +import org.hibernate.generator.Generator; import org.hibernate.type.BasicType; import org.hibernate.type.StandardBasicTypes; import org.hibernate.type.spi.TypeConfiguration; diff --git a/hibernate-core/src/main/java/org/hibernate/engine/internal/Nullability.java b/hibernate-core/src/main/java/org/hibernate/engine/internal/Nullability.java index dcc95b43bc..b00e3583bb 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/internal/Nullability.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/internal/Nullability.java @@ -14,7 +14,7 @@ import org.hibernate.bytecode.enhance.spi.LazyPropertyInitializer; import org.hibernate.engine.spi.CascadingActions; import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.persister.entity.EntityPersister; -import org.hibernate.tuple.Generator; +import org.hibernate.generator.Generator; import org.hibernate.type.CollectionType; import org.hibernate.type.CompositeType; import org.hibernate.type.Type; diff --git a/hibernate-core/src/main/java/org/hibernate/engine/spi/SessionFactoryDelegatingImpl.java b/hibernate-core/src/main/java/org/hibernate/engine/spi/SessionFactoryDelegatingImpl.java index fb6a47fbcb..23214462b9 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/spi/SessionFactoryDelegatingImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/spi/SessionFactoryDelegatingImpl.java @@ -46,7 +46,7 @@ import org.hibernate.query.spi.QueryEngine; import org.hibernate.relational.SchemaManager; import org.hibernate.service.spi.ServiceRegistryImplementor; import org.hibernate.stat.spi.StatisticsImplementor; -import org.hibernate.tuple.Generator; +import org.hibernate.generator.Generator; import org.hibernate.type.Type; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.spi.TypeConfiguration; diff --git a/hibernate-core/src/main/java/org/hibernate/engine/spi/SessionFactoryImplementor.java b/hibernate-core/src/main/java/org/hibernate/engine/spi/SessionFactoryImplementor.java index 759d7e08e1..32eb8cc011 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/spi/SessionFactoryImplementor.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/spi/SessionFactoryImplementor.java @@ -33,7 +33,7 @@ import org.hibernate.query.sqm.spi.SqmCreationContext; import org.hibernate.service.spi.ServiceRegistryImplementor; import org.hibernate.sql.ast.spi.SqlAstCreationContext; import org.hibernate.stat.spi.StatisticsImplementor; -import org.hibernate.tuple.Generator; +import org.hibernate.generator.Generator; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.spi.TypeConfiguration; diff --git a/hibernate-core/src/main/java/org/hibernate/event/internal/AbstractSaveEventListener.java b/hibernate-core/src/main/java/org/hibernate/event/internal/AbstractSaveEventListener.java index f3b11ac094..0b849fdcf6 100644 --- a/hibernate-core/src/main/java/org/hibernate/event/internal/AbstractSaveEventListener.java +++ b/hibernate-core/src/main/java/org/hibernate/event/internal/AbstractSaveEventListener.java @@ -34,8 +34,8 @@ import org.hibernate.jpa.event.spi.CallbackRegistry; import org.hibernate.jpa.event.spi.CallbackRegistryConsumer; import org.hibernate.persister.entity.EntityPersister; import org.hibernate.pretty.MessageHelper; -import org.hibernate.tuple.Generator; -import org.hibernate.tuple.InMemoryGenerator; +import org.hibernate.generator.Generator; +import org.hibernate.generator.InMemoryGenerator; import org.hibernate.type.Type; import org.hibernate.type.TypeHelper; diff --git a/hibernate-core/src/main/java/org/hibernate/tuple/AnnotationBasedGenerator.java b/hibernate-core/src/main/java/org/hibernate/generator/AnnotationBasedGenerator.java similarity index 98% rename from hibernate-core/src/main/java/org/hibernate/tuple/AnnotationBasedGenerator.java rename to hibernate-core/src/main/java/org/hibernate/generator/AnnotationBasedGenerator.java index 74c8b4f3fd..9c086e6b7c 100644 --- a/hibernate-core/src/main/java/org/hibernate/tuple/AnnotationBasedGenerator.java +++ b/hibernate-core/src/main/java/org/hibernate/generator/AnnotationBasedGenerator.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 . */ -package org.hibernate.tuple; +package org.hibernate.generator; import java.lang.annotation.Annotation; import java.lang.reflect.Member; diff --git a/hibernate-core/src/main/java/org/hibernate/tuple/Generator.java b/hibernate-core/src/main/java/org/hibernate/generator/Generator.java similarity index 97% rename from hibernate-core/src/main/java/org/hibernate/tuple/Generator.java rename to hibernate-core/src/main/java/org/hibernate/generator/Generator.java index 3d2b5f1da0..11fac3a5af 100644 --- a/hibernate-core/src/main/java/org/hibernate/tuple/Generator.java +++ b/hibernate-core/src/main/java/org/hibernate/generator/Generator.java @@ -4,9 +4,10 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.tuple; +package org.hibernate.generator; import org.hibernate.engine.spi.SharedSessionContractImplementor; +import org.hibernate.tuple.ValueGenerator; import java.io.Serializable; diff --git a/hibernate-core/src/main/java/org/hibernate/tuple/GeneratorCreationContext.java b/hibernate-core/src/main/java/org/hibernate/generator/GeneratorCreationContext.java similarity index 95% rename from hibernate-core/src/main/java/org/hibernate/tuple/GeneratorCreationContext.java rename to hibernate-core/src/main/java/org/hibernate/generator/GeneratorCreationContext.java index 6483e4c3b8..094f0c1e2c 100644 --- a/hibernate-core/src/main/java/org/hibernate/tuple/GeneratorCreationContext.java +++ b/hibernate-core/src/main/java/org/hibernate/generator/GeneratorCreationContext.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.tuple; +package org.hibernate.generator; import org.hibernate.Incubating; import org.hibernate.boot.model.relational.Database; diff --git a/hibernate-core/src/main/java/org/hibernate/tuple/InDatabaseGenerator.java b/hibernate-core/src/main/java/org/hibernate/generator/InDatabaseGenerator.java similarity index 99% rename from hibernate-core/src/main/java/org/hibernate/tuple/InDatabaseGenerator.java rename to hibernate-core/src/main/java/org/hibernate/generator/InDatabaseGenerator.java index a3e46725d1..0457468b86 100644 --- a/hibernate-core/src/main/java/org/hibernate/tuple/InDatabaseGenerator.java +++ b/hibernate-core/src/main/java/org/hibernate/generator/InDatabaseGenerator.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 . */ -package org.hibernate.tuple; +package org.hibernate.generator; import org.hibernate.dialect.Dialect; import org.hibernate.persister.entity.EntityPersister; diff --git a/hibernate-core/src/main/java/org/hibernate/tuple/InMemoryGenerator.java b/hibernate-core/src/main/java/org/hibernate/generator/InMemoryGenerator.java similarity index 96% rename from hibernate-core/src/main/java/org/hibernate/tuple/InMemoryGenerator.java rename to hibernate-core/src/main/java/org/hibernate/generator/InMemoryGenerator.java index 7da33cb7de..266769e331 100644 --- a/hibernate-core/src/main/java/org/hibernate/tuple/InMemoryGenerator.java +++ b/hibernate-core/src/main/java/org/hibernate/generator/InMemoryGenerator.java @@ -4,9 +4,10 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.tuple; +package org.hibernate.generator; import org.hibernate.engine.spi.SharedSessionContractImplementor; +import org.hibernate.tuple.GenerationTiming; /** * A generator that is called to produce a value just before a row is written to the database. diff --git a/hibernate-core/src/main/java/org/hibernate/tuple/CurrentTimestampGeneration.java b/hibernate-core/src/main/java/org/hibernate/generator/internal/CurrentTimestampGeneration.java similarity index 68% rename from hibernate-core/src/main/java/org/hibernate/tuple/CurrentTimestampGeneration.java rename to hibernate-core/src/main/java/org/hibernate/generator/internal/CurrentTimestampGeneration.java index 4067dda8ca..e1220f7b11 100644 --- a/hibernate-core/src/main/java/org/hibernate/tuple/CurrentTimestampGeneration.java +++ b/hibernate-core/src/main/java/org/hibernate/generator/internal/CurrentTimestampGeneration.java @@ -4,17 +4,23 @@ * 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.tuple; +package org.hibernate.generator.internal; import org.hibernate.AssertionFailure; -import org.hibernate.Internal; +import org.hibernate.Session; import org.hibernate.annotations.CreationTimestamp; import org.hibernate.annotations.CurrentTimestamp; import org.hibernate.annotations.GenerationTime; import org.hibernate.annotations.SourceType; import org.hibernate.annotations.UpdateTimestamp; import org.hibernate.dialect.Dialect; +import org.hibernate.engine.spi.SharedSessionContractImplementor; +import org.hibernate.generator.InDatabaseGenerator; +import org.hibernate.generator.InMemoryGenerator; import org.hibernate.internal.util.ReflectHelper; +import org.hibernate.generator.GeneratorCreationContext; +import org.hibernate.tuple.TimestampGenerators; +import org.hibernate.tuple.ValueGenerator; import java.lang.reflect.Member; @@ -38,8 +44,7 @@ import static org.hibernate.annotations.GenerationTime.INSERT_OR_UPDATE; * @author Steve Ebersole * @author Gavin King */ -@Internal -public class CurrentTimestampGeneration implements ValueGeneration { +public class CurrentTimestampGeneration implements InMemoryGenerator, InDatabaseGenerator { private final GenerationTime timing; private final ValueGenerator generator; @@ -71,27 +76,37 @@ public class CurrentTimestampGeneration implements ValueGeneration { } @Override - public GenerationTiming getGenerationTiming() { - return timing.getEquivalent(); + public boolean generatedByDatabase() { + return generator == null; } @Override - public ValueGenerator getValueGenerator() { - return generator; + public boolean generatedOnInsert() { + return timing.includesInsert(); } @Override - public boolean referenceColumnInSql() { + public boolean generatedOnUpdate() { + return timing.includesUpdate(); + } + + @Override + public Object generate(SharedSessionContractImplementor session, Object owner, Object currentValue) { + return generator.generateValue( (Session) session, owner, currentValue ); + } + + @Override + public boolean writePropertyValue() { + return false; + } + + @Override + public boolean referenceColumnsInSql(Dialect dialect) { return true; } @Override - public String getDatabaseGeneratedReferencedColumnValue() { - return "current_timestamp"; - } - - @Override - public String getDatabaseGeneratedReferencedColumnValue(Dialect dialect) { - return dialect.currentTimestamp(); + public String[] getReferencedColumnValues(Dialect dialect) { + return new String[] { dialect.currentTimestamp() }; } } diff --git a/hibernate-core/src/main/java/org/hibernate/tuple/GeneratedAlwaysValueGeneration.java b/hibernate-core/src/main/java/org/hibernate/generator/internal/GeneratedAlwaysGeneration.java similarity index 79% rename from hibernate-core/src/main/java/org/hibernate/tuple/GeneratedAlwaysValueGeneration.java rename to hibernate-core/src/main/java/org/hibernate/generator/internal/GeneratedAlwaysGeneration.java index e6fa92cd57..76a8b78dfa 100644 --- a/hibernate-core/src/main/java/org/hibernate/tuple/GeneratedAlwaysValueGeneration.java +++ b/hibernate-core/src/main/java/org/hibernate/generator/internal/GeneratedAlwaysGeneration.java @@ -4,20 +4,20 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.tuple; +package org.hibernate.generator.internal; import org.hibernate.annotations.GeneratedColumn; import org.hibernate.dialect.Dialect; +import org.hibernate.generator.InDatabaseGenerator; /** * For {@link GeneratedColumn}. * * @author Gavin King */ -public class GeneratedAlwaysValueGeneration - implements InDatabaseGenerator { +public class GeneratedAlwaysGeneration implements InDatabaseGenerator { - public GeneratedAlwaysValueGeneration() {} + public GeneratedAlwaysGeneration() {} @Override public boolean generatedOnUpdate() { diff --git a/hibernate-core/src/main/java/org/hibernate/tuple/GeneratedValueGeneration.java b/hibernate-core/src/main/java/org/hibernate/generator/internal/GeneratedGeneration.java similarity index 80% rename from hibernate-core/src/main/java/org/hibernate/tuple/GeneratedValueGeneration.java rename to hibernate-core/src/main/java/org/hibernate/generator/internal/GeneratedGeneration.java index dcc8761b1b..2964bd6cde 100644 --- a/hibernate-core/src/main/java/org/hibernate/tuple/GeneratedValueGeneration.java +++ b/hibernate-core/src/main/java/org/hibernate/generator/internal/GeneratedGeneration.java @@ -4,11 +4,13 @@ * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ -package org.hibernate.tuple; +package org.hibernate.generator.internal; import org.hibernate.annotations.Generated; import org.hibernate.annotations.GenerationTime; import org.hibernate.dialect.Dialect; +import org.hibernate.generator.InDatabaseGenerator; +import org.hibernate.tuple.AnnotationValueGeneration; import static org.hibernate.annotations.GenerationTime.INSERT_OR_UPDATE; import static org.hibernate.internal.util.StringHelper.isEmpty; @@ -19,20 +21,20 @@ import static org.hibernate.internal.util.StringHelper.isEmpty; * @author Steve Ebersole * @author Gunnar Morling */ -public class GeneratedValueGeneration implements InDatabaseGenerator { +public class GeneratedGeneration implements InDatabaseGenerator { private GenerationTime timing; private boolean writable; private String[] sql; - public GeneratedValueGeneration() { + public GeneratedGeneration() { } - public GeneratedValueGeneration(GenerationTime event) { + public GeneratedGeneration(GenerationTime event) { this.timing = event; } - public GeneratedValueGeneration(Generated annotation) { + public GeneratedGeneration(Generated annotation) { timing = annotation.event() == INSERT_OR_UPDATE ? annotation.value() : annotation.event(); sql = isEmpty( annotation.sql() ) ? null : new String[] { annotation.sql() }; writable = annotation.writable() || sql != null; diff --git a/hibernate-core/src/main/java/org/hibernate/tuple/SourceGeneration.java b/hibernate-core/src/main/java/org/hibernate/generator/internal/SourceGeneration.java similarity index 93% rename from hibernate-core/src/main/java/org/hibernate/tuple/SourceGeneration.java rename to hibernate-core/src/main/java/org/hibernate/generator/internal/SourceGeneration.java index e01bae252c..6a636a362c 100644 --- a/hibernate-core/src/main/java/org/hibernate/tuple/SourceGeneration.java +++ b/hibernate-core/src/main/java/org/hibernate/generator/internal/SourceGeneration.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.tuple; +package org.hibernate.generator.internal; import org.hibernate.AssertionFailure; import org.hibernate.Internal; @@ -13,7 +13,11 @@ import org.hibernate.annotations.Source; import org.hibernate.dialect.Dialect; import org.hibernate.engine.jdbc.spi.JdbcCoordinator; import org.hibernate.engine.spi.SharedSessionContractImplementor; +import org.hibernate.generator.GeneratorCreationContext; +import org.hibernate.generator.InMemoryGenerator; import org.hibernate.internal.CoreMessageLogger; +import org.hibernate.tuple.TimestampGenerators; +import org.hibernate.tuple.ValueGenerator; import org.jboss.logging.Logger; import java.lang.reflect.Member; @@ -39,7 +43,7 @@ import static java.sql.Types.TIMESTAMP; */ @Deprecated(since = "6.2") @Internal -public class SourceGeneration implements InMemoryGenerator, ValueGenerator { +public class SourceGeneration implements InMemoryGenerator { private static final CoreMessageLogger log = Logger.getMessageLogger( CoreMessageLogger.class, @@ -57,7 +61,7 @@ public class SourceGeneration implements InMemoryGenerator, ValueGenerator. */ -package org.hibernate.tuple; +package org.hibernate.generator.internal; import org.hibernate.MappingException; import org.hibernate.PropertyValueException; @@ -12,6 +12,8 @@ import org.hibernate.annotations.TenantId; import org.hibernate.context.spi.CurrentTenantIdentifierResolver; import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.engine.spi.SharedSessionContractImplementor; +import org.hibernate.generator.InMemoryGenerator; +import org.hibernate.generator.GeneratorCreationContext; import org.hibernate.type.descriptor.java.JavaType; import java.lang.reflect.Member; @@ -19,7 +21,8 @@ import java.lang.reflect.Member; import static org.hibernate.internal.util.ReflectHelper.getPropertyType; /** - * Value generation implementation for {@link TenantId}. + * A generator that produces the current tenant identifier + * to be assigned to the {@link TenantId} property. * * @author Gavin King */ diff --git a/hibernate-core/src/main/java/org/hibernate/id/BulkInsertionCapableIdentifierGenerator.java b/hibernate-core/src/main/java/org/hibernate/id/BulkInsertionCapableIdentifierGenerator.java index f44d6cec29..ab5838d55a 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/BulkInsertionCapableIdentifierGenerator.java +++ b/hibernate-core/src/main/java/org/hibernate/id/BulkInsertionCapableIdentifierGenerator.java @@ -7,7 +7,7 @@ package org.hibernate.id; import org.hibernate.boot.model.relational.SqlStringGenerationContext; -import org.hibernate.tuple.Generator; +import org.hibernate.generator.Generator; /** * Specialized contract for {@link IdentifierGenerator} implementations capable of being used in conjunction diff --git a/hibernate-core/src/main/java/org/hibernate/id/IdentifierGenerator.java b/hibernate-core/src/main/java/org/hibernate/id/IdentifierGenerator.java index 88677d5fd8..a70906e96c 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/IdentifierGenerator.java +++ b/hibernate-core/src/main/java/org/hibernate/id/IdentifierGenerator.java @@ -16,7 +16,7 @@ import org.hibernate.boot.model.relational.SqlStringGenerationContext; import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.service.ServiceRegistry; import org.hibernate.tuple.GenerationTiming; -import org.hibernate.tuple.InMemoryGenerator; +import org.hibernate.generator.InMemoryGenerator; import org.hibernate.type.Type; /** diff --git a/hibernate-core/src/main/java/org/hibernate/id/IdentityGenerator.java b/hibernate-core/src/main/java/org/hibernate/id/IdentityGenerator.java index 6d1742b7ae..4839f742b5 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/IdentityGenerator.java +++ b/hibernate-core/src/main/java/org/hibernate/id/IdentityGenerator.java @@ -8,7 +8,7 @@ package org.hibernate.id; import org.hibernate.dialect.Dialect; import org.hibernate.id.factory.spi.StandardGenerator; -import org.hibernate.tuple.InDatabaseGenerator; +import org.hibernate.generator.InDatabaseGenerator; /** * An {@link InDatabaseGenerator} that handles {@code IDENTITY}/"autoincrement" columns diff --git a/hibernate-core/src/main/java/org/hibernate/id/PostInsertIdentifierGenerator.java b/hibernate-core/src/main/java/org/hibernate/id/PostInsertIdentifierGenerator.java index ef9112a5fe..3338390f80 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/PostInsertIdentifierGenerator.java +++ b/hibernate-core/src/main/java/org/hibernate/id/PostInsertIdentifierGenerator.java @@ -8,7 +8,7 @@ package org.hibernate.id; import org.hibernate.service.ServiceRegistry; import org.hibernate.tuple.GenerationTiming; -import org.hibernate.tuple.InDatabaseGenerator; +import org.hibernate.generator.InDatabaseGenerator; import org.hibernate.type.Type; import java.util.Properties; diff --git a/hibernate-core/src/main/java/org/hibernate/id/SelectGenerator.java b/hibernate-core/src/main/java/org/hibernate/id/SelectGenerator.java index d3121521aa..31fb375114 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/SelectGenerator.java +++ b/hibernate-core/src/main/java/org/hibernate/id/SelectGenerator.java @@ -8,6 +8,7 @@ package org.hibernate.id; import java.util.Properties; +import org.hibernate.generator.InDatabaseGenerator; import org.hibernate.persister.entity.EntityPersister; import org.hibernate.service.ServiceRegistry; import org.hibernate.type.Type; @@ -24,7 +25,7 @@ import org.hibernate.type.Type; * Hibernate. *

* Arguably, this class breaks the natural separation of responsibility between the - * {@linkplain org.hibernate.tuple.InDatabaseGenerator generator} and the coordinating + * {@linkplain InDatabaseGenerator generator} and the coordinating * code, since it's role is to specify how the generated value is retrieved. * * @see org.hibernate.annotations.NaturalId diff --git a/hibernate-core/src/main/java/org/hibernate/id/factory/IdentifierGeneratorFactory.java b/hibernate-core/src/main/java/org/hibernate/id/factory/IdentifierGeneratorFactory.java index 8a0ed6d8ec..a9d0389c59 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/factory/IdentifierGeneratorFactory.java +++ b/hibernate-core/src/main/java/org/hibernate/id/factory/IdentifierGeneratorFactory.java @@ -14,7 +14,7 @@ import org.hibernate.id.IdentifierGenerator; import org.hibernate.id.factory.spi.GeneratorDefinitionResolver; import org.hibernate.service.Service; import org.hibernate.service.ServiceRegistry; -import org.hibernate.tuple.Generator; +import org.hibernate.generator.Generator; import org.hibernate.type.Type; import org.hibernate.type.descriptor.java.JavaType; @@ -39,7 +39,7 @@ import jakarta.persistence.GenerationType; * method {@link IdentifierGenerator#configure(Type, Properties, ServiceRegistry)}. *

* This is part of an older mechanism for instantiating and configuring id generators - * which predates the existence of {@link org.hibernate.tuple.Generator} and the + * which predates the existence of {@link Generator} and the * {@link org.hibernate.annotations.IdGeneratorType @IdGeneratorType} meta-annotation. * * @author Steve Ebersole diff --git a/hibernate-core/src/main/java/org/hibernate/id/factory/internal/IdentifierGeneratorUtil.java b/hibernate-core/src/main/java/org/hibernate/id/factory/internal/IdentifierGeneratorUtil.java index 3901c5ece0..199692b161 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/factory/internal/IdentifierGeneratorUtil.java +++ b/hibernate-core/src/main/java/org/hibernate/id/factory/internal/IdentifierGeneratorUtil.java @@ -20,7 +20,7 @@ import org.hibernate.mapping.Column; import org.hibernate.mapping.RootClass; import org.hibernate.mapping.SimpleValue; import org.hibernate.mapping.Table; -import org.hibernate.tuple.Generator; +import org.hibernate.generator.Generator; import java.util.Properties; diff --git a/hibernate-core/src/main/java/org/hibernate/id/factory/internal/StandardIdentifierGeneratorFactory.java b/hibernate-core/src/main/java/org/hibernate/id/factory/internal/StandardIdentifierGeneratorFactory.java index 76a5e86e37..3a8dd0dbdf 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/factory/internal/StandardIdentifierGeneratorFactory.java +++ b/hibernate-core/src/main/java/org/hibernate/id/factory/internal/StandardIdentifierGeneratorFactory.java @@ -44,7 +44,7 @@ import org.hibernate.resource.beans.internal.FallbackBeanInstanceProducer; import org.hibernate.resource.beans.internal.Helper; import org.hibernate.resource.beans.spi.ManagedBeanRegistry; import org.hibernate.service.ServiceRegistry; -import org.hibernate.tuple.Generator; +import org.hibernate.generator.Generator; import org.hibernate.type.Type; import org.hibernate.type.descriptor.java.JavaType; diff --git a/hibernate-core/src/main/java/org/hibernate/id/factory/spi/CustomIdGeneratorCreationContext.java b/hibernate-core/src/main/java/org/hibernate/id/factory/spi/CustomIdGeneratorCreationContext.java index dcb061f500..99647dd8f1 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/factory/spi/CustomIdGeneratorCreationContext.java +++ b/hibernate-core/src/main/java/org/hibernate/id/factory/spi/CustomIdGeneratorCreationContext.java @@ -9,7 +9,7 @@ package org.hibernate.id.factory.spi; import org.hibernate.Incubating; import org.hibernate.id.factory.IdentifierGeneratorFactory; import org.hibernate.mapping.RootClass; -import org.hibernate.tuple.GeneratorCreationContext; +import org.hibernate.generator.GeneratorCreationContext; @Incubating public interface CustomIdGeneratorCreationContext extends GeneratorCreationContext { diff --git a/hibernate-core/src/main/java/org/hibernate/id/factory/spi/StandardGenerator.java b/hibernate-core/src/main/java/org/hibernate/id/factory/spi/StandardGenerator.java index bb6bb41bd3..cfd3419e19 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/factory/spi/StandardGenerator.java +++ b/hibernate-core/src/main/java/org/hibernate/id/factory/spi/StandardGenerator.java @@ -6,8 +6,10 @@ */ package org.hibernate.id.factory.spi; +import org.hibernate.generator.Generator; + /** - * Marker interface for Hibernate-provided implementations of {@link org.hibernate.tuple.Generator}. + * Marker interface for Hibernate-provided implementations of {@link Generator}. */ public interface StandardGenerator { } diff --git a/hibernate-core/src/main/java/org/hibernate/id/insert/BasicSelectingDelegate.java b/hibernate-core/src/main/java/org/hibernate/id/insert/BasicSelectingDelegate.java index 3feed2f2d2..d75ec74650 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/insert/BasicSelectingDelegate.java +++ b/hibernate-core/src/main/java/org/hibernate/id/insert/BasicSelectingDelegate.java @@ -15,7 +15,7 @@ import org.hibernate.jdbc.Expectation; import org.hibernate.metamodel.mapping.BasicEntityIdentifierMapping; import org.hibernate.sql.model.ast.builder.TableInsertBuilder; import org.hibernate.sql.model.ast.builder.TableInsertBuilderStandard; -import org.hibernate.tuple.InDatabaseGenerator; +import org.hibernate.generator.InDatabaseGenerator; /** * Delegate for dealing with {@code IDENTITY} columns where the dialect requires an diff --git a/hibernate-core/src/main/java/org/hibernate/id/insert/GetGeneratedKeysDelegate.java b/hibernate-core/src/main/java/org/hibernate/id/insert/GetGeneratedKeysDelegate.java index cd5ece4a38..d485b232f4 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/insert/GetGeneratedKeysDelegate.java +++ b/hibernate-core/src/main/java/org/hibernate/id/insert/GetGeneratedKeysDelegate.java @@ -25,7 +25,7 @@ import org.hibernate.jdbc.Expectation; import org.hibernate.metamodel.mapping.BasicEntityIdentifierMapping; import org.hibernate.sql.model.ast.builder.TableInsertBuilder; import org.hibernate.sql.model.ast.builder.TableInsertBuilderStandard; -import org.hibernate.tuple.InDatabaseGenerator; +import org.hibernate.generator.InDatabaseGenerator; import static java.sql.Statement.RETURN_GENERATED_KEYS; import static org.hibernate.id.IdentifierGeneratorHelper.getGeneratedIdentity; diff --git a/hibernate-core/src/main/java/org/hibernate/id/insert/InsertGeneratedIdentifierDelegate.java b/hibernate-core/src/main/java/org/hibernate/id/insert/InsertGeneratedIdentifierDelegate.java index 6a59734de9..5890dd6cc7 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/insert/InsertGeneratedIdentifierDelegate.java +++ b/hibernate-core/src/main/java/org/hibernate/id/insert/InsertGeneratedIdentifierDelegate.java @@ -13,13 +13,14 @@ import org.hibernate.engine.jdbc.mutation.JdbcValueBindings; import org.hibernate.engine.jdbc.mutation.group.PreparedStatementDetails; import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.engine.spi.SharedSessionContractImplementor; +import org.hibernate.generator.InDatabaseGenerator; import org.hibernate.jdbc.Expectation; import org.hibernate.metamodel.mapping.BasicEntityIdentifierMapping; import org.hibernate.sql.model.ast.builder.TableInsertBuilder; /** * Each implementation defines a strategy for retrieving a primary key - * {@linkplain org.hibernate.tuple.InDatabaseGenerator generated by + * {@linkplain InDatabaseGenerator generated by * the database} from the database after execution of an {@code insert} * statement. The generated primary key is usually an {@code IDENTITY} * column, but in principle it might be something else, for example, @@ -31,9 +32,9 @@ import org.hibernate.sql.model.ast.builder.TableInsertBuilder; *

  • retrieving the generated identifier value using JDBC. * * The implementation should be written to handle any instance of - * {@link org.hibernate.tuple.InDatabaseGenerator}. + * {@link InDatabaseGenerator}. * - * @see org.hibernate.tuple.InDatabaseGenerator + * @see InDatabaseGenerator * * @author Steve Ebersole */ diff --git a/hibernate-core/src/main/java/org/hibernate/id/insert/InsertReturningDelegate.java b/hibernate-core/src/main/java/org/hibernate/id/insert/InsertReturningDelegate.java index 516db9503a..3795d87551 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/insert/InsertReturningDelegate.java +++ b/hibernate-core/src/main/java/org/hibernate/id/insert/InsertReturningDelegate.java @@ -21,7 +21,7 @@ import org.hibernate.id.PostInsertIdentityPersister; import org.hibernate.jdbc.Expectation; import org.hibernate.metamodel.mapping.BasicEntityIdentifierMapping; import org.hibernate.sql.model.ast.builder.TableInsertBuilder; -import org.hibernate.tuple.InDatabaseGenerator; +import org.hibernate.generator.InDatabaseGenerator; import static java.sql.Statement.NO_GENERATED_KEYS; import static org.hibernate.id.IdentifierGeneratorHelper.getGeneratedIdentity; diff --git a/hibernate-core/src/main/java/org/hibernate/id/insert/InsertSelectIdentityInsert.java b/hibernate-core/src/main/java/org/hibernate/id/insert/InsertSelectIdentityInsert.java index 030aed98f4..ba3375a15f 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/insert/InsertSelectIdentityInsert.java +++ b/hibernate-core/src/main/java/org/hibernate/id/insert/InsertSelectIdentityInsert.java @@ -8,7 +8,7 @@ package org.hibernate.id.insert; import org.hibernate.MappingException; import org.hibernate.dialect.Dialect; import org.hibernate.sql.Insert; -import org.hibernate.tuple.InDatabaseGenerator; +import org.hibernate.generator.InDatabaseGenerator; /** * Specialized {@link IdentifierGeneratingInsert} which appends the database diff --git a/hibernate-core/src/main/java/org/hibernate/id/uuid/UuidGenerator.java b/hibernate-core/src/main/java/org/hibernate/id/uuid/UuidGenerator.java index 0e658fa1fe..e3bf23bf97 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/uuid/UuidGenerator.java +++ b/hibernate-core/src/main/java/org/hibernate/id/uuid/UuidGenerator.java @@ -12,7 +12,7 @@ import java.util.UUID; import org.hibernate.HibernateException; import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.id.factory.spi.CustomIdGeneratorCreationContext; -import org.hibernate.tuple.InMemoryGenerator; +import org.hibernate.generator.InMemoryGenerator; import org.hibernate.type.descriptor.java.UUIDJavaType; import org.hibernate.type.descriptor.java.UUIDJavaType.ValueTransformer; diff --git a/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java b/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java index 95dc6efdc3..b49db53d71 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java @@ -123,7 +123,7 @@ import org.hibernate.service.spi.SessionFactoryServiceRegistryFactory; import org.hibernate.stat.spi.StatisticsImplementor; import org.hibernate.tool.schema.spi.DelayedDropAction; import org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator; -import org.hibernate.tuple.Generator; +import org.hibernate.generator.Generator; import org.hibernate.type.Type; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.spi.TypeConfiguration; diff --git a/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java b/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java index 9b03efb130..f3773a6877 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java @@ -139,7 +139,7 @@ import org.hibernate.resource.transaction.spi.TransactionStatus; import org.hibernate.stat.SessionStatistics; import org.hibernate.stat.internal.SessionStatisticsImpl; import org.hibernate.stat.spi.StatisticsImplementor; -import org.hibernate.tuple.TenantIdBinder; +import org.hibernate.binder.internal.TenantIdBinder; import jakarta.persistence.CacheRetrieveMode; import jakarta.persistence.CacheStoreMode; @@ -162,7 +162,6 @@ import static org.hibernate.cfg.AvailableSettings.JPA_LOCK_SCOPE; import static org.hibernate.cfg.AvailableSettings.JPA_LOCK_TIMEOUT; import static org.hibernate.cfg.AvailableSettings.JPA_SHARED_CACHE_RETRIEVE_MODE; import static org.hibernate.cfg.AvailableSettings.JPA_SHARED_CACHE_STORE_MODE; -import static org.hibernate.engine.internal.ManagedTypeHelper.isHibernateProxy; import static org.hibernate.jpa.HibernateHints.HINT_READ_ONLY; import static org.hibernate.jpa.LegacySpecHints.HINT_JAVAEE_LOCK_TIMEOUT; import static org.hibernate.jpa.LegacySpecHints.HINT_JAVAEE_QUERY_TIMEOUT; diff --git a/hibernate-core/src/main/java/org/hibernate/internal/StatelessSessionImpl.java b/hibernate-core/src/main/java/org/hibernate/internal/StatelessSessionImpl.java index 8e1faf44b9..775e01e72e 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/StatelessSessionImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/StatelessSessionImpl.java @@ -33,14 +33,13 @@ import org.hibernate.persister.entity.EntityPersister; import org.hibernate.pretty.MessageHelper; import org.hibernate.proxy.HibernateProxy; import org.hibernate.proxy.LazyInitializer; -import org.hibernate.tuple.Generator; -import org.hibernate.tuple.InMemoryGenerator; +import org.hibernate.generator.Generator; +import org.hibernate.generator.InMemoryGenerator; import org.hibernate.tuple.entity.EntityMetamodel; import jakarta.transaction.SystemException; import static org.hibernate.engine.internal.ManagedTypeHelper.asPersistentAttributeInterceptable; -import static org.hibernate.engine.internal.ManagedTypeHelper.isHibernateProxy; import static org.hibernate.engine.internal.ManagedTypeHelper.isPersistentAttributeInterceptable; /** diff --git a/hibernate-core/src/main/java/org/hibernate/mapping/Component.java b/hibernate-core/src/main/java/org/hibernate/mapping/Component.java index 5026353200..07d9e5367d 100644 --- a/hibernate-core/src/main/java/org/hibernate/mapping/Component.java +++ b/hibernate-core/src/main/java/org/hibernate/mapping/Component.java @@ -35,8 +35,8 @@ import org.hibernate.internal.util.collections.ArrayHelper; import org.hibernate.internal.util.collections.JoinedIterator; import org.hibernate.metamodel.spi.EmbeddableInstantiator; import org.hibernate.property.access.spi.Setter; -import org.hibernate.tuple.Generator; -import org.hibernate.tuple.InMemoryGenerator; +import org.hibernate.generator.Generator; +import org.hibernate.generator.InMemoryGenerator; import org.hibernate.type.ComponentType; import org.hibernate.type.EmbeddedComponentType; import org.hibernate.type.Type; diff --git a/hibernate-core/src/main/java/org/hibernate/mapping/GeneratorCreator.java b/hibernate-core/src/main/java/org/hibernate/mapping/GeneratorCreator.java index 5b2e9c553e..503f6fe905 100644 --- a/hibernate-core/src/main/java/org/hibernate/mapping/GeneratorCreator.java +++ b/hibernate-core/src/main/java/org/hibernate/mapping/GeneratorCreator.java @@ -7,8 +7,8 @@ package org.hibernate.mapping; import org.hibernate.Internal; -import org.hibernate.tuple.Generator; -import org.hibernate.tuple.GeneratorCreationContext; +import org.hibernate.generator.Generator; +import org.hibernate.generator.GeneratorCreationContext; @Internal @FunctionalInterface diff --git a/hibernate-core/src/main/java/org/hibernate/mapping/IdentifierGeneratorCreator.java b/hibernate-core/src/main/java/org/hibernate/mapping/IdentifierGeneratorCreator.java index 7a9cb69e45..6f21466843 100644 --- a/hibernate-core/src/main/java/org/hibernate/mapping/IdentifierGeneratorCreator.java +++ b/hibernate-core/src/main/java/org/hibernate/mapping/IdentifierGeneratorCreator.java @@ -8,7 +8,7 @@ package org.hibernate.mapping; import org.hibernate.Internal; import org.hibernate.id.factory.spi.CustomIdGeneratorCreationContext; -import org.hibernate.tuple.Generator; +import org.hibernate.generator.Generator; @Internal @FunctionalInterface diff --git a/hibernate-core/src/main/java/org/hibernate/mapping/KeyValue.java b/hibernate-core/src/main/java/org/hibernate/mapping/KeyValue.java index 679bd4b99a..2e4a56582b 100644 --- a/hibernate-core/src/main/java/org/hibernate/mapping/KeyValue.java +++ b/hibernate-core/src/main/java/org/hibernate/mapping/KeyValue.java @@ -9,8 +9,7 @@ package org.hibernate.mapping; import org.hibernate.dialect.Dialect; import org.hibernate.id.IdentifierGenerator; import org.hibernate.id.factory.IdentifierGeneratorFactory; -import org.hibernate.tuple.Generator; -import org.hibernate.tuple.InMemoryGenerator; +import org.hibernate.generator.Generator; /** * A mapping model {@link Value} which may be treated as an identifying key of a diff --git a/hibernate-core/src/main/java/org/hibernate/mapping/Property.java b/hibernate-core/src/main/java/org/hibernate/mapping/Property.java index f83f187c92..72e0fe277a 100644 --- a/hibernate-core/src/main/java/org/hibernate/mapping/Property.java +++ b/hibernate-core/src/main/java/org/hibernate/mapping/Property.java @@ -30,8 +30,8 @@ import org.hibernate.property.access.spi.PropertyAccessStrategy; import org.hibernate.property.access.spi.PropertyAccessStrategyResolver; import org.hibernate.property.access.spi.Setter; import org.hibernate.service.ServiceRegistry; -import org.hibernate.tuple.Generator; -import org.hibernate.tuple.GeneratorCreationContext; +import org.hibernate.generator.Generator; +import org.hibernate.generator.GeneratorCreationContext; import org.hibernate.type.CompositeType; import org.hibernate.type.Type; diff --git a/hibernate-core/src/main/java/org/hibernate/mapping/SimpleValue.java b/hibernate-core/src/main/java/org/hibernate/mapping/SimpleValue.java index 439db91e70..5aab5231fc 100644 --- a/hibernate-core/src/main/java/org/hibernate/mapping/SimpleValue.java +++ b/hibernate-core/src/main/java/org/hibernate/mapping/SimpleValue.java @@ -48,7 +48,7 @@ import org.hibernate.internal.util.collections.ArrayHelper; import org.hibernate.metamodel.model.convert.spi.JpaAttributeConverter; import org.hibernate.resource.beans.spi.ManagedBeanRegistry; import org.hibernate.service.ServiceRegistry; -import org.hibernate.tuple.Generator; +import org.hibernate.generator.Generator; import org.hibernate.type.Type; import org.hibernate.type.descriptor.JdbcTypeNameMapper; import org.hibernate.type.descriptor.java.JavaType; diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/AttributeMapping.java b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/AttributeMapping.java index 801edfbb6a..16497073b4 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/AttributeMapping.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/AttributeMapping.java @@ -9,7 +9,7 @@ package org.hibernate.metamodel.mapping; import org.hibernate.property.access.spi.PropertyAccess; import org.hibernate.sql.results.graph.DatabaseSnapshotContributor; import org.hibernate.sql.results.graph.Fetchable; -import org.hibernate.tuple.Generator; +import org.hibernate.generator.Generator; import org.hibernate.type.descriptor.java.JavaType; import org.hibernate.type.descriptor.java.MutabilityPlan; import org.hibernate.type.descriptor.java.MutabilityPlanExposer; diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/GeneratedValueResolver.java b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/GeneratedValueResolver.java index 81df94f539..5250d54bd5 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/GeneratedValueResolver.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/GeneratedValueResolver.java @@ -8,10 +8,6 @@ package org.hibernate.metamodel.mapping; import org.hibernate.Incubating; import org.hibernate.engine.spi.SharedSessionContractImplementor; -import org.hibernate.metamodel.mapping.internal.NoGeneratedValueResolver; -import org.hibernate.tuple.Generator; -import org.hibernate.tuple.GenerationTiming; -import org.hibernate.tuple.InMemoryGenerator; /** * Generalized contract covering an attribute's generation handling diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/InMemoryGeneratedValueResolver.java b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/InMemoryGeneratedValueResolver.java index 000de9345f..8b031879c3 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/InMemoryGeneratedValueResolver.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/InMemoryGeneratedValueResolver.java @@ -9,7 +9,7 @@ package org.hibernate.metamodel.mapping; import org.hibernate.Internal; import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.tuple.GenerationTiming; -import org.hibernate.tuple.InMemoryGenerator; +import org.hibernate.generator.InMemoryGenerator; /** * GeneratedValueResolver impl for in-memory generation diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/AbstractSingularAttributeMapping.java b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/AbstractSingularAttributeMapping.java index 82a4a71cc4..c0f121c6ea 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/AbstractSingularAttributeMapping.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/AbstractSingularAttributeMapping.java @@ -13,7 +13,7 @@ import org.hibernate.metamodel.mapping.ManagedMappingType; import org.hibernate.metamodel.mapping.SingularAttributeMapping; import org.hibernate.property.access.spi.PropertyAccess; import org.hibernate.sql.results.graph.FetchOptions; -import org.hibernate.tuple.Generator; +import org.hibernate.generator.Generator; /** * @author Steve Ebersole diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/GeneratedValuesProcessor.java b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/GeneratedValuesProcessor.java index 12860dc0f9..582923bdfa 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/GeneratedValuesProcessor.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/GeneratedValuesProcessor.java @@ -14,6 +14,7 @@ import org.hibernate.LockOptions; import org.hibernate.engine.spi.LoadQueryInfluencers; import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.engine.spi.SharedSessionContractImplementor; +import org.hibernate.generator.InDatabaseGenerator; import org.hibernate.loader.ast.internal.LoaderSelectBuilder; import org.hibernate.metamodel.UnsupportedMappingException; import org.hibernate.metamodel.mapping.AttributeMapping; @@ -31,19 +32,19 @@ import org.hibernate.sql.exec.spi.ExecutionContext; import org.hibernate.sql.exec.spi.JdbcOperationQuerySelect; import org.hibernate.sql.exec.spi.JdbcParameterBindings; import org.hibernate.tuple.GenerationTiming; -import org.hibernate.tuple.Generator; +import org.hibernate.generator.Generator; import static org.hibernate.sql.results.spi.ListResultsConsumer.UniqueSemantic.FILTER; /** - * Responsible for retrieving {@linkplain org.hibernate.tuple.InDatabaseGenerator + * Responsible for retrieving {@linkplain InDatabaseGenerator * database-generated} attribute values after an {@code insert} statement is executed. *

    * Note that this class has responsibility for regular attributes of the entity. The * primary key / id attribute is handled separately, being the responsibility of an * instance of {@link org.hibernate.id.insert.InsertGeneratedIdentifierDelegate}. * - * @see org.hibernate.tuple.InDatabaseGenerator + * @see InDatabaseGenerator * * @author Steve Ebersole */ @@ -83,7 +84,7 @@ public class GeneratedValuesProcessor { } /** - * Find attributes generated by a {@link org.hibernate.tuple.InDatabaseGenerator}, + * Find attributes generated by a {@link InDatabaseGenerator}, * populate the list of {@link GeneratedValueDescriptor}s by side effect, and * return a list of {@link AttributeMapping}s. */ diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/PluralAttributeMappingImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/PluralAttributeMappingImpl.java index a938ee0fd1..a57548bc03 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/PluralAttributeMappingImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/PluralAttributeMappingImpl.java @@ -69,7 +69,7 @@ import org.hibernate.sql.results.graph.collection.internal.CollectionDomainResul import org.hibernate.sql.results.graph.collection.internal.DelayedCollectionFetch; import org.hibernate.sql.results.graph.collection.internal.EagerCollectionFetch; import org.hibernate.sql.results.graph.collection.internal.SelectEagerCollectionFetch; -import org.hibernate.tuple.Generator; +import org.hibernate.generator.Generator; import org.jboss.logging.Logger; diff --git a/hibernate-core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java b/hibernate-core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java index 16f8949dc8..bfe7104606 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/collection/AbstractCollectionPersister.java @@ -128,8 +128,8 @@ import org.hibernate.sql.model.jdbc.JdbcDeleteMutation; import org.hibernate.sql.model.jdbc.JdbcMutationOperation; import org.hibernate.sql.results.graph.DomainResult; import org.hibernate.sql.results.internal.SqlSelectionImpl; -import org.hibernate.tuple.Generator; -import org.hibernate.tuple.InMemoryGenerator; +import org.hibernate.generator.Generator; +import org.hibernate.generator.InMemoryGenerator; import org.hibernate.type.CollectionType; import org.hibernate.type.CompositeType; import org.hibernate.type.EntityType; diff --git a/hibernate-core/src/main/java/org/hibernate/persister/collection/CollectionPersister.java b/hibernate-core/src/main/java/org/hibernate/persister/collection/CollectionPersister.java index 3ecfb44ab0..9767692171 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/collection/CollectionPersister.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/collection/CollectionPersister.java @@ -33,7 +33,7 @@ import org.hibernate.persister.entity.EntityPersister; import org.hibernate.sql.ast.spi.SqlAstCreationState; import org.hibernate.sql.ast.tree.from.TableGroup; import org.hibernate.sql.ast.tree.predicate.Predicate; -import org.hibernate.tuple.InMemoryGenerator; +import org.hibernate.generator.InMemoryGenerator; import org.hibernate.type.CollectionType; import org.hibernate.type.Type; diff --git a/hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java b/hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java index 396da6dbd3..48078fdd5b 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java @@ -257,9 +257,9 @@ import org.hibernate.sql.results.graph.embeddable.EmbeddableResultGraphNode; import org.hibernate.sql.results.graph.entity.internal.EntityResultImpl; import org.hibernate.sql.results.internal.SqlSelectionImpl; import org.hibernate.stat.spi.StatisticsImplementor; +import org.hibernate.generator.Generator; +import org.hibernate.generator.InDatabaseGenerator; import org.hibernate.tuple.GenerationTiming; -import org.hibernate.tuple.Generator; -import org.hibernate.tuple.InDatabaseGenerator; import org.hibernate.tuple.NonIdentifierAttribute; import org.hibernate.tuple.entity.EntityBasedAssociationAttribute; import org.hibernate.tuple.entity.EntityMetamodel; diff --git a/hibernate-core/src/main/java/org/hibernate/persister/entity/EntityPersister.java b/hibernate-core/src/main/java/org/hibernate/persister/entity/EntityPersister.java index 24c74dc23b..38f003312e 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/entity/EntityPersister.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/entity/EntityPersister.java @@ -46,7 +46,7 @@ import org.hibernate.query.sqm.mutation.spi.SqmMultiTableMutationStrategy; import org.hibernate.sql.ast.spi.SqlAliasStemHelper; import org.hibernate.sql.ast.tree.from.RootTableGroupProducer; import org.hibernate.sql.ast.tree.from.TableGroup; -import org.hibernate.tuple.Generator; +import org.hibernate.generator.Generator; import org.hibernate.tuple.entity.EntityMetamodel; import org.hibernate.type.BasicType; import org.hibernate.type.Type; diff --git a/hibernate-core/src/main/java/org/hibernate/persister/entity/mutation/AbstractMutationCoordinator.java b/hibernate-core/src/main/java/org/hibernate/persister/entity/mutation/AbstractMutationCoordinator.java index b1c75b7c20..26a3dadd02 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/entity/mutation/AbstractMutationCoordinator.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/entity/mutation/AbstractMutationCoordinator.java @@ -24,7 +24,7 @@ import org.hibernate.sql.model.ast.builder.MutationGroupBuilder; import org.hibernate.sql.model.internal.MutationOperationGroupNone; import org.hibernate.sql.model.internal.MutationOperationGroupSingle; import org.hibernate.sql.model.internal.MutationOperationGroupStandard; -import org.hibernate.tuple.InDatabaseGenerator; +import org.hibernate.generator.InDatabaseGenerator; /** * Base support for coordinating mutations against an entity diff --git a/hibernate-core/src/main/java/org/hibernate/persister/entity/mutation/InsertCoordinator.java b/hibernate-core/src/main/java/org/hibernate/persister/entity/mutation/InsertCoordinator.java index cd6c226e2c..ba9037183d 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/entity/mutation/InsertCoordinator.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/entity/mutation/InsertCoordinator.java @@ -31,9 +31,9 @@ import org.hibernate.sql.model.ValuesAnalysis; import org.hibernate.sql.model.ast.builder.MutationGroupBuilder; import org.hibernate.sql.model.ast.builder.TableInsertBuilder; import org.hibernate.sql.model.ast.builder.TableInsertBuilderStandard; -import org.hibernate.tuple.Generator; -import org.hibernate.tuple.InDatabaseGenerator; -import org.hibernate.tuple.InMemoryGenerator; +import org.hibernate.generator.Generator; +import org.hibernate.generator.InDatabaseGenerator; +import org.hibernate.generator.InMemoryGenerator; import org.hibernate.tuple.entity.EntityMetamodel; /** diff --git a/hibernate-core/src/main/java/org/hibernate/persister/entity/mutation/UpdateCoordinatorStandard.java b/hibernate-core/src/main/java/org/hibernate/persister/entity/mutation/UpdateCoordinatorStandard.java index 2c13cad3b1..068caf4ed6 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/entity/mutation/UpdateCoordinatorStandard.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/entity/mutation/UpdateCoordinatorStandard.java @@ -50,9 +50,9 @@ import org.hibernate.sql.model.ast.builder.TableUpdateBuilderSkipped; import org.hibernate.sql.model.ast.builder.TableUpdateBuilderStandard; import org.hibernate.sql.model.internal.MutationOperationGroupSingle; import org.hibernate.sql.model.jdbc.JdbcMutationOperation; -import org.hibernate.tuple.Generator; -import org.hibernate.tuple.InDatabaseGenerator; -import org.hibernate.tuple.InMemoryGenerator; +import org.hibernate.generator.Generator; +import org.hibernate.generator.InDatabaseGenerator; +import org.hibernate.generator.InMemoryGenerator; import org.hibernate.tuple.entity.EntityMetamodel; import static org.hibernate.engine.OptimisticLockStyle.ALL; diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/internal/QuerySqmImpl.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/internal/QuerySqmImpl.java index 3696f38305..1c2bfd70cb 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/internal/QuerySqmImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/internal/QuerySqmImpl.java @@ -107,8 +107,7 @@ import org.hibernate.query.sqm.tree.update.SqmAssignment; import org.hibernate.query.sqm.tree.update.SqmUpdateStatement; import org.hibernate.sql.results.internal.TupleMetadata; import org.hibernate.sql.results.spi.ListResultsConsumer; -import org.hibernate.tuple.Generator; -import org.hibernate.tuple.InMemoryGenerator; +import org.hibernate.generator.Generator; import static org.hibernate.jpa.HibernateHints.HINT_CACHEABLE; import static org.hibernate.jpa.HibernateHints.HINT_CACHE_MODE; diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/cte/CteInsertHandler.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/cte/CteInsertHandler.java index 6616d1f164..9f323a457c 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/cte/CteInsertHandler.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/cte/CteInsertHandler.java @@ -22,7 +22,6 @@ import org.hibernate.engine.jdbc.spi.JdbcServices; import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.id.BulkInsertionCapableIdentifierGenerator; import org.hibernate.id.OptimizableGenerator; -import org.hibernate.id.PostInsertIdentifierGenerator; import org.hibernate.id.enhanced.Optimizer; import org.hibernate.internal.util.collections.CollectionHelper; import org.hibernate.internal.util.collections.Stack; @@ -94,7 +93,7 @@ import org.hibernate.sql.results.graph.DomainResult; import org.hibernate.sql.results.graph.basic.BasicResult; import org.hibernate.sql.results.internal.SqlSelectionImpl; import org.hibernate.sql.results.spi.ListResultsConsumer; -import org.hibernate.tuple.Generator; +import org.hibernate.generator.Generator; import org.hibernate.type.spi.TypeConfiguration; /** 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 ecaad12635..6542a00448 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 @@ -24,8 +24,6 @@ import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.id.BulkInsertionCapableIdentifierGenerator; import org.hibernate.id.OptimizableGenerator; -import org.hibernate.id.PostInsertIdentifierGenerator; -import org.hibernate.id.PostInsertIdentityPersister; import org.hibernate.id.enhanced.Optimizer; import org.hibernate.id.insert.Binder; import org.hibernate.id.insert.InsertGeneratedIdentifierDelegate; @@ -74,9 +72,9 @@ import org.hibernate.sql.exec.spi.JdbcParameterBindings; import org.hibernate.sql.results.graph.basic.BasicFetch; import org.hibernate.sql.results.internal.SqlSelectionImpl; import org.hibernate.sql.results.spi.ListResultsConsumer; -import org.hibernate.tuple.Generator; -import org.hibernate.tuple.InDatabaseGenerator; -import org.hibernate.tuple.InMemoryGenerator; +import org.hibernate.generator.Generator; +import org.hibernate.generator.InDatabaseGenerator; +import org.hibernate.generator.InMemoryGenerator; import org.hibernate.type.descriptor.ValueBinder; /** 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 cae7e3cba5..af1a824503 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 @@ -52,8 +52,7 @@ import org.hibernate.sql.ast.tree.update.Assignment; import org.hibernate.sql.exec.internal.JdbcParameterImpl; import org.hibernate.sql.exec.spi.ExecutionContext; import org.hibernate.sql.results.internal.SqlSelectionImpl; -import org.hibernate.tuple.Generator; -import org.hibernate.tuple.InMemoryGenerator; +import org.hibernate.generator.Generator; import org.hibernate.type.BasicType; import org.jboss.logging.Logger; 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 3bc525c2a1..d860577a70 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 @@ -382,8 +382,8 @@ import org.hibernate.sql.results.graph.FetchableContainer; import org.hibernate.sql.results.graph.instantiation.internal.DynamicInstantiation; import org.hibernate.sql.results.internal.SqlSelectionImpl; import org.hibernate.sql.results.internal.StandardEntityGraphTraversalStateImpl; -import org.hibernate.tuple.Generator; -import org.hibernate.tuple.InMemoryGenerator; +import org.hibernate.generator.Generator; +import org.hibernate.generator.InMemoryGenerator; import org.hibernate.type.BasicType; import org.hibernate.type.CustomType; import org.hibernate.type.EnumType; diff --git a/hibernate-core/src/main/java/org/hibernate/sql/Insert.java b/hibernate-core/src/main/java/org/hibernate/sql/Insert.java index 632e165fcf..25bf6439e6 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/Insert.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/Insert.java @@ -14,7 +14,7 @@ import org.hibernate.Internal; import org.hibernate.MappingException; import org.hibernate.dialect.Dialect; import org.hibernate.dialect.identity.IdentityColumnSupport; -import org.hibernate.tuple.InDatabaseGenerator; +import org.hibernate.generator.InDatabaseGenerator; /** * An SQL {@code INSERT} statement diff --git a/hibernate-core/src/main/java/org/hibernate/tuple/AnnotationValueGeneration.java b/hibernate-core/src/main/java/org/hibernate/tuple/AnnotationValueGeneration.java index 6c39a34bc9..54b8bc81d4 100644 --- a/hibernate-core/src/main/java/org/hibernate/tuple/AnnotationValueGeneration.java +++ b/hibernate-core/src/main/java/org/hibernate/tuple/AnnotationValueGeneration.java @@ -7,6 +7,9 @@ package org.hibernate.tuple; import org.hibernate.AssertionFailure; +import org.hibernate.generator.AnnotationBasedGenerator; +import org.hibernate.generator.Generator; +import org.hibernate.generator.GeneratorCreationContext; import java.lang.annotation.Annotation; import java.lang.reflect.Field; diff --git a/hibernate-core/src/main/java/org/hibernate/tuple/CreationTimestampGeneration.java b/hibernate-core/src/main/java/org/hibernate/tuple/CreationTimestampGeneration.java index 626551e32d..6bb6f74d49 100644 --- a/hibernate-core/src/main/java/org/hibernate/tuple/CreationTimestampGeneration.java +++ b/hibernate-core/src/main/java/org/hibernate/tuple/CreationTimestampGeneration.java @@ -17,7 +17,7 @@ import org.hibernate.dialect.Dialect; * * @author Gunnar Morling * - * @deprecated use {@link CurrentTimestampGeneration} + * @deprecated use {@link org.hibernate.generator.internal.CurrentTimestampGeneration} */ @Internal @Deprecated(since = "6.2") @Remove diff --git a/hibernate-core/src/main/java/org/hibernate/tuple/IdentifierAttribute.java b/hibernate-core/src/main/java/org/hibernate/tuple/IdentifierAttribute.java index 510ca17f47..3634ae34ad 100644 --- a/hibernate-core/src/main/java/org/hibernate/tuple/IdentifierAttribute.java +++ b/hibernate-core/src/main/java/org/hibernate/tuple/IdentifierAttribute.java @@ -6,6 +6,7 @@ */ package org.hibernate.tuple; +import org.hibernate.generator.Generator; import org.hibernate.id.IdentifierGenerator; /** diff --git a/hibernate-core/src/main/java/org/hibernate/tuple/IdentifierProperty.java b/hibernate-core/src/main/java/org/hibernate/tuple/IdentifierProperty.java index 4311336fb7..236bf25eaa 100644 --- a/hibernate-core/src/main/java/org/hibernate/tuple/IdentifierProperty.java +++ b/hibernate-core/src/main/java/org/hibernate/tuple/IdentifierProperty.java @@ -6,8 +6,8 @@ */ package org.hibernate.tuple; +import org.hibernate.generator.Generator; import org.hibernate.id.IdentifierGenerator; -import org.hibernate.id.PostInsertIdentifierGenerator; import org.hibernate.type.Type; /** diff --git a/hibernate-core/src/main/java/org/hibernate/tuple/PropertyFactory.java b/hibernate-core/src/main/java/org/hibernate/tuple/PropertyFactory.java index b084dc2771..f0713847ba 100644 --- a/hibernate-core/src/main/java/org/hibernate/tuple/PropertyFactory.java +++ b/hibernate-core/src/main/java/org/hibernate/tuple/PropertyFactory.java @@ -11,6 +11,7 @@ import org.hibernate.boot.spi.MetadataImplementor; import org.hibernate.boot.spi.SessionFactoryOptions; import org.hibernate.bytecode.enhance.spi.interceptor.EnhancementHelper; import org.hibernate.engine.spi.SessionFactoryImplementor; +import org.hibernate.generator.Generator; import org.hibernate.mapping.PersistentClass; import org.hibernate.mapping.Property; import org.hibernate.metamodel.spi.RuntimeModelCreationContext; diff --git a/hibernate-core/src/main/java/org/hibernate/tuple/UpdateTimestampGeneration.java b/hibernate-core/src/main/java/org/hibernate/tuple/UpdateTimestampGeneration.java index b56417d6f9..7eb6880574 100644 --- a/hibernate-core/src/main/java/org/hibernate/tuple/UpdateTimestampGeneration.java +++ b/hibernate-core/src/main/java/org/hibernate/tuple/UpdateTimestampGeneration.java @@ -17,7 +17,7 @@ import org.hibernate.dialect.Dialect; * * @author Gunnar Morling * - * @deprecated use {@link CurrentTimestampGeneration} + * @deprecated use {@link org.hibernate.generator.internal.CurrentTimestampGeneration} */ @Internal @Deprecated(since = "6.2") @Remove diff --git a/hibernate-core/src/main/java/org/hibernate/tuple/ValueGeneration.java b/hibernate-core/src/main/java/org/hibernate/tuple/ValueGeneration.java index 97d8faf43b..50ab9528bf 100644 --- a/hibernate-core/src/main/java/org/hibernate/tuple/ValueGeneration.java +++ b/hibernate-core/src/main/java/org/hibernate/tuple/ValueGeneration.java @@ -9,6 +9,9 @@ package org.hibernate.tuple; import org.hibernate.Session; import org.hibernate.dialect.Dialect; import org.hibernate.engine.spi.SharedSessionContractImplementor; +import org.hibernate.generator.Generator; +import org.hibernate.generator.InDatabaseGenerator; +import org.hibernate.generator.InMemoryGenerator; /** * A value generator that can adapt to both Java value generation and database value generation. diff --git a/hibernate-core/src/main/java/org/hibernate/tuple/VmValueGeneration.java b/hibernate-core/src/main/java/org/hibernate/tuple/VmValueGeneration.java index 1dbdb05aca..d115a6ee4b 100644 --- a/hibernate-core/src/main/java/org/hibernate/tuple/VmValueGeneration.java +++ b/hibernate-core/src/main/java/org/hibernate/tuple/VmValueGeneration.java @@ -14,11 +14,12 @@ import org.hibernate.Session; import org.hibernate.annotations.GenerationTime; import org.hibernate.annotations.GeneratorType; import org.hibernate.engine.spi.SharedSessionContractImplementor; +import org.hibernate.generator.InMemoryGenerator; import static org.hibernate.internal.util.ReflectHelper.getDefaultConstructor; /** - * An {@link AnnotationValueGeneration} which delegates to a {@link ValueGenerator}. + * An {@link InMemoryGenerator} which delegates to a {@link ValueGenerator}. * Underlies the {@link GeneratorType} annotation. * * @author Gunnar Morling diff --git a/hibernate-core/src/main/java/org/hibernate/tuple/entity/EntityMetamodel.java b/hibernate-core/src/main/java/org/hibernate/tuple/entity/EntityMetamodel.java index 95b87e5af3..743de615a6 100644 --- a/hibernate-core/src/main/java/org/hibernate/tuple/entity/EntityMetamodel.java +++ b/hibernate-core/src/main/java/org/hibernate/tuple/entity/EntityMetamodel.java @@ -42,10 +42,10 @@ import org.hibernate.metamodel.mapping.EntityMappingType; import org.hibernate.metamodel.spi.RuntimeModelCreationContext; import org.hibernate.persister.entity.EntityPersister; import org.hibernate.persister.spi.PersisterCreationContext; -import org.hibernate.tuple.Generator; +import org.hibernate.generator.Generator; import org.hibernate.tuple.IdentifierProperty; -import org.hibernate.tuple.InDatabaseGenerator; -import org.hibernate.tuple.InMemoryGenerator; +import org.hibernate.generator.InDatabaseGenerator; +import org.hibernate.generator.InMemoryGenerator; import org.hibernate.tuple.NonIdentifierAttribute; import org.hibernate.tuple.PropertyFactory; import org.hibernate.type.AssociationType; diff --git a/hibernate-core/src/main/java/org/hibernate/type/ComponentType.java b/hibernate-core/src/main/java/org/hibernate/type/ComponentType.java index 1ea58e99b2..3ad9505a5d 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/ComponentType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/ComponentType.java @@ -36,7 +36,7 @@ import org.hibernate.metamodel.spi.EmbeddableInstantiator; import org.hibernate.property.access.spi.PropertyAccess; import org.hibernate.query.sqm.SqmExpressible; import org.hibernate.resource.beans.spi.ManagedBeanRegistry; -import org.hibernate.tuple.Generator; +import org.hibernate.generator.Generator; import org.hibernate.tuple.PropertyFactory; import org.hibernate.tuple.StandardProperty; import org.hibernate.type.descriptor.jdbc.JdbcType; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/hql/BulkManipulationTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/hql/BulkManipulationTest.java index 214c9c0727..97a67ab1e5 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/hql/BulkManipulationTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/hql/BulkManipulationTest.java @@ -33,7 +33,7 @@ import org.hibernate.testing.RequiresDialectFeature; import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; -import org.hibernate.tuple.Generator; +import org.hibernate.generator.Generator; import org.junit.Test; import org.junit.jupiter.api.Assumptions; import junit.framework.AssertionFailedError; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/attributebinder/YesNoBinder.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/attributebinder/YesNoBinder.java index fe8d89a6fe..c8f69bcc2a 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/attributebinder/YesNoBinder.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/attributebinder/YesNoBinder.java @@ -13,7 +13,7 @@ import org.hibernate.boot.spi.MetadataBuildingContext; import org.hibernate.mapping.BasicValue; import org.hibernate.mapping.PersistentClass; import org.hibernate.mapping.Property; -import org.hibernate.tuple.AttributeBinder; +import org.hibernate.binder.AttributeBinder; import org.hibernate.type.YesNoConverter; import org.hibernate.type.descriptor.java.BasicJavaType; import org.hibernate.type.descriptor.jdbc.JdbcType; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/generated/temporals/GeneratedUuidTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/generated/temporals/GeneratedUuidTests.java index ee0e687126..4596166f7d 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/generated/temporals/GeneratedUuidTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/generated/temporals/GeneratedUuidTests.java @@ -20,7 +20,7 @@ import jakarta.persistence.Table; import org.hibernate.annotations.ValueGenerationType; import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.tuple.GenerationTiming; -import org.hibernate.tuple.InMemoryGenerator; +import org.hibernate.generator.InMemoryGenerator; import org.hibernate.testing.orm.junit.DomainModel; import org.hibernate.testing.orm.junit.SessionFactory; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/tenantid/TenantIdTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/tenantid/TenantIdTest.java index 6e8735724d..012c812a9a 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/tenantid/TenantIdTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/tenantid/TenantIdTest.java @@ -17,7 +17,7 @@ import org.hibernate.testing.orm.junit.SessionFactory; import org.hibernate.testing.orm.junit.SessionFactoryProducer; import org.hibernate.testing.orm.junit.SessionFactoryScope; import org.hibernate.testing.orm.junit.Setting; -import org.hibernate.tuple.TenantIdBinder; +import org.hibernate.binder.internal.TenantIdBinder; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/tenantlongid/TenantLongIdTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/tenantlongid/TenantLongIdTest.java index e0fc772ee4..cbf49bea27 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/tenantlongid/TenantLongIdTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/tenantlongid/TenantLongIdTest.java @@ -17,7 +17,7 @@ import org.hibernate.testing.orm.junit.SessionFactory; import org.hibernate.testing.orm.junit.SessionFactoryProducer; import org.hibernate.testing.orm.junit.SessionFactoryScope; import org.hibernate.testing.orm.junit.Setting; -import org.hibernate.tuple.TenantIdBinder; +import org.hibernate.binder.internal.TenantIdBinder; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/tenantuuid/TenantUuidTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/tenantuuid/TenantUuidTest.java index 2d3532f67b..d31be99ffc 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/tenantuuid/TenantUuidTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/tenantuuid/TenantUuidTest.java @@ -17,7 +17,7 @@ import org.hibernate.testing.orm.junit.SessionFactory; import org.hibernate.testing.orm.junit.SessionFactoryProducer; import org.hibernate.testing.orm.junit.SessionFactoryScope; import org.hibernate.testing.orm.junit.Setting; -import org.hibernate.tuple.TenantIdBinder; +import org.hibernate.binder.internal.TenantIdBinder; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; diff --git a/hibernate-envers/src/main/java/org/hibernate/envers/configuration/internal/metadata/AuditMetadataGenerator.java b/hibernate-envers/src/main/java/org/hibernate/envers/configuration/internal/metadata/AuditMetadataGenerator.java index e51506c94f..f33d51c44d 100644 --- a/hibernate-envers/src/main/java/org/hibernate/envers/configuration/internal/metadata/AuditMetadataGenerator.java +++ b/hibernate-envers/src/main/java/org/hibernate/envers/configuration/internal/metadata/AuditMetadataGenerator.java @@ -34,7 +34,7 @@ import org.hibernate.mapping.GeneratorCreator; import org.hibernate.mapping.PersistentClass; import org.hibernate.mapping.Property; import org.hibernate.mapping.SyntheticProperty; -import org.hibernate.tuple.GeneratedValueGeneration; +import org.hibernate.generator.internal.GeneratedGeneration; import org.jboss.logging.Logger; @@ -121,8 +121,8 @@ public final class AuditMetadataGenerator extends AbstractMetadataGenerator { if ( !property.isInsertable() ) { // TODO: this is now broken by changes to generators final GeneratorCreator generation = property.getValueGeneratorCreator(); - if ( generation instanceof GeneratedValueGeneration ) { - final GeneratedValueGeneration valueGeneration = (GeneratedValueGeneration) generation; + if ( generation instanceof GeneratedGeneration) { + final GeneratedGeneration valueGeneration = (GeneratedGeneration) generation; if ( valueGeneration.generatedOnInsert() ) { return true; }