HHH-15800 create .generator and .binder packages and move new interfaces to them

This commit is contained in:
Gavin 2022-12-03 14:37:39 +01:00 committed by Gavin King
parent 95aa852e15
commit 075b268280
95 changed files with 201 additions and 174 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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 <em>creation timestamp</em>.

View File

@ -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;

View File

@ -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 {

View File

@ -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.

View File

@ -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;

View File

@ -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
*/

View File

@ -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;

View File

@ -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;

View File

@ -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 <em>update timestamp.</em>

View File

@ -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;
* <p>
* 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.
* <p>
* A {@code @ValueGenerationType} annotation must have retention policy
* {@link RetentionPolicy#RUNTIME}.

View File

@ -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.binder;
import org.hibernate.Incubating;
import org.hibernate.boot.spi.MetadataBuildingContext;

View File

@ -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 <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
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;

View File

@ -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 <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
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;

View File

@ -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;

View File

@ -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() ) {

View File

@ -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;

View File

@ -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) {

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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 java.lang.annotation.Annotation;
import java.lang.reflect.Member;

View File

@ -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 <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.tuple;
package org.hibernate.generator;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.tuple.ValueGenerator;
import java.io.Serializable;

View File

@ -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;

View File

@ -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.dialect.Dialect;
import org.hibernate.persister.entity.EntityPersister;

View File

@ -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 <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
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.

View File

@ -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() };
}
}

View File

@ -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 <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
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() {

View File

@ -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 <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
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;

View File

@ -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<Object> {
public class SourceGeneration implements InMemoryGenerator {
private static final CoreMessageLogger log = Logger.getMessageLogger(
CoreMessageLogger.class,
@ -57,7 +61,7 @@ public class SourceGeneration implements InMemoryGenerator, ValueGenerator<Objec
this.propertyType = propertyType;
switch ( annotation.value() ) {
case DB:
valueGenerator = this;
valueGenerator = this::generateValue;
break;
case VM:
valueGenerator = TimestampGenerators.get( propertyType );
@ -88,7 +92,6 @@ public class SourceGeneration implements InMemoryGenerator, ValueGenerator<Objec
return valueGenerator.generateValue( (Session) session, owner, currentValue );
}
@Override
public Object generateValue(Session session, Object owner) {
SharedSessionContractImplementor implementor = (SharedSessionContractImplementor) session;
return implementor.getTypeConfiguration().getBasicTypeForJavaType( propertyType )

View File

@ -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.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
*/

View File

@ -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

View File

@ -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;
/**

View File

@ -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

View File

@ -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;

View File

@ -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.
* <p>
* 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 <em>retrieved</em>.
*
* @see org.hibernate.annotations.NaturalId

View File

@ -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)}.
* <p>
* 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

View File

@ -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;

View File

@ -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;

View File

@ -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 {

View File

@ -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 {
}

View File

@ -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

View File

@ -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;

View File

@ -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;
* <li>retrieving the generated identifier value using JDBC.
* </ul>
* 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
*/

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;
/**

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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.
* <p>
* 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.
*/

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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;
/**

View File

@ -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;

View File

@ -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;

View File

@ -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;
/**

View File

@ -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;
/**

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.tuple;
import org.hibernate.generator.Generator;
import org.hibernate.id.IdentifierGenerator;
/**

View File

@ -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;
/**

View File

@ -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;

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;
}