Skip to content

Commit dd74418

Browse files
committed
HHH-19366 - Upgrade hibernate-models to 1.0.0.CR1
1 parent 7f03854 commit dd74418

File tree

336 files changed

+1388
-1410
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

336 files changed

+1388
-1410
lines changed

hibernate-core/src/main/java/org/hibernate/boot/internal/BootstrapContextImpl.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import org.hibernate.metamodel.internal.ManagedTypeRepresentationResolverStandard;
3030
import org.hibernate.metamodel.spi.ManagedTypeRepresentationResolver;
3131
import org.hibernate.models.spi.ModelsConfiguration;
32-
import org.hibernate.models.spi.SourceModelBuildingContext;
32+
import org.hibernate.models.spi.ModelsContext;
3333
import org.hibernate.query.sqm.function.SqmFunctionDescriptor;
3434
import org.hibernate.query.sqm.function.SqmFunctionRegistry;
3535
import org.hibernate.resource.beans.spi.BeanInstanceProducer;
@@ -80,7 +80,7 @@ public class BootstrapContextImpl implements BootstrapContext {
8080
private final ManagedTypeRepresentationResolver representationStrategySelector;
8181
private final ConfigurationService configurationService;
8282

83-
private final SourceModelBuildingContext modelsContext;
83+
private final ModelsContext modelsContext;
8484

8585
public BootstrapContextImpl(
8686
StandardServiceRegistry serviceRegistry,
@@ -136,7 +136,7 @@ public TypeConfiguration getTypeConfiguration() {
136136
}
137137

138138
@Override
139-
public SourceModelBuildingContext getModelsContext() {
139+
public ModelsContext getModelsContext() {
140140
return modelsContext;
141141
}
142142

@@ -354,7 +354,7 @@ public void addCacheRegionDefinition(CacheRegionDefinition cacheRegionDefinition
354354
cacheRegionDefinitions.add( cacheRegionDefinition );
355355
}
356356

357-
public static SourceModelBuildingContext createModelBuildingContext(
357+
public static ModelsContext createModelBuildingContext(
358358
ClassLoaderService classLoaderService,
359359
ConfigurationService configService) {
360360
final ClassLoaderServiceLoading classLoading = new ClassLoaderServiceLoading( classLoaderService );

hibernate-core/src/main/java/org/hibernate/boot/model/internal/AbstractPropertyHolder.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import org.hibernate.models.spi.AnnotationTarget;
2626
import org.hibernate.models.spi.ClassDetails;
2727
import org.hibernate.models.spi.MemberDetails;
28-
import org.hibernate.models.spi.SourceModelBuildingContext;
28+
import org.hibernate.models.spi.ModelsContext;
2929
import org.hibernate.usertype.internal.AbstractTimeZoneStorageCompositeUserType;
3030
import org.hibernate.usertype.internal.OffsetTimeCompositeUserType;
3131

@@ -172,7 +172,7 @@ protected MetadataBuildingContext getContext() {
172172
return context;
173173
}
174174

175-
protected SourceModelBuildingContext getSourceModelContext() {
175+
protected ModelsContext getSourceModelContext() {
176176
return getContext().getBootstrapContext().getModelsContext();
177177
}
178178

@@ -435,7 +435,7 @@ private static Map<String, Column[]> buildColumnOverride(
435435
return result;
436436
}
437437

438-
final SourceModelBuildingContext sourceModelContext =
438+
final ModelsContext sourceModelContext =
439439
context.getBootstrapContext().getModelsContext();
440440
final Map<String, List<Column>> columnOverrideMap = new HashMap<>();
441441

@@ -571,7 +571,7 @@ public MetadataBuildingContext getBuildingContext() {
571571
}
572572

573573
private static Map<String, ColumnTransformer> buildColumnTransformerOverride(AnnotationTarget element, MetadataBuildingContext context) {
574-
final SourceModelBuildingContext sourceModelContext = context.getBootstrapContext().getModelsContext();
574+
final ModelsContext sourceModelContext = context.getBootstrapContext().getModelsContext();
575575
final Map<String, ColumnTransformer> columnOverride = new HashMap<>();
576576
if ( element != null ) {
577577
element.forEachAnnotationUsage( ColumnTransformer.class, sourceModelContext, (usage) -> {

hibernate-core/src/main/java/org/hibernate/boot/model/internal/AnnotatedColumn.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
import org.hibernate.mapping.SimpleValue;
3737
import org.hibernate.mapping.Table;
3838
import org.hibernate.models.spi.MemberDetails;
39-
import org.hibernate.models.spi.SourceModelBuildingContext;
39+
import org.hibernate.models.spi.ModelsContext;
4040

4141
import static org.hibernate.boot.model.internal.BinderHelper.getPath;
4242
import static org.hibernate.boot.model.internal.BinderHelper.getRelativePath;
@@ -831,7 +831,7 @@ private static AnnotatedColumn buildColumn(
831831
FractionalSeconds fractionalSeconds,
832832
String sqlType,
833833
String tableName,
834-
SourceModelBuildingContext sourceModelContext) {
834+
ModelsContext sourceModelContext) {
835835
final String columnName = logicalColumnName( inferredData, suffixForDefaultColumnName, database, column );
836836
final AnnotatedColumn annotatedColumn = new AnnotatedColumn();
837837
annotatedColumn.setLogicalColumnName( columnName );
@@ -983,7 +983,7 @@ void applyCheckConstraint(PropertyData inferredData, int length) {
983983
private void extractDataFromPropertyData(
984984
PropertyHolder propertyHolder,
985985
PropertyData inferredData,
986-
SourceModelBuildingContext context) {
986+
ModelsContext context) {
987987
if ( inferredData != null ) {
988988
final MemberDetails attributeMember = inferredData.getAttributeMember();
989989
if ( attributeMember != null ) {

hibernate-core/src/main/java/org/hibernate/boot/model/internal/AnnotationBinder.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import org.hibernate.internal.CoreMessageLogger;
3636
import org.hibernate.models.spi.AnnotationTarget;
3737
import org.hibernate.models.spi.ClassDetails;
38-
import org.hibernate.models.spi.SourceModelBuildingContext;
38+
import org.hibernate.models.spi.ModelsContext;
3939
import org.hibernate.resource.beans.internal.FallbackBeanInstanceProducer;
4040
import org.hibernate.resource.beans.spi.ManagedBeanRegistry;
4141
import org.hibernate.type.descriptor.jdbc.JdbcType;
@@ -124,7 +124,7 @@ public static void bindDefaults(MetadataBuildingContext context) {
124124

125125
}
126126

127-
private static SourceModelBuildingContext modelsContext(MetadataBuildingContext context) {
127+
private static ModelsContext modelsContext(MetadataBuildingContext context) {
128128
return context.getBootstrapContext().getModelsContext();
129129
}
130130

@@ -170,7 +170,7 @@ public static void bindQueries(AnnotationTarget annotationTarget, MetadataBuildi
170170
}
171171

172172
private static void bindNamedHibernateQueries(AnnotationTarget annotationTarget, MetadataBuildingContext context) {
173-
final SourceModelBuildingContext sourceModelContext = modelsContext( context );
173+
final ModelsContext sourceModelContext = modelsContext( context );
174174

175175
annotationTarget.forEachRepeatedAnnotationUsages(
176176
HibernateAnnotations.NAMED_QUERY,
@@ -186,7 +186,7 @@ private static void bindNamedHibernateQueries(AnnotationTarget annotationTarget,
186186
}
187187

188188
private static void bindNamedJpaQueries(AnnotationTarget annotationTarget, MetadataBuildingContext context) {
189-
final SourceModelBuildingContext sourceModelContext = modelsContext( context );
189+
final ModelsContext sourceModelContext = modelsContext( context );
190190

191191
annotationTarget.forEachRepeatedAnnotationUsages(
192192
JpaAnnotations.SQL_RESULT_SET_MAPPING,
@@ -277,7 +277,7 @@ private static void bindTypeDescriptorRegistrations(
277277
final ManagedBeanRegistry managedBeanRegistry =
278278
context.getBootstrapContext().getManagedBeanRegistry();
279279

280-
final SourceModelBuildingContext sourceModelContext = modelsContext( context );
280+
final ModelsContext sourceModelContext = modelsContext( context );
281281

282282
annotatedElement.forEachAnnotationUsage( JavaTypeRegistration.class, sourceModelContext, (usage) -> {
283283
handleJavaTypeRegistration( context, managedBeanRegistry, usage );
@@ -382,7 +382,7 @@ private static void handleCompositeUserTypeRegistration(
382382
}
383383

384384
private static void bindConverterRegistrations(AnnotationTarget container, MetadataBuildingContext context) {
385-
final SourceModelBuildingContext sourceModelContext = modelsContext( context );
385+
final ModelsContext sourceModelContext = modelsContext( context );
386386
container.forEachAnnotationUsage( ConverterRegistration.class, sourceModelContext, (usage) -> {
387387
handleConverterRegistration( usage, context );
388388
} );

hibernate-core/src/main/java/org/hibernate/boot/model/internal/BasicValueBinder.java

+16-16
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
import org.hibernate.mapping.Table;
4343
import org.hibernate.models.spi.ClassDetails;
4444
import org.hibernate.models.spi.MemberDetails;
45-
import org.hibernate.models.spi.SourceModelBuildingContext;
45+
import org.hibernate.models.spi.ModelsContext;
4646
import org.hibernate.models.spi.TypeDetails;
4747
import org.hibernate.resource.beans.internal.FallbackBeanInstanceProducer;
4848
import org.hibernate.resource.beans.spi.ManagedBeanRegistry;
@@ -151,7 +151,7 @@ public BasicValueBinder(Kind kind, Component aggregateComponent, MetadataBuildin
151151
this.buildingContext = buildingContext;
152152
}
153153

154-
protected SourceModelBuildingContext getSourceModelContext() {
154+
protected ModelsContext getSourceModelContext() {
155155
return buildingContext.getBootstrapContext().getModelsContext();
156156
}
157157

@@ -1370,21 +1370,21 @@ private Map<String, Object> createDynamicParameterizedTypeParameters() {
13701370
* Access to detail of basic value mappings based on {@link Kind}
13711371
*/
13721372
private interface BasicMappingAccess {
1373-
Class<? extends UserType<?>> customType(MemberDetails attribute, SourceModelBuildingContext context);
1374-
Map<String,String> customTypeParameters(MemberDetails attribute, SourceModelBuildingContext context);
1373+
Class<? extends UserType<?>> customType(MemberDetails attribute, ModelsContext context);
1374+
Map<String,String> customTypeParameters(MemberDetails attribute, ModelsContext context);
13751375
}
13761376

13771377
private static class ValueMappingAccess implements BasicMappingAccess {
13781378
private static final ValueMappingAccess INSTANCE = new ValueMappingAccess();
13791379

13801380
@Override
1381-
public Class<? extends UserType<?>> customType(MemberDetails attribute, SourceModelBuildingContext context) {
1381+
public Class<? extends UserType<?>> customType(MemberDetails attribute, ModelsContext context) {
13821382
final Type customType = attribute.locateAnnotationUsage( Type.class, context );
13831383
return customType == null ? null : customType.value();
13841384
}
13851385

13861386
@Override
1387-
public Map<String,String> customTypeParameters(MemberDetails attribute, SourceModelBuildingContext context) {
1387+
public Map<String,String> customTypeParameters(MemberDetails attribute, ModelsContext context) {
13881388
final Type customType = attribute.locateAnnotationUsage( Type.class, context );
13891389
return customType == null ? null : extractParameterMap( customType.parameters() );
13901390
}
@@ -1394,12 +1394,12 @@ private static class AnyDiscriminatorMappingAccess implements BasicMappingAccess
13941394
private static final AnyDiscriminatorMappingAccess INSTANCE = new AnyDiscriminatorMappingAccess();
13951395

13961396
@Override
1397-
public Class<? extends UserType<?>> customType(MemberDetails attribute, SourceModelBuildingContext context) {
1397+
public Class<? extends UserType<?>> customType(MemberDetails attribute, ModelsContext context) {
13981398
return null;
13991399
}
14001400

14011401
@Override
1402-
public Map<String,String> customTypeParameters(MemberDetails attribute, SourceModelBuildingContext context) {
1402+
public Map<String,String> customTypeParameters(MemberDetails attribute, ModelsContext context) {
14031403
return emptyMap();
14041404
}
14051405
}
@@ -1408,12 +1408,12 @@ private static class AnyKeyMappingAccess implements BasicMappingAccess {
14081408
private static final AnyKeyMappingAccess INSTANCE = new AnyKeyMappingAccess();
14091409

14101410
@Override
1411-
public Class<? extends UserType<?>> customType(MemberDetails attribute, SourceModelBuildingContext context) {
1411+
public Class<? extends UserType<?>> customType(MemberDetails attribute, ModelsContext context) {
14121412
return null;
14131413
}
14141414

14151415
@Override
1416-
public Map<String,String> customTypeParameters(MemberDetails attribute, SourceModelBuildingContext context) {
1416+
public Map<String,String> customTypeParameters(MemberDetails attribute, ModelsContext context) {
14171417
return emptyMap();
14181418
}
14191419
}
@@ -1422,14 +1422,14 @@ private static class MapKeyMappingAccess implements BasicMappingAccess {
14221422
private static final MapKeyMappingAccess INSTANCE = new MapKeyMappingAccess();
14231423

14241424
@Override
1425-
public Class<? extends UserType<?>> customType(MemberDetails attribute, SourceModelBuildingContext context) {
1425+
public Class<? extends UserType<?>> customType(MemberDetails attribute, ModelsContext context) {
14261426
final MapKeyType customType = attribute.locateAnnotationUsage( MapKeyType.class, context );
14271427
return customType == null ? null : customType.value();
14281428

14291429
}
14301430

14311431
@Override
1432-
public Map<String,String> customTypeParameters(MemberDetails attribute, SourceModelBuildingContext context) {
1432+
public Map<String,String> customTypeParameters(MemberDetails attribute, ModelsContext context) {
14331433
final MapKeyType customType = attribute.locateAnnotationUsage( MapKeyType.class, context );
14341434
return customType == null ? null : extractParameterMap( customType.parameters() );
14351435

@@ -1440,14 +1440,14 @@ private static class CollectionIdMappingAccess implements BasicMappingAccess {
14401440
private static final CollectionIdMappingAccess INSTANCE = new CollectionIdMappingAccess();
14411441

14421442
@Override
1443-
public Class<? extends UserType<?>> customType(MemberDetails attribute, SourceModelBuildingContext context) {
1443+
public Class<? extends UserType<?>> customType(MemberDetails attribute, ModelsContext context) {
14441444
final CollectionIdType customType = attribute.locateAnnotationUsage( CollectionIdType.class, context );
14451445
return customType == null ? null : customType.value();
14461446

14471447
}
14481448

14491449
@Override
1450-
public Map<String,String> customTypeParameters(MemberDetails attribute, SourceModelBuildingContext context) {
1450+
public Map<String,String> customTypeParameters(MemberDetails attribute, ModelsContext context) {
14511451
final CollectionIdType customType = attribute.locateAnnotationUsage( CollectionIdType.class, context );
14521452
return customType == null ? null : extractParameterMap( customType.parameters() );
14531453

@@ -1458,12 +1458,12 @@ private static class ListIndexMappingAccess implements BasicMappingAccess {
14581458
private static final ListIndexMappingAccess INSTANCE = new ListIndexMappingAccess();
14591459

14601460
@Override
1461-
public Class<? extends UserType<?>> customType(MemberDetails attribute, SourceModelBuildingContext context) {
1461+
public Class<? extends UserType<?>> customType(MemberDetails attribute, ModelsContext context) {
14621462
return null;
14631463
}
14641464

14651465
@Override
1466-
public Map<String,String> customTypeParameters(MemberDetails attribute, SourceModelBuildingContext context) {
1466+
public Map<String,String> customTypeParameters(MemberDetails attribute, ModelsContext context) {
14671467
return emptyMap();
14681468
}
14691469
}

hibernate-core/src/main/java/org/hibernate/boot/model/internal/BinderHelper.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
import org.hibernate.models.spi.AnnotationTarget;
4545
import org.hibernate.models.spi.ClassDetails;
4646
import org.hibernate.models.spi.MemberDetails;
47-
import org.hibernate.models.spi.SourceModelBuildingContext;
47+
import org.hibernate.models.spi.ModelsContext;
4848
import org.hibernate.models.spi.TypeDetails;
4949
import org.hibernate.type.descriptor.java.JavaType;
5050

@@ -828,7 +828,7 @@ public static Any buildAnyValue(
828828
private static void processAnyDiscriminatorValues(
829829
MemberDetails property,
830830
Consumer<AnyDiscriminatorValue> consumer,
831-
SourceModelBuildingContext sourceModelContext) {
831+
ModelsContext sourceModelContext) {
832832
final AnyDiscriminatorValues valuesAnn =
833833
property.locateAnnotationUsage( AnyDiscriminatorValues.class, sourceModelContext );
834834
if ( valuesAnn != null ) {
@@ -1076,7 +1076,7 @@ public static <A extends Annotation> A extractFromPackage(
10761076
return null;
10771077
}
10781078
else {
1079-
final SourceModelBuildingContext modelsContext =
1079+
final ModelsContext modelsContext =
10801080
context.getBootstrapContext().getModelsContext();
10811081
try {
10821082
return modelsContext.getClassDetailsRegistry()

hibernate-core/src/main/java/org/hibernate/boot/model/internal/CollectionBinder.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
import org.hibernate.models.internal.ClassTypeDetailsImpl;
107107
import org.hibernate.models.spi.ClassDetails;
108108
import org.hibernate.models.spi.MemberDetails;
109-
import org.hibernate.models.spi.SourceModelBuildingContext;
109+
import org.hibernate.models.spi.ModelsContext;
110110
import org.hibernate.models.spi.TypeDetails;
111111
import org.hibernate.resource.beans.spi.ManagedBean;
112112
import org.hibernate.usertype.CompositeUserType;
@@ -264,7 +264,7 @@ public static void bindCollection(
264264
Map<ClassDetails, InheritanceState> inheritanceStatePerClass,
265265
MemberDetails property,
266266
AnnotatedJoinColumns joinColumns) {
267-
final SourceModelBuildingContext modelsContext = context.getBootstrapContext().getModelsContext();
267+
final ModelsContext modelsContext = context.getBootstrapContext().getModelsContext();
268268

269269
final OneToMany oneToManyAnn = property.getAnnotationUsage( OneToMany.class, modelsContext );
270270
final ManyToMany manyToManyAnn = property.getAnnotationUsage( ManyToMany.class, modelsContext );
@@ -381,7 +381,7 @@ private static NotFoundAction notFoundAction(
381381
PropertyData inferredData,
382382
MemberDetails property,
383383
ManyToMany manyToManyAnn,
384-
SourceModelBuildingContext sourceModelContext) {
384+
ModelsContext sourceModelContext) {
385385
final NotFound notFound = property.getAnnotationUsage( NotFound.class, sourceModelContext );
386386
if ( notFound != null ) {
387387
if ( manyToManyAnn == null ) {
@@ -634,7 +634,7 @@ else if ( property.hasDirectAnnotationUsage( Columns.class ) ) {
634634
private static JoinColumn[] mapKeyJoinColumnAnnotations(
635635
MemberDetails property,
636636
MetadataBuildingContext context) {
637-
final SourceModelBuildingContext modelsContext = context.getBootstrapContext().getModelsContext();
637+
final ModelsContext modelsContext = context.getBootstrapContext().getModelsContext();
638638

639639
final MapKeyJoinColumn[] mapKeyJoinColumns = property.getRepeatedAnnotationUsages(
640640
JpaAnnotations.MAP_KEY_JOIN_COLUMN,
@@ -957,7 +957,7 @@ private static CollectionClassification determineCollectionClassification(
957957
return CollectionClassification.ARRAY;
958958
}
959959

960-
final SourceModelBuildingContext modelsContext = buildingContext.getBootstrapContext().getModelsContext();
960+
final ModelsContext modelsContext = buildingContext.getBootstrapContext().getModelsContext();
961961
if ( !property.hasAnnotationUsage( Bag.class, modelsContext ) ) {
962962
return determineCollectionClassification( determineSemanticJavaType( property ), property, buildingContext );
963963
}
@@ -1026,7 +1026,7 @@ private static CollectionClassification determineCollectionClassification(
10261026
return CollectionClassification.BAG;
10271027
}
10281028

1029-
final SourceModelBuildingContext modelsContext =
1029+
final ModelsContext modelsContext =
10301030
buildingContext.getBootstrapContext().getModelsContext();
10311031
final ManyToMany manyToMany = property.getAnnotationUsage( ManyToMany.class, modelsContext );
10321032
if ( manyToMany != null && !manyToMany.mappedBy().isBlank() ) {
@@ -1460,7 +1460,7 @@ private void defineFetchingStrategy() {
14601460
handleFetchProfileOverrides();
14611461
}
14621462

1463-
private SourceModelBuildingContext modelsContext() {
1463+
private ModelsContext modelsContext() {
14641464
return buildingContext.getBootstrapContext().getModelsContext();
14651465
}
14661466

hibernate-core/src/main/java/org/hibernate/boot/model/internal/ColumnsBuilder.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import org.hibernate.boot.spi.MetadataBuildingContext;
1717
import org.hibernate.boot.spi.PropertyData;
1818
import org.hibernate.models.spi.MemberDetails;
19-
import org.hibernate.models.spi.SourceModelBuildingContext;
19+
import org.hibernate.models.spi.ModelsContext;
2020

2121
import jakarta.persistence.Column;
2222
import jakarta.persistence.ElementCollection;
@@ -239,7 +239,7 @@ private AnnotatedJoinColumns buildExplicitJoinColumns(MemberDetails property, Pr
239239
}
240240

241241
private JoinColumnOrFormula[] joinColumnOrFormulaAnnotations(MemberDetails property, PropertyData inferredData) {
242-
final SourceModelBuildingContext modelsContext = buildingContext.getBootstrapContext().getModelsContext();
242+
final ModelsContext modelsContext = buildingContext.getBootstrapContext().getModelsContext();
243243
final JoinColumnOrFormula[] annotations = property.getRepeatedAnnotationUsages(
244244
HibernateAnnotations.JOIN_COLUMN_OR_FORMULA,
245245
modelsContext
@@ -252,7 +252,7 @@ private JoinColumnOrFormula[] joinColumnOrFormulaAnnotations(MemberDetails prope
252252
}
253253

254254
private JoinColumn[] getJoinColumnAnnotations(MemberDetails property, PropertyData inferredData) {
255-
final SourceModelBuildingContext modelsContext = buildingContext.getBootstrapContext().getModelsContext();
255+
final ModelsContext modelsContext = buildingContext.getBootstrapContext().getModelsContext();
256256

257257
final JoinColumn[] joinColumns = property.getRepeatedAnnotationUsages(
258258
JpaAnnotations.JOIN_COLUMN,

0 commit comments

Comments
 (0)