From df974fd1fb86772b09f64861cec84092283c9e2e Mon Sep 17 00:00:00 2001 From: Gavin King Date: Thu, 14 Nov 2024 13:38:20 +0100 Subject: [PATCH] move TypeBeanInstanceProducer as per the todo --- .../boot/internal/BootstrapContextImpl.java | 1 - .../TypeBeanInstanceProducer.java | 4 +-- .../hibernate/boot/spi/BootstrapContext.java | 3 +- ...tionExtractorJdbcDatabaseMetaDataImpl.java | 30 +++++++++---------- .../boot/models/BootstrapContextTesting.java | 2 +- 5 files changed, 20 insertions(+), 20 deletions(-) rename hibernate-core/src/main/java/org/hibernate/boot/{model => internal}/TypeBeanInstanceProducer.java (94%) diff --git a/hibernate-core/src/main/java/org/hibernate/boot/internal/BootstrapContextImpl.java b/hibernate-core/src/main/java/org/hibernate/boot/internal/BootstrapContextImpl.java index 3377618ac9..561b08b6bd 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/internal/BootstrapContextImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/internal/BootstrapContextImpl.java @@ -17,7 +17,6 @@ import org.hibernate.boot.archive.scan.spi.ScanEnvironment; import org.hibernate.boot.archive.scan.spi.ScanOptions; import org.hibernate.boot.archive.scan.spi.Scanner; import org.hibernate.boot.archive.spi.ArchiveDescriptorFactory; -import org.hibernate.boot.model.TypeBeanInstanceProducer; import org.hibernate.boot.model.convert.spi.ConverterDescriptor; import org.hibernate.boot.model.relational.AuxiliaryDatabaseObject; import org.hibernate.boot.registry.StandardServiceRegistry; diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/TypeBeanInstanceProducer.java b/hibernate-core/src/main/java/org/hibernate/boot/internal/TypeBeanInstanceProducer.java similarity index 94% rename from hibernate-core/src/main/java/org/hibernate/boot/model/TypeBeanInstanceProducer.java rename to hibernate-core/src/main/java/org/hibernate/boot/internal/TypeBeanInstanceProducer.java index ffabe3fca5..5cc24d1468 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/TypeBeanInstanceProducer.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/internal/TypeBeanInstanceProducer.java @@ -2,7 +2,7 @@ * SPDX-License-Identifier: LGPL-2.1-or-later * Copyright Red Hat Inc. and Hibernate Authors */ -package org.hibernate.boot.model; +package org.hibernate.boot.internal; import org.hibernate.InstantiationException; import org.hibernate.Internal; @@ -19,7 +19,7 @@ import java.util.Map; * * @author Christian Beikov */ -@Internal //TODO: move this to org.hibernate.boot.internal, where its only usage is +@Internal public class TypeBeanInstanceProducer implements BeanInstanceProducer, TypeBootstrapContext { private final ConfigurationService configurationService; diff --git a/hibernate-core/src/main/java/org/hibernate/boot/spi/BootstrapContext.java b/hibernate-core/src/main/java/org/hibernate/boot/spi/BootstrapContext.java index 746c414164..fb8abe4705 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/spi/BootstrapContext.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/spi/BootstrapContext.java @@ -14,6 +14,7 @@ import org.hibernate.boot.archive.scan.spi.ScanEnvironment; import org.hibernate.boot.archive.scan.spi.ScanOptions; import org.hibernate.boot.archive.spi.ArchiveDescriptorFactory; import org.hibernate.boot.internal.ClassmateContext; +import org.hibernate.boot.internal.TypeBeanInstanceProducer; import org.hibernate.boot.model.convert.spi.ConverterDescriptor; import org.hibernate.boot.model.relational.AuxiliaryDatabaseObject; import org.hibernate.boot.registry.StandardServiceRegistry; @@ -61,7 +62,7 @@ public interface BootstrapContext { /** * The {@link BeanInstanceProducer} to use when creating custom type references. * - * @implNote Usually a {@link org.hibernate.boot.model.TypeBeanInstanceProducer}. + * @implNote Usually a {@link TypeBeanInstanceProducer}. */ BeanInstanceProducer getCustomTypeProducer(); diff --git a/hibernate-core/src/main/java/org/hibernate/tool/schema/extract/internal/InformationExtractorJdbcDatabaseMetaDataImpl.java b/hibernate-core/src/main/java/org/hibernate/tool/schema/extract/internal/InformationExtractorJdbcDatabaseMetaDataImpl.java index 02740dcaf1..f93a675ccf 100644 --- a/hibernate-core/src/main/java/org/hibernate/tool/schema/extract/internal/InformationExtractorJdbcDatabaseMetaDataImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/tool/schema/extract/internal/InformationExtractorJdbcDatabaseMetaDataImpl.java @@ -53,8 +53,8 @@ public class InformationExtractorJdbcDatabaseMetaDataImpl extends AbstractInform ExtractionContext.ResultSetProcessor processor) throws SQLException { try ( ResultSet resultSet = - getJdbcDatabaseMetaData() - .getSchemas( catalog, schemaPattern ) ) { + getJdbcDatabaseMetaData() + .getSchemas( catalog, schemaPattern ) ) { return processor.process( resultSet ); } } @@ -68,8 +68,8 @@ public class InformationExtractorJdbcDatabaseMetaDataImpl extends AbstractInform ExtractionContext.ResultSetProcessor processor) throws SQLException { try ( ResultSet resultSet = - getJdbcDatabaseMetaData() - .getTables( catalog, schemaPattern, tableNamePattern, types) ) { + getJdbcDatabaseMetaData() + .getTables( catalog, schemaPattern, tableNamePattern, types) ) { return processor.process( resultSet ); } } @@ -83,8 +83,8 @@ public class InformationExtractorJdbcDatabaseMetaDataImpl extends AbstractInform ExtractionContext.ResultSetProcessor processor) throws SQLException { try ( ResultSet resultSet = - getJdbcDatabaseMetaData() - .getColumns( catalog, schemaPattern, tableNamePattern, columnNamePattern ) ) { + getJdbcDatabaseMetaData() + .getColumns( catalog, schemaPattern, tableNamePattern, columnNamePattern ) ) { return processor.process( resultSet ); } } @@ -97,8 +97,8 @@ public class InformationExtractorJdbcDatabaseMetaDataImpl extends AbstractInform ExtractionContext.ResultSetProcessor processor) throws SQLException { try ( ResultSet resultSet = - getJdbcDatabaseMetaData() - .getPrimaryKeys( catalogFilter, schemaFilter, tableName.getText() ) ) { + getJdbcDatabaseMetaData() + .getPrimaryKeys( catalogFilter, schemaFilter, tableName.getText() ) ) { return processor.process( resultSet ); } } @@ -113,8 +113,8 @@ public class InformationExtractorJdbcDatabaseMetaDataImpl extends AbstractInform ExtractionContext.ResultSetProcessor processor) throws SQLException { try ( ResultSet resultSet = - getJdbcDatabaseMetaData() - .getIndexInfo( catalog, schema, table, unique, approximate ) ) { + getJdbcDatabaseMetaData() + .getIndexInfo( catalog, schema, table, unique, approximate ) ) { return processor.process( resultSet ); } } @@ -127,8 +127,8 @@ public class InformationExtractorJdbcDatabaseMetaDataImpl extends AbstractInform ExtractionContext.ResultSetProcessor processor) throws SQLException { try ( ResultSet resultSet = - getJdbcDatabaseMetaData() - .getImportedKeys( catalog, schema, table ) ) { + getJdbcDatabaseMetaData() + .getImportedKeys( catalog, schema, table ) ) { return processor.process( resultSet ); } } @@ -144,9 +144,9 @@ public class InformationExtractorJdbcDatabaseMetaDataImpl extends AbstractInform ExtractionContext.ResultSetProcessor processor) throws SQLException { try ( ResultSet resultSet = - getJdbcDatabaseMetaData() - .getCrossReference( parentCatalog, parentSchema, parentTable, - foreignCatalog, foreignSchema, foreignTable) ) { + getJdbcDatabaseMetaData() + .getCrossReference( parentCatalog, parentSchema, parentTable, + foreignCatalog, foreignSchema, foreignTable) ) { return processor.process( resultSet ); } } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/boot/models/BootstrapContextTesting.java b/hibernate-core/src/test/java/org/hibernate/orm/test/boot/models/BootstrapContextTesting.java index b6ff4774e1..6a934b9a20 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/boot/models/BootstrapContextTesting.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/boot/models/BootstrapContextTesting.java @@ -17,7 +17,7 @@ import org.hibernate.boot.archive.scan.spi.ScanOptions; import org.hibernate.boot.archive.spi.ArchiveDescriptorFactory; import org.hibernate.boot.internal.ClassLoaderAccessImpl; import org.hibernate.boot.internal.ClassmateContext; -import org.hibernate.boot.model.TypeBeanInstanceProducer; +import org.hibernate.boot.internal.TypeBeanInstanceProducer; import org.hibernate.boot.model.convert.spi.ConverterDescriptor; import org.hibernate.boot.model.relational.AuxiliaryDatabaseObject; import org.hibernate.boot.registry.StandardServiceRegistry;