Skip to content

Commit

Permalink
HHH-18139 further integrate legacy identifier generates with new infr…
Browse files Browse the repository at this point in the history
…astructure

- recover ability to use BeanContainer
- simplify logic by making full use of Generator.allowAssignedIdentifiers()
- various simplifications
- deprecate CustomIdGeneratorCreationContext (which was incubating)

Signed-off-by: Gavin King <[email protected]>
  • Loading branch information
gavinking authored and sebersole committed May 28, 2024
1 parent a96b7f9 commit c5807ee
Show file tree
Hide file tree
Showing 16 changed files with 378 additions and 288 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

import static org.hibernate.boot.model.internal.AnnotatedDiscriminatorColumn.DEFAULT_DISCRIMINATOR_COLUMN_NAME;
import static org.hibernate.boot.model.internal.AnnotatedDiscriminatorColumn.buildDiscriminatorColumn;
import static org.hibernate.boot.model.internal.BinderHelper.getOverridableAnnotation;
import static org.hibernate.boot.model.internal.DialectOverridesAnnotationHelper.getOverridableAnnotation;
import static org.hibernate.boot.model.internal.BinderHelper.getPath;
import static org.hibernate.boot.model.internal.BinderHelper.getPropertyOverriddenByMapperOrMapsId;
import static org.hibernate.boot.model.internal.BinderHelper.getRelativePath;
Expand Down Expand Up @@ -796,7 +796,7 @@ private static void processGeneratedId(MetadataBuildingContext context, Componen
final AnnotationUsage<GeneratedValue> generatedValue = property.getAnnotationUsage( GeneratedValue.class );
final String generatorType = generatedValue != null
? generatorType( generatedValue, property.getType().determineRawClass(), context )
: DEFAULT_ID_GEN_STRATEGY;
: GeneratorBinder.ASSIGNED_GENERATOR_NAME;
final String generator = generatedValue != null ? generatedValue.getString( "generator" ) : "";

if ( isGlobalGeneratorNameGlobal( context ) ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@
import static org.hibernate.internal.util.StringHelper.nullIfEmpty;
import static org.hibernate.internal.util.StringHelper.unqualify;
import static org.hibernate.internal.util.collections.CollectionHelper.isNotEmpty;
import static org.hibernate.mapping.SimpleValue.DEFAULT_ID_GEN_STRATEGY;


/**
Expand Down Expand Up @@ -750,7 +749,7 @@ private static void handleIdGenerator(PropertyData inferredData, MetadataBuildin
buildingContext.getMetadataCollector().addSecondPass( new IdGeneratorResolverSecondPass(
id,
inferredData.getAttributeMember(),
DEFAULT_ID_GEN_STRATEGY,
GeneratorBinder.ASSIGNED_GENERATOR_NAME,
"",
buildingContext
) );
Expand All @@ -759,7 +758,7 @@ private static void handleIdGenerator(PropertyData inferredData, MetadataBuildin
makeIdGenerator(
id,
inferredData.getAttributeMember(),
DEFAULT_ID_GEN_STRATEGY,
GeneratorBinder.ASSIGNED_GENERATOR_NAME,
"",
buildingContext,
Collections.emptyMap()
Expand Down
Loading

0 comments on commit c5807ee

Please sign in to comment.