diff --git a/design/6.0-changes.adoc b/design/6.0-changes.adoc index 12a26b3c83..34464bf797 100644 --- a/design/6.0-changes.adoc +++ b/design/6.0-changes.adoc @@ -7,9 +7,9 @@ Changes in 6.0 worth documenting in various places Document in release-notes: -* `@SqlTypeCode` -* `@SqlType` -* `@SqlTypeRegistration` +* `@JdbcTypeCode` +* `@JdbcType` +* `@JdbcTypeRegistration` * `@JavaType` * `@JavaTypeRegistration` * `NativeQuery#addScalar(Class)` diff --git a/documentation/src/main/asciidoc/topical/logging/Logging.adoc b/documentation/src/main/asciidoc/topical/logging/Logging.adoc index f85e399fce..d87911d17a 100644 --- a/documentation/src/main/asciidoc/topical/logging/Logging.adoc +++ b/documentation/src/main/asciidoc/topical/logging/Logging.adoc @@ -68,7 +68,7 @@ troubleshooting device. Some log categories of particular interest include: |org.hibernate.SQL |Log all SQL statements as they are executed with through JDBC -|org.hibernate.type.descriptor.sql +|org.hibernate.type.descriptor.jdbc |Log all values as they are bound to JDBC parameters and extracted from JDBC results |org.hibernate.tool.hbm2ddl diff --git a/documentation/src/main/asciidoc/userguide/appendices/BestPractices.adoc b/documentation/src/main/asciidoc/userguide/appendices/BestPractices.adoc index e1160a01f5..9b7801524c 100644 --- a/documentation/src/main/asciidoc/userguide/appendices/BestPractices.adoc +++ b/documentation/src/main/asciidoc/userguide/appendices/BestPractices.adoc @@ -36,7 +36,7 @@ log4j.logger.org.hibernate.SQL=debug ### log JDBC bind parameters ### log4j.logger.org.hibernate.type=trace -log4j.logger.org.hibernate.type.descriptor.sql=trace +log4j.logger.org.hibernate.type.descriptor.jdbc=trace ---- However, there are some other alternatives like using datasource-proxy or p6spy. diff --git a/documentation/src/main/asciidoc/userguide/chapters/domain/basic_types.adoc b/documentation/src/main/asciidoc/userguide/chapters/domain/basic_types.adoc index e867553c26..2648e7a2f7 100644 --- a/documentation/src/main/asciidoc/userguide/chapters/domain/basic_types.adoc +++ b/documentation/src/main/asciidoc/userguide/chapters/domain/basic_types.adoc @@ -276,8 +276,8 @@ include::{sourcedir}/basic/BitSetType.java[tags=basic-custom-type-BitSetType-exa ---- ==== -The `AbstractSingleColumnStandardBasicType` requires an `sqlTypeDescriptor` and a `javaTypeDescriptor`. -The `sqlTypeDescriptor` is `VarcharTypeDescriptor.INSTANCE` because the database column is a VARCHAR. +The `AbstractSingleColumnStandardBasicType` requires an `jdbcTypeDescriptor` and a `javaTypeDescriptor`. +The `jdbcTypeDescriptor` is `VarcharTypeDescriptor.INSTANCE` because the database column is a VARCHAR. On the Java side, we need to use a `BitSetTypeDescriptor` instance which can be implemented like this: [[basic-custom-type-BitSetTypeDescriptor-example]] diff --git a/documentation/src/main/asciidoc/userguide/chapters/domain/jdbc_mappings.adoc b/documentation/src/main/asciidoc/userguide/chapters/domain/jdbc_mappings.adoc index 4cbdf85c50..1ebcd2f86e 100644 --- a/documentation/src/main/asciidoc/userguide/chapters/domain/jdbc_mappings.adoc +++ b/documentation/src/main/asciidoc/userguide/chapters/domain/jdbc_mappings.adoc @@ -2,12 +2,12 @@ === JDBC Mappings Historically Hibernate's BasicType / UserType system is based on a static binding between a Java type -(`JavaTypeDescriptor`) and a SQL/JDBC type (`SqlTypeDescriptor`). 6.0 introduces the ability to influence -the `JavaTypeDescriptor` and `SqlTypeDescriptor` independently. Under this new approach, the resolution of a +(`JavaTypeDescriptor`) and a SQL/JDBC type (`JdbcTypeDescriptor`). 6.0 introduces the ability to influence +the `JavaTypeDescriptor` and `JdbcTypeDescriptor` independently. Under this new approach, the resolution of a basic value mapping comes down to: * `JavaTypeDescriptor` to use -* `SqlTypeDescriptor` to use +* `JdbcTypeDescriptor` to use * `BasicValueConverter` to use (if one) * `MutabilityPlan` to use @@ -29,13 +29,13 @@ An `AttributeConverter` can also influence the `JavaTypeDescriptor` used in cert ==== SqlTypeDescriptor -`@SqlType` can be used to explicitly specify the `SqlTypeDescriptor` to use for a particular mapping. +`JdbcType` can be used to explicitly specify the `JdbcTypeDescriptor` to use for a particular mapping. -`@SqlTypeCode` can be used to indicate the `SqlTypeDescriptorRegistry` entry to use. `@SqlTypeRegistration` can -be used to register a `SqlTypeDescriptor` with the `SqlTypeDescriptorRegistry`. +`JdbcTypeCode` can be used to indicate the `JdbcTypeDescriptorRegistry` entry to use. `JdbcTypeRegistration` can +be used to register a `JdbcTypeDescriptor` with the `JdbcTypeDescriptorRegistry`. -`@MapKeySqlType` and `@MapKeySqlTypeCode` work the same as `@SqlType` and `@SqlTypeCode`, respectively, except -describing the `SqlTypeDescriptor` to use for the map's key. In which case, `@SqlType` and `@SqlTypeCode` refer +`MapKeyJdbcType` and `MapKeyJdbcTypeCode` work the same as `JdbcType` and `JdbcTypeCode`, respectively, except +describing the `JdbcTypeDescriptor` to use for the map's key. In which case, `JdbcType` and `JdbcTypeCode` refer to the map's values. For character and binary data, the JPA `@Lob` annotation can be used to indicate that a JDBC BLOB, CLOB, NCLOB should @@ -44,12 +44,12 @@ be used. For character data, `@Nationalized` can be used to indicate that the JDBC nationalized variant should be used. E.g. `Types.CLOB` -> `Types.CLOB`, `Types.VARCHAR` -> `Types.NVARCHAR`, etc -`@Enumerated` influences the `SqlTypeDescriptor` to use by the `EnumType` specified. `EnumType#ORDINAL` implies +`@Enumerated` influences the `JdbcTypeDescriptor` to use by the `EnumType` specified. `EnumType#ORDINAL` implies that `Types.TINYINT` should be used. `EnumType#STRING` implies that `Types.VARCHAR` should be used. -`@Temporal` can also influence the `SqlTypeDescriptor` used. +`@Temporal` can also influence the `JdbcTypeDescriptor` used. -An `AttributeConverter` can also influence the `SqlTypeDescriptor` to use by the Java type it reports for its +An `AttributeConverter` can also influence the `JdbcTypeDescriptor` to use by the Java type it reports for its "relational type" diff --git a/documentation/src/test/java/org/hibernate/userguide/collections/type/CommaDelimitedStringsType.java b/documentation/src/test/java/org/hibernate/userguide/collections/type/CommaDelimitedStringsType.java index 58fc9064e8..e6039ce61a 100644 --- a/documentation/src/test/java/org/hibernate/userguide/collections/type/CommaDelimitedStringsType.java +++ b/documentation/src/test/java/org/hibernate/userguide/collections/type/CommaDelimitedStringsType.java @@ -9,7 +9,7 @@ package org.hibernate.userguide.collections.type; import java.util.List; import org.hibernate.type.AbstractSingleColumnStandardBasicType; -import org.hibernate.type.descriptor.sql.VarcharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.VarcharTypeDescriptor; /** * @author Vlad Mihalcea diff --git a/documentation/src/test/java/org/hibernate/userguide/collections/type/TimestampEpochType.java b/documentation/src/test/java/org/hibernate/userguide/collections/type/TimestampEpochType.java index d12585e17a..cbcccdd667 100644 --- a/documentation/src/test/java/org/hibernate/userguide/collections/type/TimestampEpochType.java +++ b/documentation/src/test/java/org/hibernate/userguide/collections/type/TimestampEpochType.java @@ -11,14 +11,12 @@ import java.util.Comparator; import java.util.Date; import org.hibernate.HibernateException; -import org.hibernate.dialect.Dialect; import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.type.AbstractSingleColumnStandardBasicType; import org.hibernate.type.LiteralType; -import org.hibernate.type.StringType; import org.hibernate.type.VersionType; import org.hibernate.type.descriptor.java.JdbcTimestampTypeDescriptor; -import org.hibernate.type.descriptor.sql.BigIntTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.BigIntTypeDescriptor; /** * @author Vlad Mihalcea diff --git a/documentation/src/test/java/org/hibernate/userguide/mapping/basic/BitSetType.java b/documentation/src/test/java/org/hibernate/userguide/mapping/basic/BitSetType.java index 54065eaa82..66e328568b 100644 --- a/documentation/src/test/java/org/hibernate/userguide/mapping/basic/BitSetType.java +++ b/documentation/src/test/java/org/hibernate/userguide/mapping/basic/BitSetType.java @@ -5,7 +5,7 @@ import java.util.BitSet; import org.hibernate.dialect.Dialect; import org.hibernate.type.AbstractSingleColumnStandardBasicType; import org.hibernate.type.DiscriminatorType; -import org.hibernate.type.descriptor.sql.VarcharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.VarcharTypeDescriptor; /** * @author Vlad Mihalcea diff --git a/documentation/src/test/java/org/hibernate/userguide/mapping/basic/GenderType.java b/documentation/src/test/java/org/hibernate/userguide/mapping/basic/GenderType.java index 2e764f5245..0f08fae202 100644 --- a/documentation/src/test/java/org/hibernate/userguide/mapping/basic/GenderType.java +++ b/documentation/src/test/java/org/hibernate/userguide/mapping/basic/GenderType.java @@ -1,7 +1,7 @@ package org.hibernate.userguide.mapping.basic; import org.hibernate.type.AbstractSingleColumnStandardBasicType; -import org.hibernate.type.descriptor.sql.CharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.CharTypeDescriptor; /** * @author Vlad Mihalcea diff --git a/documentation/src/test/resources/log4j.properties b/documentation/src/test/resources/log4j.properties index 49358a1a2d..12f6f8b9e6 100644 --- a/documentation/src/test/resources/log4j.properties +++ b/documentation/src/test/resources/log4j.properties @@ -26,7 +26,7 @@ log4j.logger.org.hibernate.SQL=debug ### log JDBC bind parameters ### log4j.logger.org.hibernate.type=trace -log4j.logger.org.hibernate.type.descriptor.sql=trace +log4j.logger.org.hibernate.type.descriptor.jdbc=trace log4j.logger.org.hibernate.id.enhanced.TableGenerator=trace log4j.logger.org.hibernate.id.IdentifierGeneratorHelper=trace log4j.logger.org.hibernate.persister.entity.AbstractEntityPersister=trace diff --git a/hibernate-agroal/src/test/resources/log4j.properties b/hibernate-agroal/src/test/resources/log4j.properties index eb96581a28..5e77474efb 100644 --- a/hibernate-agroal/src/test/resources/log4j.properties +++ b/hibernate-agroal/src/test/resources/log4j.properties @@ -34,8 +34,8 @@ log4j.logger.org.hibernate.testing.cache=debug # SQL Logging - HHH-6833 log4j.logger.org.hibernate.SQL=debug -log4j.logger.org.hibernate.type.descriptor.sql.BasicBinder=trace -log4j.logger.org.hibernate.type.descriptor.sql.BasicExtractor=trace +log4j.logger.org.hibernate.type.descriptor.jdbc.BasicBinder=trace +log4j.logger.org.hibernate.type.descriptor.jdbc.BasicExtractor=trace log4j.logger.org.hibernate.hql.internal.ast=debug diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/SqlType.java b/hibernate-core/src/main/java/org/hibernate/annotations/JdbcType.java similarity index 56% rename from hibernate-core/src/main/java/org/hibernate/annotations/SqlType.java rename to hibernate-core/src/main/java/org/hibernate/annotations/JdbcType.java index 32f7691713..7c70366ccc 100644 --- a/hibernate-core/src/main/java/org/hibernate/annotations/SqlType.java +++ b/hibernate-core/src/main/java/org/hibernate/annotations/JdbcType.java @@ -10,8 +10,8 @@ import java.lang.annotation.Inherited; import java.lang.annotation.Retention; import org.hibernate.resource.beans.spi.ManagedBean; -import org.hibernate.resource.beans.spi.ManagedBeanRegistry; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry; import static java.lang.annotation.ElementType.ANNOTATION_TYPE; import static java.lang.annotation.ElementType.FIELD; @@ -19,26 +19,25 @@ import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.RetentionPolicy.RUNTIME; /** - * Allows specifying the specific {@link org.hibernate.type.descriptor.sql.SqlTypeDescriptor} - * to use for a particular column mapping. Can reference a {@link ManagedBean} - see - * {@link ManagedBeanRegistry} + * Allows specifying the specific {@link JdbcTypeDescriptor} + * to use for a particular column mapping. Resolved as a {@link ManagedBean} * * ```` * @Entity * class User { * ... - * @SqlType ( MyCustomSqlIntegerDescriptor.class ) + * @JdbcType ( MyCustomSqlIntegerDescriptor.class ) * int getAge() { ... } * - * @SqlType ( MyCustomSqlVarcharDescriptor.class ) + * @JdbcType ( MyCustomSqlVarcharDescriptor.class ) * String getName() { ... } * } * ```` * - * @apiNote Should not be used in combination with {@link SqlTypeCode} + * @apiNote Should not be used in combination with {@link JdbcTypeCode} * - * @see org.hibernate.type.descriptor.sql.SqlTypeDescriptor - * @see org.hibernate.type.descriptor.sql.spi.SqlTypeDescriptorRegistry + * @see JdbcTypeDescriptor + * @see JdbcTypeDescriptorRegistry * * @author Steve Ebersole * @@ -47,6 +46,6 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; @java.lang.annotation.Target({METHOD, FIELD, ANNOTATION_TYPE}) @Inherited @Retention(RUNTIME) -public @interface SqlType { - Class value(); +public @interface JdbcType { + Class value(); } diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/SqlTypeCode.java b/hibernate-core/src/main/java/org/hibernate/annotations/JdbcTypeCode.java similarity index 71% rename from hibernate-core/src/main/java/org/hibernate/annotations/SqlTypeCode.java rename to hibernate-core/src/main/java/org/hibernate/annotations/JdbcTypeCode.java index 3f3549ec0e..eb6fab8376 100644 --- a/hibernate-core/src/main/java/org/hibernate/annotations/SqlTypeCode.java +++ b/hibernate-core/src/main/java/org/hibernate/annotations/JdbcTypeCode.java @@ -9,6 +9,9 @@ package org.hibernate.annotations; import java.lang.annotation.Inherited; import java.lang.annotation.Retention; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry; + import static java.lang.annotation.ElementType.ANNOTATION_TYPE; import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; @@ -17,10 +20,10 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; /** * @asciidoc * - * Allows specifying the {@link org.hibernate.type.descriptor.sql.SqlTypeDescriptor} to - * use based on the type-code. This might be a* standard {@linkplain java.sql.Types JDBC Types} + * Allows specifying the {@link JdbcTypeDescriptor} to + * use based on the type-code. This might be a standard {@linkplain java.sql.Types JDBC Type} * code or a custom code. Either way, there must be an entry in the - * {@link org.hibernate.type.descriptor.sql.spi.SqlTypeDescriptorRegistry} registered under this code + * {@link JdbcTypeDescriptorRegistry} registered under this code * * ```` * @Entity @@ -28,29 +31,29 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; * ... * // By default Hibernate maps Java's Integer to JDBC's INTEGER * // but here we want to use JDBC's TINYINT instead. - * @SqlTypeCode ( Types.TINYINT ) + * @JdbcTypeCode ( Types.TINYINT ) * int getAge() { ... } * * // By default Hibernate maps Java's String to JDBC's VARCHAR * // but here we want to use JDBC's NVARCHAR instead. - * @SqlTypeCode ( Types.NVARCHAR ) + * @JdbcTypeCode ( Types.NVARCHAR ) * String getName() { ... } * } * ```` - * * + * * Other forms of influencing the JDBC type used include: * * These forms should not be mixed on the same mapping. The result is not defined * - * @apiNote Should not be used in combination with {@link SqlType} + * @apiNote Should not be used in combination with the other forms of influencing the JDBC type used * - * @see SqlTypeRegistration + * @see JdbcTypeRegistration * * @author Steve Ebersole * @@ -59,10 +62,10 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; @java.lang.annotation.Target({METHOD, FIELD, ANNOTATION_TYPE}) @Inherited @Retention(RUNTIME) -public @interface SqlTypeCode { +public @interface JdbcTypeCode { /** * The standard {@linkplain java.sql.Types JDBC Types} code or a custom code. - * This ultimately decides which {@link org.hibernate.type.descriptor.sql.SqlTypeDescriptor} + * This ultimately decides which {@link JdbcTypeDescriptor} * is used to "understand" the described SQL data type */ int value(); diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/SqlTypeRegistration.java b/hibernate-core/src/main/java/org/hibernate/annotations/JdbcTypeRegistration.java similarity index 73% rename from hibernate-core/src/main/java/org/hibernate/annotations/SqlTypeRegistration.java rename to hibernate-core/src/main/java/org/hibernate/annotations/JdbcTypeRegistration.java index 94f9a86565..1d967256c7 100644 --- a/hibernate-core/src/main/java/org/hibernate/annotations/SqlTypeRegistration.java +++ b/hibernate-core/src/main/java/org/hibernate/annotations/JdbcTypeRegistration.java @@ -10,7 +10,8 @@ import java.lang.annotation.Inherited; import java.lang.annotation.Repeatable; import java.lang.annotation.Retention; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry; import static java.lang.annotation.ElementType.ANNOTATION_TYPE; import static java.lang.annotation.ElementType.PACKAGE; @@ -19,7 +20,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; /** * Describes a SqlTypeDescriptor to be added to the - * {@link org.hibernate.type.descriptor.sql.spi.SqlTypeDescriptorRegistry} + * {@link JdbcTypeDescriptorRegistry} * * @author Steve Ebersole * @@ -28,18 +29,18 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; @java.lang.annotation.Target({PACKAGE, TYPE, ANNOTATION_TYPE}) @Inherited @Retention(RUNTIME) -@Repeatable( SqlTypeRegistrations.class ) -public @interface SqlTypeRegistration { +@Repeatable( JdbcTypeRegistrations.class ) +public @interface JdbcTypeRegistration { /** * The descriptor to register */ - Class value(); + Class value(); /** * The type-code under which to register this descriptor. Can either add a new descriptor * or override an existing one. * - * By default we will use {@link SqlTypeDescriptor#getJdbcTypeCode} + * By default we will use {@link JdbcTypeDescriptor#getJdbcTypeCode} */ int registrationCode() default Integer.MIN_VALUE; } diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/SqlTypeRegistrations.java b/hibernate-core/src/main/java/org/hibernate/annotations/JdbcTypeRegistrations.java similarity index 86% rename from hibernate-core/src/main/java/org/hibernate/annotations/SqlTypeRegistrations.java rename to hibernate-core/src/main/java/org/hibernate/annotations/JdbcTypeRegistrations.java index 1a7f0c107e..5b90a629cf 100644 --- a/hibernate-core/src/main/java/org/hibernate/annotations/SqlTypeRegistrations.java +++ b/hibernate-core/src/main/java/org/hibernate/annotations/JdbcTypeRegistrations.java @@ -15,7 +15,7 @@ import static java.lang.annotation.ElementType.TYPE; import static java.lang.annotation.RetentionPolicy.RUNTIME; /** - * Grouping of {@link SqlTypeRegistration} + * Grouping of {@link JdbcTypeRegistration} * * @author Steve Ebersole * @@ -24,6 +24,6 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; @java.lang.annotation.Target({PACKAGE, TYPE, ANNOTATION_TYPE}) @Inherited @Retention(RUNTIME) -public @interface SqlTypeRegistrations { - SqlTypeRegistration[] value(); +public @interface JdbcTypeRegistrations { + JdbcTypeRegistration[] value(); } diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/MapKeySqlType.java b/hibernate-core/src/main/java/org/hibernate/annotations/MapKeyJdbcType.java similarity index 84% rename from hibernate-core/src/main/java/org/hibernate/annotations/MapKeySqlType.java rename to hibernate-core/src/main/java/org/hibernate/annotations/MapKeyJdbcType.java index b7394a3c7c..a2d8baa275 100644 --- a/hibernate-core/src/main/java/org/hibernate/annotations/MapKeySqlType.java +++ b/hibernate-core/src/main/java/org/hibernate/annotations/MapKeyJdbcType.java @@ -15,7 +15,7 @@ import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.RetentionPolicy.RUNTIME; /** - * Same function as {@link SqlType}, but used to define the SQL type descriptor to + * Same function as {@link JdbcType}, but used to define the SQL type descriptor to * use for the map-key * * @author Steve Ebersole @@ -25,6 +25,6 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; @java.lang.annotation.Target({METHOD, FIELD, ANNOTATION_TYPE}) @Inherited @Retention(RUNTIME) -public @interface MapKeySqlType { - SqlType value(); +public @interface MapKeyJdbcType { + JdbcType value(); } diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/MapKeySqlTypeCode.java b/hibernate-core/src/main/java/org/hibernate/annotations/MapKeyJdbcTypeCode.java similarity index 83% rename from hibernate-core/src/main/java/org/hibernate/annotations/MapKeySqlTypeCode.java rename to hibernate-core/src/main/java/org/hibernate/annotations/MapKeyJdbcTypeCode.java index 29b42a85e2..3de393ed39 100644 --- a/hibernate-core/src/main/java/org/hibernate/annotations/MapKeySqlTypeCode.java +++ b/hibernate-core/src/main/java/org/hibernate/annotations/MapKeyJdbcTypeCode.java @@ -15,7 +15,7 @@ import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.RetentionPolicy.RUNTIME; /** - * Same function as {@link SqlTypeCode}, but used to define the SQL type descriptor to + * Same function as {@link JdbcTypeCode}, but used to define the SQL type descriptor to * use for the map-key * * @author Steve Ebersole @@ -25,6 +25,6 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; @java.lang.annotation.Target({METHOD, FIELD, ANNOTATION_TYPE}) @Inherited @Retention(RUNTIME) -public @interface MapKeySqlTypeCode { - SqlTypeCode value(); +public @interface MapKeyJdbcTypeCode { + JdbcTypeCode value(); } 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 cdd0cb57ff..09a81b3a67 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 @@ -107,7 +107,7 @@ import org.hibernate.mapping.UniqueKey; import org.hibernate.query.named.NamedObjectRepository; import org.hibernate.query.sqm.function.SqmFunctionDescriptor; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; import org.hibernate.type.spi.TypeConfiguration; /** @@ -397,8 +397,8 @@ public class InFlightMetadataCollectorImpl implements InFlightMetadataCollector } @Override - public void addSqlTypeRegistration(int typeCode, SqlTypeDescriptor std) { - getTypeConfiguration().getSqlTypeDescriptorRegistry().addDescriptor( typeCode, std ); + public void addJdbcTypeRegistration(int typeCode, JdbcTypeDescriptor jdbcTypeDescriptor) { + getTypeConfiguration().getJdbcTypeDescriptorRegistry().addDescriptor( typeCode, jdbcTypeDescriptor ); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/hibernate-core/src/main/java/org/hibernate/boot/internal/MetadataBuilderImpl.java b/hibernate-core/src/main/java/org/hibernate/boot/internal/MetadataBuilderImpl.java index f1e55f7f99..92045e888d 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/internal/MetadataBuilderImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/internal/MetadataBuilderImpl.java @@ -68,7 +68,7 @@ import org.hibernate.query.sqm.function.SqmFunctionDescriptor; import org.hibernate.service.ServiceRegistry; import org.hibernate.type.BasicType; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; import org.hibernate.type.spi.TypeConfiguration; import org.hibernate.usertype.UserType; @@ -283,8 +283,8 @@ public class MetadataBuilderImpl implements MetadataBuilderImplementor, TypeCont } @Override - public void contributeSqlTypeDescriptor(SqlTypeDescriptor descriptor) { - this.bootstrapContext.getTypeConfiguration().getSqlTypeDescriptorRegistry().addDescriptor( descriptor ); + public void contributeJdbcTypeDescriptor(JdbcTypeDescriptor descriptor) { + this.bootstrapContext.getTypeConfiguration().getJdbcTypeDescriptorRegistry().addDescriptor( descriptor ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/TypeContributions.java b/hibernate-core/src/main/java/org/hibernate/boot/model/TypeContributions.java index ca8b6a0eb1..d98c4fd437 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/TypeContributions.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/TypeContributions.java @@ -9,7 +9,7 @@ package org.hibernate.boot.model; import org.hibernate.type.BasicType; import org.hibernate.type.StandardBasicTypeTemplate; import org.hibernate.type.descriptor.java.spi.JavaTypeDescriptorRegistry; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; import org.hibernate.type.spi.TypeConfiguration; import org.hibernate.usertype.UserType; @@ -32,17 +32,17 @@ public interface TypeContributions { * Add the JavaTypeDescriptor to the {@link TypeConfiguration}'s * {@link JavaTypeDescriptorRegistry} */ - void contributeSqlTypeDescriptor(SqlTypeDescriptor descriptor); + void contributeJdbcTypeDescriptor(JdbcTypeDescriptor descriptor); void contributeType(BasicType type); /** * @deprecated (since 5.3) Use {@link #contributeType(BasicType)} instead. Basic * types will be defined and handled much differently in 6.0 based on a combination - * of {@link JavaTypeDescriptor}, {@link SqlTypeDescriptor} and a concept of a "value + * of {@link JavaTypeDescriptor}, {@link JdbcTypeDescriptor} and a concept of a "value * converter" (a JPA AttributeConverter, an enum value resolver, etc). To get as * close as possible in 5.3 use existing {@link JavaTypeDescriptor} and - * {@link SqlTypeDescriptor} implementations (or write your own for custom types) + * {@link JdbcTypeDescriptor} implementations (or write your own for custom types) * and use {@link StandardBasicTypeTemplate} to combine those with * registration keys and call {@link #contributeType(BasicType)} instead */ @@ -54,7 +54,7 @@ public interface TypeContributions { * {@link UserType}, as currently defined, will be done very differently in 6.0. * In most cases a {@link UserType} can be simply replaced with proper * {@link JavaTypeDescriptor}. To get as close as possible to 6.0 in 5.3 use - * existing {@link JavaTypeDescriptor} and {@link SqlTypeDescriptor} + * existing {@link JavaTypeDescriptor} and {@link JdbcTypeDescriptor} * implementations (or write your own for custom impls) and use * {@link StandardBasicTypeTemplate} to combine those with registration keys * and call {@link #contributeType(BasicType)} instead diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/TypeDefinition.java b/hibernate-core/src/main/java/org/hibernate/boot/model/TypeDefinition.java index 6e10950c53..8401c34324 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/TypeDefinition.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/TypeDefinition.java @@ -31,7 +31,7 @@ import org.hibernate.type.Type; import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; import org.hibernate.type.descriptor.java.MutabilityPlan; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; import org.hibernate.type.spi.TypeConfiguration; import org.hibernate.type.spi.TypeConfigurationAware; @@ -102,7 +102,7 @@ public class TypeDefinition implements Serializable { public BasicValue.Resolution resolve( Map localConfigParameters, MutabilityPlan explicitMutabilityPlan, - MetadataBuildingContext context, + MetadataBuildingContext context, SqlTypeDescriptorIndicators indicators) { if ( CollectionHelper.isEmpty( localConfigParameters ) ) { // we can use the re-usable resolution... @@ -212,8 +212,8 @@ public class TypeDefinition implements Serializable { } @Override - public SqlTypeDescriptor getRelationalSqlTypeDescriptor() { - return resolvedBasicType.getSqlTypeDescriptor(); + public JdbcTypeDescriptor getJdbcTypeDescriptor() { + return resolvedBasicType.getJdbcTypeDescriptor(); } @Override @@ -264,8 +264,8 @@ public class TypeDefinition implements Serializable { } @Override - public SqlTypeDescriptor getRelationalSqlTypeDescriptor() { - return resolved.getSqlTypeDescriptor(); + public JdbcTypeDescriptor getJdbcTypeDescriptor() { + return resolved.getJdbcTypeDescriptor(); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/process/internal/EnumeratedValueResolution.java b/hibernate-core/src/main/java/org/hibernate/boot/model/process/internal/EnumeratedValueResolution.java index 73720e8137..8b5a5ea43a 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/process/internal/EnumeratedValueResolution.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/process/internal/EnumeratedValueResolution.java @@ -14,7 +14,7 @@ import org.hibernate.type.CustomType; import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; import org.hibernate.type.descriptor.java.MutabilityPlan; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; /** * @author Steve Ebersole @@ -23,19 +23,19 @@ public class EnumeratedValueResolution> implements BasicValue. private final CustomType enumTypeMapping; private final JavaTypeDescriptor domainJtd; private final JavaTypeDescriptor jdbcJtd; - private final SqlTypeDescriptor std; + private final JdbcTypeDescriptor jdbcTypeDescriptor; private final EnumValueConverter valueConverter; public EnumeratedValueResolution( CustomType enumTypeMapping, JavaTypeDescriptor domainJtd, JavaTypeDescriptor jdbcJtd, - SqlTypeDescriptor std, + JdbcTypeDescriptor jdbcTypeDescriptor, EnumValueConverter valueConverter) { this.enumTypeMapping = enumTypeMapping; this.domainJtd = domainJtd; this.jdbcJtd = jdbcJtd; - this.std = std; + this.jdbcTypeDescriptor = jdbcTypeDescriptor; this.valueConverter = valueConverter; } @@ -60,8 +60,8 @@ public class EnumeratedValueResolution> implements BasicValue. } @Override - public SqlTypeDescriptor getRelationalSqlTypeDescriptor() { - return std; + public JdbcTypeDescriptor getJdbcTypeDescriptor() { + return jdbcTypeDescriptor; } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/process/internal/InferredBasicValueResolution.java b/hibernate-core/src/main/java/org/hibernate/boot/model/process/internal/InferredBasicValueResolution.java index 7e93b7b050..3ec0a104f9 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/process/internal/InferredBasicValueResolution.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/process/internal/InferredBasicValueResolution.java @@ -12,7 +12,7 @@ import org.hibernate.metamodel.model.convert.spi.BasicValueConverter; import org.hibernate.type.BasicType; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; import org.hibernate.type.descriptor.java.MutabilityPlan; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; /** * @author Steve Ebersole @@ -20,7 +20,7 @@ import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; public class InferredBasicValueResolution implements BasicValue.Resolution { private JavaTypeDescriptor domainJtd; private JavaTypeDescriptor relationalJtd; - private SqlTypeDescriptor relationalStd; + private JdbcTypeDescriptor jdbcTypeDescriptor; private MutabilityPlan mutabilityPlan; @@ -33,7 +33,7 @@ public class InferredBasicValueResolution implements BasicValue.Resolution JdbcMapping jdbcMapping, JavaTypeDescriptor domainJtd, JavaTypeDescriptor relationalJtd, - SqlTypeDescriptor relationalStd, + JdbcTypeDescriptor jdbcTypeDescriptor, BasicValueConverter valueConverter, BasicType legacyType, MutabilityPlan mutabilityPlan) { @@ -41,7 +41,7 @@ public class InferredBasicValueResolution implements BasicValue.Resolution this.legacyType = legacyType; this.domainJtd = domainJtd; this.relationalJtd = relationalJtd; - this.relationalStd = relationalStd; + this.jdbcTypeDescriptor = jdbcTypeDescriptor; this.valueConverter = valueConverter; this.mutabilityPlan = mutabilityPlan == null ? domainJtd.getMutabilityPlan() : mutabilityPlan; } @@ -67,8 +67,8 @@ public class InferredBasicValueResolution implements BasicValue.Resolution } @Override - public SqlTypeDescriptor getRelationalSqlTypeDescriptor() { - return relationalStd; + public JdbcTypeDescriptor getJdbcTypeDescriptor() { + return jdbcTypeDescriptor; } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/process/internal/InferredBasicValueResolver.java b/hibernate-core/src/main/java/org/hibernate/boot/model/process/internal/InferredBasicValueResolver.java index 571d29a5ea..52c9645a22 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/process/internal/InferredBasicValueResolver.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/process/internal/InferredBasicValueResolver.java @@ -27,9 +27,9 @@ import org.hibernate.type.descriptor.java.EnumJavaTypeDescriptor; import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; import org.hibernate.type.descriptor.java.TemporalJavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; -import org.hibernate.type.descriptor.sql.TinyIntTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.TinyIntTypeDescriptor; import org.hibernate.type.spi.TypeConfiguration; /** @@ -42,9 +42,9 @@ public class InferredBasicValueResolver { @SuppressWarnings({"unchecked", "rawtypes"}) public static BasicValue.Resolution from( Function explicitJavaTypeAccess, - Function explicitSqlTypeAccess, + Function explicitSqlTypeAccess, Supplier reflectedJtdResolver, - SqlTypeDescriptorIndicators stdIndicators, + JdbcTypeDescriptorIndicators stdIndicators, Table table, Selectable selectable, String ownerName, @@ -52,7 +52,7 @@ public class InferredBasicValueResolver { TypeConfiguration typeConfiguration) { final BasicJavaDescriptor explicitJavaType = explicitJavaTypeAccess != null ? explicitJavaTypeAccess.apply( typeConfiguration ) : null; - final SqlTypeDescriptor explicitSqlType = explicitSqlTypeAccess != null ? explicitSqlTypeAccess.apply( typeConfiguration ) : null; + final JdbcTypeDescriptor explicitJdbcType = explicitSqlTypeAccess != null ? explicitSqlTypeAccess.apply( typeConfiguration ) : null; final BasicJavaDescriptor reflectedJtd = (BasicJavaDescriptor) reflectedJtdResolver.get(); @@ -66,20 +66,20 @@ public class InferredBasicValueResolver { if ( explicitJavaType != null ) { // we have an explicit @JavaType - if ( explicitSqlType != null ) { + if ( explicitJdbcType != null ) { // we also have an explicit @SqlType(Code) jdbcMapping = typeConfiguration.getBasicTypeRegistry().resolve( explicitJavaType, - explicitSqlType + explicitJdbcType ); } else { // infer the STD - final SqlTypeDescriptor inferredStd = explicitJavaType.getJdbcRecommendedSqlType( stdIndicators ); + final JdbcTypeDescriptor inferredJdbcType = explicitJavaType.getRecommendedJdbcType( stdIndicators ); jdbcMapping = typeConfiguration.getBasicTypeRegistry().resolve( explicitJavaType, - inferredStd + inferredJdbcType ); } @@ -88,12 +88,12 @@ public class InferredBasicValueResolver { else if ( reflectedJtd != null ) { // we were able to determine the "reflected java-type" - if ( explicitSqlType != null ) { + if ( explicitJdbcType != null ) { // we also have an explicit @SqlType(Code) jdbcMapping = typeConfiguration.getBasicTypeRegistry().resolve( reflectedJtd, - explicitSqlType + explicitJdbcType ); legacyType = jdbcMapping; @@ -109,13 +109,13 @@ public class InferredBasicValueResolver { } } else { - if ( explicitSqlType != null ) { + if ( explicitJdbcType != null ) { // we have an explicit STD, but no JTD - infer JTD // - NOTE : yes its an odd case, but its easy to implement here, so... - final BasicJavaDescriptor recommendedJtd = explicitSqlType.getJdbcRecommendedJavaTypeMapping( typeConfiguration ); + final BasicJavaDescriptor recommendedJtd = explicitJdbcType.getJdbcRecommendedJavaTypeMapping( typeConfiguration ); final BasicType resolved = typeConfiguration.getBasicTypeRegistry().resolve( recommendedJtd, - explicitSqlType + explicitJdbcType ); jdbcMapping = resolveSqlTypeIndicators( stdIndicators, resolved ); @@ -148,7 +148,7 @@ public class InferredBasicValueResolver { jdbcMapping, jdbcMapping.getJavaTypeDescriptor(), jdbcMapping.getJavaTypeDescriptor(), - jdbcMapping.getSqlTypeDescriptor(), + jdbcMapping.getJdbcTypeDescriptor(), null, legacyType, null @@ -157,7 +157,7 @@ public class InferredBasicValueResolver { @SuppressWarnings("rawtypes") public static BasicType resolveSqlTypeIndicators( - SqlTypeDescriptorIndicators stdIndicators, + JdbcTypeDescriptorIndicators stdIndicators, BasicType resolved) { if ( resolved instanceof SqlTypeDescriptorIndicatorCapable ) { final SqlTypeDescriptorIndicatorCapable indicatorCapable = (SqlTypeDescriptorIndicatorCapable) resolved; @@ -173,8 +173,8 @@ public class InferredBasicValueResolver { public static InferredBasicValueResolution fromEnum( EnumJavaTypeDescriptor enumJavaDescriptor, BasicJavaDescriptor explicitJavaType, - SqlTypeDescriptor explicitSqlType, - SqlTypeDescriptorIndicators stdIndicators, + JdbcTypeDescriptor explicitJdbcType, + JdbcTypeDescriptorIndicators stdIndicators, TypeConfiguration typeConfiguration) { final EnumType enumStyle = stdIndicators.getEnumeratedType() != null ? stdIndicators.getEnumeratedType() @@ -199,12 +199,12 @@ public class InferredBasicValueResolver { relationalJtd = typeConfiguration.getJavaTypeDescriptorRegistry().getDescriptor( relationalJavaType ); } - final SqlTypeDescriptor std = explicitSqlType != null ? explicitSqlType : relationalJtd.getJdbcRecommendedSqlType( stdIndicators ); + final JdbcTypeDescriptor jdbcTypeDescriptor = explicitJdbcType != null ? explicitJdbcType : relationalJtd.getRecommendedJdbcType( stdIndicators ); //noinspection unchecked final NamedEnumValueConverter valueConverter = new NamedEnumValueConverter( enumJavaDescriptor, - std, + jdbcTypeDescriptor, relationalJtd ); @@ -217,14 +217,14 @@ public class InferredBasicValueResolver { final CustomType legacyEnumTypeWrapper = new CustomType( legacyEnumType, typeConfiguration ); - final JdbcMapping jdbcMapping = typeConfiguration.getBasicTypeRegistry().resolve( relationalJtd, std ); + final JdbcMapping jdbcMapping = typeConfiguration.getBasicTypeRegistry().resolve( relationalJtd, jdbcTypeDescriptor ); //noinspection unchecked return new InferredBasicValueResolution( jdbcMapping, enumJavaDescriptor, relationalJtd, - std, + jdbcTypeDescriptor, valueConverter, legacyEnumTypeWrapper, ImmutableMutabilityPlan.INSTANCE @@ -247,12 +247,12 @@ public class InferredBasicValueResolver { relationalJtd = typeConfiguration.getJavaTypeDescriptorRegistry().getDescriptor( Integer.class ); } - final SqlTypeDescriptor std = explicitSqlType != null ? explicitSqlType : TinyIntTypeDescriptor.INSTANCE; + final JdbcTypeDescriptor jdbcTypeDescriptor = explicitJdbcType != null ? explicitJdbcType : TinyIntTypeDescriptor.INSTANCE; //noinspection unchecked final OrdinalEnumValueConverter valueConverter = new OrdinalEnumValueConverter( enumJavaDescriptor, - std, + jdbcTypeDescriptor, relationalJtd ); @@ -265,14 +265,14 @@ public class InferredBasicValueResolver { final CustomType legacyEnumTypeWrapper = new CustomType( legacyEnumType, typeConfiguration ); - final JdbcMapping jdbcMapping = typeConfiguration.getBasicTypeRegistry().resolve( relationalJtd, std ); + final JdbcMapping jdbcMapping = typeConfiguration.getBasicTypeRegistry().resolve( relationalJtd, jdbcTypeDescriptor ); //noinspection unchecked return new InferredBasicValueResolution( jdbcMapping, enumJavaDescriptor, relationalJtd, - std, + jdbcTypeDescriptor, valueConverter, legacyEnumTypeWrapper, ImmutableMutabilityPlan.INSTANCE @@ -288,8 +288,8 @@ public class InferredBasicValueResolver { public static InferredBasicValueResolution fromTemporal( TemporalJavaTypeDescriptor reflectedJtd, Function explicitJavaTypeAccess, - Function explicitSqlTypeAccess, - SqlTypeDescriptorIndicators stdIndicators, + Function explicitSqlTypeAccess, + JdbcTypeDescriptorIndicators stdIndicators, TypeConfiguration typeConfiguration) { final TemporalType requestedTemporalPrecision = stdIndicators.getTemporalPrecision(); @@ -301,12 +301,12 @@ public class InferredBasicValueResolver { explicitJavaType = null; } - final SqlTypeDescriptor explicitSqlType; + final JdbcTypeDescriptor explicitJdbcType; if ( explicitSqlTypeAccess != null ) { - explicitSqlType = explicitSqlTypeAccess.apply( typeConfiguration ); + explicitJdbcType = explicitSqlTypeAccess.apply( typeConfiguration ); } else { - explicitSqlType = null; + explicitJdbcType = null; } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -330,15 +330,15 @@ public class InferredBasicValueResolver { ); } - final SqlTypeDescriptor std = explicitSqlType != null ? explicitSqlType : explicitTemporalJtd.getJdbcRecommendedSqlType( stdIndicators ); + final JdbcTypeDescriptor jdbcTypeDescriptor = explicitJdbcType != null ? explicitJdbcType : explicitTemporalJtd.getRecommendedJdbcType( stdIndicators ); - final BasicType jdbcMapping = typeConfiguration.getBasicTypeRegistry().resolve( explicitTemporalJtd, std ); + final BasicType jdbcMapping = typeConfiguration.getBasicTypeRegistry().resolve( explicitTemporalJtd, jdbcTypeDescriptor ); return new InferredBasicValueResolution( jdbcMapping, explicitTemporalJtd, explicitTemporalJtd, - std, + jdbcTypeDescriptor, null, jdbcMapping, explicitJavaType.getMutabilityPlan() @@ -351,7 +351,7 @@ public class InferredBasicValueResolver { // - still a special case because we want to perform the new resolution // due to the new annotations being used - if ( explicitSqlType != null ) { + if ( explicitJdbcType != null ) { final TemporalJavaTypeDescriptor jtd; if ( requestedTemporalPrecision != null ) { @@ -364,13 +364,13 @@ public class InferredBasicValueResolver { jtd = reflectedJtd; } - final BasicType jdbcMapping = typeConfiguration.getBasicTypeRegistry().resolve( jtd, explicitSqlType ); + final BasicType jdbcMapping = typeConfiguration.getBasicTypeRegistry().resolve( jtd, explicitJdbcType ); return new InferredBasicValueResolution( jdbcMapping, jtd, jtd, - explicitSqlType, + explicitJdbcType, null, jdbcMapping, jtd.getMutabilityPlan() @@ -401,7 +401,7 @@ public class InferredBasicValueResolver { basicType, basicType.getJavaTypeDescriptor(), basicType.getJavaTypeDescriptor(), - basicType.getSqlTypeDescriptor(), + basicType.getJdbcTypeDescriptor(), null, basicType, reflectedJtd.getMutabilityPlan() diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/process/internal/NamedBasicTypeResolution.java b/hibernate-core/src/main/java/org/hibernate/boot/model/process/internal/NamedBasicTypeResolution.java index 543d6ae045..ef8447dba0 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/process/internal/NamedBasicTypeResolution.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/process/internal/NamedBasicTypeResolution.java @@ -13,10 +13,9 @@ import org.hibernate.mapping.BasicValue; import org.hibernate.metamodel.mapping.JdbcMapping; import org.hibernate.metamodel.model.convert.spi.BasicValueConverter; import org.hibernate.type.BasicType; -import org.hibernate.type.Type; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; import org.hibernate.type.descriptor.java.MutabilityPlan; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; import org.hibernate.type.spi.TypeConfiguration; /** @@ -76,8 +75,8 @@ public class NamedBasicTypeResolution implements BasicValue.Resolution { } @Override - public SqlTypeDescriptor getRelationalSqlTypeDescriptor() { - return basicType.getSqlTypeDescriptor(); + public JdbcTypeDescriptor getJdbcTypeDescriptor() { + return basicType.getJdbcTypeDescriptor(); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/process/internal/NamedConverterResolution.java b/hibernate-core/src/main/java/org/hibernate/boot/model/process/internal/NamedConverterResolution.java index 54f1b1e84d..f7ce186370 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/process/internal/NamedConverterResolution.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/process/internal/NamedConverterResolution.java @@ -6,8 +6,6 @@ */ package org.hibernate.boot.model.process.internal; -import java.util.Collections; -import java.util.List; import java.util.function.Function; import javax.persistence.AttributeConverter; @@ -17,25 +15,18 @@ import org.hibernate.boot.model.convert.spi.JpaAttributeConverterCreationContext import org.hibernate.boot.registry.StandardServiceRegistry; import org.hibernate.boot.registry.classloading.spi.ClassLoaderService; import org.hibernate.boot.spi.MetadataBuildingContext; -import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.mapping.BasicValue; -import org.hibernate.mapping.IndexedConsumer; import org.hibernate.metamodel.mapping.JdbcMapping; -import org.hibernate.metamodel.mapping.MappingModelExpressable; -import org.hibernate.metamodel.mapping.SqlExpressable; import org.hibernate.metamodel.model.convert.spi.JpaAttributeConverter; -import org.hibernate.sql.ast.Clause; import org.hibernate.type.BasicType; -import org.hibernate.type.descriptor.ValueBinder; -import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.converter.AttributeConverterMutabilityPlanImpl; import org.hibernate.type.descriptor.converter.AttributeConverterTypeAdapter; import org.hibernate.type.descriptor.java.BasicJavaDescriptor; import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; import org.hibernate.type.descriptor.java.MutabilityPlan; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; import org.hibernate.type.spi.TypeConfiguration; /** @@ -47,9 +38,9 @@ public class NamedConverterResolution implements BasicValue.Resolution { public static NamedConverterResolution from( ConverterDescriptor converterDescriptor, Function explicitJtdAccess, - Function explicitStdAccess, + Function explicitStdAccess, Function explicitMutabilityPlanAccess, - SqlTypeDescriptorIndicators sqlTypeIndicators, + JdbcTypeDescriptorIndicators sqlTypeIndicators, JpaAttributeConverterCreationContext converterCreationContext, MetadataBuildingContext context) { return fromInternal( @@ -65,9 +56,9 @@ public class NamedConverterResolution implements BasicValue.Resolution { public static NamedConverterResolution from( String name, Function explicitJtdAccess, - Function explicitStdAccess, + Function explicitStdAccess, Function explicitMutabilityPlanAccess, - SqlTypeDescriptorIndicators sqlTypeIndicators, + JdbcTypeDescriptorIndicators sqlTypeIndicators, JpaAttributeConverterCreationContext converterCreationContext, MetadataBuildingContext context) { assert name.startsWith( ConverterDescriptor.TYPE_NAME_PREFIX ); @@ -94,9 +85,9 @@ public class NamedConverterResolution implements BasicValue.Resolution { private static NamedConverterResolution fromInternal( Function explicitJtdAccess, - Function explicitStdAccess, + Function explicitStdAccess, Function explicitMutabilityPlanAccess, - JpaAttributeConverter converter, SqlTypeDescriptorIndicators sqlTypeIndicators, + JpaAttributeConverter converter, JdbcTypeDescriptorIndicators sqlTypeIndicators, MetadataBuildingContext context) { final TypeConfiguration typeConfiguration = context.getBootstrapContext().getTypeConfiguration(); @@ -108,15 +99,15 @@ public class NamedConverterResolution implements BasicValue.Resolution { ? explicitJtd : converter.getDomainJavaDescriptor(); - final SqlTypeDescriptor explicitStd = explicitStdAccess != null + final JdbcTypeDescriptor explicitJdbcType = explicitStdAccess != null ? explicitStdAccess.apply( typeConfiguration ) : null; final JavaTypeDescriptor relationalJtd = converter.getRelationalJavaDescriptor(); - final SqlTypeDescriptor relationalStd = explicitStd != null - ? explicitStd - : relationalJtd.getJdbcRecommendedSqlType( sqlTypeIndicators ); + final JdbcTypeDescriptor jdbcType = explicitJdbcType != null + ? explicitJdbcType + : relationalJtd.getRecommendedJdbcType( sqlTypeIndicators ); final MutabilityPlan explicitMutabilityPlan = explicitMutabilityPlanAccess != null ? explicitMutabilityPlanAccess.apply( typeConfiguration ) @@ -137,7 +128,7 @@ public class NamedConverterResolution implements BasicValue.Resolution { return new NamedConverterResolution( domainJtd, relationalJtd, - relationalStd, + jdbcType, converter, mutabilityPlan, context.getBootstrapContext().getTypeConfiguration() @@ -147,7 +138,7 @@ public class NamedConverterResolution implements BasicValue.Resolution { private final JavaTypeDescriptor domainJtd; private final JavaTypeDescriptor relationalJtd; - private final SqlTypeDescriptor relationalStd; + private final JdbcTypeDescriptor jdbcTypeDescriptor; private final JpaAttributeConverter valueConverter; private final MutabilityPlan mutabilityPlan; @@ -160,7 +151,7 @@ public class NamedConverterResolution implements BasicValue.Resolution { public NamedConverterResolution( JavaTypeDescriptor domainJtd, JavaTypeDescriptor relationalJtd, - SqlTypeDescriptor relationalStd, + JdbcTypeDescriptor jdbcTypeDescriptor, JpaAttributeConverter valueConverter, MutabilityPlan mutabilityPlan, TypeConfiguration typeConfiguration) { @@ -170,8 +161,8 @@ public class NamedConverterResolution implements BasicValue.Resolution { assert relationalJtd != null; this.relationalJtd = relationalJtd; - assert relationalStd != null; - this.relationalStd = relationalStd; + assert jdbcTypeDescriptor != null; + this.jdbcTypeDescriptor = jdbcTypeDescriptor; assert valueConverter != null; this.valueConverter = valueConverter; @@ -181,7 +172,7 @@ public class NamedConverterResolution implements BasicValue.Resolution { this.jdbcMapping = typeConfiguration.getBasicTypeRegistry().resolve( relationalJtd, - relationalStd + jdbcTypeDescriptor ); // this.jdbcMapping = new JdbcMapping() { // private final ValueExtractor extractor = relationalStd.getExtractor( relationalJtd ); @@ -225,7 +216,7 @@ public class NamedConverterResolution implements BasicValue.Resolution { relationalJtd.getJavaType().getTypeName() ), valueConverter, - relationalStd, + jdbcTypeDescriptor, relationalJtd, domainJtd, mutabilityPlan @@ -250,8 +241,8 @@ public class NamedConverterResolution implements BasicValue.Resolution { } @Override - public SqlTypeDescriptor getRelationalSqlTypeDescriptor() { - return relationalStd; + public JdbcTypeDescriptor getJdbcTypeDescriptor() { + return jdbcTypeDescriptor; } @Override @@ -275,140 +266,4 @@ public class NamedConverterResolution implements BasicValue.Resolution { return "NamedConverterResolution(" + valueConverter.getConverterBean().getBeanClass().getName() + ')'; } - /** - * Allows treating the attribute conversion as a jdbc-level reference. - * This covers the conversion plus managing the JDBC-value - */ - private static class ConverterJdbcMappingImpl implements JdbcMapping, MappingModelExpressable, SqlExpressable { - private final JavaTypeDescriptor domainJtd; - private final JavaTypeDescriptor jdbcJtd; - private final SqlTypeDescriptor std; - private final JpaAttributeConverter valueConverter; - private final MutabilityPlan mutabilityPlan; - - private final ValueExtractor extractor; - private final ValueBinder binder; - private final BasicType lowLevelJdbcMapping; - - public ConverterJdbcMappingImpl( - JavaTypeDescriptor domainJtd, - JavaTypeDescriptor jdbcJtd, - SqlTypeDescriptor std, - JpaAttributeConverter valueConverter, - MutabilityPlan mutabilityPlan, - TypeConfiguration typeConfiguration) { - this.domainJtd = domainJtd; - this.jdbcJtd = jdbcJtd; - this.std = std; - this.valueConverter = valueConverter; - this.mutabilityPlan = mutabilityPlan; - - this.extractor = std.getExtractor( jdbcJtd ); - this.binder = std.getBinder( jdbcJtd ); - - this.lowLevelJdbcMapping = typeConfiguration.getBasicTypeRegistry().resolve( jdbcJtd, std ); - } - - @Override - public JavaTypeDescriptor getJavaTypeDescriptor() { - return domainJtd; - } - - @Override - public SqlTypeDescriptor getSqlTypeDescriptor() { - return std; - } - - @Override - public ValueExtractor getJdbcValueExtractor() { - return extractor; - } - - @Override - public ValueBinder getJdbcValueBinder() { - return binder; - } - - @Override - public int getJdbcTypeCount() { - return 1; - } - - @Override - public List getJdbcMappings() { - return Collections.singletonList( this ); - } - - @Override - public int forEachJdbcType(IndexedConsumer action) { - action.accept( 0, this ); - return 1; - } - - @Override - public int forEachJdbcType(int offset, IndexedConsumer action) { - action.accept( offset, this ); - return 1; - } - - @Override - public Object disassemble(Object value, SharedSessionContractImplementor session) { - return mutabilityPlan.disassemble( value ); - } - - @Override - public int forEachJdbcValue( - Object value, - Clause clause, - int offset, - JdbcValuesConsumer valuesConsumer, - SharedSessionContractImplementor session) { - final AttributeConverter converter = (AttributeConverter) valueConverter.getConverterBean().getBeanInstance(); - final Object converted = converter.convertToDatabaseColumn( value ); - valuesConsumer.consume( offset, converted, this ); - return 1; - } - - @Override - public int forEachDisassembledJdbcValue( - Object value, - Clause clause, - JdbcValuesConsumer valuesConsumer, - SharedSessionContractImplementor session) { - final AttributeConverter converter = (AttributeConverter) valueConverter.getConverterBean().getBeanInstance(); - final Object converted = converter.convertToDatabaseColumn( value ); - valuesConsumer.consume( 0, converted, this ); - return 1; - } - - @Override - public int forEachDisassembledJdbcValue( - Object value, - Clause clause, - int offset, - JdbcValuesConsumer valuesConsumer, - SharedSessionContractImplementor session) { - final AttributeConverter converter = (AttributeConverter) valueConverter.getConverterBean().getBeanInstance(); - final Object converted = converter.convertToDatabaseColumn( value ); - valuesConsumer.consume( offset, converted, this ); - return 1; - } - - @Override - public int forEachJdbcValue( - Object value, - Clause clause, - JdbcValuesConsumer valuesConsumer, - SharedSessionContractImplementor session) { - final AttributeConverter converter = (AttributeConverter) valueConverter.getConverterBean().getBeanInstance(); - final Object converted = converter.convertToDatabaseColumn( value ); - valuesConsumer.consume( 0, converted, this ); - return 1; - } - - @Override - public JdbcMapping getJdbcMapping() { - return lowLevelJdbcMapping; - } - } } diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/process/internal/UserTypeResolution.java b/hibernate-core/src/main/java/org/hibernate/boot/model/process/internal/UserTypeResolution.java index fcbfabc0cc..7dd515eb96 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/process/internal/UserTypeResolution.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/process/internal/UserTypeResolution.java @@ -11,10 +11,9 @@ import org.hibernate.metamodel.mapping.JdbcMapping; import org.hibernate.metamodel.model.convert.spi.BasicValueConverter; import org.hibernate.type.BasicType; import org.hibernate.type.CustomType; -import org.hibernate.type.Type; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; import org.hibernate.type.descriptor.java.MutabilityPlan; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; /** * @author Steve Ebersole @@ -43,8 +42,8 @@ public class UserTypeResolution implements BasicValue.Resolution { } @Override - public SqlTypeDescriptor getRelationalSqlTypeDescriptor() { - return userTypeAdapter.getSqlTypeDescriptor(); + public JdbcTypeDescriptor getJdbcTypeDescriptor() { + return userTypeAdapter.getJdbcTypeDescriptor(); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/process/internal/VersionResolution.java b/hibernate-core/src/main/java/org/hibernate/boot/model/process/internal/VersionResolution.java index 32afd5b7bc..4403bbc18f 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/process/internal/VersionResolution.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/process/internal/VersionResolution.java @@ -20,8 +20,8 @@ import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; import org.hibernate.type.descriptor.java.MutabilityPlan; import org.hibernate.type.descriptor.java.PrimitiveByteArrayTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; import org.hibernate.type.spi.TypeConfiguration; /** @@ -37,7 +37,7 @@ public class VersionResolution implements BasicValue.Resolution { public static VersionResolution from( Function implicitJavaTypeAccess, Function explicitJtdAccess, - Function explicitStdAccess, + Function explicitStdAccess, TypeConfiguration typeConfiguration, @SuppressWarnings("unused") MetadataBuildingContext context) { @@ -49,7 +49,7 @@ public class VersionResolution implements BasicValue.Resolution { if ( registered instanceof PrimitiveByteArrayTypeDescriptor ) { return new VersionResolution<>( RowVersionType.INSTANCE.getJavaTypeDescriptor(), - RowVersionType.INSTANCE.getSqlTypeDescriptor(), + RowVersionType.INSTANCE.getJdbcTypeDescriptor(), RowVersionType.INSTANCE, RowVersionType.INSTANCE ); @@ -57,8 +57,8 @@ public class VersionResolution implements BasicValue.Resolution { final BasicJavaDescriptor jtd = (BasicJavaDescriptor) registered; - final SqlTypeDescriptor std = jtd.getJdbcRecommendedSqlType( - new SqlTypeDescriptorIndicators() { + final JdbcTypeDescriptor recommendedJdbcType = jtd.getRecommendedJdbcType( + new JdbcTypeDescriptorIndicators() { @Override public TypeConfiguration getTypeConfiguration() { return typeConfiguration; @@ -72,27 +72,27 @@ public class VersionResolution implements BasicValue.Resolution { } ); - final BasicType basicType = typeConfiguration.getBasicTypeRegistry().resolve( jtd, std ); + final BasicType basicType = typeConfiguration.getBasicTypeRegistry().resolve( jtd, recommendedJdbcType ); final BasicType legacyType = typeConfiguration.getBasicTypeRegistry().getRegisteredType( jtd.getJavaType() ); - assert legacyType.getSqlTypeDescriptor().equals( std ); + assert legacyType.getJdbcTypeDescriptor().equals( recommendedJdbcType ); - return new VersionResolution<>( jtd, std, basicType, legacyType ); + return new VersionResolution<>( jtd, recommendedJdbcType, basicType, legacyType ); } private final JavaTypeDescriptor jtd; - private final SqlTypeDescriptor std; + private final JdbcTypeDescriptor jdbcTypeDescriptor; private final JdbcMapping jdbcMapping; private final BasicType legacyType; public VersionResolution( JavaTypeDescriptor javaTypeDescriptor, - SqlTypeDescriptor sqlTypeDescriptor, + JdbcTypeDescriptor jdbcTypeDescriptor, JdbcMapping jdbcMapping, BasicType legacyType) { this.jtd = javaTypeDescriptor; - this.std = sqlTypeDescriptor; + this.jdbcTypeDescriptor = jdbcTypeDescriptor; this.jdbcMapping = jdbcMapping; this.legacyType = legacyType; } @@ -120,8 +120,8 @@ public class VersionResolution implements BasicValue.Resolution { } @Override - public SqlTypeDescriptor getRelationalSqlTypeDescriptor() { - return std; + public JdbcTypeDescriptor getJdbcTypeDescriptor() { + return jdbcTypeDescriptor; } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/process/spi/MetadataBuildingProcess.java b/hibernate-core/src/main/java/org/hibernate/boot/model/process/spi/MetadataBuildingProcess.java index add0b3051d..a63a191652 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/process/spi/MetadataBuildingProcess.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/process/spi/MetadataBuildingProcess.java @@ -29,7 +29,6 @@ import org.hibernate.boot.model.source.spi.MetadataSourceProcessor; import org.hibernate.boot.registry.classloading.spi.ClassLoaderService; import org.hibernate.boot.spi.AdditionalJaxbMappingProducer; import org.hibernate.boot.spi.BootstrapContext; -import org.hibernate.boot.spi.MetadataBuildingContext; import org.hibernate.boot.spi.MetadataBuildingOptions; import org.hibernate.boot.spi.MetadataContributor; import org.hibernate.boot.spi.MetadataImplementor; @@ -42,7 +41,7 @@ import org.hibernate.engine.jdbc.spi.JdbcServices; import org.hibernate.type.BasicType; import org.hibernate.type.BasicTypeRegistry; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; import org.hibernate.type.spi.TypeConfiguration; import org.hibernate.usertype.UserType; @@ -374,8 +373,8 @@ public class MetadataBuildingProcess { } @Override - public void contributeSqlTypeDescriptor(SqlTypeDescriptor descriptor) { - bootstrapContext.getTypeConfiguration().getSqlTypeDescriptorRegistry().addDescriptor( descriptor ); + public void contributeJdbcTypeDescriptor(JdbcTypeDescriptor descriptor) { + bootstrapContext.getTypeConfiguration().getJdbcTypeDescriptorRegistry().addDescriptor( descriptor ); } @Override 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 8f7c36a594..3eaf42e004 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 @@ -1983,7 +1983,7 @@ public class ModelBinder { .getBasicTypeRegistry() .getRegisteredType( value.getTypeName() ); if ( basicType instanceof AbstractSingleColumnStandardBasicType ) { - if ( isLob( basicType.getSqlTypeDescriptor().getSqlType(), null ) ) { + if ( isLob( basicType.getJdbcTypeDescriptor().getJdbcType(), null ) ) { value.makeLob(); } } @@ -2004,9 +2004,9 @@ public class ModelBinder { private static boolean isLob(Integer sqlType, String sqlTypeName) { if ( sqlType != null ) { - return ClobType.INSTANCE.getSqlTypeDescriptor().getSqlType() == sqlType || - BlobType.INSTANCE.getSqlTypeDescriptor().getSqlType() == sqlType || - NClobType.INSTANCE.getSqlTypeDescriptor().getSqlType() == sqlType; + return ClobType.INSTANCE.getJdbcTypeDescriptor().getJdbcType() == sqlType || + BlobType.INSTANCE.getJdbcTypeDescriptor().getJdbcType() == sqlType || + NClobType.INSTANCE.getJdbcTypeDescriptor().getJdbcType() == sqlType; } else if ( sqlTypeName != null ) { return ClobType.INSTANCE.getName().equalsIgnoreCase( sqlTypeName ) || diff --git a/hibernate-core/src/main/java/org/hibernate/boot/spi/InFlightMetadataCollector.java b/hibernate-core/src/main/java/org/hibernate/boot/spi/InFlightMetadataCollector.java index 74fd903f5e..44e50cb3ff 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/spi/InFlightMetadataCollector.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/spi/InFlightMetadataCollector.java @@ -52,7 +52,7 @@ import org.hibernate.mapping.MappedSuperclass; import org.hibernate.mapping.PersistentClass; import org.hibernate.mapping.Table; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; /** * An in-flight representation of Metadata while Metadata is being built. @@ -320,7 +320,7 @@ public interface InFlightMetadataCollector extends Mapping, MetadataImplementor void registerValueMappingResolver(Function resolver); void addJavaTypeRegistration(Class javaType, JavaTypeDescriptor jtd); - void addSqlTypeRegistration(int typeCode, SqlTypeDescriptor std); + void addJdbcTypeRegistration(int typeCode, JdbcTypeDescriptor jdbcTypeDescriptor); interface DelayedPropertyReferenceHandler extends Serializable { void process(InFlightMetadataCollector metadataCollector); 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 0ca1f4712b..08d31fd0ed 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/AnnotationBinder.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/AnnotationBinder.java @@ -8,7 +8,6 @@ package org.hibernate.cfg; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collection; import java.util.Collections; import java.util.EnumSet; import java.util.HashMap; @@ -119,8 +118,8 @@ import org.hibernate.annotations.Proxy; import org.hibernate.annotations.SortComparator; import org.hibernate.annotations.SortNatural; import org.hibernate.annotations.Source; -import org.hibernate.annotations.SqlTypeRegistration; -import org.hibernate.annotations.SqlTypeRegistrations; +import org.hibernate.annotations.JdbcTypeRegistration; +import org.hibernate.annotations.JdbcTypeRegistrations; import org.hibernate.annotations.TypeDef; import org.hibernate.annotations.TypeDefs; import org.hibernate.annotations.Where; @@ -171,7 +170,7 @@ import org.hibernate.mapping.ToOne; import org.hibernate.mapping.UnionSubclass; import org.hibernate.resource.beans.spi.ManagedBeanRegistry; import org.hibernate.type.descriptor.java.BasicJavaDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; import static org.hibernate.internal.CoreLogging.messageLogger; @@ -357,14 +356,14 @@ public final class AnnotationBinder { private static void handleSqlTypeDescriptorRegistration( MetadataBuildingContext context, ManagedBeanRegistry managedBeanRegistry, - SqlTypeRegistration annotation) { - final Class stdClass = annotation.value(); - final SqlTypeDescriptor std = managedBeanRegistry.getBean( stdClass ).getBeanInstance(); + JdbcTypeRegistration annotation) { + final Class jdbcTypeClass = annotation.value(); + final JdbcTypeDescriptor jdbcTypeDescriptor = managedBeanRegistry.getBean( jdbcTypeClass ).getBeanInstance(); final int typeCode = annotation.registrationCode() == Integer.MIN_VALUE - ? std.getJdbcTypeCode() + ? jdbcTypeDescriptor.getJdbcTypeCode() : annotation.registrationCode(); - context.getMetadataCollector().addSqlTypeRegistration( typeCode, std ); + context.getMetadataCollector().addJdbcTypeRegistration( typeCode, jdbcTypeDescriptor ); } private static void handleJavaTypeDescriptorRegistration( @@ -883,13 +882,13 @@ public final class AnnotationBinder { } } - if ( annotatedElement.isAnnotationPresent( SqlTypeRegistration.class ) ) { - final SqlTypeRegistration annotation = annotatedElement.getAnnotation( SqlTypeRegistration.class ); + if ( annotatedElement.isAnnotationPresent( JdbcTypeRegistration.class ) ) { + final JdbcTypeRegistration annotation = annotatedElement.getAnnotation( JdbcTypeRegistration.class ); handleSqlTypeDescriptorRegistration( context, managedBeanRegistry, annotation ); } - if ( annotatedElement.isAnnotationPresent( SqlTypeRegistrations.class ) ) { - final SqlTypeRegistrations annotation = annotatedElement.getAnnotation( SqlTypeRegistrations.class ); - final SqlTypeRegistration[] registrations = annotation.value(); + if ( annotatedElement.isAnnotationPresent( JdbcTypeRegistrations.class ) ) { + final JdbcTypeRegistrations annotation = annotatedElement.getAnnotation( JdbcTypeRegistrations.class ); + final JdbcTypeRegistration[] registrations = annotation.value(); for ( int i = 0; i < registrations.length; i++ ) { handleSqlTypeDescriptorRegistration( context, managedBeanRegistry, registrations[i] ); } diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/annotations/BasicValueBinder.java b/hibernate-core/src/main/java/org/hibernate/cfg/annotations/BasicValueBinder.java index b6c031bc58..33f7567fcd 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/annotations/BasicValueBinder.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/annotations/BasicValueBinder.java @@ -27,14 +27,14 @@ import org.hibernate.annotations.CollectionId; import org.hibernate.annotations.Immutable; import org.hibernate.annotations.JavaType; import org.hibernate.annotations.MapKeyJavaType; -import org.hibernate.annotations.MapKeySqlType; -import org.hibernate.annotations.MapKeySqlTypeCode; +import org.hibernate.annotations.MapKeyJdbcType; +import org.hibernate.annotations.MapKeyJdbcTypeCode; import org.hibernate.annotations.MapKeyType; import org.hibernate.annotations.Mutability; import org.hibernate.annotations.Nationalized; import org.hibernate.annotations.Parameter; -import org.hibernate.annotations.SqlType; -import org.hibernate.annotations.SqlTypeCode; +import org.hibernate.annotations.JdbcType; +import org.hibernate.annotations.JdbcTypeCode; import org.hibernate.annotations.Type; import org.hibernate.annotations.common.reflection.XClass; import org.hibernate.annotations.common.reflection.XProperty; @@ -57,8 +57,8 @@ import org.hibernate.mapping.Table; import org.hibernate.type.descriptor.java.BasicJavaDescriptor; import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan; import org.hibernate.type.descriptor.java.MutabilityPlan; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; import org.hibernate.type.spi.TypeConfiguration; import org.jboss.logging.Logger; @@ -67,7 +67,7 @@ import org.jboss.logging.Logger; * @author Steve Ebersole * @author Emmanuel Bernard */ -public class BasicValueBinder implements SqlTypeDescriptorIndicators { +public class BasicValueBinder implements JdbcTypeDescriptorIndicators { // todo (6.0) : In light of how we want to build Types (specifically BasicTypes) moving forward this class should undergo major changes // see the comments in #setType @@ -97,7 +97,7 @@ public class BasicValueBinder implements SqlTypeDescriptorIndicators { private String explicitBasicTypeName; private Map explicitLocalTypeParams; - private Function explicitSqlTypeAccess; + private Function explicitSqlTypeAccess; private Function explicitJtdAccess; private Function explicitMutabilityAccess; private Function implicitJavaTypeAccess; @@ -508,10 +508,10 @@ public class BasicValueBinder implements SqlTypeDescriptorIndicators { } explicitSqlTypeAccess = typeConfiguration -> { - final MapKeySqlType explicitDescriptorAnn = attributeXProperty.getAnnotation( MapKeySqlType.class ); + final MapKeyJdbcType explicitDescriptorAnn = attributeXProperty.getAnnotation( MapKeyJdbcType.class ); if ( explicitDescriptorAnn != null ) { - final SqlType explicitStdAnn = explicitDescriptorAnn.value(); - final Class stdImplJavaType = explicitStdAnn.value(); + final JdbcType explicitStdAnn = explicitDescriptorAnn.value(); + final Class stdImplJavaType = explicitStdAnn.value(); try { return stdImplJavaType.newInstance(); @@ -521,10 +521,10 @@ public class BasicValueBinder implements SqlTypeDescriptorIndicators { } } - final MapKeySqlTypeCode explicitCodeAnn = attributeXProperty.getAnnotation( MapKeySqlTypeCode.class ); + final MapKeyJdbcTypeCode explicitCodeAnn = attributeXProperty.getAnnotation( MapKeyJdbcTypeCode.class ); if ( explicitCodeAnn != null ) { - final SqlTypeCode explicitSqlTypeAnn = explicitCodeAnn.value(); - return typeConfiguration.getSqlTypeDescriptorRegistry().getDescriptor( explicitSqlTypeAnn.value() ); + final JdbcTypeCode explicitSqlTypeAnn = explicitCodeAnn.value(); + return typeConfiguration.getJdbcTypeDescriptorRegistry().getDescriptor( explicitSqlTypeAnn.value() ); } return null; @@ -552,9 +552,9 @@ public class BasicValueBinder implements SqlTypeDescriptorIndicators { XProperty attributeXProperty, MetadataBuildingContext buildingContext) { explicitSqlTypeAccess = typeConfiguration -> { - final SqlType explicitStdAnn = attributeXProperty.getAnnotation( SqlType.class ); + final JdbcType explicitStdAnn = attributeXProperty.getAnnotation( JdbcType.class ); if ( explicitStdAnn != null ) { - final Class stdImplJavaType = explicitStdAnn.value(); + final Class stdImplJavaType = explicitStdAnn.value(); try { return stdImplJavaType.newInstance(); @@ -564,9 +564,9 @@ public class BasicValueBinder implements SqlTypeDescriptorIndicators { } } - final SqlTypeCode explicitSqlTypeAnn = attributeXProperty.getAnnotation( SqlTypeCode.class ); + final JdbcTypeCode explicitSqlTypeAnn = attributeXProperty.getAnnotation( JdbcTypeCode.class ); if ( explicitSqlTypeAnn != null ) { - return typeConfiguration.getSqlTypeDescriptorRegistry().getDescriptor( explicitSqlTypeAnn.value() ); + return typeConfiguration.getJdbcTypeDescriptorRegistry().getDescriptor( explicitSqlTypeAnn.value() ); } return null; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/AbstractHANADialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/AbstractHANADialect.java index 0bcb8854ee..0e350a6388 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/AbstractHANADialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/AbstractHANADialect.java @@ -55,7 +55,7 @@ import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.DataHelper; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.*; +import org.hibernate.type.descriptor.jdbc.*; import java.io.*; import java.nio.charset.StandardCharsets; @@ -277,7 +277,7 @@ public abstract class AbstractHANADialect extends Dialect { } } - private static class HANAStreamBlobTypeDescriptor implements SqlTypeDescriptor { + private static class HANAStreamBlobTypeDescriptor implements JdbcTypeDescriptor { private static final long serialVersionUID = -2476600722093442047L; @@ -298,7 +298,7 @@ public abstract class AbstractHANADialect extends Dialect { } @Override - public int getSqlType() { + public int getJdbcType() { return Types.BLOB; } @@ -569,7 +569,7 @@ public abstract class AbstractHANADialect extends Dialect { } } - public static class HANABlobTypeDescriptor implements SqlTypeDescriptor { + public static class HANABlobTypeDescriptor implements JdbcTypeDescriptor { private static final long serialVersionUID = 5874441715643764323L; @@ -583,7 +583,7 @@ public abstract class AbstractHANADialect extends Dialect { } @Override - public int getSqlType() { + public int getJdbcType() { return Types.BLOB; } @@ -634,7 +634,7 @@ public abstract class AbstractHANADialect extends Dialect { @Override protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException { - SqlTypeDescriptor descriptor = BlobTypeDescriptor.BLOB_BINDING; + JdbcTypeDescriptor descriptor = BlobTypeDescriptor.BLOB_BINDING; if ( byte[].class.isInstance( value ) ) { // performance shortcut for binding BLOB data in byte[] format descriptor = BlobTypeDescriptor.PRIMITIVE_ARRAY_BINDING; @@ -647,7 +647,7 @@ public abstract class AbstractHANADialect extends Dialect { @Override protected void doBind(CallableStatement st, X value, String name, WrapperOptions options) throws SQLException { - SqlTypeDescriptor descriptor = BlobTypeDescriptor.BLOB_BINDING; + JdbcTypeDescriptor descriptor = BlobTypeDescriptor.BLOB_BINDING; if ( byte[].class.isInstance( value ) ) { // performance shortcut for binding BLOB data in byte[] format descriptor = BlobTypeDescriptor.PRIMITIVE_ARRAY_BINDING; @@ -1002,7 +1002,7 @@ public abstract class AbstractHANADialect extends Dialect { } @Override - protected SqlTypeDescriptor getSqlTypeDescriptorOverride(final int sqlCode) { + protected JdbcTypeDescriptor getSqlTypeDescriptorOverride(final int sqlCode) { switch ( sqlCode ) { case Types.CLOB: return this.clobTypeDescriptor; @@ -1475,7 +1475,7 @@ public abstract class AbstractHANADialect extends Dialect { } } - public SqlTypeDescriptor getBlobTypeDescriptor() { + public JdbcTypeDescriptor getBlobTypeDescriptor() { return this.blobTypeDescriptor; } diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/AbstractTransactSQLDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/AbstractTransactSQLDialect.java index 81430795a1..dc3e42adb3 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/AbstractTransactSQLDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/AbstractTransactSQLDialect.java @@ -24,8 +24,8 @@ import org.hibernate.query.sqm.mutation.internal.idtable.IdTable; import org.hibernate.query.sqm.mutation.internal.idtable.LocalTemporaryTableStrategy; import org.hibernate.query.sqm.mutation.internal.idtable.TempIdTableExporter; import org.hibernate.query.sqm.mutation.spi.SqmMultiTableMutationStrategy; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.spi.SqlTypeDescriptorRegistry; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry; import java.sql.CallableStatement; import java.sql.ResultSet; @@ -68,15 +68,15 @@ abstract class AbstractTransactSQLDialect extends Dialect { } @Override - public SqlTypeDescriptor resolveSqlTypeDescriptor( + public JdbcTypeDescriptor resolveSqlTypeDescriptor( int jdbcTypeCode, int precision, int scale, - SqlTypeDescriptorRegistry sqlTypeDescriptorRegistry) { + JdbcTypeDescriptorRegistry jdbcTypeDescriptorRegistry) { if ( jdbcTypeCode == Types.BIT ) { - return sqlTypeDescriptorRegistry.getDescriptor( Types.BOOLEAN ); + return jdbcTypeDescriptorRegistry.getDescriptor( Types.BOOLEAN ); } - return super.resolveSqlTypeDescriptor( jdbcTypeCode, precision, scale, sqlTypeDescriptorRegistry ); + return super.resolveSqlTypeDescriptor( jdbcTypeCode, precision, scale, jdbcTypeDescriptorRegistry ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/CUBRIDDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/CUBRIDDialect.java index 7111d1a769..8424426fdb 100755 --- a/hibernate-core/src/main/java/org/hibernate/dialect/CUBRIDDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/CUBRIDDialect.java @@ -27,8 +27,8 @@ import org.hibernate.sql.ast.tree.Statement; import org.hibernate.sql.exec.spi.JdbcOperation; import org.hibernate.tool.schema.extract.internal.SequenceInformationExtractorCUBRIDDatabaseImpl; import org.hibernate.tool.schema.extract.spi.SequenceInformationExtractor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.spi.SqlTypeDescriptorRegistry; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry; import java.sql.Types; @@ -104,15 +104,15 @@ public class CUBRIDDialect extends Dialect { } @Override - public SqlTypeDescriptor resolveSqlTypeDescriptor( + public JdbcTypeDescriptor resolveSqlTypeDescriptor( int jdbcTypeCode, int precision, int scale, - SqlTypeDescriptorRegistry sqlTypeDescriptorRegistry) { + JdbcTypeDescriptorRegistry jdbcTypeDescriptorRegistry) { if ( jdbcTypeCode == Types.BIT ) { - return sqlTypeDescriptorRegistry.getDescriptor( Types.BOOLEAN ); + return jdbcTypeDescriptorRegistry.getDescriptor( Types.BOOLEAN ); } - return super.resolveSqlTypeDescriptor( jdbcTypeCode, precision, scale, sqlTypeDescriptorRegistry ); + return super.resolveSqlTypeDescriptor( jdbcTypeCode, precision, scale, jdbcTypeDescriptorRegistry ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/CacheDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/CacheDialect.java index 677db6f49a..ae8edfc161 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/CacheDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/CacheDialect.java @@ -34,8 +34,8 @@ import org.hibernate.sql.ast.spi.StandardSqlAstTranslatorFactory; import org.hibernate.sql.ast.tree.Statement; import org.hibernate.sql.exec.spi.JdbcOperation; import org.hibernate.type.StandardBasicTypes; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.spi.SqlTypeDescriptorRegistry; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry; import java.sql.CallableStatement; import java.sql.ResultSet; @@ -87,15 +87,15 @@ public class CacheDialect extends Dialect { } @Override - public SqlTypeDescriptor resolveSqlTypeDescriptor( + public JdbcTypeDescriptor resolveSqlTypeDescriptor( int jdbcTypeCode, int precision, int scale, - SqlTypeDescriptorRegistry sqlTypeDescriptorRegistry) { + JdbcTypeDescriptorRegistry jdbcTypeDescriptorRegistry) { if ( jdbcTypeCode == Types.BIT ) { - return sqlTypeDescriptorRegistry.getDescriptor( Types.BOOLEAN ); + return jdbcTypeDescriptorRegistry.getDescriptor( Types.BOOLEAN ); } - return super.resolveSqlTypeDescriptor( jdbcTypeCode, precision, scale, sqlTypeDescriptorRegistry ); + return super.resolveSqlTypeDescriptor( jdbcTypeCode, precision, scale, jdbcTypeDescriptorRegistry ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/DB2Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/DB2Dialect.java index 594e9681fc..9ea2334d01 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/DB2Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/DB2Dialect.java @@ -41,7 +41,7 @@ import org.hibernate.tool.schema.extract.internal.SequenceInformationExtractorDB import org.hibernate.tool.schema.extract.internal.SequenceInformationExtractorNoOpImpl; import org.hibernate.tool.schema.extract.spi.SequenceInformationExtractor; import org.hibernate.type.StandardBasicTypes; -import org.hibernate.type.descriptor.sql.*; +import org.hibernate.type.descriptor.jdbc.*; import java.sql.CallableStatement; import java.sql.ResultSet; @@ -520,7 +520,7 @@ public class DB2Dialect extends Dialect { } @Override - protected SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) { + protected JdbcTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) { final int version = getVersion(); if ( version < 1100 && sqlCode == Types.BOOLEAN ) { diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/DerbyDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/DerbyDialect.java index f4a06a9913..f975ce8f1e 100755 --- a/hibernate-core/src/main/java/org/hibernate/dialect/DerbyDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/DerbyDialect.java @@ -52,10 +52,10 @@ import org.hibernate.tool.schema.extract.internal.SequenceInformationExtractorDe import org.hibernate.tool.schema.extract.internal.SequenceInformationExtractorNoOpImpl; import org.hibernate.tool.schema.extract.spi.SequenceInformationExtractor; import org.hibernate.type.StandardBasicTypes; -import org.hibernate.type.descriptor.sql.DecimalTypeDescriptor; -import org.hibernate.type.descriptor.sql.SmallIntTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.TimestampTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.DecimalTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.SmallIntTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.TimestampTypeDescriptor; import java.sql.DatabaseMetaData; import java.sql.SQLException; @@ -487,7 +487,7 @@ public class DerbyDialect extends Dialect { return false; } - protected SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) { + protected JdbcTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) { if ( getVersion() < 1070 && sqlCode == Types.BOOLEAN) { return SmallIntTypeDescriptor.INSTANCE; } diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java index e59949a6a6..84c82d5d24 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java @@ -83,9 +83,9 @@ import org.hibernate.tool.schema.spi.Exporter; import org.hibernate.type.StandardBasicTypes; import org.hibernate.type.Type; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.ClobTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.spi.SqlTypeDescriptorRegistry; +import org.hibernate.type.descriptor.jdbc.ClobTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry; import javax.persistence.TemporalType; import java.io.InputStream; @@ -243,12 +243,12 @@ public abstract class Dialect implements ConversionContext { sizeStrategy = new SizeStrategyImpl(); } - public SqlTypeDescriptor resolveSqlTypeDescriptor( + public JdbcTypeDescriptor resolveSqlTypeDescriptor( int jdbcTypeCode, int precision, int scale, - SqlTypeDescriptorRegistry sqlTypeDescriptorRegistry) { - return sqlTypeDescriptorRegistry.getDescriptor( jdbcTypeCode ); + JdbcTypeDescriptorRegistry jdbcTypeDescriptorRegistry) { + return jdbcTypeDescriptorRegistry.getDescriptor( jdbcTypeCode ); } /** @@ -1018,12 +1018,12 @@ public abstract class Dialect implements ConversionContext { return paren>0 ? result.substring(0, paren) : result; } - public String getRawTypeName(SqlTypeDescriptor sqlTypeDescriptor) throws HibernateException { - return getRawTypeName( sqlTypeDescriptor.getJdbcTypeCode() ); + public String getRawTypeName(JdbcTypeDescriptor jdbcTypeDescriptor) throws HibernateException { + return getRawTypeName( jdbcTypeDescriptor.getJdbcTypeCode() ); } - public String getTypeName(SqlTypeDescriptor sqlTypeDescriptor) throws HibernateException { - return getTypeName( sqlTypeDescriptor.getJdbcTypeCode() ); + public String getTypeName(JdbcTypeDescriptor jdbcTypeDescriptor) throws HibernateException { + return getTypeName( jdbcTypeDescriptor.getJdbcTypeCode() ); } public String getTypeName(int code) throws HibernateException { @@ -1081,14 +1081,14 @@ public abstract class Dialect implements ConversionContext { * Get the name of the database type associated with the given * SqlTypeDescriptor. * - * @param sqlTypeDescriptor the SQL type + * @param jdbcTypeDescriptor the SQL type * @param size the length, precision, scale of the column * * @return the database type name * */ - public String getTypeName(SqlTypeDescriptor sqlTypeDescriptor, Size size) { - return getTypeName( sqlTypeDescriptor.getJdbcTypeCode(), size ); + public String getTypeName(JdbcTypeDescriptor jdbcTypeDescriptor, Size size) { + return getTypeName( jdbcTypeDescriptor.getJdbcTypeCode(), size ); } /** @@ -1103,7 +1103,7 @@ public abstract class Dialect implements ConversionContext { if ( length == null && precision == null ) { //use defaults size = getSizeStrategy().resolveSize( - type.getJdbcMapping().getSqlTypeDescriptor(), + type.getJdbcMapping().getJdbcTypeDescriptor(), type.getJdbcMapping().getJavaTypeDescriptor(), precision, scale, @@ -1122,7 +1122,7 @@ public abstract class Dialect implements ConversionContext { .setScale( scale ); } - return getTypeName( type.getJdbcMapping().getSqlTypeDescriptor(), size ); + return getTypeName( type.getJdbcMapping().getJdbcTypeDescriptor(), size ); } /** @@ -1150,44 +1150,44 @@ public abstract class Dialect implements ConversionContext { } /** - * Allows the dialect to override a {@link SqlTypeDescriptor}. + * Allows the dialect to override a {@link JdbcTypeDescriptor}. *

* If the passed {@code sqlTypeDescriptor} allows itself to be remapped (per - * {@link SqlTypeDescriptor#canBeRemapped()}), then this method uses + * {@link JdbcTypeDescriptor#canBeRemapped()}), then this method uses * {@link #getSqlTypeDescriptorOverride} to get an optional override based on the SQL code returned by - * {@link SqlTypeDescriptor#getJdbcTypeCode()}. + * {@link JdbcTypeDescriptor#getJdbcTypeCode()}. *

* If this dialect does not provide an override or if the {@code sqlTypeDescriptor} does not allow itself to be * remapped, then this method simply returns the original passed {@code sqlTypeDescriptor} * - * @param sqlTypeDescriptor The {@link SqlTypeDescriptor} to override - * @return The {@link SqlTypeDescriptor} that should be used for this dialect; + * @param jdbcTypeDescriptor The {@link JdbcTypeDescriptor} to override + * @return The {@link JdbcTypeDescriptor} that should be used for this dialect; * if there is no override, then original {@code sqlTypeDescriptor} is returned. * @throws IllegalArgumentException if {@code sqlTypeDescriptor} is null. * * @see #getSqlTypeDescriptorOverride */ - public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) { - if ( sqlTypeDescriptor == null ) { + public JdbcTypeDescriptor remapSqlTypeDescriptor(JdbcTypeDescriptor jdbcTypeDescriptor) { + if ( jdbcTypeDescriptor == null ) { throw new IllegalArgumentException( "sqlTypeDescriptor is null" ); } - if ( ! sqlTypeDescriptor.canBeRemapped() ) { - return sqlTypeDescriptor; + if ( ! jdbcTypeDescriptor.canBeRemapped() ) { + return jdbcTypeDescriptor; } - final SqlTypeDescriptor overridden = getSqlTypeDescriptorOverride( sqlTypeDescriptor.getJdbcTypeCode() ); - return overridden == null ? sqlTypeDescriptor : overridden; + final JdbcTypeDescriptor overridden = getSqlTypeDescriptorOverride( jdbcTypeDescriptor.getJdbcTypeCode() ); + return overridden == null ? jdbcTypeDescriptor : overridden; } /** - * Returns the {@link SqlTypeDescriptor} that should be used to handle the given JDBC type code. Returns + * Returns the {@link JdbcTypeDescriptor} that should be used to handle the given JDBC type code. Returns * {@code null} if there is no override. * * @param sqlCode A {@link Types} constant indicating the SQL column type - * @return The {@link SqlTypeDescriptor} to use as an override, or {@code null} if there is no override. + * @return The {@link JdbcTypeDescriptor} to use as an override, or {@code null} if there is no override. */ - protected SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) { - SqlTypeDescriptor descriptor; + protected JdbcTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) { + JdbcTypeDescriptor descriptor; switch ( sqlCode ) { case Types.CLOB: { descriptor = useInputStreamToInsertBlob() ? ClobTypeDescriptor.STREAM_BINDING : null; @@ -3717,12 +3717,12 @@ public abstract class Dialect implements ConversionContext { public interface SizeStrategy { /** * Resolve the {@link Size} to use for columns of the given - * {@link SqlTypeDescriptor SQL type} and {@link JavaTypeDescriptor Java type}. + * {@link JdbcTypeDescriptor SQL type} and {@link JavaTypeDescriptor Java type}. * * @return a non-null {@link Size} */ Size resolveSize( - SqlTypeDescriptor sqlType, + JdbcTypeDescriptor jdbcType, JavaTypeDescriptor javaType, Integer precision, Integer scale, Long length); @@ -3731,13 +3731,13 @@ public abstract class Dialect implements ConversionContext { public class SizeStrategyImpl implements SizeStrategy { @Override public Size resolveSize( - SqlTypeDescriptor sqlType, + JdbcTypeDescriptor jdbcType, JavaTypeDescriptor javaType, Integer precision, Integer scale, Long length) { final Size size = new Size(); - int jdbcTypeCode = sqlType.getJdbcTypeCode(); + int jdbcTypeCode = jdbcType.getJdbcTypeCode(); switch (jdbcTypeCode) { case Types.BIT: diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/FirebirdDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/FirebirdDialect.java index 0666d85737..20d69c151f 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/FirebirdDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/FirebirdDialect.java @@ -50,8 +50,8 @@ import org.hibernate.tool.schema.extract.internal.SequenceInformationExtractorFi import org.hibernate.tool.schema.extract.internal.SequenceNameExtractorImpl; import org.hibernate.tool.schema.extract.spi.SequenceInformationExtractor; import org.hibernate.type.StandardBasicTypes; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.spi.SqlTypeDescriptorRegistry; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry; import java.sql.DatabaseMetaData; import java.sql.SQLException; @@ -162,15 +162,15 @@ public class FirebirdDialect extends Dialect { } @Override - public SqlTypeDescriptor resolveSqlTypeDescriptor( + public JdbcTypeDescriptor resolveSqlTypeDescriptor( int jdbcTypeCode, int precision, int scale, - SqlTypeDescriptorRegistry sqlTypeDescriptorRegistry) { + JdbcTypeDescriptorRegistry jdbcTypeDescriptorRegistry) { if ( jdbcTypeCode == Types.BIT ) { - return sqlTypeDescriptorRegistry.getDescriptor( Types.BOOLEAN ); + return jdbcTypeDescriptorRegistry.getDescriptor( Types.BOOLEAN ); } - return super.resolveSqlTypeDescriptor( jdbcTypeCode, precision, scale, sqlTypeDescriptorRegistry ); + return super.resolveSqlTypeDescriptor( jdbcTypeCode, precision, scale, jdbcTypeDescriptorRegistry ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/IngresDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/IngresDialect.java index a94b6d3f32..e5a31d16fd 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/IngresDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/IngresDialect.java @@ -35,8 +35,8 @@ import org.hibernate.sql.exec.spi.JdbcOperation; import org.hibernate.tool.schema.extract.internal.SequenceNameExtractorImpl; import org.hibernate.tool.schema.extract.spi.SequenceInformationExtractor; import org.hibernate.type.StandardBasicTypes; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.spi.SqlTypeDescriptorRegistry; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry; import java.sql.Types; import javax.persistence.TemporalType; @@ -159,15 +159,15 @@ public class IngresDialect extends Dialect { } @Override - public SqlTypeDescriptor resolveSqlTypeDescriptor( + public JdbcTypeDescriptor resolveSqlTypeDescriptor( int jdbcTypeCode, int precision, int scale, - SqlTypeDescriptorRegistry sqlTypeDescriptorRegistry) { + JdbcTypeDescriptorRegistry jdbcTypeDescriptorRegistry) { if ( jdbcTypeCode == Types.BIT ) { - return sqlTypeDescriptorRegistry.getDescriptor( Types.BOOLEAN ); + return jdbcTypeDescriptorRegistry.getDescriptor( Types.BOOLEAN ); } - return super.resolveSqlTypeDescriptor( jdbcTypeCode, precision, scale, sqlTypeDescriptorRegistry ); + return super.resolveSqlTypeDescriptor( jdbcTypeCode, precision, scale, jdbcTypeDescriptorRegistry ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/MaxDBDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/MaxDBDialect.java index 14516b13ec..9f4a4a2527 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/MaxDBDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/MaxDBDialect.java @@ -29,8 +29,8 @@ import org.hibernate.sql.exec.spi.JdbcOperation; import org.hibernate.tool.schema.extract.internal.SequenceInformationExtractorSAPDBDatabaseImpl; import org.hibernate.tool.schema.extract.spi.SequenceInformationExtractor; import org.hibernate.type.StandardBasicTypes; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.spi.SqlTypeDescriptorRegistry; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry; import java.sql.DatabaseMetaData; import java.sql.Types; @@ -64,19 +64,19 @@ public class MaxDBDialect extends Dialect { } @Override - public SqlTypeDescriptor resolveSqlTypeDescriptor( + public JdbcTypeDescriptor resolveSqlTypeDescriptor( int jdbcTypeCode, int precision, int scale, - SqlTypeDescriptorRegistry sqlTypeDescriptorRegistry) { + JdbcTypeDescriptorRegistry jdbcTypeDescriptorRegistry) { switch ( jdbcTypeCode ) { case Types.NUMERIC: case Types.DECIMAL: if ( precision == 19 && scale == 0 ) { - return sqlTypeDescriptorRegistry.getDescriptor( Types.BIGINT ); + return jdbcTypeDescriptorRegistry.getDescriptor( Types.BIGINT ); } } - return super.resolveSqlTypeDescriptor( jdbcTypeCode, precision, scale, sqlTypeDescriptorRegistry ); + return super.resolveSqlTypeDescriptor( jdbcTypeCode, precision, scale, jdbcTypeDescriptorRegistry ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/MySQLDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/MySQLDialect.java index 85b854c1f9..a616ef4ca0 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/MySQLDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/MySQLDialect.java @@ -48,8 +48,8 @@ import org.hibernate.sql.ast.tree.Statement; import org.hibernate.sql.exec.spi.JdbcOperation; import org.hibernate.type.StandardBasicTypes; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.spi.SqlTypeDescriptorRegistry; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry; import java.sql.CallableStatement; import java.sql.ResultSet; @@ -169,12 +169,12 @@ public class MySQLDialect extends Dialect { sizeStrategy = new SizeStrategyImpl() { @Override public Size resolveSize( - SqlTypeDescriptor sqlType, + JdbcTypeDescriptor jdbcType, JavaTypeDescriptor javaType, Integer precision, Integer scale, Long length) { - final int jdbcTypeCode = sqlType.getSqlType(); + final int jdbcTypeCode = jdbcType.getJdbcType(); switch ( jdbcTypeCode ) { case Types.BIT: // MySQL allows BIT with a length up to 64 @@ -182,7 +182,7 @@ public class MySQLDialect extends Dialect { return Size.length( Math.min( Math.max( length, 1 ), 64 ) ); } } - return super.resolveSize( sqlType, javaType, precision, scale, length ); + return super.resolveSize( jdbcType, javaType, precision, scale, length ); } }; } @@ -208,15 +208,15 @@ public class MySQLDialect extends Dialect { } @Override - public SqlTypeDescriptor resolveSqlTypeDescriptor( + public JdbcTypeDescriptor resolveSqlTypeDescriptor( int jdbcTypeCode, int precision, int scale, - SqlTypeDescriptorRegistry sqlTypeDescriptorRegistry) { + JdbcTypeDescriptorRegistry jdbcTypeDescriptorRegistry) { if ( jdbcTypeCode == Types.BIT ) { - return sqlTypeDescriptorRegistry.getDescriptor( Types.BOOLEAN ); + return jdbcTypeDescriptorRegistry.getDescriptor( Types.BOOLEAN ); } - return super.resolveSqlTypeDescriptor( jdbcTypeCode, precision, scale, sqlTypeDescriptorRegistry ); + return super.resolveSqlTypeDescriptor( jdbcTypeCode, precision, scale, jdbcTypeDescriptorRegistry ); } @Override @@ -575,7 +575,7 @@ public class MySQLDialect extends Dialect { @Override public String getCastTypeName(SqlExpressable type, Long length, Integer precision, Integer scale) { - switch ( type.getJdbcMapping().getSqlTypeDescriptor().getJdbcTypeCode() ) { + switch ( type.getJdbcMapping().getJdbcTypeDescriptor().getJdbcTypeCode() ) { case Types.INTEGER: case Types.BIGINT: case Types.SMALLINT: diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/OracleDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/OracleDialect.java index 00403bcf71..921461bfb9 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/OracleDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/OracleDialect.java @@ -61,11 +61,11 @@ import org.hibernate.type.descriptor.JdbcTypeNameMapper; import org.hibernate.type.descriptor.ValueBinder; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.BasicBinder; -import org.hibernate.type.descriptor.sql.BlobTypeDescriptor; -import org.hibernate.type.descriptor.sql.BooleanTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.spi.SqlTypeDescriptorRegistry; +import org.hibernate.type.descriptor.jdbc.BasicBinder; +import org.hibernate.type.descriptor.jdbc.BlobTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.BooleanTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry; import java.sql.CallableStatement; import java.sql.PreparedStatement; @@ -600,11 +600,11 @@ public class OracleDialect extends Dialect { } @Override - public SqlTypeDescriptor resolveSqlTypeDescriptor( + public JdbcTypeDescriptor resolveSqlTypeDescriptor( int jdbcTypeCode, int precision, int scale, - SqlTypeDescriptorRegistry sqlTypeDescriptorRegistry) { + JdbcTypeDescriptorRegistry jdbcTypeDescriptorRegistry) { // This is the reverse of what registerNumericTypeMappings registers switch ( jdbcTypeCode ) { case Types.NUMERIC: @@ -612,19 +612,19 @@ public class OracleDialect extends Dialect { if ( scale == 0 ) { switch ( precision ) { case 1: - return sqlTypeDescriptorRegistry.getDescriptor( Types.BOOLEAN ); + return jdbcTypeDescriptorRegistry.getDescriptor( Types.BOOLEAN ); case 3: - return sqlTypeDescriptorRegistry.getDescriptor( Types.TINYINT ); + return jdbcTypeDescriptorRegistry.getDescriptor( Types.TINYINT ); case 5: - return sqlTypeDescriptorRegistry.getDescriptor( Types.SMALLINT ); + return jdbcTypeDescriptorRegistry.getDescriptor( Types.SMALLINT ); case 10: - return sqlTypeDescriptorRegistry.getDescriptor( Types.INTEGER ); + return jdbcTypeDescriptorRegistry.getDescriptor( Types.INTEGER ); case 19: - return sqlTypeDescriptorRegistry.getDescriptor( Types.BIGINT ); + return jdbcTypeDescriptorRegistry.getDescriptor( Types.BIGINT ); } } } - return super.resolveSqlTypeDescriptor( jdbcTypeCode, precision, scale, sqlTypeDescriptorRegistry ); + return super.resolveSqlTypeDescriptor( jdbcTypeCode, precision, scale, jdbcTypeDescriptorRegistry ); } /** @@ -654,9 +654,9 @@ public class OracleDialect extends Dialect { BlobTypeDescriptor.PRIMITIVE_ARRAY_BINDING : BlobTypeDescriptor.DEFAULT; - typeContributions.contributeSqlTypeDescriptor( descriptor ); + typeContributions.contributeJdbcTypeDescriptor( descriptor ); } - typeContributions.contributeSqlTypeDescriptor( new OracleBooleanTypeDescriptor() ); + typeContributions.contributeJdbcTypeDescriptor( new OracleBooleanTypeDescriptor() ); } private static final class OracleBooleanTypeDescriptor extends BooleanTypeDescriptor { diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java index 02b06b5b15..ccafdc2508 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java @@ -47,12 +47,13 @@ import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.BasicJavaDescriptor; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.BasicBinder; -import org.hibernate.type.descriptor.sql.BasicExtractor; -import org.hibernate.type.descriptor.sql.BlobTypeDescriptor; -import org.hibernate.type.descriptor.sql.ClobTypeDescriptor; -import org.hibernate.type.descriptor.sql.JdbcLiteralFormatter; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.BasicBinder; +import org.hibernate.type.descriptor.jdbc.BasicExtractor; +import org.hibernate.type.descriptor.jdbc.BlobTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.ClobTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcLiteralFormatter; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry; import org.hibernate.type.spi.TypeConfiguration; import java.sql.*; @@ -327,7 +328,7 @@ public class PostgreSQLDialect extends Dialect { } @Override - public SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) { + public JdbcTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) { // For discussion of BLOB support in Postgres, as of 8.4, have a peek at // http://jdbc.postgresql.org/documentation/84/binary-data.html. // For the effects in regards to Hibernate see http://in.relation.to/15492.lace @@ -822,11 +823,11 @@ public class PostgreSQLDialect extends Dialect { if ( getVersion() >= 820 ) { // HHH-9562 - typeContributions.contributeSqlTypeDescriptor( PostgresUUIDType.INSTANCE ); + typeContributions.contributeJdbcTypeDescriptor( PostgresUUIDType.INSTANCE ); } } - private static class PostgresUUIDType implements SqlTypeDescriptor { + private static class PostgresUUIDType implements JdbcTypeDescriptor { /** * Singleton access */ @@ -837,18 +838,18 @@ public class PostgreSQLDialect extends Dialect { * it reports a lot of its types as {@link java.sql.Types#OTHER}, making that * value useless for distinguishing one SqlTypeDescriptor from another. * So here we define a "magic value" that is a (hopefully no collisions) - * unique key within the {@link org.hibernate.type.descriptor.sql.spi.SqlTypeDescriptorRegistry} + * unique key within the {@link JdbcTypeDescriptorRegistry} */ private static final int JDBC_TYPE_CODE = 3975; @Override - public int getSqlType() { + public int getJdbcType() { return JDBC_TYPE_CODE; } @Override public int getJdbcTypeCode() { - return getSqlType(); + return getJdbcType(); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/RDMSOS2200Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/RDMSOS2200Dialect.java index d528334867..f56face4f6 100755 --- a/hibernate-core/src/main/java/org/hibernate/dialect/RDMSOS2200Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/RDMSOS2200Dialect.java @@ -26,8 +26,8 @@ import org.hibernate.sql.ast.SqlAstTranslatorFactory; import org.hibernate.sql.ast.spi.StandardSqlAstTranslatorFactory; import org.hibernate.sql.ast.tree.Statement; import org.hibernate.sql.exec.spi.JdbcOperation; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.spi.SqlTypeDescriptorRegistry; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry; import org.jboss.logging.Logger; @@ -110,15 +110,15 @@ public class RDMSOS2200Dialect extends Dialect { } @Override - public SqlTypeDescriptor resolveSqlTypeDescriptor( + public JdbcTypeDescriptor resolveSqlTypeDescriptor( int jdbcTypeCode, int precision, int scale, - SqlTypeDescriptorRegistry sqlTypeDescriptorRegistry) { + JdbcTypeDescriptorRegistry jdbcTypeDescriptorRegistry) { if ( jdbcTypeCode == Types.BIT ) { - return sqlTypeDescriptorRegistry.getDescriptor( Types.BOOLEAN ); + return jdbcTypeDescriptorRegistry.getDescriptor( Types.BOOLEAN ); } - return super.resolveSqlTypeDescriptor( jdbcTypeCode, precision, scale, sqlTypeDescriptorRegistry ); + return super.resolveSqlTypeDescriptor( jdbcTypeCode, precision, scale, jdbcTypeDescriptorRegistry ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/SQLServerDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/SQLServerDialect.java index d4937d85a5..c9af94c2c2 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/SQLServerDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/SQLServerDialect.java @@ -33,8 +33,8 @@ import org.hibernate.sql.ast.spi.StandardSqlAstTranslatorFactory; import org.hibernate.sql.ast.tree.Statement; import org.hibernate.sql.exec.spi.JdbcOperation; import org.hibernate.type.StandardBasicTypes; -import org.hibernate.type.descriptor.sql.SmallIntTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.SmallIntTypeDescriptor; import java.sql.Types; import java.util.regex.Pattern; @@ -129,7 +129,7 @@ public class SQLServerDialect extends AbstractTransactSQLDialect { } @Override - protected SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) { + protected JdbcTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) { return sqlCode == Types.TINYINT ? SmallIntTypeDescriptor.INSTANCE : super.getSqlTypeDescriptorOverride( sqlCode ); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/SpannerDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/SpannerDialect.java index ff0de5f8e9..8aee479c55 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/SpannerDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/SpannerDialect.java @@ -788,7 +788,7 @@ public class SpannerDialect extends Dialect { @Override public String getCastTypeName(SqlExpressable type, Long length, Integer precision, Integer scale) { //Spanner doesn't let you specify a length in cast() types - return super.getRawTypeName( type.getJdbcMapping().getSqlTypeDescriptor() ); + return super.getRawTypeName( type.getJdbcMapping().getJdbcTypeDescriptor() ); } /** diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/SybaseASEDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/SybaseASEDialect.java index 4b7d57c58c..87bbb629b6 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/SybaseASEDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/SybaseASEDialect.java @@ -26,8 +26,8 @@ import org.hibernate.sql.ast.SqlAstTranslatorFactory; import org.hibernate.sql.ast.spi.StandardSqlAstTranslatorFactory; import org.hibernate.sql.ast.tree.Statement; import org.hibernate.sql.exec.spi.JdbcOperation; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.TinyIntTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.TinyIntTypeDescriptor; import java.sql.Types; import java.util.Map; @@ -100,7 +100,7 @@ public class SybaseASEDialect extends SybaseDialect { } @Override - protected SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) { + protected JdbcTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) { return sqlCode == Types.BOOLEAN ? TinyIntTypeDescriptor.INSTANCE : super.getSqlTypeDescriptorOverride( sqlCode ); diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/SybaseDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/SybaseDialect.java index 45cbaa2571..f8e5b255b9 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/SybaseDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/SybaseDialect.java @@ -16,10 +16,10 @@ import org.hibernate.sql.ast.SqlAstTranslatorFactory; import org.hibernate.sql.ast.spi.StandardSqlAstTranslatorFactory; import org.hibernate.sql.ast.tree.Statement; import org.hibernate.sql.exec.spi.JdbcOperation; -import org.hibernate.type.descriptor.sql.BlobTypeDescriptor; -import org.hibernate.type.descriptor.sql.ClobTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.spi.SqlTypeDescriptorRegistry; +import org.hibernate.type.descriptor.jdbc.BlobTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.ClobTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry; import java.sql.Types; import javax.persistence.TemporalType; @@ -53,19 +53,19 @@ public class SybaseDialect extends AbstractTransactSQLDialect { } @Override - public SqlTypeDescriptor resolveSqlTypeDescriptor( + public JdbcTypeDescriptor resolveSqlTypeDescriptor( int jdbcTypeCode, int precision, int scale, - SqlTypeDescriptorRegistry sqlTypeDescriptorRegistry) { + JdbcTypeDescriptorRegistry jdbcTypeDescriptorRegistry) { switch ( jdbcTypeCode ) { case Types.NUMERIC: case Types.DECIMAL: if ( precision == 19 && scale == 0 ) { - return sqlTypeDescriptorRegistry.getDescriptor( Types.BIGINT ); + return jdbcTypeDescriptorRegistry.getDescriptor( Types.BIGINT ); } } - return super.resolveSqlTypeDescriptor( jdbcTypeCode, precision, scale, sqlTypeDescriptorRegistry ); + return super.resolveSqlTypeDescriptor( jdbcTypeCode, precision, scale, jdbcTypeDescriptorRegistry ); } @Override @@ -90,7 +90,7 @@ public class SybaseDialect extends AbstractTransactSQLDialect { } @Override - protected SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) { + protected JdbcTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) { switch (sqlCode) { case Types.BLOB: return BlobTypeDescriptor.PRIMITIVE_ARRAY_BINDING; diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/TeradataDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/TeradataDialect.java index 0260bb68c7..2a812eb37d 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/TeradataDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/TeradataDialect.java @@ -43,8 +43,8 @@ import org.hibernate.sql.exec.spi.JdbcOperation; import org.hibernate.tool.schema.internal.StandardIndexExporter; import org.hibernate.tool.schema.spi.Exporter; import org.hibernate.type.StandardBasicTypes; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.spi.SqlTypeDescriptorRegistry; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry; import java.sql.CallableStatement; import java.sql.ResultSet; @@ -123,21 +123,21 @@ public class TeradataDialect extends Dialect { } @Override - public SqlTypeDescriptor resolveSqlTypeDescriptor( + public JdbcTypeDescriptor resolveSqlTypeDescriptor( int jdbcTypeCode, int precision, int scale, - SqlTypeDescriptorRegistry sqlTypeDescriptorRegistry) { + JdbcTypeDescriptorRegistry jdbcTypeDescriptorRegistry) { switch ( jdbcTypeCode ) { case Types.BIT: - return sqlTypeDescriptorRegistry.getDescriptor( Types.BOOLEAN ); + return jdbcTypeDescriptorRegistry.getDescriptor( Types.BOOLEAN ); case Types.NUMERIC: case Types.DECIMAL: if ( precision == 19 && scale == 0 ) { - return sqlTypeDescriptorRegistry.getDescriptor( Types.BIGINT ); + return jdbcTypeDescriptorRegistry.getDescriptor( Types.BIGINT ); } } - return super.resolveSqlTypeDescriptor( jdbcTypeCode, precision, scale, sqlTypeDescriptorRegistry ); + return super.resolveSqlTypeDescriptor( jdbcTypeCode, precision, scale, jdbcTypeDescriptorRegistry ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/TimesTenDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/TimesTenDialect.java index cb300525dc..f932ba0d9a 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/TimesTenDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/TimesTenDialect.java @@ -33,8 +33,8 @@ import org.hibernate.sql.exec.spi.JdbcOperation; import org.hibernate.tool.schema.extract.internal.SequenceInformationExtractorTimesTenDatabaseImpl; import org.hibernate.tool.schema.extract.spi.SequenceInformationExtractor; import org.hibernate.type.StandardBasicTypes; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.spi.SqlTypeDescriptorRegistry; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry; import java.sql.Types; import javax.persistence.TemporalType; @@ -98,15 +98,15 @@ public class TimesTenDialect extends Dialect { } @Override - public SqlTypeDescriptor resolveSqlTypeDescriptor( + public JdbcTypeDescriptor resolveSqlTypeDescriptor( int jdbcTypeCode, int precision, int scale, - SqlTypeDescriptorRegistry sqlTypeDescriptorRegistry) { + JdbcTypeDescriptorRegistry jdbcTypeDescriptorRegistry) { if ( jdbcTypeCode == Types.BIT ) { - return sqlTypeDescriptorRegistry.getDescriptor( Types.BOOLEAN ); + return jdbcTypeDescriptorRegistry.getDescriptor( Types.BOOLEAN ); } - return super.resolveSqlTypeDescriptor( jdbcTypeCode, precision, scale, sqlTypeDescriptorRegistry ); + return super.resolveSqlTypeDescriptor( jdbcTypeCode, precision, scale, jdbcTypeDescriptorRegistry ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/engine/spi/AbstractDelegatingWrapperOptions.java b/hibernate-core/src/main/java/org/hibernate/engine/spi/AbstractDelegatingWrapperOptions.java index 4bc92b674a..ff3efe387a 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/spi/AbstractDelegatingWrapperOptions.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/spi/AbstractDelegatingWrapperOptions.java @@ -10,7 +10,7 @@ import java.util.TimeZone; import org.hibernate.engine.jdbc.LobCreator; import org.hibernate.type.descriptor.WrapperOptions; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; /** * @author Christian Beikov @@ -34,8 +34,8 @@ public abstract class AbstractDelegatingWrapperOptions implements WrapperOptions } @Override - public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) { - return delegate().remapSqlTypeDescriptor( sqlTypeDescriptor ); + public JdbcTypeDescriptor remapSqlTypeDescriptor(JdbcTypeDescriptor jdbcTypeDescriptor) { + return delegate().remapSqlTypeDescriptor( jdbcTypeDescriptor ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/engine/spi/SessionDelegatorBaseImpl.java b/hibernate-core/src/main/java/org/hibernate/engine/spi/SessionDelegatorBaseImpl.java index 07f2e2e38f..2eeb7e1bdb 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/spi/SessionDelegatorBaseImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/spi/SessionDelegatorBaseImpl.java @@ -60,7 +60,7 @@ import org.hibernate.query.sql.spi.NativeQueryImplementor; import org.hibernate.resource.jdbc.spi.JdbcSessionContext; import org.hibernate.resource.transaction.spi.TransactionCoordinator; import org.hibernate.stat.SessionStatistics; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; /** * This class is meant to be extended. @@ -1101,8 +1101,8 @@ public class SessionDelegatorBaseImpl implements SessionImplementor { } @Override - public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) { - return delegate.remapSqlTypeDescriptor( sqlTypeDescriptor ); + public JdbcTypeDescriptor remapSqlTypeDescriptor(JdbcTypeDescriptor jdbcTypeDescriptor) { + return delegate.remapSqlTypeDescriptor( jdbcTypeDescriptor ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/internal/AbstractSharedSessionContract.java b/hibernate-core/src/main/java/org/hibernate/internal/AbstractSharedSessionContract.java index 6cf9618f82..d7c11adfda 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/AbstractSharedSessionContract.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/AbstractSharedSessionContract.java @@ -26,7 +26,6 @@ import org.hibernate.FlushMode; import org.hibernate.Hibernate; import org.hibernate.HibernateException; import org.hibernate.Interceptor; -import org.hibernate.LockMode; import org.hibernate.MultiTenancyStrategy; import org.hibernate.NotYetImplementedFor6Exception; import org.hibernate.SessionEventListener; @@ -81,7 +80,7 @@ import org.hibernate.resource.jdbc.spi.StatementInspector; import org.hibernate.resource.transaction.backend.jta.internal.JtaTransactionCoordinatorImpl; import org.hibernate.resource.transaction.spi.TransactionCoordinator; import org.hibernate.resource.transaction.spi.TransactionCoordinatorBuilder; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; /** * Base class for SharedSessionContract/SharedSessionContractImplementor @@ -581,8 +580,8 @@ public abstract class AbstractSharedSessionContract implements SharedSessionCont } @Override - public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) { - return fastSessionServices.remapSqlTypeDescriptor( sqlTypeDescriptor ); + public JdbcTypeDescriptor remapSqlTypeDescriptor(JdbcTypeDescriptor jdbcTypeDescriptor) { + return fastSessionServices.remapSqlTypeDescriptor( jdbcTypeDescriptor ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/internal/FastSessionServices.java b/hibernate-core/src/main/java/org/hibernate/internal/FastSessionServices.java index 9abb00d3c9..21b7228814 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/FastSessionServices.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/FastSessionServices.java @@ -66,7 +66,7 @@ import org.hibernate.jpa.internal.util.ConfigurationHelper; import org.hibernate.jpa.internal.util.LockOptionsHelper; import org.hibernate.resource.transaction.spi.TransactionCoordinatorBuilder; import org.hibernate.service.spi.ServiceRegistryImplementor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; import static org.hibernate.cfg.AvailableSettings.JPA_LOCK_SCOPE; import static org.hibernate.cfg.AvailableSettings.JPA_LOCK_TIMEOUT; @@ -248,13 +248,13 @@ public final class FastSessionServices { return elr.getEventListenerGroup( type ); } - public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) { - if ( !sqlTypeDescriptor.canBeRemapped() ) { - return sqlTypeDescriptor; + public JdbcTypeDescriptor remapSqlTypeDescriptor(JdbcTypeDescriptor jdbcTypeDescriptor) { + if ( !jdbcTypeDescriptor.canBeRemapped() ) { + return jdbcTypeDescriptor; } - final SqlTypeDescriptor remapped = dialect.remapSqlTypeDescriptor( sqlTypeDescriptor ); - return remapped == null ? sqlTypeDescriptor : remapped; + final JdbcTypeDescriptor remapped = dialect.remapSqlTypeDescriptor( jdbcTypeDescriptor ); + return remapped == null ? jdbcTypeDescriptor : remapped; } private static boolean isTransactionAccessible(SessionFactoryImpl sf, TransactionCoordinatorBuilder transactionCoordinatorBuilder) { diff --git a/hibernate-core/src/main/java/org/hibernate/mapping/BasicValue.java b/hibernate-core/src/main/java/org/hibernate/mapping/BasicValue.java index d21feba3d5..7f17a57fcf 100644 --- a/hibernate-core/src/main/java/org/hibernate/mapping/BasicValue.java +++ b/hibernate-core/src/main/java/org/hibernate/mapping/BasicValue.java @@ -44,15 +44,15 @@ import org.hibernate.type.descriptor.java.EnumJavaTypeDescriptor; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; import org.hibernate.type.descriptor.java.MutabilityPlan; import org.hibernate.type.descriptor.java.TemporalJavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; import org.hibernate.type.spi.TypeConfiguration; /** * @author Steve Ebersole */ @SuppressWarnings({"unchecked", "rawtypes"}) -public class BasicValue extends SimpleValue implements SqlTypeDescriptorIndicators, Resolvable { +public class BasicValue extends SimpleValue implements JdbcTypeDescriptorIndicators, Resolvable { private static final CoreMessageLogger log = CoreLogging.messageLogger( BasicValue.class ); private final TypeConfiguration typeConfiguration; @@ -65,7 +65,7 @@ public class BasicValue extends SimpleValue implements SqlTypeDescriptorIndicato private Map explicitLocalTypeParams; private Function explicitJavaTypeAccess; - private Function explicitSqlTypeAccess; + private Function explicitSqlTypeAccess; private Function explicitMutabilityPlanAccess; private Function implicitJavaTypeAccess; @@ -132,7 +132,7 @@ public class BasicValue extends SimpleValue implements SqlTypeDescriptorIndicato this.explicitJavaTypeAccess = explicitJavaTypeAccess; } - public void setExplicitSqlTypeAccess(Function sqlTypeAccess) { + public void setExplicitSqlTypeAccess(Function sqlTypeAccess) { this.explicitSqlTypeAccess = sqlTypeAccess; } @@ -255,7 +255,7 @@ public class BasicValue extends SimpleValue implements SqlTypeDescriptorIndicato if ( column instanceof Column && resolution.getValueConverter() == null ) { final Column physicalColumn = (Column) column; if ( physicalColumn.getSqlTypeCode() == null ) { - physicalColumn.setSqlTypeCode( resolution.getRelationalSqlTypeDescriptor().getJdbcTypeCode() ); + physicalColumn.setSqlTypeCode( resolution.getJdbcTypeDescriptor().getJdbcTypeCode() ); } final BasicType basicType = resolution.getLegacyResolvedBasicType(); @@ -265,7 +265,7 @@ public class BasicValue extends SimpleValue implements SqlTypeDescriptorIndicato physicalColumn.setCheckConstraint( basicType.getJavaTypeDescriptor().getCheckCondition( physicalColumn.getQuotedName( dialect ), - basicType.getSqlTypeDescriptor(), + basicType.getJdbcTypeDescriptor(), dialect ) ); @@ -443,11 +443,11 @@ public class BasicValue extends SimpleValue implements SqlTypeDescriptorIndicato EnumType enumerationStyle, Function implicitJavaTypeAccess, Function explicitJtdAccess, - Function explicitStdAccess, + Function explicitStdAccess, Function explicitMutabilityPlanAccess, ConverterDescriptor converterDescriptor, Map localTypeParams, - SqlTypeDescriptorIndicators stdIndicators, + JdbcTypeDescriptorIndicators stdIndicators, TypeConfiguration typeConfiguration, MetadataBuildingContext context) { @@ -666,7 +666,7 @@ public class BasicValue extends SimpleValue implements SqlTypeDescriptorIndicato * The JavaTypeDescriptor for the relational value as part of * the relational model (its JDBC representation) */ - SqlTypeDescriptor getRelationalSqlTypeDescriptor(); + JdbcTypeDescriptor getJdbcTypeDescriptor(); /** * Converter, if any, to convert values between the diff --git a/hibernate-core/src/main/java/org/hibernate/mapping/Column.java b/hibernate-core/src/main/java/org/hibernate/mapping/Column.java index e4218dec8f..ae6ad4fd1f 100644 --- a/hibernate-core/src/main/java/org/hibernate/mapping/Column.java +++ b/hibernate-core/src/main/java/org/hibernate/mapping/Column.java @@ -268,7 +268,7 @@ public class Column implements Selectable, Serializable, Cloneable { type = getTypeForComponentValue( mapping, type, getTypeIndex() ); } return dialect.getSizeStrategy().resolveSize( - ( (JdbcMapping) type ).getSqlTypeDescriptor(), + ( (JdbcMapping) type ).getJdbcTypeDescriptor(), ( (JdbcMapping) type ).getJavaTypeDescriptor(), precision, scale, 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 8632c696a1..31efe455ba 100644 --- a/hibernate-core/src/main/java/org/hibernate/mapping/SimpleValue.java +++ b/hibernate-core/src/main/java/org/hibernate/mapping/SimpleValue.java @@ -47,12 +47,12 @@ import org.hibernate.resource.beans.spi.ManagedBeanRegistry; import org.hibernate.service.ServiceRegistry; import org.hibernate.type.Type; import org.hibernate.type.descriptor.JdbcTypeNameMapper; -import org.hibernate.type.descriptor.converter.AttributeConverterSqlTypeDescriptorAdapter; +import org.hibernate.type.descriptor.converter.AttributeConverterJdbcTypeDescriptorAdapter; import org.hibernate.type.descriptor.converter.AttributeConverterTypeAdapter; import org.hibernate.type.descriptor.java.BasicJavaDescriptor; -import org.hibernate.type.descriptor.sql.LobTypeMappings; -import org.hibernate.type.descriptor.sql.NationalizedTypeMappings; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.LobTypeMappings; +import org.hibernate.type.descriptor.jdbc.NationalizedTypeMappings; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; import org.hibernate.type.spi.TypeConfiguration; import org.hibernate.usertype.DynamicParameterizedType; @@ -627,11 +627,11 @@ public abstract class SimpleValue implements KeyValue { // corresponding to the AttributeConverter's declared "databaseColumnJavaType" (how we read that value out // of ResultSets). See JdbcTypeJavaClassMappings for details. Again, given example, this should return // VARCHAR/CHAR - final SqlTypeDescriptor recommendedSqlType = jpaAttributeConverter.getRelationalJavaTypeDescriptor().getJdbcRecommendedSqlType( + final JdbcTypeDescriptor recommendedJdbcType = jpaAttributeConverter.getRelationalJavaTypeDescriptor().getRecommendedJdbcType( // todo (6.0) : handle the other JdbcRecommendedSqlTypeMappingContext methods metadata::getTypeConfiguration ); - int jdbcTypeCode = recommendedSqlType.getSqlType(); + int jdbcTypeCode = recommendedJdbcType.getJdbcType(); if ( isLob() ) { if ( LobTypeMappings.isMappedToKnownLobCode( jdbcTypeCode ) ) { jdbcTypeCode = LobTypeMappings.getLobCodeTypeMapping( jdbcTypeCode ); @@ -657,7 +657,7 @@ public abstract class SimpleValue implements KeyValue { } // find the standard SqlTypeDescriptor for that JDBC type code (allow it to be remapped if needed!) - final SqlTypeDescriptor sqlTypeDescriptor = getMetadata() + final JdbcTypeDescriptor jdbcTypeDescriptor = getMetadata() .getMetadataBuildingOptions() .getServiceRegistry() .getService( JdbcServices.class ) @@ -665,14 +665,14 @@ public abstract class SimpleValue implements KeyValue { .getDialect() .remapSqlTypeDescriptor( metadata.getTypeConfiguration() - .getSqlTypeDescriptorRegistry() + .getJdbcTypeDescriptorRegistry() .getDescriptor( jdbcTypeCode ) ); // and finally construct the adapter, which injects the AttributeConverter calls into the binding/extraction // process... - final SqlTypeDescriptor sqlTypeDescriptorAdapter = new AttributeConverterSqlTypeDescriptorAdapter( + final JdbcTypeDescriptor jdbcTypeDescriptorAdapter = new AttributeConverterJdbcTypeDescriptorAdapter( jpaAttributeConverter, - sqlTypeDescriptor, + jdbcTypeDescriptor, jpaAttributeConverter.getRelationalJavaTypeDescriptor() ); @@ -688,7 +688,7 @@ public abstract class SimpleValue implements KeyValue { name, description, jpaAttributeConverter, - sqlTypeDescriptorAdapter, + jdbcTypeDescriptorAdapter, jpaAttributeConverter.getRelationalJavaTypeDescriptor(), jpaAttributeConverter.getDomainJavaTypeDescriptor(), null diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/JdbcMapping.java b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/JdbcMapping.java index d165bd910b..a4c31000c8 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/JdbcMapping.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/JdbcMapping.java @@ -10,7 +10,7 @@ import org.hibernate.query.CastType; import org.hibernate.type.descriptor.ValueBinder; import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; /** * Models the type of a thing that can be used as an expression in a SQL query @@ -28,10 +28,10 @@ public interface JdbcMapping extends MappingType { * The descriptor for the SQL type represented by this * expressable type */ - SqlTypeDescriptor getSqlTypeDescriptor(); + JdbcTypeDescriptor getJdbcTypeDescriptor(); default CastType getCastType() { - return getSqlTypeDescriptor().getCastType(); + return getJdbcTypeDescriptor().getCastType(); } /** diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/MappingModelCreationHelper.java b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/MappingModelCreationHelper.java index 2cb43f2287..9b7d24bfb2 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/MappingModelCreationHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/MappingModelCreationHelper.java @@ -370,7 +370,7 @@ public class MappingModelCreationHelper { .getBasicTypeRegistry() .resolve( valueConverter.getRelationalJavaDescriptor(), - resolution.getRelationalSqlTypeDescriptor() + resolution.getJdbcTypeDescriptor() ); diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/model/convert/internal/NamedEnumValueConverter.java b/hibernate-core/src/main/java/org/hibernate/metamodel/model/convert/internal/NamedEnumValueConverter.java index 85c31075b5..de7a01f30d 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/model/convert/internal/NamedEnumValueConverter.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/model/convert/internal/NamedEnumValueConverter.java @@ -11,7 +11,6 @@ import java.io.ObjectInputStream; import java.io.Serializable; import java.sql.PreparedStatement; import java.sql.SQLException; -import java.sql.Types; import java.util.Locale; import org.hibernate.engine.spi.SharedSessionContractImplementor; @@ -20,7 +19,7 @@ import org.hibernate.type.descriptor.ValueBinder; import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.java.EnumJavaTypeDescriptor; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; /** * BasicValueConverter handling the conversion of an enum based on @@ -30,7 +29,7 @@ import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; */ public class NamedEnumValueConverter> implements EnumValueConverter, Serializable { private final EnumJavaTypeDescriptor domainTypeDescriptor; - private final SqlTypeDescriptor sqlTypeDescriptor; + private final JdbcTypeDescriptor jdbcTypeDescriptor; private final JavaTypeDescriptor relationalTypeDescriptor; private transient ValueExtractor valueExtractor; @@ -38,14 +37,14 @@ public class NamedEnumValueConverter> implements EnumValueConv public NamedEnumValueConverter( EnumJavaTypeDescriptor domainTypeDescriptor, - SqlTypeDescriptor sqlTypeDescriptor, + JdbcTypeDescriptor jdbcTypeDescriptor, JavaTypeDescriptor relationalTypeDescriptor) { this.domainTypeDescriptor = domainTypeDescriptor; - this.sqlTypeDescriptor = sqlTypeDescriptor; + this.jdbcTypeDescriptor = jdbcTypeDescriptor; this.relationalTypeDescriptor = relationalTypeDescriptor; - this.valueExtractor = sqlTypeDescriptor.getExtractor( relationalTypeDescriptor ); - this.valueBinder = sqlTypeDescriptor.getBinder( relationalTypeDescriptor ); + this.valueExtractor = jdbcTypeDescriptor.getExtractor( relationalTypeDescriptor ); + this.valueBinder = jdbcTypeDescriptor.getBinder( relationalTypeDescriptor ); } @Override @@ -70,7 +69,7 @@ public class NamedEnumValueConverter> implements EnumValueConv @Override public int getJdbcTypeCode() { - return sqlTypeDescriptor.getJdbcTypeCode(); + return jdbcTypeDescriptor.getJdbcTypeCode(); } @Override @@ -82,8 +81,8 @@ public class NamedEnumValueConverter> implements EnumValueConv private void readObject(ObjectInputStream stream) throws ClassNotFoundException, IOException { stream.defaultReadObject(); - this.valueExtractor = sqlTypeDescriptor.getExtractor( relationalTypeDescriptor ); - this.valueBinder = sqlTypeDescriptor.getBinder( relationalTypeDescriptor ); + this.valueExtractor = jdbcTypeDescriptor.getExtractor( relationalTypeDescriptor ); + this.valueBinder = jdbcTypeDescriptor.getBinder( relationalTypeDescriptor ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/model/convert/internal/OrdinalEnumValueConverter.java b/hibernate-core/src/main/java/org/hibernate/metamodel/model/convert/internal/OrdinalEnumValueConverter.java index d825b3380c..4af913d08e 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/model/convert/internal/OrdinalEnumValueConverter.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/model/convert/internal/OrdinalEnumValueConverter.java @@ -19,7 +19,7 @@ import org.hibernate.type.descriptor.ValueBinder; import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.java.EnumJavaTypeDescriptor; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; /** * BasicValueConverter handling the conversion of an enum based on @@ -30,7 +30,7 @@ import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; public class OrdinalEnumValueConverter> implements EnumValueConverter, Serializable { private final EnumJavaTypeDescriptor enumJavaDescriptor; - private final SqlTypeDescriptor sqlTypeDescriptor; + private final JdbcTypeDescriptor jdbcTypeDescriptor; private final JavaTypeDescriptor relationalJavaDescriptor; private transient ValueExtractor valueExtractor; @@ -38,14 +38,14 @@ public class OrdinalEnumValueConverter> implements EnumValueCo public OrdinalEnumValueConverter( EnumJavaTypeDescriptor enumJavaDescriptor, - SqlTypeDescriptor sqlTypeDescriptor, + JdbcTypeDescriptor jdbcTypeDescriptor, JavaTypeDescriptor relationalJavaDescriptor) { this.enumJavaDescriptor = enumJavaDescriptor; - this.sqlTypeDescriptor = sqlTypeDescriptor; + this.jdbcTypeDescriptor = jdbcTypeDescriptor; this.relationalJavaDescriptor = relationalJavaDescriptor; - this.valueExtractor = sqlTypeDescriptor.getExtractor( relationalJavaDescriptor ); - this.valueBinder = sqlTypeDescriptor.getBinder( relationalJavaDescriptor ); + this.valueExtractor = jdbcTypeDescriptor.getExtractor( relationalJavaDescriptor ); + this.valueBinder = jdbcTypeDescriptor.getBinder( relationalJavaDescriptor ); } @Override @@ -85,8 +85,8 @@ public class OrdinalEnumValueConverter> implements EnumValueCo private void readObject(ObjectInputStream stream) throws ClassNotFoundException, IOException { stream.defaultReadObject(); - this.valueExtractor = sqlTypeDescriptor.getExtractor( relationalJavaDescriptor ); - this.valueBinder = sqlTypeDescriptor.getBinder( relationalJavaDescriptor ); + this.valueExtractor = jdbcTypeDescriptor.getExtractor( relationalJavaDescriptor ); + this.valueBinder = jdbcTypeDescriptor.getBinder( relationalJavaDescriptor ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/model/domain/AllowableOutputParameterType.java b/hibernate-core/src/main/java/org/hibernate/metamodel/model/domain/AllowableOutputParameterType.java index b28f71ea0d..0f51c91c9d 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/model/domain/AllowableOutputParameterType.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/model/domain/AllowableOutputParameterType.java @@ -10,13 +10,13 @@ import java.sql.CallableStatement; import java.sql.SQLException; import org.hibernate.engine.spi.SharedSessionContractImplementor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; /** * Specialization of DomainType for types that can be used as a * parameter output for a {@link org.hibernate.procedure.ProcedureCall} * - * @apiNote We assume a type that maps to exactly one SQL value, hence {@link #getSqlTypeDescriptor()} + * @apiNote We assume a type that maps to exactly one SQL value, hence {@link #getJdbcTypeDescriptor()} * * @author Steve Ebersole */ @@ -31,7 +31,7 @@ public interface AllowableOutputParameterType extends AllowableParameterType< /** * Descriptor for the SQL type mapped by this type. */ - SqlTypeDescriptor getSqlTypeDescriptor(); + JdbcTypeDescriptor getJdbcTypeDescriptor(); /** * Perform the extraction diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/model/domain/internal/BasicTypeImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/model/domain/internal/BasicTypeImpl.java index 2d789512e6..ce198c3e45 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/model/domain/internal/BasicTypeImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/model/domain/internal/BasicTypeImpl.java @@ -14,7 +14,7 @@ import org.hibernate.NotYetImplementedFor6Exception; import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.metamodel.model.domain.BasicDomainType; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; /** * @author Emmanuel Bernard @@ -45,7 +45,7 @@ public class BasicTypeImpl implements BasicDomainType, Serializable { } @Override - public SqlTypeDescriptor getSqlTypeDescriptor() { + public JdbcTypeDescriptor getJdbcTypeDescriptor() { throw new NotYetImplementedFor6Exception( getClass() ); } diff --git a/hibernate-core/src/main/java/org/hibernate/procedure/internal/FunctionReturnImpl.java b/hibernate-core/src/main/java/org/hibernate/procedure/internal/FunctionReturnImpl.java index 131dc850ea..1e4d2e6a54 100644 --- a/hibernate-core/src/main/java/org/hibernate/procedure/internal/FunctionReturnImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/procedure/internal/FunctionReturnImpl.java @@ -32,7 +32,7 @@ public class FunctionReturnImpl implements FunctionReturnImplementor { public FunctionReturnImpl(ProcedureCallImplementor procedureCall, AllowableOutputParameterType ormType) { this.procedureCall = procedureCall; - this.jdbcTypeCode = ormType.getSqlTypeDescriptor().getSqlType(); + this.jdbcTypeCode = ormType.getJdbcTypeDescriptor().getJdbcType(); this.ormType = ormType; } diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/idtable/TempIdTableExporter.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/idtable/TempIdTableExporter.java index eb5b6ca936..dfa7d7249f 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/idtable/TempIdTableExporter.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/idtable/TempIdTableExporter.java @@ -57,7 +57,7 @@ public class TempIdTableExporter implements IdTableExporter { } buffer.append( column.getColumnName() ).append( ' ' ); - final int sqlTypeCode = column.getJdbcMapping().getSqlTypeDescriptor().getSqlType(); + final int sqlTypeCode = column.getJdbcMapping().getJdbcTypeDescriptor().getJdbcType(); final String databaseTypeName = databaseTypeNameResolver.apply( sqlTypeCode ); buffer.append( " " ).append( databaseTypeName ).append( " " ); diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/produce/function/StandardFunctionReturnTypeResolvers.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/produce/function/StandardFunctionReturnTypeResolvers.java index 874be2bf35..63ca55badb 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/produce/function/StandardFunctionReturnTypeResolvers.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/produce/function/StandardFunctionReturnTypeResolvers.java @@ -137,8 +137,8 @@ public class StandardFunctionReturnTypeResolvers { //that is determined by how the function is used in the HQL query. In essence //the types are compatible if the map to the same JDBC type, of if they are //both numeric types. - int impliedTypeCode = ((BasicType) implied).getJdbcMapping().getSqlTypeDescriptor().getJdbcTypeCode(); - int definedTypeCode = ((BasicType) defined).getJdbcMapping().getSqlTypeDescriptor().getJdbcTypeCode(); + int impliedTypeCode = ((BasicType) implied).getJdbcMapping().getJdbcTypeDescriptor().getJdbcTypeCode(); + int definedTypeCode = ((BasicType) defined).getJdbcMapping().getJdbcTypeDescriptor().getJdbcTypeCode(); return impliedTypeCode == definedTypeCode || isNumeric( impliedTypeCode ) && isNumeric( definedTypeCode ); } @@ -177,8 +177,8 @@ public class StandardFunctionReturnTypeResolvers { //that is determined by how the function is used in the HQL query. In essence //the types are compatible if the map to the same JDBC type, of if they are //both numeric types. - int impliedTypeCode = implied.getJdbcMapping().getSqlTypeDescriptor().getJdbcTypeCode(); - int definedTypeCode = defined.getJdbcMapping().getSqlTypeDescriptor().getJdbcTypeCode(); + int impliedTypeCode = implied.getJdbcMapping().getJdbcTypeDescriptor().getJdbcTypeCode(); + int definedTypeCode = defined.getJdbcMapping().getJdbcTypeDescriptor().getJdbcTypeCode(); return impliedTypeCode == definedTypeCode || isNumeric( impliedTypeCode ) && isNumeric( definedTypeCode ); 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 c5906d6e77..8119660319 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 @@ -275,7 +275,7 @@ import org.hibernate.sql.results.internal.StandardEntityGraphTraversalStateImpl; import org.hibernate.type.BasicType; import org.hibernate.type.StandardBasicTypes; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; import org.hibernate.type.spi.TypeConfiguration; import org.jboss.logging.Logger; @@ -293,7 +293,7 @@ import static org.hibernate.type.spi.TypeConfiguration.isDuration; * @author Steve Ebersole */ public abstract class BaseSqmToSqlAstConverter extends BaseSemanticQueryWalker - implements SqmTranslator, DomainResultCreationState, SqlTypeDescriptorIndicators { + implements SqmTranslator, DomainResultCreationState, JdbcTypeDescriptorIndicators { private static final Logger log = Logger.getLogger( BaseSqmToSqlAstConverter.class ); diff --git a/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/AbstractSqlAstTranslator.java b/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/AbstractSqlAstTranslator.java index 0f402b2f6f..e9a5e8c907 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/AbstractSqlAstTranslator.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/AbstractSqlAstTranslator.java @@ -141,8 +141,8 @@ import org.hibernate.sql.results.jdbc.internal.JdbcValuesMappingProducerStandard import org.hibernate.type.IntegerType; import org.hibernate.type.StringType; import org.hibernate.type.descriptor.WrapperOptions; -import org.hibernate.type.descriptor.sql.JdbcLiteralFormatter; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcLiteralFormatter; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; import static org.hibernate.query.TemporalUnit.NANOSECOND; import static org.hibernate.sql.ast.SqlTreePrinter.logSqlAst; @@ -261,8 +261,8 @@ public abstract class AbstractSqlAstTranslator implemen } @Override - public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) { - return sessionFactory.getFastSessionServices().remapSqlTypeDescriptor( sqlTypeDescriptor ); + public JdbcTypeDescriptor remapSqlTypeDescriptor(JdbcTypeDescriptor jdbcTypeDescriptor) { + return sessionFactory.getFastSessionServices().remapSqlTypeDescriptor( jdbcTypeDescriptor ); } @Override @@ -2442,7 +2442,7 @@ public abstract class AbstractSqlAstTranslator implemen final JdbcMapping jdbcMapping = literal.getJdbcMapping(); final JdbcLiteralFormatter literalFormatter = jdbcMapping - .getSqlTypeDescriptor() + .getJdbcTypeDescriptor() .getJdbcLiteralFormatter( jdbcMapping.getJavaTypeDescriptor() ); // If we encounter a plain literal in the select clause which has no literal formatter, we must render it as parameter @@ -2774,13 +2774,13 @@ public abstract class AbstractSqlAstTranslator implemen final JdbcMapping jdbcMapping = jdbcParameter.getExpressionType().getJdbcMappings().get( 0 ); // We try to avoid inlining parameters if possible which can be done by wrapping the parameter // in an expression that is semantically unnecessary e.g. numeric + 0 or concat with an empty string - if ( jdbcMapping.getSqlTypeDescriptor().isNumber() ) { + if ( jdbcMapping.getJdbcTypeDescriptor().isNumber() ) { appendSql( '(' ); sqlAstNode.accept( this ); appendSql( "+0)" ); break; } - else if ( jdbcMapping.getSqlTypeDescriptor().isString() ) { + else if ( jdbcMapping.getJdbcTypeDescriptor().isString() ) { final SqmFunctionDescriptor sqmFunctionDescriptor = getSessionFactory().getQueryEngine() .getSqmFunctionRegistry() .findFunctionDescriptor( "concat" ); @@ -3253,7 +3253,7 @@ public abstract class AbstractSqlAstTranslator implemen else { assert jdbcParameter.getExpressionType().getJdbcTypeCount() == 1; final JdbcMapping jdbcMapping = jdbcParameter.getExpressionType().getJdbcMappings().get( 0 ); - final JdbcLiteralFormatter literalFormatter = jdbcMapping.getSqlTypeDescriptor().getJdbcLiteralFormatter( jdbcMapping.getJavaTypeDescriptor() ); + final JdbcLiteralFormatter literalFormatter = jdbcMapping.getJdbcTypeDescriptor().getJdbcLiteralFormatter( jdbcMapping.getJavaTypeDescriptor() ); if ( literalFormatter == null ) { throw new IllegalArgumentException( "Can't render parameter as literal, no literal formatter found" ); } diff --git a/hibernate-core/src/main/java/org/hibernate/sql/results/jdbc/internal/ResultSetAccess.java b/hibernate-core/src/main/java/org/hibernate/sql/results/jdbc/internal/ResultSetAccess.java index 42127ecc42..3e417a6870 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/results/jdbc/internal/ResultSetAccess.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/results/jdbc/internal/ResultSetAccess.java @@ -15,7 +15,7 @@ import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.sql.results.jdbc.spi.JdbcValuesMetadata; import org.hibernate.type.BasicType; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; import org.hibernate.type.spi.TypeConfiguration; /** @@ -73,23 +73,23 @@ public interface ResultSetAccess extends JdbcValuesMetadata { try { final TypeConfiguration typeConfiguration = getFactory().getTypeConfiguration(); final ResultSetMetaData metaData = getResultSet().getMetaData(); - final SqlTypeDescriptor sqlTypeDescriptor = jdbcServices.getDialect() + final JdbcTypeDescriptor jdbcTypeDescriptor = jdbcServices.getDialect() .resolveSqlTypeDescriptor( metaData.getColumnType( position ), metaData.getPrecision( position ), metaData.getScale( position ), - typeConfiguration.getSqlTypeDescriptorRegistry() + typeConfiguration.getJdbcTypeDescriptorRegistry() ); final JavaTypeDescriptor javaTypeDescriptor; if ( explicitJavaTypeDescriptor == null ) { - javaTypeDescriptor = sqlTypeDescriptor.getJdbcRecommendedJavaTypeMapping( typeConfiguration ); + javaTypeDescriptor = jdbcTypeDescriptor.getJdbcRecommendedJavaTypeMapping( typeConfiguration ); } else { javaTypeDescriptor = explicitJavaTypeDescriptor; } return typeConfiguration.getBasicTypeRegistry().resolve( javaTypeDescriptor, - sqlTypeDescriptor + jdbcTypeDescriptor ); } catch (SQLException e) { diff --git a/hibernate-core/src/main/java/org/hibernate/sql/results/jdbc/spi/JdbcValuesMetadata.java b/hibernate-core/src/main/java/org/hibernate/sql/results/jdbc/spi/JdbcValuesMetadata.java index d470470e76..d692856c0c 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/results/jdbc/spi/JdbcValuesMetadata.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/results/jdbc/spi/JdbcValuesMetadata.java @@ -8,8 +8,6 @@ package org.hibernate.sql.results.jdbc.spi; import org.hibernate.type.BasicType; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.spi.TypeConfiguration; /** * Access to information about the underlying JDBC values diff --git a/hibernate-core/src/main/java/org/hibernate/type/AbstractSingleColumnStandardBasicType.java b/hibernate-core/src/main/java/org/hibernate/type/AbstractSingleColumnStandardBasicType.java index 0579716c57..c69c5420e5 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/AbstractSingleColumnStandardBasicType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/AbstractSingleColumnStandardBasicType.java @@ -12,7 +12,7 @@ import java.sql.SQLException; import org.hibernate.HibernateException; import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; /** * TODO : javadoc @@ -23,13 +23,13 @@ public abstract class AbstractSingleColumnStandardBasicType extends AbstractStandardBasicType implements SingleColumnType { - public AbstractSingleColumnStandardBasicType(SqlTypeDescriptor sqlTypeDescriptor, JavaTypeDescriptor javaTypeDescriptor) { - super( sqlTypeDescriptor, javaTypeDescriptor ); + public AbstractSingleColumnStandardBasicType(JdbcTypeDescriptor jdbcTypeDescriptor, JavaTypeDescriptor javaTypeDescriptor) { + super( jdbcTypeDescriptor, javaTypeDescriptor ); } @Override public final int sqlType() { - return getSqlTypeDescriptor().getSqlType(); + return getJdbcTypeDescriptor().getJdbcType(); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/type/AbstractStandardBasicType.java b/hibernate-core/src/main/java/org/hibernate/type/AbstractStandardBasicType.java index 748acd9000..acc9407c78 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/AbstractStandardBasicType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/AbstractStandardBasicType.java @@ -28,7 +28,7 @@ import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; import org.hibernate.type.descriptor.java.MutabilityPlan; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; /** * Convenience base class for {@link BasicType} implementations @@ -44,7 +44,7 @@ public abstract class AbstractStandardBasicType // Don't use final here. Need to initialize after-the-fact // by DynamicParameterizedTypes. - private SqlTypeDescriptor sqlTypeDescriptor; + private JdbcTypeDescriptor jdbcTypeDescriptor; private JavaTypeDescriptor javaTypeDescriptor; // sqlTypes need always to be in sync with sqlTypeDescriptor private int[] sqlTypes; @@ -52,13 +52,13 @@ public abstract class AbstractStandardBasicType private ValueBinder jdbcValueBinder; private ValueExtractor jdbcValueExtractor; - public AbstractStandardBasicType(SqlTypeDescriptor sqlTypeDescriptor, JavaTypeDescriptor javaTypeDescriptor) { - this.sqlTypeDescriptor = sqlTypeDescriptor; - this.sqlTypes = new int[] { sqlTypeDescriptor.getSqlType() }; + public AbstractStandardBasicType(JdbcTypeDescriptor jdbcTypeDescriptor, JavaTypeDescriptor javaTypeDescriptor) { + this.jdbcTypeDescriptor = jdbcTypeDescriptor; + this.sqlTypes = new int[] { jdbcTypeDescriptor.getJdbcType() }; this.javaTypeDescriptor = javaTypeDescriptor; - this.jdbcValueBinder = sqlTypeDescriptor.getBinder( javaTypeDescriptor ); - this.jdbcValueExtractor = sqlTypeDescriptor.getExtractor( javaTypeDescriptor ); + this.jdbcValueBinder = jdbcTypeDescriptor.getBinder( javaTypeDescriptor ); + this.jdbcValueExtractor = jdbcTypeDescriptor.getExtractor( javaTypeDescriptor ); } @Override @@ -146,20 +146,20 @@ public abstract class AbstractStandardBasicType public final void setJavaTypeDescriptor( JavaTypeDescriptor javaTypeDescriptor ) { this.javaTypeDescriptor = javaTypeDescriptor; - this.jdbcValueBinder = getSqlTypeDescriptor().getBinder( javaTypeDescriptor ); - this.jdbcValueExtractor = getSqlTypeDescriptor().getExtractor( javaTypeDescriptor ); + this.jdbcValueBinder = getJdbcTypeDescriptor().getBinder( javaTypeDescriptor ); + this.jdbcValueExtractor = getJdbcTypeDescriptor().getExtractor( javaTypeDescriptor ); } - public final SqlTypeDescriptor getSqlTypeDescriptor() { - return sqlTypeDescriptor; + public final JdbcTypeDescriptor getJdbcTypeDescriptor() { + return jdbcTypeDescriptor; } - public final void setSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) { - this.sqlTypeDescriptor = sqlTypeDescriptor; - this.sqlTypes = new int[] { sqlTypeDescriptor.getSqlType() }; + public final void setSqlTypeDescriptor(JdbcTypeDescriptor jdbcTypeDescriptor) { + this.jdbcTypeDescriptor = jdbcTypeDescriptor; + this.sqlTypes = new int[] { jdbcTypeDescriptor.getJdbcType() }; - this.jdbcValueBinder = getSqlTypeDescriptor().getBinder( javaTypeDescriptor ); - this.jdbcValueExtractor = getSqlTypeDescriptor().getExtractor( javaTypeDescriptor ); + this.jdbcValueBinder = getJdbcTypeDescriptor().getBinder( javaTypeDescriptor ); + this.jdbcValueExtractor = getJdbcTypeDescriptor().getExtractor( javaTypeDescriptor ); } @Override @@ -310,8 +310,8 @@ public abstract class AbstractStandardBasicType remapSqlTypeDescriptor( options ).getBinder( javaTypeDescriptor ).bind( st, ( T ) value, index, options ); } - protected SqlTypeDescriptor remapSqlTypeDescriptor(WrapperOptions options) { - return options.remapSqlTypeDescriptor( sqlTypeDescriptor ); + protected JdbcTypeDescriptor remapSqlTypeDescriptor(WrapperOptions options) { + return options.remapSqlTypeDescriptor( jdbcTypeDescriptor ); } public void set(PreparedStatement st, T value, int index, SharedSessionContractImplementor session) throws HibernateException, SQLException { diff --git a/hibernate-core/src/main/java/org/hibernate/type/AdaptedImmutableType.java b/hibernate-core/src/main/java/org/hibernate/type/AdaptedImmutableType.java index b85da74fca..691bfd363d 100755 --- a/hibernate-core/src/main/java/org/hibernate/type/AdaptedImmutableType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/AdaptedImmutableType.java @@ -19,7 +19,7 @@ public class AdaptedImmutableType extends AbstractSingleColumnStandardBasicTy private final AbstractStandardBasicType baseMutableType; public AdaptedImmutableType(AbstractStandardBasicType baseMutableType) { - super( baseMutableType.getSqlTypeDescriptor(), baseMutableType.getJavaTypeDescriptor() ); + super( baseMutableType.getJdbcTypeDescriptor(), baseMutableType.getJavaTypeDescriptor() ); this.baseMutableType = baseMutableType; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/BasicType.java b/hibernate-core/src/main/java/org/hibernate/type/BasicType.java index 568301715d..2a2f235fb1 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/BasicType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/BasicType.java @@ -53,13 +53,13 @@ public interface BasicType extends Type, BasicDomainType, MappingType, Bas @Override default ValueExtractor getJdbcValueExtractor() { //noinspection unchecked - return getSqlTypeDescriptor().getExtractor( getMappedJavaTypeDescriptor() ); + return getJdbcTypeDescriptor().getExtractor( getMappedJavaTypeDescriptor() ); } @Override default ValueBinder getJdbcValueBinder() { //noinspection unchecked - return getSqlTypeDescriptor().getBinder( getMappedJavaTypeDescriptor() ); + return getJdbcTypeDescriptor().getBinder( getMappedJavaTypeDescriptor() ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/type/BasicTypeRegistry.java b/hibernate-core/src/main/java/org/hibernate/type/BasicTypeRegistry.java index 9a3138c4f8..e4c2108bbe 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/BasicTypeRegistry.java +++ b/hibernate-core/src/main/java/org/hibernate/type/BasicTypeRegistry.java @@ -17,7 +17,7 @@ import org.hibernate.internal.CoreMessageLogger; import org.hibernate.internal.util.StringHelper; import org.hibernate.internal.util.collections.CollectionHelper; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; import org.hibernate.type.internal.StandardBasicTypeImpl; import org.hibernate.type.spi.TypeConfiguration; import org.hibernate.usertype.UserType; @@ -32,7 +32,7 @@ public class BasicTypeRegistry implements Serializable { private final TypeConfiguration typeConfiguration; - private final Map, BasicType>> registryValues = new ConcurrentHashMap<>(); + private final Map, BasicType>> registryValues = new ConcurrentHashMap<>(); private boolean primed; private final Map> typesByName = new ConcurrentHashMap<>(); @@ -61,7 +61,7 @@ public class BasicTypeRegistry implements Serializable { * Find an existing BasicType registration for the given JavaTypeDescriptor and * SqlTypeDescriptor combo or create (and register) one. */ - public BasicType resolve(JavaTypeDescriptor jtdToUse, SqlTypeDescriptor stdToUse) { + public BasicType resolve(JavaTypeDescriptor jtdToUse, JdbcTypeDescriptor stdToUse) { //noinspection unchecked return resolve( jtdToUse, @@ -74,7 +74,7 @@ public class BasicTypeRegistry implements Serializable { * Find an existing BasicType registration for the given JavaTypeDescriptor and * SqlTypeDescriptor combo or create (and register) one. */ - public BasicType resolve(JavaTypeDescriptor jtdToUse, SqlTypeDescriptor stdToUse, Supplier> creator) { + public BasicType resolve(JavaTypeDescriptor jtdToUse, JdbcTypeDescriptor stdToUse, Supplier> creator) { final Map, BasicType> typeByJtdForStd = registryValues.computeIfAbsent( stdToUse, sqlTypeDescriptor -> new ConcurrentHashMap<>() @@ -118,7 +118,7 @@ public class BasicTypeRegistry implements Serializable { private void applyOrOverwriteEntry(BasicType type) { final Map, BasicType> mappingsForStdToUse = registryValues.computeIfAbsent( - type.getSqlTypeDescriptor(), + type.getJdbcTypeDescriptor(), sqlTypeDescriptor -> new ConcurrentHashMap<>() ); @@ -126,7 +126,7 @@ public class BasicTypeRegistry implements Serializable { if ( existing != null ) { LOG.debugf( "BasicTypeRegistry registration overwritten (%s + %s); previous =`%s`", - type.getSqlTypeDescriptor().getFriendlyName(), + type.getJdbcTypeDescriptor().getFriendlyName(), type.getJavaTypeDescriptor(), existing ); @@ -184,7 +184,7 @@ public class BasicTypeRegistry implements Serializable { private void primeRegistryEntry(BasicType type) { final Map, BasicType> mappingsForStdToUse = registryValues.computeIfAbsent( - type.getSqlTypeDescriptor(), + type.getJdbcTypeDescriptor(), sqlTypeDescriptor -> new ConcurrentHashMap<>() ); @@ -193,7 +193,7 @@ public class BasicTypeRegistry implements Serializable { if ( existing != null ) { LOG.debugf( "Skipping registration of BasicType (%s + %s); still priming. existing = %s", - type.getSqlTypeDescriptor().getFriendlyName(), + type.getJdbcTypeDescriptor().getFriendlyName(), type.getJavaTypeDescriptor(), existing ); diff --git a/hibernate-core/src/main/java/org/hibernate/type/BigDecimalType.java b/hibernate-core/src/main/java/org/hibernate/type/BigDecimalType.java index 8280eb9d95..f3fe2c0b60 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/BigDecimalType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/BigDecimalType.java @@ -9,7 +9,7 @@ package org.hibernate.type; import java.math.BigDecimal; import org.hibernate.type.descriptor.java.BigDecimalTypeDescriptor; -import org.hibernate.type.descriptor.sql.NumericTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.NumericTypeDescriptor; /** * A type that maps between a {@link java.sql.Types#NUMERIC NUMERIC} and {@link BigDecimal}. diff --git a/hibernate-core/src/main/java/org/hibernate/type/BigIntegerType.java b/hibernate-core/src/main/java/org/hibernate/type/BigIntegerType.java index 114a6aa188..153b0ac1bb 100755 --- a/hibernate-core/src/main/java/org/hibernate/type/BigIntegerType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/BigIntegerType.java @@ -10,7 +10,7 @@ import java.math.BigInteger; import org.hibernate.dialect.Dialect; import org.hibernate.type.descriptor.java.BigIntegerTypeDescriptor; -import org.hibernate.type.descriptor.sql.NumericTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.NumericTypeDescriptor; /** * A type that maps between a {@link java.sql.Types#NUMERIC NUMERIC} and {@link BigInteger}. diff --git a/hibernate-core/src/main/java/org/hibernate/type/BinaryType.java b/hibernate-core/src/main/java/org/hibernate/type/BinaryType.java index 2d06e44420..2158363ddc 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/BinaryType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/BinaryType.java @@ -10,7 +10,7 @@ import java.util.Comparator; import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.type.descriptor.java.PrimitiveByteArrayTypeDescriptor; -import org.hibernate.type.descriptor.sql.VarbinaryTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.VarbinaryTypeDescriptor; /** * A type that maps between a {@link java.sql.Types#VARBINARY VARBINARY} and {@code byte[]} diff --git a/hibernate-core/src/main/java/org/hibernate/type/BlobType.java b/hibernate-core/src/main/java/org/hibernate/type/BlobType.java index b06f42dd47..8628ac6c96 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/BlobType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/BlobType.java @@ -21,7 +21,7 @@ public class BlobType extends AbstractSingleColumnStandardBasicType { public static final BlobType INSTANCE = new BlobType(); public BlobType() { - super( org.hibernate.type.descriptor.sql.BlobTypeDescriptor.DEFAULT, BlobTypeDescriptor.INSTANCE ); + super( org.hibernate.type.descriptor.jdbc.BlobTypeDescriptor.DEFAULT, BlobTypeDescriptor.INSTANCE ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/type/BooleanType.java b/hibernate-core/src/main/java/org/hibernate/type/BooleanType.java index e021b7b550..2b29792e14 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/BooleanType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/BooleanType.java @@ -11,8 +11,8 @@ import java.sql.Types; import org.hibernate.dialect.Dialect; import org.hibernate.type.descriptor.java.BooleanTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; /** * A type that maps between {@link java.sql.Types#BOOLEAN BOOLEAN} and {@link Boolean} @@ -26,11 +26,11 @@ public class BooleanType public static final BooleanType INSTANCE = new BooleanType(); public BooleanType() { - this( org.hibernate.type.descriptor.sql.BooleanTypeDescriptor.INSTANCE, BooleanTypeDescriptor.INSTANCE ); + this( org.hibernate.type.descriptor.jdbc.BooleanTypeDescriptor.INSTANCE, BooleanTypeDescriptor.INSTANCE ); } - protected BooleanType(SqlTypeDescriptor sqlTypeDescriptor, BooleanTypeDescriptor javaTypeDescriptor) { - super( sqlTypeDescriptor, javaTypeDescriptor ); + protected BooleanType(JdbcTypeDescriptor jdbcTypeDescriptor, BooleanTypeDescriptor javaTypeDescriptor) { + super( jdbcTypeDescriptor, javaTypeDescriptor ); } @Override public String getName() { @@ -60,25 +60,25 @@ public class BooleanType } @Override - public BasicType resolveIndicatedType(SqlTypeDescriptorIndicators indicators) { + public BasicType resolveIndicatedType(JdbcTypeDescriptorIndicators indicators) { final int preferredSqlTypeCodeForBoolean = indicators.getPreferredSqlTypeCodeForBoolean(); - final SqlTypeDescriptor sqlTypeDescriptor; + final JdbcTypeDescriptor jdbcTypeDescriptor; // We treat BIT like BOOLEAN because it uses the same JDBC access methods - if ( preferredSqlTypeCodeForBoolean != Types.BIT && preferredSqlTypeCodeForBoolean != getSqlTypeDescriptor().getJdbcTypeCode() ) { - sqlTypeDescriptor = indicators.getTypeConfiguration() - .getSqlTypeDescriptorRegistry() + if ( preferredSqlTypeCodeForBoolean != Types.BIT && preferredSqlTypeCodeForBoolean != getJdbcTypeDescriptor().getJdbcTypeCode() ) { + jdbcTypeDescriptor = indicators.getTypeConfiguration() + .getJdbcTypeDescriptorRegistry() .getDescriptor( preferredSqlTypeCodeForBoolean ); } else { - sqlTypeDescriptor = indicators.getTypeConfiguration() - .getSqlTypeDescriptorRegistry() + jdbcTypeDescriptor = indicators.getTypeConfiguration() + .getJdbcTypeDescriptorRegistry() .getDescriptor( Types.BOOLEAN ); } - if ( sqlTypeDescriptor != getSqlTypeDescriptor() ) { + if ( jdbcTypeDescriptor != getJdbcTypeDescriptor() ) { //noinspection unchecked return (BasicType) indicators.getTypeConfiguration() .getBasicTypeRegistry() - .resolve( getJavaTypeDescriptor(), sqlTypeDescriptor ); + .resolve( getJavaTypeDescriptor(), jdbcTypeDescriptor ); } //noinspection unchecked diff --git a/hibernate-core/src/main/java/org/hibernate/type/ByteType.java b/hibernate-core/src/main/java/org/hibernate/type/ByteType.java index 6305af799c..fb01ebcf6f 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/ByteType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/ByteType.java @@ -12,7 +12,7 @@ import java.util.Comparator; import org.hibernate.dialect.Dialect; import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.type.descriptor.java.ByteTypeDescriptor; -import org.hibernate.type.descriptor.sql.TinyIntTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.TinyIntTypeDescriptor; /** * A type that maps between {@link java.sql.Types#TINYINT TINYINT} and {@link Byte} diff --git a/hibernate-core/src/main/java/org/hibernate/type/CalendarDateType.java b/hibernate-core/src/main/java/org/hibernate/type/CalendarDateType.java index 98896832ca..7947b018ef 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/CalendarDateType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/CalendarDateType.java @@ -13,7 +13,7 @@ import javax.persistence.TemporalType; import org.hibernate.QueryException; import org.hibernate.metamodel.model.domain.AllowableTemporalParameterType; import org.hibernate.type.descriptor.java.CalendarDateTypeDescriptor; -import org.hibernate.type.descriptor.sql.DateTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.DateTypeDescriptor; import org.hibernate.type.spi.TypeConfiguration; /** diff --git a/hibernate-core/src/main/java/org/hibernate/type/CalendarTimeType.java b/hibernate-core/src/main/java/org/hibernate/type/CalendarTimeType.java index e01b698a0f..6b8c986e71 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/CalendarTimeType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/CalendarTimeType.java @@ -13,7 +13,7 @@ import javax.persistence.TemporalType; import org.hibernate.QueryException; import org.hibernate.metamodel.model.domain.AllowableTemporalParameterType; import org.hibernate.type.descriptor.java.CalendarTimeTypeDescriptor; -import org.hibernate.type.descriptor.sql.TimeTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.TimeTypeDescriptor; import org.hibernate.type.spi.TypeConfiguration; /** diff --git a/hibernate-core/src/main/java/org/hibernate/type/CalendarType.java b/hibernate-core/src/main/java/org/hibernate/type/CalendarType.java index 2e068b7117..ad46108bec 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/CalendarType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/CalendarType.java @@ -16,7 +16,7 @@ import org.hibernate.QueryException; import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.metamodel.model.domain.AllowableTemporalParameterType; import org.hibernate.type.descriptor.java.CalendarTypeDescriptor; -import org.hibernate.type.descriptor.sql.TimestampTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.TimestampTypeDescriptor; import org.hibernate.type.spi.TypeConfiguration; /** diff --git a/hibernate-core/src/main/java/org/hibernate/type/CharArrayType.java b/hibernate-core/src/main/java/org/hibernate/type/CharArrayType.java index 2c4666c392..997755300c 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/CharArrayType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/CharArrayType.java @@ -8,9 +8,9 @@ package org.hibernate.type; import java.sql.Types; import org.hibernate.type.descriptor.java.PrimitiveCharacterArrayTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; -import org.hibernate.type.descriptor.sql.VarcharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.VarcharTypeDescriptor; /** * A type that maps between {@link java.sql.Types#VARCHAR VARCHAR} and {@code char[]} @@ -37,15 +37,15 @@ public class CharArrayType } @Override - public BasicType resolveIndicatedType(SqlTypeDescriptorIndicators indicators) { + public BasicType resolveIndicatedType(JdbcTypeDescriptorIndicators indicators) { if ( indicators.isLob() ) { //noinspection unchecked return (BasicType) ( indicators.isNationalized() ? CharacterArrayNClobType.INSTANCE : CharacterArrayClobType.INSTANCE ); } if ( indicators.isNationalized() ) { - final SqlTypeDescriptor nvarcharType = indicators.getTypeConfiguration() - .getSqlTypeDescriptorRegistry() + final JdbcTypeDescriptor nvarcharType = indicators.getTypeConfiguration() + .getJdbcTypeDescriptorRegistry() .getDescriptor( Types.NVARCHAR ); //noinspection unchecked diff --git a/hibernate-core/src/main/java/org/hibernate/type/CharacterArrayClobType.java b/hibernate-core/src/main/java/org/hibernate/type/CharacterArrayClobType.java index f554b6cda5..b0800b55f1 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/CharacterArrayClobType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/CharacterArrayClobType.java @@ -7,8 +7,8 @@ package org.hibernate.type; import org.hibernate.type.descriptor.java.CharacterArrayTypeDescriptor; -import org.hibernate.type.descriptor.sql.ClobTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.ClobTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; /** * A type that maps between {@link java.sql.Types#CLOB CLOB} and {@link Character Character[]} @@ -33,7 +33,7 @@ public class CharacterArrayClobType } @Override - public BasicType resolveIndicatedType(SqlTypeDescriptorIndicators indicators) { + public BasicType resolveIndicatedType(JdbcTypeDescriptorIndicators indicators) { //noinspection unchecked return (BasicType) ( indicators.isNationalized() ? CharacterArrayNClobType.INSTANCE : this ); } diff --git a/hibernate-core/src/main/java/org/hibernate/type/CharacterArrayNClobType.java b/hibernate-core/src/main/java/org/hibernate/type/CharacterArrayNClobType.java index c4d48a80b0..8b66f5ffa4 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/CharacterArrayNClobType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/CharacterArrayNClobType.java @@ -7,7 +7,7 @@ package org.hibernate.type; import org.hibernate.type.descriptor.java.CharacterArrayTypeDescriptor; -import org.hibernate.type.descriptor.sql.NClobTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.NClobTypeDescriptor; /** * A type that maps between {@link java.sql.Types#NCLOB NCLOB} and {@link Character Character[]} diff --git a/hibernate-core/src/main/java/org/hibernate/type/CharacterArrayType.java b/hibernate-core/src/main/java/org/hibernate/type/CharacterArrayType.java index 45db71c7b8..e8375147fe 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/CharacterArrayType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/CharacterArrayType.java @@ -8,9 +8,9 @@ package org.hibernate.type; import java.sql.Types; import org.hibernate.type.descriptor.java.CharacterArrayTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; -import org.hibernate.type.descriptor.sql.VarcharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.VarcharTypeDescriptor; import org.hibernate.type.spi.TypeConfiguration; /** @@ -38,7 +38,7 @@ public class CharacterArrayType } @Override - public BasicType resolveIndicatedType(SqlTypeDescriptorIndicators indicators) { + public BasicType resolveIndicatedType(JdbcTypeDescriptorIndicators indicators) { if ( indicators.isNationalized() ) { final TypeConfiguration typeConfiguration = indicators.getTypeConfiguration(); if ( indicators.isLob() ) { @@ -46,7 +46,7 @@ public class CharacterArrayType return (BasicType) CharacterArrayNClobType.INSTANCE; } else { - final SqlTypeDescriptor nvarcharType = typeConfiguration.getSqlTypeDescriptorRegistry().getDescriptor( Types.NVARCHAR ); + final JdbcTypeDescriptor nvarcharType = typeConfiguration.getJdbcTypeDescriptorRegistry().getDescriptor( Types.NVARCHAR ); //noinspection unchecked return (BasicType) typeConfiguration.getBasicTypeRegistry().resolve( getJavaTypeDescriptor(), nvarcharType ); } diff --git a/hibernate-core/src/main/java/org/hibernate/type/CharacterNCharType.java b/hibernate-core/src/main/java/org/hibernate/type/CharacterNCharType.java index 8b9756f03e..6499de2154 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/CharacterNCharType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/CharacterNCharType.java @@ -10,7 +10,7 @@ import java.io.Serializable; import org.hibernate.dialect.Dialect; import org.hibernate.type.descriptor.java.CharacterTypeDescriptor; -import org.hibernate.type.descriptor.sql.NCharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.NCharTypeDescriptor; /** * A type that maps between {@link java.sql.Types#NCHAR NCHAR(1)} and {@link Character} diff --git a/hibernate-core/src/main/java/org/hibernate/type/CharacterType.java b/hibernate-core/src/main/java/org/hibernate/type/CharacterType.java index 88935ea7eb..beda1370f9 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/CharacterType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/CharacterType.java @@ -10,8 +10,8 @@ import java.io.Serializable; import org.hibernate.dialect.Dialect; import org.hibernate.type.descriptor.java.CharacterTypeDescriptor; -import org.hibernate.type.descriptor.sql.CharTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.CharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; /** * A type that maps between {@link java.sql.Types#CHAR CHAR(1)} and {@link Character} @@ -55,7 +55,7 @@ public class CharacterType } @Override - public BasicType resolveIndicatedType(SqlTypeDescriptorIndicators indicators) { + public BasicType resolveIndicatedType(JdbcTypeDescriptorIndicators indicators) { return (BasicType) ( indicators.isNationalized() ? CharacterNCharType.INSTANCE : this ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/type/ClassType.java b/hibernate-core/src/main/java/org/hibernate/type/ClassType.java index cf8b24ce55..cc0f1eecbe 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/ClassType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/ClassType.java @@ -6,7 +6,7 @@ */ package org.hibernate.type; import org.hibernate.type.descriptor.java.ClassTypeDescriptor; -import org.hibernate.type.descriptor.sql.VarcharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.VarcharTypeDescriptor; /** * A type that maps between {@link java.sql.Types#VARCHAR VARCHAR} and {@link Class} diff --git a/hibernate-core/src/main/java/org/hibernate/type/ClobType.java b/hibernate-core/src/main/java/org/hibernate/type/ClobType.java index e4a8f50bd5..9aef581a13 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/ClobType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/ClobType.java @@ -10,7 +10,7 @@ import java.sql.Clob; import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.type.descriptor.java.ClobTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; /** * A type that maps between {@link java.sql.Types#CLOB CLOB} and {@link Clob} @@ -22,7 +22,7 @@ public class ClobType extends AbstractSingleColumnStandardBasicType implem public static final ClobType INSTANCE = new ClobType(); public ClobType() { - super( org.hibernate.type.descriptor.sql.ClobTypeDescriptor.DEFAULT, ClobTypeDescriptor.INSTANCE ); + super( org.hibernate.type.descriptor.jdbc.ClobTypeDescriptor.DEFAULT, ClobTypeDescriptor.INSTANCE ); } @Override @@ -42,7 +42,7 @@ public class ClobType extends AbstractSingleColumnStandardBasicType implem @SuppressWarnings({"rawtypes", "unchecked"}) @Override - public BasicType resolveIndicatedType(SqlTypeDescriptorIndicators indicators) { + public BasicType resolveIndicatedType(JdbcTypeDescriptorIndicators indicators) { // todo (6.0) : Support a "wrapped clob"? This would be a (N)VARCHAR column we handle as a Clob in-memory // - might be especially interesting for streaming based (N)VARCHAR reading 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 1eca84a601..45a3cb329f 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/ComponentType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/ComponentType.java @@ -34,7 +34,7 @@ import org.hibernate.tuple.ValueGeneration; import org.hibernate.tuple.component.ComponentMetamodel; import org.hibernate.tuple.component.ComponentTuplizer; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; import org.hibernate.type.spi.TypeConfiguration; /** @@ -760,7 +760,7 @@ public class ComponentType extends AbstractType implements CompositeType, Proced } @Override - public SqlTypeDescriptor getSqlTypeDescriptor() { + public JdbcTypeDescriptor getJdbcTypeDescriptor() { throw new NotYetImplementedFor6Exception( getClass() ); } diff --git a/hibernate-core/src/main/java/org/hibernate/type/CurrencyType.java b/hibernate-core/src/main/java/org/hibernate/type/CurrencyType.java index 4bc85f9cb2..1dbe33657c 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/CurrencyType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/CurrencyType.java @@ -10,7 +10,7 @@ import java.util.Currency; import org.hibernate.dialect.Dialect; import org.hibernate.type.descriptor.java.CurrencyTypeDescriptor; -import org.hibernate.type.descriptor.sql.VarcharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.VarcharTypeDescriptor; /** * A type that maps between {@link java.sql.Types#VARCHAR VARCHAR} and {@link Currency} diff --git a/hibernate-core/src/main/java/org/hibernate/type/CustomType.java b/hibernate-core/src/main/java/org/hibernate/type/CustomType.java index 2488cdfaf9..0fd49a94a7 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/CustomType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/CustomType.java @@ -24,7 +24,7 @@ import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.internal.util.collections.ArrayHelper; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; import org.hibernate.type.spi.TypeConfiguration; import org.hibernate.usertype.EnhancedUserType; import org.hibernate.usertype.LoggableUserType; @@ -56,7 +56,7 @@ public class CustomType private final String name; private final JavaTypeDescriptor mappedJavaTypeDescriptor; - private final SqlTypeDescriptor sqlTypeDescriptor; + private final JdbcTypeDescriptor jdbcTypeDescriptor; private final Size dictatedSize; private final Size defaultSize; @@ -73,7 +73,7 @@ public class CustomType //noinspection unchecked this.mappedJavaTypeDescriptor = typeConfiguration.getJavaTypeDescriptorRegistry().getDescriptor( userType.returnedClass() ); - this.sqlTypeDescriptor = typeConfiguration.getSqlTypeDescriptorRegistry().getDescriptor( userType.sqlTypes()[0] ); + this.jdbcTypeDescriptor = typeConfiguration.getJdbcTypeDescriptorRegistry().getDescriptor( userType.sqlTypes()[0] ); if ( userType instanceof Sized ) { final Sized sized = (Sized) userType; @@ -94,13 +94,13 @@ public class CustomType } @Override - public SqlTypeDescriptor getSqlTypeDescriptor() { - return sqlTypeDescriptor; + public JdbcTypeDescriptor getJdbcTypeDescriptor() { + return jdbcTypeDescriptor; } @Override public int[] sqlTypes(Mapping pi) { - return new int[] { sqlTypeDescriptor.getSqlType() }; + return new int[] { jdbcTypeDescriptor.getJdbcType() }; } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/type/DateType.java b/hibernate-core/src/main/java/org/hibernate/type/DateType.java index f1654751fb..bbaec83ba9 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/DateType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/DateType.java @@ -29,7 +29,7 @@ public class DateType public static final DateType INSTANCE = new DateType(); public DateType() { - super( org.hibernate.type.descriptor.sql.DateTypeDescriptor.INSTANCE, JdbcDateTypeDescriptor.INSTANCE ); + super( org.hibernate.type.descriptor.jdbc.DateTypeDescriptor.INSTANCE, JdbcDateTypeDescriptor.INSTANCE ); } public String getName() { diff --git a/hibernate-core/src/main/java/org/hibernate/type/DoubleType.java b/hibernate-core/src/main/java/org/hibernate/type/DoubleType.java index af25b9c891..280a86e97d 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/DoubleType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/DoubleType.java @@ -23,7 +23,7 @@ public class DoubleType extends AbstractSingleColumnStandardBasicType im public static final Double ZERO = 0.0; public DoubleType() { - super( org.hibernate.type.descriptor.sql.FloatTypeDescriptor.INSTANCE, DoubleTypeDescriptor.INSTANCE ); + super( org.hibernate.type.descriptor.jdbc.FloatTypeDescriptor.INSTANCE, DoubleTypeDescriptor.INSTANCE ); } @Override public String getName() { diff --git a/hibernate-core/src/main/java/org/hibernate/type/DurationType.java b/hibernate-core/src/main/java/org/hibernate/type/DurationType.java index 7989309e58..ce03f677ee 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/DurationType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/DurationType.java @@ -9,7 +9,7 @@ package org.hibernate.type; import java.time.Duration; import org.hibernate.type.descriptor.java.DurationJavaDescriptor; -import org.hibernate.type.descriptor.sql.NumericTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.NumericTypeDescriptor; /** * @author Steve Ebersole diff --git a/hibernate-core/src/main/java/org/hibernate/type/EnumType.java b/hibernate-core/src/main/java/org/hibernate/type/EnumType.java index 95031f4c4c..4df5aef0c9 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/EnumType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/EnumType.java @@ -31,8 +31,8 @@ import org.hibernate.metamodel.model.convert.internal.OrdinalEnumValueConverter; import org.hibernate.metamodel.model.convert.spi.EnumValueConverter; import org.hibernate.type.descriptor.java.BasicJavaDescriptor; import org.hibernate.type.descriptor.java.EnumJavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; import org.hibernate.type.spi.TypeConfiguration; import org.hibernate.type.spi.TypeConfigurationAware; import org.hibernate.usertype.DynamicParameterizedType; @@ -133,7 +133,7 @@ public class EnumType> .getJavaTypeDescriptorRegistry() .getDescriptor( enumClass ); - final LocalSqlTypeDescriptorIndicators indicators = new LocalSqlTypeDescriptorIndicators( + final LocalJdbcTypeDescriptorIndicators indicators = new LocalJdbcTypeDescriptorIndicators( enumType, columnLength, reader @@ -144,19 +144,19 @@ public class EnumType> enumJavaDescriptor ); - final SqlTypeDescriptor sqlTypeDescriptor = relationalJtd.getJdbcRecommendedSqlType( indicators ); + final JdbcTypeDescriptor jdbcTypeDescriptor = relationalJtd.getRecommendedJdbcType( indicators ); if ( isOrdinal ) { this.enumValueConverter = new OrdinalEnumValueConverter( enumJavaDescriptor, - sqlTypeDescriptor, + jdbcTypeDescriptor, relationalJtd ); } else { this.enumValueConverter = new NamedEnumValueConverter( enumJavaDescriptor, - sqlTypeDescriptor, + jdbcTypeDescriptor, relationalJtd ); } @@ -183,9 +183,9 @@ public class EnumType> } private BasicJavaDescriptor resolveRelationalJavaTypeDescriptor( - LocalSqlTypeDescriptorIndicators indicators, + LocalJdbcTypeDescriptorIndicators indicators, EnumJavaTypeDescriptor enumJavaDescriptor) { - return enumJavaDescriptor.getJdbcRecommendedSqlType( indicators ).getJdbcRecommendedJavaTypeMapping( typeConfiguration ); + return enumJavaDescriptor.getRecommendedJdbcType( indicators ).getJdbcRecommendedJavaTypeMapping( typeConfiguration ); } private javax.persistence.EnumType getEnumType(ParameterType reader) { @@ -226,7 +226,7 @@ public class EnumType> // this method should only be called for hbm.xml handling assert parameters.get( PARAMETER_TYPE ) == null; - final LocalSqlTypeDescriptorIndicators localIndicators = new LocalSqlTypeDescriptorIndicators( + final LocalJdbcTypeDescriptorIndicators localIndicators = new LocalJdbcTypeDescriptorIndicators( // use ORDINAL as default for hbm.xml mappings javax.persistence.EnumType.ORDINAL, // Is there a reasonable value here? Limits the @@ -246,7 +246,7 @@ public class EnumType> //noinspection rawtypes return new NamedEnumValueConverter( enumJavaDescriptor, - stringJavaDescriptor.getJdbcRecommendedSqlType( localIndicators ), + stringJavaDescriptor.getRecommendedJdbcType( localIndicators ), stringJavaDescriptor ); } @@ -254,7 +254,7 @@ public class EnumType> //noinspection rawtypes return new OrdinalEnumValueConverter( enumJavaDescriptor, - integerJavaDescriptor.getJdbcRecommendedSqlType( localIndicators ), + integerJavaDescriptor.getRecommendedJdbcType( localIndicators ), typeConfiguration.getJavaTypeDescriptorRegistry().getDescriptor( Integer.class ) ); } @@ -266,7 +266,7 @@ public class EnumType> //noinspection rawtypes return new OrdinalEnumValueConverter( enumJavaDescriptor, - integerJavaDescriptor.getJdbcRecommendedSqlType( localIndicators ), + integerJavaDescriptor.getRecommendedJdbcType( localIndicators ), typeConfiguration.getJavaTypeDescriptorRegistry().getDescriptor( Integer.class ) ); } @@ -274,7 +274,7 @@ public class EnumType> //noinspection rawtypes return new NamedEnumValueConverter( enumJavaDescriptor, - stringJavaDescriptor.getJdbcRecommendedSqlType( localIndicators ), + stringJavaDescriptor.getRecommendedJdbcType( localIndicators ), stringJavaDescriptor ); } @@ -292,7 +292,7 @@ public class EnumType> // the fallback return new OrdinalEnumValueConverter( enumJavaDescriptor, - integerJavaDescriptor.getJdbcRecommendedSqlType( localIndicators ), + integerJavaDescriptor.getRecommendedJdbcType( localIndicators ), typeConfiguration.getJavaTypeDescriptorRegistry().getDescriptor( Integer.class ) ); } @@ -432,12 +432,12 @@ public class EnumType> return enumValueConverter instanceof OrdinalEnumValueConverter; } - private class LocalSqlTypeDescriptorIndicators implements SqlTypeDescriptorIndicators { + private class LocalJdbcTypeDescriptorIndicators implements JdbcTypeDescriptorIndicators { private final javax.persistence.EnumType enumType; private final Long columnLength; private final ParameterType reader; - public LocalSqlTypeDescriptorIndicators(javax.persistence.EnumType enumType, Long columnLength, ParameterType reader) { + public LocalJdbcTypeDescriptorIndicators(javax.persistence.EnumType enumType, Long columnLength, ParameterType reader) { this.enumType = enumType; this.columnLength = columnLength; this.reader = reader; diff --git a/hibernate-core/src/main/java/org/hibernate/type/FloatType.java b/hibernate-core/src/main/java/org/hibernate/type/FloatType.java index a9b016e293..c99669f7c8 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/FloatType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/FloatType.java @@ -23,7 +23,7 @@ public class FloatType extends AbstractSingleColumnStandardBasicType impl public static final Float ZERO = 0.0f; public FloatType() { - super( org.hibernate.type.descriptor.sql.FloatTypeDescriptor.INSTANCE, FloatTypeDescriptor.INSTANCE ); + super( org.hibernate.type.descriptor.jdbc.FloatTypeDescriptor.INSTANCE, FloatTypeDescriptor.INSTANCE ); } @Override public String getName() { diff --git a/hibernate-core/src/main/java/org/hibernate/type/ImageType.java b/hibernate-core/src/main/java/org/hibernate/type/ImageType.java index d0547ce398..4623067c0e 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/ImageType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/ImageType.java @@ -6,7 +6,7 @@ */ package org.hibernate.type; import org.hibernate.type.descriptor.java.PrimitiveByteArrayTypeDescriptor; -import org.hibernate.type.descriptor.sql.LongVarbinaryTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.LongVarbinaryTypeDescriptor; /** * A type that maps between {@link java.sql.Types#LONGVARBINARY LONGVARBINARY} and {@code byte[]} diff --git a/hibernate-core/src/main/java/org/hibernate/type/InstantType.java b/hibernate-core/src/main/java/org/hibernate/type/InstantType.java index 952d2e4853..5a82962dfd 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/InstantType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/InstantType.java @@ -17,7 +17,7 @@ import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.internal.util.compare.ComparableComparator; import org.hibernate.metamodel.model.domain.AllowableTemporalParameterType; import org.hibernate.type.descriptor.java.InstantJavaDescriptor; -import org.hibernate.type.descriptor.sql.TimestampTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.TimestampTypeDescriptor; import org.hibernate.type.spi.TypeConfiguration; /** diff --git a/hibernate-core/src/main/java/org/hibernate/type/IntegerType.java b/hibernate-core/src/main/java/org/hibernate/type/IntegerType.java index f72cb7d02d..cf79e6a048 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/IntegerType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/IntegerType.java @@ -27,7 +27,7 @@ public class IntegerType extends AbstractSingleColumnStandardBasicType public static final Integer ZERO = 0; public IntegerType() { - super( org.hibernate.type.descriptor.sql.IntegerTypeDescriptor.INSTANCE, IntegerTypeDescriptor.INSTANCE ); + super( org.hibernate.type.descriptor.jdbc.IntegerTypeDescriptor.INSTANCE, IntegerTypeDescriptor.INSTANCE ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/type/JavaObjectType.java b/hibernate-core/src/main/java/org/hibernate/type/JavaObjectType.java index 8f0772d237..a0539abfc2 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/JavaObjectType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/JavaObjectType.java @@ -7,7 +7,7 @@ package org.hibernate.type; import org.hibernate.type.descriptor.java.JavaObjectTypeDescriptor; -import org.hibernate.type.descriptor.sql.ObjectSqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.ObjectJdbcTypeDescriptor; /** * @author Steve Ebersole @@ -19,7 +19,7 @@ public class JavaObjectType extends AbstractSingleColumnStandardBasicType BasicType resolveIndicatedType(SqlTypeDescriptorIndicators indicators) { + public BasicType resolveIndicatedType(JdbcTypeDescriptorIndicators indicators) { if ( indicators.isNationalized() ) { //noinspection unchecked return (BasicType) MaterializedNClobType.INSTANCE; diff --git a/hibernate-core/src/main/java/org/hibernate/type/MaterializedNClobType.java b/hibernate-core/src/main/java/org/hibernate/type/MaterializedNClobType.java index 64a7f8b05a..6381ca0e89 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/MaterializedNClobType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/MaterializedNClobType.java @@ -7,7 +7,7 @@ package org.hibernate.type; import org.hibernate.type.descriptor.java.StringTypeDescriptor; -import org.hibernate.type.descriptor.sql.NClobTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.NClobTypeDescriptor; /** * A type that maps between {@link java.sql.Types#CLOB CLOB} and {@link String} diff --git a/hibernate-core/src/main/java/org/hibernate/type/NClobType.java b/hibernate-core/src/main/java/org/hibernate/type/NClobType.java index bf736ce373..6f17b3cdb6 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/NClobType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/NClobType.java @@ -21,7 +21,7 @@ public class NClobType extends AbstractSingleColumnStandardBasicType { public static final NClobType INSTANCE = new NClobType(); public NClobType() { - super( org.hibernate.type.descriptor.sql.NClobTypeDescriptor.DEFAULT, NClobTypeDescriptor.INSTANCE ); + super( org.hibernate.type.descriptor.jdbc.NClobTypeDescriptor.DEFAULT, NClobTypeDescriptor.INSTANCE ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/type/NTextType.java b/hibernate-core/src/main/java/org/hibernate/type/NTextType.java index f041d6bef4..62e41123cc 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/NTextType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/NTextType.java @@ -7,7 +7,7 @@ package org.hibernate.type; import org.hibernate.type.descriptor.java.StringTypeDescriptor; -import org.hibernate.type.descriptor.sql.LongNVarcharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.LongNVarcharTypeDescriptor; /** * A type that maps between {@link java.sql.Types#LONGNVARCHAR LONGNVARCHAR} and {@link String} diff --git a/hibernate-core/src/main/java/org/hibernate/type/NumericBooleanType.java b/hibernate-core/src/main/java/org/hibernate/type/NumericBooleanType.java index efb173432a..ac6008d4ea 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/NumericBooleanType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/NumericBooleanType.java @@ -9,9 +9,11 @@ package org.hibernate.type; import java.io.Serializable; import org.hibernate.dialect.Dialect; +import org.hibernate.metamodel.model.convert.spi.BasicValueConverter; import org.hibernate.query.CastType; import org.hibernate.type.descriptor.java.BooleanTypeDescriptor; -import org.hibernate.type.descriptor.sql.IntegerTypeDescriptor; +import org.hibernate.type.descriptor.java.JavaTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.IntegerTypeDescriptor; /** * A type that maps between {@link java.sql.Types#INTEGER INTEGER} and {@link Boolean} (using 1 and 0) @@ -20,9 +22,10 @@ import org.hibernate.type.descriptor.sql.IntegerTypeDescriptor; */ public class NumericBooleanType extends AbstractSingleColumnStandardBasicType - implements PrimitiveType, DiscriminatorType { + implements PrimitiveType, DiscriminatorType, ConvertedBasicType { public static final NumericBooleanType INSTANCE = new NumericBooleanType(); + public static final NumericConverter CONVERTER = new NumericConverter(); public NumericBooleanType() { super( IntegerTypeDescriptor.INSTANCE, BooleanTypeDescriptor.INSTANCE ); @@ -51,4 +54,47 @@ public class NumericBooleanType public CastType getCastType() { return CastType.INTEGER_BOOLEAN; } + + @Override + public BasicValueConverter getValueConverter() { + return CONVERTER; + } + + private static class NumericConverter implements BasicValueConverter { + @Override + public Boolean toDomainValue(Integer relationalForm) { + if ( relationalForm == null ) { + return null; + } + + if ( 1 == relationalForm ) { + return true; + } + + if ( 0 == relationalForm ) { + return false; + } + + return null; + } + + @Override + public Integer toRelationalValue(Boolean domainForm) { + if ( domainForm == null ) { + return null; + } + + return domainForm ? 1 : 0; + } + + @Override + public JavaTypeDescriptor getDomainJavaDescriptor() { + return BooleanTypeDescriptor.INSTANCE; + } + + @Override + public JavaTypeDescriptor getRelationalJavaDescriptor() { + return org.hibernate.type.descriptor.java.IntegerTypeDescriptor.INSTANCE; + } + } } diff --git a/hibernate-core/src/main/java/org/hibernate/type/OffsetDateTimeType.java b/hibernate-core/src/main/java/org/hibernate/type/OffsetDateTimeType.java index f8aa980ad9..c3e2a6f121 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/OffsetDateTimeType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/OffsetDateTimeType.java @@ -16,7 +16,7 @@ import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.metamodel.model.domain.AllowableTemporalParameterType; import org.hibernate.query.CastType; import org.hibernate.type.descriptor.java.OffsetDateTimeJavaDescriptor; -import org.hibernate.type.descriptor.sql.TimestampWithTimeZoneDescriptor; +import org.hibernate.type.descriptor.jdbc.TimestampWithTimeZoneDescriptor; import org.hibernate.type.spi.TypeConfiguration; /** diff --git a/hibernate-core/src/main/java/org/hibernate/type/OffsetTimeType.java b/hibernate-core/src/main/java/org/hibernate/type/OffsetTimeType.java index 9efe94615c..f3f88cda43 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/OffsetTimeType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/OffsetTimeType.java @@ -12,7 +12,7 @@ import javax.persistence.TemporalType; import org.hibernate.QueryException; import org.hibernate.metamodel.model.domain.AllowableTemporalParameterType; import org.hibernate.type.descriptor.java.OffsetTimeJavaDescriptor; -import org.hibernate.type.descriptor.sql.TimeTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.TimeTypeDescriptor; import org.hibernate.type.spi.TypeConfiguration; /** diff --git a/hibernate-core/src/main/java/org/hibernate/type/PostgresUUIDType.java b/hibernate-core/src/main/java/org/hibernate/type/PostgresUUIDType.java index c2cac94328..18222f8546 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/PostgresUUIDType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/PostgresUUIDType.java @@ -19,9 +19,9 @@ import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.BasicJavaDescriptor; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; import org.hibernate.type.descriptor.java.UUIDTypeDescriptor; -import org.hibernate.type.descriptor.sql.BasicBinder; -import org.hibernate.type.descriptor.sql.BasicExtractor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.BasicBinder; +import org.hibernate.type.descriptor.jdbc.BasicExtractor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; import org.hibernate.type.spi.TypeConfiguration; /** @@ -35,7 +35,7 @@ public class PostgresUUIDType extends AbstractSingleColumnStandardBasicType( javaTypeDescriptor, this ) { @Override protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException { - st.setObject( index, javaTypeDescriptor.unwrap( value, UUID.class, options ), getSqlType() ); + st.setObject( index, javaTypeDescriptor.unwrap( value, UUID.class, options ), getJdbcType() ); } @Override protected void doBind(CallableStatement st, X value, String name, WrapperOptions options) throws SQLException { - st.setObject( name, javaTypeDescriptor.unwrap( value, UUID.class, options ), getSqlType() ); + st.setObject( name, javaTypeDescriptor.unwrap( value, UUID.class, options ), getJdbcType() ); } }; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/PrimitiveCharacterArrayClobType.java b/hibernate-core/src/main/java/org/hibernate/type/PrimitiveCharacterArrayClobType.java index 02f782260a..518ce187d0 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/PrimitiveCharacterArrayClobType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/PrimitiveCharacterArrayClobType.java @@ -6,8 +6,8 @@ */ package org.hibernate.type; import org.hibernate.type.descriptor.java.PrimitiveCharacterArrayTypeDescriptor; -import org.hibernate.type.descriptor.sql.ClobTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.ClobTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; /** * Map a char[] to a Clob @@ -29,7 +29,7 @@ public class PrimitiveCharacterArrayClobType } @Override - public BasicType resolveIndicatedType(SqlTypeDescriptorIndicators indicators) { + public BasicType resolveIndicatedType(JdbcTypeDescriptorIndicators indicators) { if ( indicators.isNationalized() ) { //noinspection unchecked return (BasicType) PrimitiveCharacterArrayNClobType.INSTANCE; diff --git a/hibernate-core/src/main/java/org/hibernate/type/PrimitiveCharacterArrayNClobType.java b/hibernate-core/src/main/java/org/hibernate/type/PrimitiveCharacterArrayNClobType.java index a907e93038..b5a93fdd43 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/PrimitiveCharacterArrayNClobType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/PrimitiveCharacterArrayNClobType.java @@ -7,7 +7,7 @@ package org.hibernate.type; import org.hibernate.type.descriptor.java.PrimitiveCharacterArrayTypeDescriptor; -import org.hibernate.type.descriptor.sql.NClobTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.NClobTypeDescriptor; /** * Map a char[] to a NClob diff --git a/hibernate-core/src/main/java/org/hibernate/type/RowVersionType.java b/hibernate-core/src/main/java/org/hibernate/type/RowVersionType.java index 9415167b35..e1c4595d29 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/RowVersionType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/RowVersionType.java @@ -10,7 +10,7 @@ import java.util.Comparator; import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.type.descriptor.java.RowVersionTypeDescriptor; -import org.hibernate.type.descriptor.sql.VarbinaryTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.VarbinaryTypeDescriptor; /** * A type that maps between a {@link java.sql.Types#VARBINARY VARBINARY} and {@code byte[]} diff --git a/hibernate-core/src/main/java/org/hibernate/type/SerializableToBlobType.java b/hibernate-core/src/main/java/org/hibernate/type/SerializableToBlobType.java index fa69bcd100..ca149cf321 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/SerializableToBlobType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/SerializableToBlobType.java @@ -12,7 +12,7 @@ import java.util.Properties; import org.hibernate.MappingException; import org.hibernate.internal.util.ReflectHelper; import org.hibernate.type.descriptor.java.SerializableTypeDescriptor; -import org.hibernate.type.descriptor.sql.BlobTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.BlobTypeDescriptor; import org.hibernate.usertype.DynamicParameterizedType; /** diff --git a/hibernate-core/src/main/java/org/hibernate/type/SerializableType.java b/hibernate-core/src/main/java/org/hibernate/type/SerializableType.java index 7eba3b8103..9f04f19e0a 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/SerializableType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/SerializableType.java @@ -9,7 +9,7 @@ package org.hibernate.type; import java.io.Serializable; import org.hibernate.type.descriptor.java.SerializableTypeDescriptor; -import org.hibernate.type.descriptor.sql.VarbinaryTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.VarbinaryTypeDescriptor; /** * A type that maps between a {@link java.sql.Types#VARBINARY VARBINARY} and {@link Serializable} classes. diff --git a/hibernate-core/src/main/java/org/hibernate/type/ShortType.java b/hibernate-core/src/main/java/org/hibernate/type/ShortType.java index 106131740a..5a96cac2ac 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/ShortType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/ShortType.java @@ -12,7 +12,7 @@ import java.util.Comparator; import org.hibernate.dialect.Dialect; import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.type.descriptor.java.ShortTypeDescriptor; -import org.hibernate.type.descriptor.sql.SmallIntTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.SmallIntTypeDescriptor; /** * A type that maps between {@link java.sql.Types#SMALLINT SMALLINT} and {@link Short} diff --git a/hibernate-core/src/main/java/org/hibernate/type/SqlTypeDescriptorIndicatorCapable.java b/hibernate-core/src/main/java/org/hibernate/type/SqlTypeDescriptorIndicatorCapable.java index b06f58ba77..83ebb7a29f 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/SqlTypeDescriptorIndicatorCapable.java +++ b/hibernate-core/src/main/java/org/hibernate/type/SqlTypeDescriptorIndicatorCapable.java @@ -6,7 +6,7 @@ */ package org.hibernate.type; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; /** * @author Steve Ebersole @@ -15,5 +15,5 @@ public interface SqlTypeDescriptorIndicatorCapable extends BasicType { /** * For Types whose resolution can be affected by SqlTypeDescriptorIndicators */ - BasicType resolveIndicatedType(SqlTypeDescriptorIndicators indicators); + BasicType resolveIndicatedType(JdbcTypeDescriptorIndicators indicators); } diff --git a/hibernate-core/src/main/java/org/hibernate/type/StandardBasicTypeTemplate.java b/hibernate-core/src/main/java/org/hibernate/type/StandardBasicTypeTemplate.java index 54b5fdc489..6612fe6300 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/StandardBasicTypeTemplate.java +++ b/hibernate-core/src/main/java/org/hibernate/type/StandardBasicTypeTemplate.java @@ -7,7 +7,7 @@ package org.hibernate.type; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; /** * A BasicType adapter targeting partial portability to 6.0's type @@ -22,14 +22,14 @@ public class StandardBasicTypeTemplate extends AbstractSingleColumnStandardBa private final String[] registrationKeys; public StandardBasicTypeTemplate( - SqlTypeDescriptor sqlTypeDescriptor, + JdbcTypeDescriptor jdbcTypeDescriptor, JavaTypeDescriptor javaTypeDescriptor, String... registrationKeys) { - super( sqlTypeDescriptor, javaTypeDescriptor ); + super( jdbcTypeDescriptor, javaTypeDescriptor ); this.registrationKeys = registrationKeys; this.name = javaTypeDescriptor.getJavaType() == null ? "(map-mode)" : javaTypeDescriptor.getJavaType().getTypeName() - + " -> " + sqlTypeDescriptor.getSqlType(); + + " -> " + jdbcTypeDescriptor.getJdbcType(); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/type/StandardBasicTypes.java b/hibernate-core/src/main/java/org/hibernate/type/StandardBasicTypes.java index 797ecb9cbe..7446ce7d20 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/StandardBasicTypes.java +++ b/hibernate-core/src/main/java/org/hibernate/type/StandardBasicTypes.java @@ -31,8 +31,8 @@ import java.util.UUID; import org.hibernate.type.descriptor.java.CharacterArrayTypeDescriptor; import org.hibernate.type.descriptor.java.PrimitiveCharacterArrayTypeDescriptor; -import org.hibernate.type.descriptor.sql.ClobTypeDescriptor; -import org.hibernate.type.descriptor.sql.NClobTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.ClobTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.NClobTypeDescriptor; import org.hibernate.type.internal.StandardBasicTypeImpl; import org.hibernate.type.spi.TypeConfiguration; diff --git a/hibernate-core/src/main/java/org/hibernate/type/StringNVarcharType.java b/hibernate-core/src/main/java/org/hibernate/type/StringNVarcharType.java index 4116eb2355..e5560229ff 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/StringNVarcharType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/StringNVarcharType.java @@ -8,7 +8,7 @@ package org.hibernate.type; import org.hibernate.dialect.Dialect; import org.hibernate.type.descriptor.java.StringTypeDescriptor; -import org.hibernate.type.descriptor.sql.NVarcharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.NVarcharTypeDescriptor; /** * A type that maps between {@link java.sql.Types#VARCHAR VARCHAR} and {@link String} diff --git a/hibernate-core/src/main/java/org/hibernate/type/StringType.java b/hibernate-core/src/main/java/org/hibernate/type/StringType.java index 0cb67b1b03..0bf34f48ba 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/StringType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/StringType.java @@ -7,8 +7,8 @@ package org.hibernate.type; import org.hibernate.dialect.Dialect; import org.hibernate.type.descriptor.java.StringTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; -import org.hibernate.type.descriptor.sql.VarcharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.VarcharTypeDescriptor; /** * A type that maps between {@link java.sql.Types#VARCHAR VARCHAR} and {@link String} @@ -49,7 +49,7 @@ public class StringType @SuppressWarnings({"rawtypes", "unchecked"}) @Override - public BasicType resolveIndicatedType(SqlTypeDescriptorIndicators indicators) { + public BasicType resolveIndicatedType(JdbcTypeDescriptorIndicators indicators) { if ( indicators.isLob() ) { return indicators.isNationalized() ? MaterializedNClobType.INSTANCE : MaterializedClobType.INSTANCE; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/TextType.java b/hibernate-core/src/main/java/org/hibernate/type/TextType.java index 8231a53732..2767680084 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/TextType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/TextType.java @@ -6,8 +6,8 @@ */ package org.hibernate.type; import org.hibernate.type.descriptor.java.StringTypeDescriptor; -import org.hibernate.type.descriptor.sql.LongVarcharTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.LongVarcharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; /** * A type that maps between {@link java.sql.Types#LONGVARCHAR LONGVARCHAR} and {@link String} @@ -30,7 +30,7 @@ public class TextType } @Override - public BasicType resolveIndicatedType(SqlTypeDescriptorIndicators indicators) { + public BasicType resolveIndicatedType(JdbcTypeDescriptorIndicators indicators) { if ( indicators.isNationalized() ) { //noinspection unchecked return (BasicType) NTextType.INSTANCE; diff --git a/hibernate-core/src/main/java/org/hibernate/type/TimeType.java b/hibernate-core/src/main/java/org/hibernate/type/TimeType.java index bff3fd3e38..5f713882ef 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/TimeType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/TimeType.java @@ -28,7 +28,7 @@ public class TimeType public static final TimeType INSTANCE = new TimeType(); public TimeType() { - super( org.hibernate.type.descriptor.sql.TimeTypeDescriptor.INSTANCE, JdbcTimeTypeDescriptor.INSTANCE ); + super( org.hibernate.type.descriptor.jdbc.TimeTypeDescriptor.INSTANCE, JdbcTimeTypeDescriptor.INSTANCE ); } public String getName() { diff --git a/hibernate-core/src/main/java/org/hibernate/type/TimeZoneType.java b/hibernate-core/src/main/java/org/hibernate/type/TimeZoneType.java index 1a6eb65bf9..c16d6063e3 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/TimeZoneType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/TimeZoneType.java @@ -10,7 +10,7 @@ import java.util.TimeZone; import org.hibernate.dialect.Dialect; import org.hibernate.type.descriptor.java.TimeZoneTypeDescriptor; -import org.hibernate.type.descriptor.sql.VarcharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.VarcharTypeDescriptor; /** * A type mapping {@link java.sql.Types#VARCHAR VARCHAR} and {@link TimeZone} diff --git a/hibernate-core/src/main/java/org/hibernate/type/TimestampType.java b/hibernate-core/src/main/java/org/hibernate/type/TimestampType.java index 49764aca15..0a6a284b46 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/TimestampType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/TimestampType.java @@ -16,7 +16,7 @@ import org.hibernate.QueryException; import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.metamodel.model.domain.AllowableTemporalParameterType; import org.hibernate.type.descriptor.java.JdbcTimestampTypeDescriptor; -import org.hibernate.type.descriptor.sql.TimestampTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.TimestampTypeDescriptor; import org.hibernate.type.spi.TypeConfiguration; /** diff --git a/hibernate-core/src/main/java/org/hibernate/type/TrueFalseType.java b/hibernate-core/src/main/java/org/hibernate/type/TrueFalseType.java index 46ad07de4e..58379df490 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/TrueFalseType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/TrueFalseType.java @@ -14,7 +14,7 @@ import org.hibernate.query.CastType; import org.hibernate.type.descriptor.java.BooleanTypeDescriptor; import org.hibernate.type.descriptor.java.CharacterTypeDescriptor; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.CharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.CharTypeDescriptor; /** * A type that maps between {@link java.sql.Types#CHAR CHAR(1)} and {@link Boolean} (using 'T' and 'F') diff --git a/hibernate-core/src/main/java/org/hibernate/type/UUIDBinaryType.java b/hibernate-core/src/main/java/org/hibernate/type/UUIDBinaryType.java index 1854b51990..cc84c1877b 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/UUIDBinaryType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/UUIDBinaryType.java @@ -10,7 +10,7 @@ import java.util.UUID; import org.hibernate.dialect.Dialect; import org.hibernate.type.descriptor.java.UUIDTypeDescriptor; -import org.hibernate.type.descriptor.sql.BinaryTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.BinaryTypeDescriptor; /** * A type mapping {@link java.sql.Types#BINARY} and {@link UUID} diff --git a/hibernate-core/src/main/java/org/hibernate/type/UUIDCharType.java b/hibernate-core/src/main/java/org/hibernate/type/UUIDCharType.java index fd1500b981..d0b458b0fb 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/UUIDCharType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/UUIDCharType.java @@ -10,7 +10,7 @@ import java.util.UUID; import org.hibernate.dialect.Dialect; import org.hibernate.type.descriptor.java.UUIDTypeDescriptor; -import org.hibernate.type.descriptor.sql.VarcharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.VarcharTypeDescriptor; /** * A type mapping {@link java.sql.Types#CHAR} (or {@link java.sql.Types#VARCHAR}) and {@link java.util.UUID} diff --git a/hibernate-core/src/main/java/org/hibernate/type/UrlType.java b/hibernate-core/src/main/java/org/hibernate/type/UrlType.java index 2cb05943b9..1512e41461 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/UrlType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/UrlType.java @@ -10,7 +10,7 @@ import java.net.URL; import org.hibernate.dialect.Dialect; import org.hibernate.type.descriptor.java.UrlTypeDescriptor; -import org.hibernate.type.descriptor.sql.VarcharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.VarcharTypeDescriptor; /** * A type that maps between {@link java.sql.Types#VARCHAR VARCHAR} and {@link URL} diff --git a/hibernate-core/src/main/java/org/hibernate/type/WrappedMaterializedBlobType.java b/hibernate-core/src/main/java/org/hibernate/type/WrappedMaterializedBlobType.java index 17c2cd8805..af37de6846 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/WrappedMaterializedBlobType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/WrappedMaterializedBlobType.java @@ -6,7 +6,7 @@ */ package org.hibernate.type; import org.hibernate.type.descriptor.java.ByteArrayTypeDescriptor; -import org.hibernate.type.descriptor.sql.BlobTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.BlobTypeDescriptor; /** * A type that maps JDBC {@link java.sql.Types#BLOB BLOB} and {@code Byte[]}. diff --git a/hibernate-core/src/main/java/org/hibernate/type/WrapperBinaryType.java b/hibernate-core/src/main/java/org/hibernate/type/WrapperBinaryType.java index 79a34f0830..bd3dbd93ba 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/WrapperBinaryType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/WrapperBinaryType.java @@ -6,7 +6,7 @@ */ package org.hibernate.type; import org.hibernate.type.descriptor.java.ByteArrayTypeDescriptor; -import org.hibernate.type.descriptor.sql.VarbinaryTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.VarbinaryTypeDescriptor; /** * A type mapping {@link java.sql.Types#VARBINARY VARBINARY} and {@link Byte Byte[]} diff --git a/hibernate-core/src/main/java/org/hibernate/type/YesNoType.java b/hibernate-core/src/main/java/org/hibernate/type/YesNoType.java index ecbf32aeec..88f937a979 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/YesNoType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/YesNoType.java @@ -14,7 +14,7 @@ import org.hibernate.query.CastType; import org.hibernate.type.descriptor.java.BooleanTypeDescriptor; import org.hibernate.type.descriptor.java.CharacterTypeDescriptor; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.CharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.CharTypeDescriptor; /** * A type that maps between {@link java.sql.Types#CHAR CHAR(1)} and {@link Boolean} (using 'Y' and 'N') diff --git a/hibernate-core/src/main/java/org/hibernate/type/ZoneOffsetType.java b/hibernate-core/src/main/java/org/hibernate/type/ZoneOffsetType.java index 49c24d4f59..dc1f2d1129 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/ZoneOffsetType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/ZoneOffsetType.java @@ -8,7 +8,7 @@ package org.hibernate.type; import org.hibernate.dialect.Dialect; import org.hibernate.type.descriptor.java.ZoneOffsetJavaDescriptor; -import org.hibernate.type.descriptor.sql.VarcharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.VarcharTypeDescriptor; import java.time.ZoneOffset; diff --git a/hibernate-core/src/main/java/org/hibernate/type/ZonedDateTimeType.java b/hibernate-core/src/main/java/org/hibernate/type/ZonedDateTimeType.java index 1e960a1137..6c8b4f2ce9 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/ZonedDateTimeType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/ZonedDateTimeType.java @@ -16,7 +16,7 @@ import org.hibernate.internal.util.ZonedDateTimeComparator; import org.hibernate.metamodel.model.domain.AllowableTemporalParameterType; import org.hibernate.query.CastType; import org.hibernate.type.descriptor.java.ZonedDateTimeJavaDescriptor; -import org.hibernate.type.descriptor.sql.TimestampWithTimeZoneDescriptor; +import org.hibernate.type.descriptor.jdbc.TimestampWithTimeZoneDescriptor; import org.hibernate.type.spi.TypeConfiguration; /** diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/WrapperOptions.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/WrapperOptions.java index 771bef1e33..dc95031491 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/WrapperOptions.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/WrapperOptions.java @@ -12,7 +12,7 @@ import java.util.TimeZone; import org.hibernate.engine.jdbc.LobCreator; import org.hibernate.engine.spi.SharedSessionContractImplementor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; /** * Gives binding (nullSafeSet) and extracting (nullSafeGet) code access to options. @@ -43,11 +43,11 @@ public interface WrapperOptions { /** * Allow remapping of descriptors for dealing with sql type. * - * @param sqlTypeDescriptor The known descriptor + * @param jdbcTypeDescriptor The known descriptor * * @return The remapped descriptor. May be the same as the known descriptor indicating no remapping. */ - SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor); + JdbcTypeDescriptor remapSqlTypeDescriptor(JdbcTypeDescriptor jdbcTypeDescriptor); /** * The JDBC {@link TimeZone} used when persisting Timestamp and DateTime properties into the database. diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/converter/AttributeConverterSqlTypeDescriptorAdapter.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/converter/AttributeConverterJdbcTypeDescriptorAdapter.java similarity index 93% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/converter/AttributeConverterSqlTypeDescriptorAdapter.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/converter/AttributeConverterJdbcTypeDescriptorAdapter.java index 37d7c35ec3..24fd557397 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/converter/AttributeConverterSqlTypeDescriptorAdapter.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/converter/AttributeConverterJdbcTypeDescriptorAdapter.java @@ -18,7 +18,7 @@ import org.hibernate.type.descriptor.ValueBinder; import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; import org.jboss.logging.Logger; @@ -34,16 +34,16 @@ import org.jboss.logging.Logger; * @author Steve Ebersole */ @SuppressWarnings("JavadocReference") -public class AttributeConverterSqlTypeDescriptorAdapter implements SqlTypeDescriptor { - private static final Logger log = Logger.getLogger( AttributeConverterSqlTypeDescriptorAdapter.class ); +public class AttributeConverterJdbcTypeDescriptorAdapter implements JdbcTypeDescriptor { + private static final Logger log = Logger.getLogger( AttributeConverterJdbcTypeDescriptorAdapter.class ); private final JpaAttributeConverter converter; - private final SqlTypeDescriptor delegate; + private final JdbcTypeDescriptor delegate; private final JavaTypeDescriptor intermediateJavaTypeDescriptor; - public AttributeConverterSqlTypeDescriptorAdapter( + public AttributeConverterJdbcTypeDescriptorAdapter( JpaAttributeConverter converter, - SqlTypeDescriptor delegate, + JdbcTypeDescriptor delegate, JavaTypeDescriptor intermediateJavaTypeDescriptor) { this.converter = converter; this.delegate = delegate; @@ -51,8 +51,8 @@ public class AttributeConverterSqlTypeDescriptorAdapter implements SqlTypeDescri } @Override - public int getSqlType() { - return delegate.getSqlType(); + public int getJdbcType() { + return delegate.getJdbcType(); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/converter/AttributeConverterTypeAdapter.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/converter/AttributeConverterTypeAdapter.java index 239563b517..28c6d49fc3 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/converter/AttributeConverterTypeAdapter.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/converter/AttributeConverterTypeAdapter.java @@ -12,16 +12,14 @@ import java.sql.SQLException; import javax.persistence.AttributeConverter; -import org.hibernate.HibernateException; import org.hibernate.boot.model.convert.spi.ConverterDescriptor; import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.metamodel.model.convert.spi.JpaAttributeConverter; import org.hibernate.type.AbstractSingleColumnStandardBasicType; import org.hibernate.type.descriptor.WrapperOptions; -import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; import org.hibernate.type.descriptor.java.MutabilityPlan; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; import org.jboss.logging.Logger; @@ -50,7 +48,7 @@ public class AttributeConverterTypeAdapter extends AbstractSingleColumnStanda String name, String description, JpaAttributeConverter attributeConverter, - SqlTypeDescriptor std, + JdbcTypeDescriptor std, JavaTypeDescriptor relationalJtd, JavaTypeDescriptor domainJtd, MutabilityPlan mutabilityPlan) { diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/BasicJavaDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/BasicJavaDescriptor.java index d047b8e536..265bbfc9cf 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/BasicJavaDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/BasicJavaDescriptor.java @@ -6,9 +6,9 @@ */ package org.hibernate.type.descriptor.java; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; -import org.hibernate.type.descriptor.sql.JdbcTypeJavaClassMappings; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.JdbcTypeJavaClassMappings; /** * @apiNote Currently this is the only high-level categorization of @@ -27,9 +27,9 @@ public interface BasicJavaDescriptor extends JavaTypeDescriptor { * * @return The recommended SQL type descriptor */ - default SqlTypeDescriptor getJdbcRecommendedSqlType(SqlTypeDescriptorIndicators indicators) { + default JdbcTypeDescriptor getRecommendedJdbcType(JdbcTypeDescriptorIndicators indicators) { // match legacy behavior - return indicators.getTypeConfiguration().getSqlTypeDescriptorRegistry().getDescriptor( + return indicators.getTypeConfiguration().getJdbcTypeDescriptorRegistry().getDescriptor( JdbcTypeJavaClassMappings.INSTANCE.determineJdbcTypeCodeForJavaClass( getJavaTypeClass() ) ); } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/BooleanTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/BooleanTypeDescriptor.java index a24cf3908d..c3eeba2517 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/BooleanTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/BooleanTypeDescriptor.java @@ -9,7 +9,7 @@ package org.hibernate.type.descriptor.java; import org.hibernate.dialect.Dialect; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.spi.Primitive; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; /** * Descriptor for {@link Boolean} handling. diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/CalendarDateTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/CalendarDateTypeDescriptor.java index 858b97fa22..f006af5824 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/CalendarDateTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/CalendarDateTypeDescriptor.java @@ -16,9 +16,8 @@ import javax.persistence.TemporalType; import org.hibernate.dialect.Dialect; import org.hibernate.internal.util.compare.CalendarComparator; import org.hibernate.type.descriptor.WrapperOptions; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; -import org.hibernate.type.descriptor.sql.TimeTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; import org.hibernate.type.spi.TypeConfiguration; /** @@ -38,8 +37,8 @@ public class CalendarDateTypeDescriptor extends AbstractTemporalTypeDescriptor { } @Override - public SqlTypeDescriptor getJdbcRecommendedSqlType(SqlTypeDescriptorIndicators indicators) { + public JdbcTypeDescriptor getRecommendedJdbcType(JdbcTypeDescriptorIndicators indicators) { if ( indicators.isNationalized() ) { - final SqlTypeDescriptorRegistry stdRegistry = indicators.getTypeConfiguration().getSqlTypeDescriptorRegistry(); + final JdbcTypeDescriptorRegistry stdRegistry = indicators.getTypeConfiguration().getJdbcTypeDescriptorRegistry(); return stdRegistry.getDescriptor( Types.NCLOB ); } - return super.getJdbcRecommendedSqlType( indicators ); + return super.getRecommendedJdbcType( indicators ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/DateTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/DateTypeDescriptor.java index 157ab70fae..63928f44b0 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/DateTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/DateTypeDescriptor.java @@ -17,9 +17,9 @@ import javax.persistence.TemporalType; import org.hibernate.HibernateException; import org.hibernate.dialect.Dialect; import org.hibernate.type.descriptor.WrapperOptions; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; -import org.hibernate.type.descriptor.sql.TimestampTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.TimestampTypeDescriptor; import org.hibernate.type.spi.TypeConfiguration; /** @@ -54,7 +54,7 @@ public class DateTypeDescriptor extends AbstractTemporalTypeDescriptor { } @Override - public SqlTypeDescriptor getJdbcRecommendedSqlType(SqlTypeDescriptorIndicators context) { + public JdbcTypeDescriptor getRecommendedJdbcType(JdbcTypeDescriptorIndicators context) { return TimestampTypeDescriptor.INSTANCE; // // return org.hibernate.type.descriptor.sql.DateTypeDescriptor.INSTANCE; diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/DoubleTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/DoubleTypeDescriptor.java index c816398b67..9bd4945796 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/DoubleTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/DoubleTypeDescriptor.java @@ -13,8 +13,8 @@ import java.sql.Types; import org.hibernate.dialect.Dialect; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.spi.Primitive; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; /** * Descriptor for {@link Double} handling. @@ -29,8 +29,8 @@ public class DoubleTypeDescriptor extends AbstractClassTypeDescriptor im } @Override - public SqlTypeDescriptor getJdbcRecommendedSqlType(SqlTypeDescriptorIndicators indicators) { - return indicators.getTypeConfiguration().getSqlTypeDescriptorRegistry().getDescriptor( Types.REAL ); + public JdbcTypeDescriptor getRecommendedJdbcType(JdbcTypeDescriptorIndicators indicators) { + return indicators.getTypeConfiguration().getJdbcTypeDescriptorRegistry().getDescriptor( Types.REAL ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/DurationJavaDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/DurationJavaDescriptor.java index c93bdd17cc..75b8fc1b74 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/DurationJavaDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/DurationJavaDescriptor.java @@ -12,9 +12,9 @@ import java.time.Duration; import org.hibernate.dialect.Dialect; import org.hibernate.internal.util.StringHelper; import org.hibernate.type.descriptor.WrapperOptions; -import org.hibernate.type.descriptor.sql.NumericTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.NumericTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; /** * Descriptor for {@link Duration}, which is represented internally @@ -44,7 +44,7 @@ public class DurationJavaDescriptor extends AbstractClassTypeDescriptor> extends AbstractClassType } @Override - public SqlTypeDescriptor getJdbcRecommendedSqlType(SqlTypeDescriptorIndicators context) { + public JdbcTypeDescriptor getRecommendedJdbcType(JdbcTypeDescriptorIndicators context) { if ( context.getEnumeratedType() != null && context.getEnumeratedType() == EnumType.STRING ) { if ( context.getColumnLength() == 1 ) { return context.isNationalized() - ? context.getTypeConfiguration().getSqlTypeDescriptorRegistry().getDescriptor( Types.NCHAR ) - : context.getTypeConfiguration().getSqlTypeDescriptorRegistry().getDescriptor( Types.CHAR ); + ? context.getTypeConfiguration().getJdbcTypeDescriptorRegistry().getDescriptor( Types.NCHAR ) + : context.getTypeConfiguration().getJdbcTypeDescriptorRegistry().getDescriptor( Types.CHAR ); } return context.isNationalized() - ? context.getTypeConfiguration().getSqlTypeDescriptorRegistry().getDescriptor( Types.NVARCHAR ) - : context.getTypeConfiguration().getSqlTypeDescriptorRegistry().getDescriptor( Types.VARCHAR ); + ? context.getTypeConfiguration().getJdbcTypeDescriptorRegistry().getDescriptor( Types.NVARCHAR ) + : context.getTypeConfiguration().getJdbcTypeDescriptorRegistry().getDescriptor( Types.VARCHAR ); } else { - return context.getTypeConfiguration().getSqlTypeDescriptorRegistry().getDescriptor( Types.TINYINT ); + return context.getTypeConfiguration().getJdbcTypeDescriptorRegistry().getDescriptor( Types.TINYINT ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/InstantJavaDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/InstantJavaDescriptor.java index 31b8df8040..964a43d58b 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/InstantJavaDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/InstantJavaDescriptor.java @@ -20,9 +20,9 @@ import javax.persistence.TemporalType; import org.hibernate.dialect.Dialect; import org.hibernate.type.descriptor.WrapperOptions; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; -import org.hibernate.type.descriptor.sql.TimestampTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.TimestampTypeDescriptor; import org.hibernate.type.spi.TypeConfiguration; /** @@ -66,7 +66,7 @@ public class InstantJavaDescriptor extends AbstractTemporalTypeDescriptor extends Serializable { * * @return The recommended SQL type descriptor */ - SqlTypeDescriptor getJdbcRecommendedSqlType(SqlTypeDescriptorIndicators context); + JdbcTypeDescriptor getRecommendedJdbcType(JdbcTypeDescriptorIndicators context); /** * The default column length when this Java type is mapped @@ -193,11 +193,11 @@ public interface JavaTypeDescriptor extends Serializable { * definition in generated DDL. * * @param columnName the name of the column - * @param sqlType the {@link SqlTypeDescriptor} of the mapped column + * @param sqlType the {@link JdbcTypeDescriptor} of the mapped column * @param dialect the SQL {@link Dialect} * @return a check constraint condition or null */ - default String getCheckCondition(String columnName, SqlTypeDescriptor sqlType, Dialect dialect) { + default String getCheckCondition(String columnName, JdbcTypeDescriptor sqlType, Dialect dialect) { return null; } } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/JdbcDateTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/JdbcDateTypeDescriptor.java index 47c6a71e15..78eb70784d 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/JdbcDateTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/JdbcDateTypeDescriptor.java @@ -17,9 +17,9 @@ import javax.persistence.TemporalType; import org.hibernate.HibernateException; import org.hibernate.type.descriptor.WrapperOptions; -import org.hibernate.type.descriptor.sql.DateTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.DateTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; import org.hibernate.type.spi.TypeConfiguration; /** @@ -72,7 +72,7 @@ public class JdbcDateTypeDescriptor extends AbstractTemporalTypeDescriptor } @Override - public SqlTypeDescriptor getJdbcRecommendedSqlType(SqlTypeDescriptorIndicators context) { + public JdbcTypeDescriptor getRecommendedJdbcType(JdbcTypeDescriptorIndicators context) { return DateTypeDescriptor.INSTANCE; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/JdbcTimeTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/JdbcTimeTypeDescriptor.java index 65fd562390..6569c78f55 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/JdbcTimeTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/JdbcTimeTypeDescriptor.java @@ -19,9 +19,9 @@ import javax.persistence.TemporalType; import org.hibernate.HibernateException; import org.hibernate.dialect.Dialect; import org.hibernate.type.descriptor.WrapperOptions; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; -import org.hibernate.type.descriptor.sql.TimeTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.TimeTypeDescriptor; import org.hibernate.type.spi.TypeConfiguration; /** @@ -68,7 +68,7 @@ public class JdbcTimeTypeDescriptor extends AbstractTemporalTypeDescriptor } @Override - public SqlTypeDescriptor getJdbcRecommendedSqlType(SqlTypeDescriptorIndicators context) { + public JdbcTypeDescriptor getRecommendedJdbcType(JdbcTypeDescriptorIndicators context) { return TimeTypeDescriptor.INSTANCE; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/JdbcTimestampTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/JdbcTimestampTypeDescriptor.java index 47cb801abc..40150a0c60 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/JdbcTimestampTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/JdbcTimestampTypeDescriptor.java @@ -22,9 +22,9 @@ import javax.persistence.TemporalType; import org.hibernate.HibernateException; import org.hibernate.dialect.Dialect; import org.hibernate.type.descriptor.WrapperOptions; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; -import org.hibernate.type.descriptor.sql.TimestampTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.TimestampTypeDescriptor; import org.hibernate.type.spi.TypeConfiguration; /** @@ -74,7 +74,7 @@ public class JdbcTimestampTypeDescriptor extends AbstractTemporalTypeDescriptor< } @Override - public SqlTypeDescriptor getJdbcRecommendedSqlType(SqlTypeDescriptorIndicators context) { + public JdbcTypeDescriptor getRecommendedJdbcType(JdbcTypeDescriptorIndicators context) { return TimestampTypeDescriptor.INSTANCE; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/LocalDateJavaDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/LocalDateJavaDescriptor.java index daae7e636b..b80386dc40 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/LocalDateJavaDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/LocalDateJavaDescriptor.java @@ -20,9 +20,9 @@ import java.util.GregorianCalendar; import javax.persistence.TemporalType; import org.hibernate.type.descriptor.WrapperOptions; -import org.hibernate.type.descriptor.sql.DateTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.DateTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; import org.hibernate.type.spi.TypeConfiguration; /** @@ -47,7 +47,7 @@ public class LocalDateJavaDescriptor extends AbstractTemporalTypeDescriptor { } @Override - public SqlTypeDescriptor getJdbcRecommendedSqlType(SqlTypeDescriptorIndicators stdIndicators) { + public JdbcTypeDescriptor getRecommendedJdbcType(JdbcTypeDescriptorIndicators stdIndicators) { final TypeConfiguration typeConfiguration = stdIndicators.getTypeConfiguration(); - final SqlTypeDescriptorRegistry stdRegistry = typeConfiguration.getSqlTypeDescriptorRegistry(); + final JdbcTypeDescriptorRegistry stdRegistry = typeConfiguration.getJdbcTypeDescriptorRegistry(); if ( stdIndicators.isLob() ) { return stdIndicators.isNationalized() @@ -53,7 +53,7 @@ public class StringTypeDescriptor extends AbstractClassTypeDescriptor { return stdRegistry.getDescriptor( Types.NVARCHAR ); } - return super.getJdbcRecommendedSqlType( stdIndicators ); + return super.getRecommendedJdbcType( stdIndicators ); } @SuppressWarnings({ "unchecked" }) diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/UUIDTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/UUIDTypeDescriptor.java index a2def4f733..9073f969fc 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/UUIDTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/UUIDTypeDescriptor.java @@ -11,9 +11,9 @@ import java.util.UUID; import org.hibernate.internal.util.BytesHelper; import org.hibernate.type.descriptor.WrapperOptions; -import org.hibernate.type.descriptor.sql.BinaryTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.BinaryTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; /** * Descriptor for {@link UUID} handling. @@ -28,7 +28,7 @@ public class UUIDTypeDescriptor extends AbstractClassTypeDescriptor { } @Override - public SqlTypeDescriptor getJdbcRecommendedSqlType(SqlTypeDescriptorIndicators context) { + public JdbcTypeDescriptor getRecommendedJdbcType(JdbcTypeDescriptorIndicators context) { return BinaryTypeDescriptor.INSTANCE; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/UrlTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/UrlTypeDescriptor.java index ac6a9b36ea..7f76de9470 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/UrlTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/UrlTypeDescriptor.java @@ -11,9 +11,9 @@ import java.net.URL; import org.hibernate.HibernateException; import org.hibernate.type.descriptor.WrapperOptions; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; -import org.hibernate.type.descriptor.sql.VarcharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.VarcharTypeDescriptor; /** * Descriptor for {@link URL} handling. @@ -28,7 +28,7 @@ public class UrlTypeDescriptor extends AbstractClassTypeDescriptor { } @Override - public SqlTypeDescriptor getJdbcRecommendedSqlType(SqlTypeDescriptorIndicators context) { + public JdbcTypeDescriptor getRecommendedJdbcType(JdbcTypeDescriptorIndicators context) { return VarcharTypeDescriptor.INSTANCE; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/ZoneOffsetJavaDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/ZoneOffsetJavaDescriptor.java index 449f6bcdd3..8bf5fa2e6c 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/ZoneOffsetJavaDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/ZoneOffsetJavaDescriptor.java @@ -8,8 +8,8 @@ package org.hibernate.type.descriptor.java; import org.hibernate.dialect.Dialect; import org.hibernate.type.descriptor.WrapperOptions; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; import java.time.ZoneOffset; import java.util.Comparator; @@ -43,8 +43,8 @@ public class ZoneOffsetJavaDescriptor extends AbstractClassTypeDescriptor extends AbstractClassTypeDescriptor } @Override - public SqlTypeDescriptor getJdbcRecommendedSqlType(SqlTypeDescriptorIndicators context) { + public JdbcTypeDescriptor getRecommendedJdbcType(JdbcTypeDescriptorIndicators context) { // none return null; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/spi/DynamicModelJtd.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/spi/DynamicModelJtd.java index 72120740e4..80011a6022 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/spi/DynamicModelJtd.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/spi/DynamicModelJtd.java @@ -10,8 +10,8 @@ import java.util.Map; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; /** * JavaTypeDescriptor for dynamic models @@ -21,7 +21,7 @@ import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; public class DynamicModelJtd implements JavaTypeDescriptor> { @Override - public SqlTypeDescriptor getJdbcRecommendedSqlType(SqlTypeDescriptorIndicators context) { + public JdbcTypeDescriptor getRecommendedJdbcType(JdbcTypeDescriptorIndicators context) { throw new UnsupportedOperationException(); } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/spi/JavaTypeDescriptorBasicAdaptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/spi/JavaTypeDescriptorBasicAdaptor.java index 89a44e0ff1..07de31230e 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/spi/JavaTypeDescriptorBasicAdaptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/spi/JavaTypeDescriptorBasicAdaptor.java @@ -9,8 +9,8 @@ package org.hibernate.type.descriptor.java.spi; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.AbstractClassTypeDescriptor; import org.hibernate.type.descriptor.java.MutabilityPlan; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; /** * AbstractBasicTypeDescriptor adapter for cases where we do not know a proper JavaTypeDescriptor @@ -28,7 +28,7 @@ public class JavaTypeDescriptorBasicAdaptor extends AbstractClassTypeDescript } @Override - public SqlTypeDescriptor getJdbcRecommendedSqlType(SqlTypeDescriptorIndicators context) { + public JdbcTypeDescriptor getRecommendedJdbcType(JdbcTypeDescriptorIndicators context) { throw new UnsupportedOperationException( "Recommended SqlTypeDescriptor not known for this Java type : " + getJavaType().getTypeName() ); diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/spi/MapEntryJavaDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/spi/MapEntryJavaDescriptor.java index ace6db195e..57ce9d91d3 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/spi/MapEntryJavaDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/java/spi/MapEntryJavaDescriptor.java @@ -10,8 +10,8 @@ import java.util.Map; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.AbstractClassTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; /** * @author Steve Ebersole @@ -27,7 +27,7 @@ public class MapEntryJavaDescriptor extends AbstractClassTypeDescriptor. */ -package org.hibernate.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.sql.CallableStatement; import java.sql.PreparedStatement; @@ -28,19 +28,19 @@ public abstract class BasicBinder implements ValueBinder { private static final String NULL_BIND_MSG_TEMPLATE = "binding parameter [%s] as [%s] - [null]"; private final JavaTypeDescriptor javaDescriptor; - private final SqlTypeDescriptor sqlDescriptor; + private final JdbcTypeDescriptor jdbcTypeDescriptor; - public JavaTypeDescriptor getJavaDescriptor() { + public JavaTypeDescriptor getJavaTypeDescriptor() { return javaDescriptor; } - public SqlTypeDescriptor getSqlDescriptor() { - return sqlDescriptor; + public JdbcTypeDescriptor getJdbcTypeDescriptor() { + return jdbcTypeDescriptor; } - public BasicBinder(JavaTypeDescriptor javaDescriptor, SqlTypeDescriptor sqlDescriptor) { + public BasicBinder(JavaTypeDescriptor javaDescriptor, JdbcTypeDescriptor jdbcTypeDescriptor) { this.javaDescriptor = javaDescriptor; - this.sqlDescriptor = sqlDescriptor; + this.jdbcTypeDescriptor = jdbcTypeDescriptor; } @Override @@ -51,11 +51,11 @@ public abstract class BasicBinder implements ValueBinder { String.format( NULL_BIND_MSG_TEMPLATE, index, - JdbcTypeNameMapper.getTypeName( getSqlDescriptor().getSqlType() ) + JdbcTypeNameMapper.getTypeName( getJdbcTypeDescriptor().getJdbcType() ) ) ); } - st.setNull( index, sqlDescriptor.getSqlType() ); + st.setNull( index, jdbcTypeDescriptor.getJdbcType() ); } else { if ( JdbcBindingLogging.TRACE_ENABLED ) { @@ -63,8 +63,8 @@ public abstract class BasicBinder implements ValueBinder { String.format( BIND_MSG_TEMPLATE, index, - JdbcTypeNameMapper.getTypeName( sqlDescriptor.getSqlType() ), - getJavaDescriptor().extractLoggableRepresentation( value ) + JdbcTypeNameMapper.getTypeName( jdbcTypeDescriptor.getJdbcType() ), + getJavaTypeDescriptor().extractLoggableRepresentation( value ) ) ); } @@ -80,11 +80,11 @@ public abstract class BasicBinder implements ValueBinder { String.format( NULL_BIND_MSG_TEMPLATE, name, - JdbcTypeNameMapper.getTypeName( getSqlDescriptor().getSqlType() ) + JdbcTypeNameMapper.getTypeName( getJdbcTypeDescriptor().getJdbcType() ) ) ); } - st.setNull( name, sqlDescriptor.getSqlType() ); + st.setNull( name, jdbcTypeDescriptor.getJdbcType() ); } else { if ( JdbcBindingLogging.TRACE_ENABLED ) { @@ -92,8 +92,8 @@ public abstract class BasicBinder implements ValueBinder { String.format( BIND_MSG_TEMPLATE, name, - JdbcTypeNameMapper.getTypeName( sqlDescriptor.getSqlType() ), - getJavaDescriptor().extractLoggableRepresentation( value ) + JdbcTypeNameMapper.getTypeName( jdbcTypeDescriptor.getJdbcType() ), + getJavaTypeDescriptor().extractLoggableRepresentation( value ) ) ); } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/BasicExtractor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/BasicExtractor.java similarity index 77% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/BasicExtractor.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/BasicExtractor.java index d8fbbdef32..a3e9cf8ec1 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/BasicExtractor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/BasicExtractor.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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.sql.CallableStatement; import java.sql.ResultSet; @@ -22,20 +22,20 @@ import org.hibernate.type.descriptor.java.JavaTypeDescriptor; * @author Steve Ebersole */ public abstract class BasicExtractor implements ValueExtractor { - private final JavaTypeDescriptor javaDescriptor; - private final SqlTypeDescriptor sqlDescriptor; + private final JavaTypeDescriptor javaTypeDescriptor; + private final JdbcTypeDescriptor jdbcTypeDescriptor; - public BasicExtractor(JavaTypeDescriptor javaDescriptor, SqlTypeDescriptor sqlDescriptor) { - this.javaDescriptor = javaDescriptor; - this.sqlDescriptor = sqlDescriptor; + public BasicExtractor(JavaTypeDescriptor javaTypeDescriptor, JdbcTypeDescriptor jdbcTypeDescriptor) { + this.javaTypeDescriptor = javaTypeDescriptor; + this.jdbcTypeDescriptor = jdbcTypeDescriptor; } - public JavaTypeDescriptor getJavaDescriptor() { - return javaDescriptor; + public JavaTypeDescriptor getJavaTypeDescriptor() { + return javaTypeDescriptor; } - public SqlTypeDescriptor getSqlDescriptor() { - return sqlDescriptor; + public JdbcTypeDescriptor getJdbcTypeDescriptor() { + return jdbcTypeDescriptor; } @Override @@ -46,7 +46,7 @@ public abstract class BasicExtractor implements ValueExtractor { JdbcExtractingLogging.LOGGER.tracef( "extracted value ([%s] : [%s]) - [null]", paramIndex, - JdbcTypeNameMapper.getTypeName( getSqlDescriptor().getSqlType() ) + JdbcTypeNameMapper.getTypeName( getJdbcTypeDescriptor().getJdbcType() ) ); } return null; @@ -56,8 +56,8 @@ public abstract class BasicExtractor implements ValueExtractor { JdbcExtractingLogging.LOGGER.tracef( "extracted value ([%s] : [%s]) - [%s]", paramIndex, - JdbcTypeNameMapper.getTypeName( getSqlDescriptor().getSqlType() ), - getJavaDescriptor().extractLoggableRepresentation( value ) + JdbcTypeNameMapper.getTypeName( getJdbcTypeDescriptor().getJdbcType() ), + getJavaTypeDescriptor().extractLoggableRepresentation( value ) ); } return value; @@ -84,7 +84,7 @@ public abstract class BasicExtractor implements ValueExtractor { JdbcExtractingLogging.LOGGER.tracef( "extracted procedure output parameter ([%s] : [%s]) - [null]", paramIndex, - JdbcTypeNameMapper.getTypeName( getSqlDescriptor().getSqlType() ) + JdbcTypeNameMapper.getTypeName( getJdbcTypeDescriptor().getJdbcType() ) ); } return null; @@ -94,8 +94,8 @@ public abstract class BasicExtractor implements ValueExtractor { JdbcExtractingLogging.LOGGER.tracef( "extracted procedure output parameter ([%s] : [%s]) - [%s]", paramIndex, - JdbcTypeNameMapper.getTypeName( getSqlDescriptor().getSqlType() ), - getJavaDescriptor().extractLoggableRepresentation( value ) + JdbcTypeNameMapper.getTypeName( getJdbcTypeDescriptor().getJdbcType() ), + getJavaTypeDescriptor().extractLoggableRepresentation( value ) ); } return value; @@ -122,7 +122,7 @@ public abstract class BasicExtractor implements ValueExtractor { JdbcExtractingLogging.LOGGER.tracef( "extracted named procedure output parameter ([%s] : [%s]) - [null]", paramName, - JdbcTypeNameMapper.getTypeName( getSqlDescriptor().getSqlType() ) + JdbcTypeNameMapper.getTypeName( getJdbcTypeDescriptor().getJdbcType() ) ); } return null; @@ -132,8 +132,8 @@ public abstract class BasicExtractor implements ValueExtractor { JdbcExtractingLogging.LOGGER.tracef( "extracted named procedure output parameter ([%s] : [%s]) - [%s]", paramName, - JdbcTypeNameMapper.getTypeName( getSqlDescriptor().getSqlType() ), - getJavaDescriptor().extractLoggableRepresentation( value ) + JdbcTypeNameMapper.getTypeName( getJdbcTypeDescriptor().getJdbcType() ), + getJavaTypeDescriptor().extractLoggableRepresentation( value ) ); } return value; diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/BigIntTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/BigIntTypeDescriptor.java similarity index 93% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/BigIntTypeDescriptor.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/BigIntTypeDescriptor.java index 047b368b6b..f6205d56b0 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/BigIntTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/BigIntTypeDescriptor.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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.sql.CallableStatement; import java.sql.PreparedStatement; @@ -17,7 +17,7 @@ import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.BasicJavaDescriptor; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.internal.JdbcLiteralFormatterNumericData; +import org.hibernate.type.descriptor.jdbc.internal.JdbcLiteralFormatterNumericData; import org.hibernate.type.spi.TypeConfiguration; /** @@ -25,14 +25,14 @@ import org.hibernate.type.spi.TypeConfiguration; * * @author Steve Ebersole */ -public class BigIntTypeDescriptor implements SqlTypeDescriptor { +public class BigIntTypeDescriptor implements JdbcTypeDescriptor { public static final BigIntTypeDescriptor INSTANCE = new BigIntTypeDescriptor(); public BigIntTypeDescriptor() { } @Override - public int getSqlType() { + public int getJdbcType() { return Types.BIGINT; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/BinaryTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/BinaryTypeDescriptor.java similarity index 89% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/BinaryTypeDescriptor.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/BinaryTypeDescriptor.java index 116bc46552..86dbbf1914 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/BinaryTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/BinaryTypeDescriptor.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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.sql.Types; /** @@ -19,7 +19,7 @@ public class BinaryTypeDescriptor extends VarbinaryTypeDescriptor { } @Override - public int getSqlType() { + public int getJdbcType() { return Types.BINARY; } } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/BlobTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/BlobTypeDescriptor.java similarity index 97% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/BlobTypeDescriptor.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/BlobTypeDescriptor.java index 4484b61421..871d97c541 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/BlobTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/BlobTypeDescriptor.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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.sql.Blob; import java.sql.CallableStatement; @@ -27,13 +27,13 @@ import org.hibernate.type.spi.TypeConfiguration; * @author Gail Badner * @author Brett Meyer */ -public abstract class BlobTypeDescriptor implements SqlTypeDescriptor { +public abstract class BlobTypeDescriptor implements JdbcTypeDescriptor { private BlobTypeDescriptor() { } @Override - public int getSqlType() { + public int getJdbcType() { return Types.BLOB; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/BooleanTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/BooleanTypeDescriptor.java similarity index 92% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/BooleanTypeDescriptor.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/BooleanTypeDescriptor.java index b60d027784..c4284ededf 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/BooleanTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/BooleanTypeDescriptor.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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.sql.CallableStatement; import java.sql.PreparedStatement; @@ -12,13 +12,12 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Types; -import org.hibernate.dialect.Dialect; import org.hibernate.type.descriptor.ValueBinder; import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.BasicJavaDescriptor; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.internal.JdbcLiteralFormatterBoolean; +import org.hibernate.type.descriptor.jdbc.internal.JdbcLiteralFormatterBoolean; import org.hibernate.type.spi.TypeConfiguration; /** @@ -26,13 +25,13 @@ import org.hibernate.type.spi.TypeConfiguration; * * @author Steve Ebersole */ -public class BooleanTypeDescriptor implements SqlTypeDescriptor { +public class BooleanTypeDescriptor implements JdbcTypeDescriptor { public static final BooleanTypeDescriptor INSTANCE = new BooleanTypeDescriptor(); public BooleanTypeDescriptor() { } - public int getSqlType() { + public int getJdbcType() { return Types.BOOLEAN; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/CharTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/CharTypeDescriptor.java similarity index 92% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/CharTypeDescriptor.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/CharTypeDescriptor.java index eaecff650a..56648ba64e 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/CharTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/CharTypeDescriptor.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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.sql.Types; import org.hibernate.type.descriptor.java.BasicJavaDescriptor; @@ -27,7 +27,7 @@ public class CharTypeDescriptor extends VarcharTypeDescriptor { } @Override - public int getSqlType() { + public int getJdbcType() { return Types.CHAR; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/ClobTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/ClobTypeDescriptor.java similarity index 97% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/ClobTypeDescriptor.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/ClobTypeDescriptor.java index f3eb4d530f..0e347a8f1f 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/ClobTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/ClobTypeDescriptor.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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.sql.CallableStatement; import java.sql.Clob; @@ -25,9 +25,9 @@ import org.hibernate.type.descriptor.java.JavaTypeDescriptor; * @author Steve Ebersole * @author Gail Badner */ -public abstract class ClobTypeDescriptor implements SqlTypeDescriptor { +public abstract class ClobTypeDescriptor implements JdbcTypeDescriptor { @Override - public int getSqlType() { + public int getJdbcType() { return Types.CLOB; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/DateTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/DateTypeDescriptor.java similarity index 93% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/DateTypeDescriptor.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/DateTypeDescriptor.java index c1b63396ad..abdc879fdb 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/DateTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/DateTypeDescriptor.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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.sql.CallableStatement; import java.sql.Date; @@ -21,7 +21,7 @@ import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.BasicJavaDescriptor; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.internal.JdbcLiteralFormatterTemporal; +import org.hibernate.type.descriptor.jdbc.internal.JdbcLiteralFormatterTemporal; import org.hibernate.type.spi.TypeConfiguration; /** @@ -29,14 +29,14 @@ import org.hibernate.type.spi.TypeConfiguration; * * @author Steve Ebersole */ -public class DateTypeDescriptor implements SqlTypeDescriptor { +public class DateTypeDescriptor implements JdbcTypeDescriptor { public static final DateTypeDescriptor INSTANCE = new DateTypeDescriptor(); public DateTypeDescriptor() { } @Override - public int getSqlType() { + public int getJdbcType() { return Types.DATE; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/DecimalTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/DecimalTypeDescriptor.java similarity index 93% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/DecimalTypeDescriptor.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/DecimalTypeDescriptor.java index acb64cc0d1..727e448895 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/DecimalTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/DecimalTypeDescriptor.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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.math.BigDecimal; import java.sql.CallableStatement; @@ -18,7 +18,7 @@ import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.BasicJavaDescriptor; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.internal.JdbcLiteralFormatterNumericData; +import org.hibernate.type.descriptor.jdbc.internal.JdbcLiteralFormatterNumericData; import org.hibernate.type.spi.TypeConfiguration; /** @@ -26,14 +26,14 @@ import org.hibernate.type.spi.TypeConfiguration; * * @author Steve Ebersole */ -public class DecimalTypeDescriptor implements SqlTypeDescriptor { +public class DecimalTypeDescriptor implements JdbcTypeDescriptor { public static final DecimalTypeDescriptor INSTANCE = new DecimalTypeDescriptor(); public DecimalTypeDescriptor() { } @Override - public int getSqlType() { + public int getJdbcType() { return Types.DECIMAL; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/DoubleTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/DoubleTypeDescriptor.java similarity index 93% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/DoubleTypeDescriptor.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/DoubleTypeDescriptor.java index 2bc4b9e452..fa9a7814b3 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/DoubleTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/DoubleTypeDescriptor.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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.sql.CallableStatement; import java.sql.PreparedStatement; @@ -17,7 +17,7 @@ import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.BasicJavaDescriptor; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.internal.JdbcLiteralFormatterNumericData; +import org.hibernate.type.descriptor.jdbc.internal.JdbcLiteralFormatterNumericData; import org.hibernate.type.spi.TypeConfiguration; /** @@ -25,14 +25,14 @@ import org.hibernate.type.spi.TypeConfiguration; * * @author Steve Ebersole */ -public class DoubleTypeDescriptor implements SqlTypeDescriptor { +public class DoubleTypeDescriptor implements JdbcTypeDescriptor { public static final DoubleTypeDescriptor INSTANCE = new DoubleTypeDescriptor(); public DoubleTypeDescriptor() { } @Override - public int getSqlType() { + public int getJdbcType() { return Types.DOUBLE; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/FloatTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/FloatTypeDescriptor.java similarity index 92% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/FloatTypeDescriptor.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/FloatTypeDescriptor.java index f022dfc749..ed7a377807 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/FloatTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/FloatTypeDescriptor.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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.sql.Types; @@ -28,7 +28,7 @@ public class FloatTypeDescriptor extends RealTypeDescriptor { } @Override - public int getSqlType() { + public int getJdbcType() { return Types.FLOAT; } } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/IntegerTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/IntegerTypeDescriptor.java similarity index 93% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/IntegerTypeDescriptor.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/IntegerTypeDescriptor.java index 2020aba473..1b9027b690 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/IntegerTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/IntegerTypeDescriptor.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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.sql.CallableStatement; import java.sql.PreparedStatement; @@ -17,7 +17,7 @@ import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.BasicJavaDescriptor; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.internal.JdbcLiteralFormatterNumericData; +import org.hibernate.type.descriptor.jdbc.internal.JdbcLiteralFormatterNumericData; import org.hibernate.type.spi.TypeConfiguration; /** @@ -25,14 +25,14 @@ import org.hibernate.type.spi.TypeConfiguration; * * @author Steve Ebersole */ -public class IntegerTypeDescriptor implements SqlTypeDescriptor { +public class IntegerTypeDescriptor implements JdbcTypeDescriptor { public static final IntegerTypeDescriptor INSTANCE = new IntegerTypeDescriptor(); public IntegerTypeDescriptor() { } @Override - public int getSqlType() { + public int getJdbcType() { return Types.INTEGER; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/JdbcLiteralFormatter.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/JdbcLiteralFormatter.java similarity index 85% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/JdbcLiteralFormatter.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/JdbcLiteralFormatter.java index 2cc0434cfa..de9dc79ee0 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/JdbcLiteralFormatter.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/JdbcLiteralFormatter.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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import org.hibernate.dialect.Dialect; import org.hibernate.type.descriptor.WrapperOptions; @@ -12,7 +12,7 @@ import org.hibernate.type.descriptor.WrapperOptions; /** * A formatter object for creating JDBC literals of a given type. *

- * Generally this is obtained from the {@link SqlTypeDescriptor#getJdbcLiteralFormatter} method + * Generally this is obtained from the {@link JdbcTypeDescriptor#getJdbcLiteralFormatter} method * and would be specific to that Java and SQL type. *

* Performs a similar function as the legacy LiteralType, except continuing the paradigm diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/SqlTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/JdbcTypeDescriptor.java similarity index 90% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/SqlTypeDescriptor.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/JdbcTypeDescriptor.java index 88781d83a7..2166fa39cc 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/SqlTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/JdbcTypeDescriptor.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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.io.Serializable; import java.sql.Types; @@ -19,17 +19,17 @@ import org.hibernate.type.spi.TypeConfiguration; /** * Descriptor for the SQL/JDBC side of a value mapping. *

- * NOTE : Implementations should be registered with the {@link SqlTypeDescriptor}. The built-in Hibernate + * NOTE : Implementations should be registered with the {@link JdbcTypeDescriptor}. The built-in Hibernate * implementations register themselves on construction. * * @author Steve Ebersole */ -public interface SqlTypeDescriptor extends Serializable { +public interface JdbcTypeDescriptor extends Serializable { /** * A "friendly" name for use in logging */ default String getFriendlyName() { - return Integer.toString( getSqlType() ); + return Integer.toString( getJdbcType() ); } /** @@ -39,15 +39,15 @@ public interface SqlTypeDescriptor extends Serializable { * * @return typeCode The JDBC type-code */ - int getSqlType(); + int getJdbcType(); /** * Get the JDBC type code associated with this SQL type descriptor * - * @see #getSqlType + * @see #getJdbcType */ default int getJdbcTypeCode() { - return getSqlType(); + return getJdbcType(); } /** @@ -64,7 +64,7 @@ public interface SqlTypeDescriptor extends Serializable { default BasicJavaDescriptor getJdbcRecommendedJavaTypeMapping(TypeConfiguration typeConfiguration) { // match legacy behavior return (BasicJavaDescriptor) typeConfiguration.getJavaTypeDescriptorRegistry().getDescriptor( - JdbcTypeJavaClassMappings.INSTANCE.determineJavaClassForJdbcTypeCode( getSqlType() ) + JdbcTypeJavaClassMappings.INSTANCE.determineJavaClassForJdbcTypeCode( getJdbcType() ) ); } @@ -96,7 +96,7 @@ public interface SqlTypeDescriptor extends Serializable { ValueExtractor getExtractor(JavaTypeDescriptor javaTypeDescriptor); default boolean isInteger() { - switch ( getSqlType() ) { + switch ( getJdbcType() ) { case Types.BIT: case Types.TINYINT: case Types.SMALLINT: @@ -108,7 +108,7 @@ public interface SqlTypeDescriptor extends Serializable { } default boolean isNumber() { - switch ( getSqlType() ) { + switch ( getJdbcType() ) { case Types.BIT: case Types.TINYINT: case Types.SMALLINT: @@ -125,7 +125,7 @@ public interface SqlTypeDescriptor extends Serializable { } default boolean isString() { - switch ( getSqlType() ) { + switch ( getJdbcType() ) { case Types.CHAR: case Types.NCHAR: case Types.VARCHAR: @@ -138,7 +138,7 @@ public interface SqlTypeDescriptor extends Serializable { } default CastType getCastType() { - switch ( getSqlType() ) { + switch ( getJdbcType() ) { case Types.INTEGER: case Types.TINYINT: case Types.SMALLINT: diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/SqlTypeDescriptorIndicators.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/JdbcTypeDescriptorIndicators.java similarity index 89% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/SqlTypeDescriptorIndicators.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/JdbcTypeDescriptorIndicators.java index fd55ccd3fb..629722aa33 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/SqlTypeDescriptorIndicators.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/JdbcTypeDescriptorIndicators.java @@ -4,23 +4,24 @@ * 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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.sql.Types; import javax.persistence.EnumType; import javax.persistence.TemporalType; +import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry; import org.hibernate.type.spi.TypeConfiguration; /** * More-or-less a parameter-object intended for use in determining the SQL/JDBC type recommended * by the JDBC spec (explicitly or implicitly) for a given Java type. * - * @see org.hibernate.type.descriptor.java.BasicJavaDescriptor#getJdbcRecommendedSqlType + * @see org.hibernate.type.descriptor.java.BasicJavaDescriptor#getRecommendedJdbcType * * @author Steve Ebersole */ -public interface SqlTypeDescriptorIndicators { +public interface JdbcTypeDescriptorIndicators { int NO_COLUMN_LENGTH = -1; /** @@ -61,7 +62,7 @@ public interface SqlTypeDescriptorIndicators { * When mapping a boolean type to the database what is the preferred SQL type code to use? *

* Specifically names the key into the - * {@link org.hibernate.type.descriptor.sql.spi.SqlTypeDescriptorRegistry}. + * {@link JdbcTypeDescriptorRegistry}. */ default int getPreferredSqlTypeCodeForBoolean() { return Types.BOOLEAN; diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/JdbcTypeFamilyInformation.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/JdbcTypeFamilyInformation.java similarity index 97% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/JdbcTypeFamilyInformation.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/JdbcTypeFamilyInformation.java index 4c89a15f1f..d31adc5f77 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/JdbcTypeFamilyInformation.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/JdbcTypeFamilyInformation.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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.sql.Types; import java.util.concurrent.ConcurrentHashMap; diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/JdbcTypeJavaClassMappings.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/JdbcTypeJavaClassMappings.java similarity index 99% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/JdbcTypeJavaClassMappings.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/JdbcTypeJavaClassMappings.java index 9b30f72329..ab8989ac91 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/JdbcTypeJavaClassMappings.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/JdbcTypeJavaClassMappings.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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.math.BigDecimal; import java.math.BigInteger; diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/LobTypeMappings.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LobTypeMappings.java similarity index 98% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/LobTypeMappings.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LobTypeMappings.java index 82873ecffe..ede0bfdbfe 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/LobTypeMappings.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LobTypeMappings.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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.sql.Types; import java.util.Locale; diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/LongNVarcharTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LongNVarcharTypeDescriptor.java similarity index 90% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/LongNVarcharTypeDescriptor.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LongNVarcharTypeDescriptor.java index e20ef9a543..3b3b5e581c 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/LongNVarcharTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LongNVarcharTypeDescriptor.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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.sql.Types; @@ -25,7 +25,7 @@ public class LongNVarcharTypeDescriptor extends NVarcharTypeDescriptor { } @Override - public int getSqlType() { + public int getJdbcType() { return Types.LONGNVARCHAR; } } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/LongVarbinaryTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LongVarbinaryTypeDescriptor.java similarity index 89% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/LongVarbinaryTypeDescriptor.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LongVarbinaryTypeDescriptor.java index 452540fb8c..f065b45c64 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/LongVarbinaryTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LongVarbinaryTypeDescriptor.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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.sql.Types; @@ -20,7 +20,7 @@ public class LongVarbinaryTypeDescriptor extends VarbinaryTypeDescriptor { } @Override - public int getSqlType() { + public int getJdbcType() { return Types.LONGVARBINARY; } } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/LongVarcharTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LongVarcharTypeDescriptor.java similarity index 90% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/LongVarcharTypeDescriptor.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LongVarcharTypeDescriptor.java index 75ce0cd4e7..a1b6240d1e 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/LongVarcharTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LongVarcharTypeDescriptor.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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.sql.Types; @@ -25,7 +25,7 @@ public class LongVarcharTypeDescriptor extends VarcharTypeDescriptor { } @Override - public int getSqlType() { + public int getJdbcType() { return Types.LONGVARCHAR; } } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/NCharTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/NCharTypeDescriptor.java similarity index 90% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/NCharTypeDescriptor.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/NCharTypeDescriptor.java index a2534542ec..305222c99c 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/NCharTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/NCharTypeDescriptor.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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.sql.Types; @@ -25,7 +25,7 @@ public class NCharTypeDescriptor extends NVarcharTypeDescriptor { } @Override - public int getSqlType() { + public int getJdbcType() { return Types.NCHAR; } } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/NClobTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/NClobTypeDescriptor.java similarity index 97% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/NClobTypeDescriptor.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/NClobTypeDescriptor.java index 68cd5cc33d..f0f66931cc 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/NClobTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/NClobTypeDescriptor.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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.sql.CallableStatement; import java.sql.NClob; @@ -25,9 +25,9 @@ import org.hibernate.type.descriptor.java.JavaTypeDescriptor; * @author Steve Ebersole * @author Gail Badner */ -public abstract class NClobTypeDescriptor implements SqlTypeDescriptor { +public abstract class NClobTypeDescriptor implements JdbcTypeDescriptor { @Override - public int getSqlType() { + public int getJdbcType() { return Types.NCLOB; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/NVarcharTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/NVarcharTypeDescriptor.java similarity index 93% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/NVarcharTypeDescriptor.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/NVarcharTypeDescriptor.java index c9198fded9..0164c23b3b 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/NVarcharTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/NVarcharTypeDescriptor.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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.sql.CallableStatement; import java.sql.PreparedStatement; @@ -17,7 +17,7 @@ import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.BasicJavaDescriptor; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.internal.JdbcLiteralFormatterCharacterData; +import org.hibernate.type.descriptor.jdbc.internal.JdbcLiteralFormatterCharacterData; import org.hibernate.type.spi.TypeConfiguration; /** @@ -25,14 +25,14 @@ import org.hibernate.type.spi.TypeConfiguration; * * @author Steve Ebersole */ -public class NVarcharTypeDescriptor implements SqlTypeDescriptor { +public class NVarcharTypeDescriptor implements JdbcTypeDescriptor { public static final NVarcharTypeDescriptor INSTANCE = new NVarcharTypeDescriptor(); public NVarcharTypeDescriptor() { } @Override - public int getSqlType() { + public int getJdbcType() { return Types.NVARCHAR; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/NationalizedTypeMappings.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/NationalizedTypeMappings.java similarity index 97% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/NationalizedTypeMappings.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/NationalizedTypeMappings.java index d17b5952ec..f2c52ad9b1 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/NationalizedTypeMappings.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/NationalizedTypeMappings.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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.sql.Types; diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/NumericTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/NumericTypeDescriptor.java similarity index 90% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/NumericTypeDescriptor.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/NumericTypeDescriptor.java index ca2a88fade..dffe8ca3ce 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/NumericTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/NumericTypeDescriptor.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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.sql.Types; @@ -25,7 +25,7 @@ public class NumericTypeDescriptor extends DecimalTypeDescriptor { } @Override - public int getSqlType() { + public int getJdbcType() { return Types.NUMERIC; } } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/ObjectSqlTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/ObjectJdbcTypeDescriptor.java similarity index 89% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/ObjectSqlTypeDescriptor.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/ObjectJdbcTypeDescriptor.java index 4057a40e92..25f92fe706 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/ObjectSqlTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/ObjectJdbcTypeDescriptor.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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.io.Serializable; import java.sql.CallableStatement; @@ -22,20 +22,20 @@ import org.hibernate.type.descriptor.java.JavaTypeDescriptor; * Descriptor for * @author Steve Ebersole */ -public class ObjectSqlTypeDescriptor implements SqlTypeDescriptor { +public class ObjectJdbcTypeDescriptor implements JdbcTypeDescriptor { /** * Singleton access */ - public static final ObjectSqlTypeDescriptor INSTANCE = new ObjectSqlTypeDescriptor( Types.JAVA_OBJECT ); + public static final ObjectJdbcTypeDescriptor INSTANCE = new ObjectJdbcTypeDescriptor( Types.JAVA_OBJECT ); private final int jdbcTypeCode; - public ObjectSqlTypeDescriptor(int jdbcTypeCode) { + public ObjectJdbcTypeDescriptor(int jdbcTypeCode) { this.jdbcTypeCode = jdbcTypeCode; } @Override - public int getSqlType() { + public int getJdbcType() { return jdbcTypeCode; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/RealTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/RealTypeDescriptor.java similarity index 93% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/RealTypeDescriptor.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/RealTypeDescriptor.java index 3261c478f6..436febe009 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/RealTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/RealTypeDescriptor.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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.sql.CallableStatement; import java.sql.PreparedStatement; @@ -17,7 +17,7 @@ import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.BasicJavaDescriptor; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.internal.JdbcLiteralFormatterNumericData; +import org.hibernate.type.descriptor.jdbc.internal.JdbcLiteralFormatterNumericData; import org.hibernate.type.spi.TypeConfiguration; /** @@ -25,14 +25,14 @@ import org.hibernate.type.spi.TypeConfiguration; * * @author Steve Ebersole */ -public class RealTypeDescriptor implements SqlTypeDescriptor { +public class RealTypeDescriptor implements JdbcTypeDescriptor { public static final RealTypeDescriptor INSTANCE = new RealTypeDescriptor(); public RealTypeDescriptor() { } @Override - public int getSqlType() { + public int getJdbcType() { return Types.REAL; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/SmallIntTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/SmallIntTypeDescriptor.java similarity index 93% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/SmallIntTypeDescriptor.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/SmallIntTypeDescriptor.java index a7b3ebd36a..d30ed4f5cc 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/SmallIntTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/SmallIntTypeDescriptor.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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.sql.CallableStatement; import java.sql.PreparedStatement; @@ -17,7 +17,7 @@ import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.BasicJavaDescriptor; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.internal.JdbcLiteralFormatterNumericData; +import org.hibernate.type.descriptor.jdbc.internal.JdbcLiteralFormatterNumericData; import org.hibernate.type.spi.TypeConfiguration; /** @@ -25,14 +25,14 @@ import org.hibernate.type.spi.TypeConfiguration; * * @author Steve Ebersole */ -public class SmallIntTypeDescriptor implements SqlTypeDescriptor { +public class SmallIntTypeDescriptor implements JdbcTypeDescriptor { public static final SmallIntTypeDescriptor INSTANCE = new SmallIntTypeDescriptor(); public SmallIntTypeDescriptor() { } @Override - public int getSqlType() { + public int getJdbcType() { return Types.SMALLINT; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/TimeTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/TimeTypeDescriptor.java similarity index 95% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/TimeTypeDescriptor.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/TimeTypeDescriptor.java index 05025e82c1..675c613452 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/TimeTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/TimeTypeDescriptor.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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.sql.CallableStatement; import java.sql.PreparedStatement; @@ -21,7 +21,7 @@ import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.BasicJavaDescriptor; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.internal.JdbcLiteralFormatterTemporal; +import org.hibernate.type.descriptor.jdbc.internal.JdbcLiteralFormatterTemporal; import org.hibernate.type.spi.TypeConfiguration; /** @@ -29,14 +29,14 @@ import org.hibernate.type.spi.TypeConfiguration; * * @author Steve Ebersole */ -public class TimeTypeDescriptor implements SqlTypeDescriptor { +public class TimeTypeDescriptor implements JdbcTypeDescriptor { public static final TimeTypeDescriptor INSTANCE = new TimeTypeDescriptor(); public TimeTypeDescriptor() { } @Override - public int getSqlType() { + public int getJdbcType() { return Types.TIME; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/TimestampTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/TimestampTypeDescriptor.java similarity index 95% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/TimestampTypeDescriptor.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/TimestampTypeDescriptor.java index 1fbcc6461b..164005d861 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/TimestampTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/TimestampTypeDescriptor.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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.sql.CallableStatement; import java.sql.PreparedStatement; @@ -21,7 +21,7 @@ import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.BasicJavaDescriptor; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.internal.JdbcLiteralFormatterTemporal; +import org.hibernate.type.descriptor.jdbc.internal.JdbcLiteralFormatterTemporal; import org.hibernate.type.spi.TypeConfiguration; /** @@ -29,14 +29,14 @@ import org.hibernate.type.spi.TypeConfiguration; * * @author Steve Ebersole */ -public class TimestampTypeDescriptor implements SqlTypeDescriptor { +public class TimestampTypeDescriptor implements JdbcTypeDescriptor { public static final TimestampTypeDescriptor INSTANCE = new TimestampTypeDescriptor(); public TimestampTypeDescriptor() { } @Override - public int getSqlType() { + public int getJdbcType() { return Types.TIMESTAMP; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/TimestampWithTimeZoneDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/TimestampWithTimeZoneDescriptor.java similarity index 95% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/TimestampWithTimeZoneDescriptor.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/TimestampWithTimeZoneDescriptor.java index 1a5f6362c4..f2b860f434 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/TimestampWithTimeZoneDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/TimestampWithTimeZoneDescriptor.java @@ -4,14 +4,14 @@ * 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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import org.hibernate.type.descriptor.ValueBinder; import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.BasicJavaDescriptor; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.internal.JdbcLiteralFormatterTemporal; +import org.hibernate.type.descriptor.jdbc.internal.JdbcLiteralFormatterTemporal; import org.hibernate.type.spi.TypeConfiguration; import javax.persistence.TemporalType; @@ -28,14 +28,14 @@ import java.time.OffsetDateTime; * * @author Gavin King */ -public class TimestampWithTimeZoneDescriptor implements SqlTypeDescriptor { +public class TimestampWithTimeZoneDescriptor implements JdbcTypeDescriptor { public static final TimestampWithTimeZoneDescriptor INSTANCE = new TimestampWithTimeZoneDescriptor(); public TimestampWithTimeZoneDescriptor() { } @Override - public int getSqlType() { + public int getJdbcType() { return Types.TIMESTAMP_WITH_TIMEZONE; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/TinyIntTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/TinyIntTypeDescriptor.java similarity index 93% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/TinyIntTypeDescriptor.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/TinyIntTypeDescriptor.java index 8e5ca1664a..2f89ff2ce9 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/TinyIntTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/TinyIntTypeDescriptor.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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.sql.CallableStatement; import java.sql.PreparedStatement; @@ -17,7 +17,7 @@ import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.BasicJavaDescriptor; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.internal.JdbcLiteralFormatterNumericData; +import org.hibernate.type.descriptor.jdbc.internal.JdbcLiteralFormatterNumericData; import org.hibernate.type.spi.TypeConfiguration; /** @@ -28,14 +28,14 @@ import org.hibernate.type.spi.TypeConfiguration; * * @author Steve Ebersole */ -public class TinyIntTypeDescriptor implements SqlTypeDescriptor { +public class TinyIntTypeDescriptor implements JdbcTypeDescriptor { public static final TinyIntTypeDescriptor INSTANCE = new TinyIntTypeDescriptor(); public TinyIntTypeDescriptor() { } @Override - public int getSqlType() { + public int getJdbcType() { return Types.TINYINT; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/VarbinaryTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/VarbinaryTypeDescriptor.java similarity index 93% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/VarbinaryTypeDescriptor.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/VarbinaryTypeDescriptor.java index eff80b72f1..c1f2f4f09b 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/VarbinaryTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/VarbinaryTypeDescriptor.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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.sql.CallableStatement; import java.sql.PreparedStatement; @@ -17,7 +17,7 @@ import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.BasicJavaDescriptor; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.internal.JdbcLiteralFormatterBinary; +import org.hibernate.type.descriptor.jdbc.internal.JdbcLiteralFormatterBinary; import org.hibernate.type.spi.TypeConfiguration; /** @@ -25,7 +25,7 @@ import org.hibernate.type.spi.TypeConfiguration; * * @author Steve Ebersole */ -public class VarbinaryTypeDescriptor implements SqlTypeDescriptor { +public class VarbinaryTypeDescriptor implements JdbcTypeDescriptor { public static final VarbinaryTypeDescriptor INSTANCE = new VarbinaryTypeDescriptor(); public static final VarbinaryTypeDescriptor INSTANCE_WITHOUT_LITERALS = new VarbinaryTypeDescriptor( false ); @@ -49,7 +49,7 @@ public class VarbinaryTypeDescriptor implements SqlTypeDescriptor { return "VarbinaryTypeDescriptor"; } - public int getSqlType() { + public int getJdbcType() { return Types.VARBINARY; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/VarcharTypeDescriptor.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/VarcharTypeDescriptor.java similarity index 93% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/VarcharTypeDescriptor.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/VarcharTypeDescriptor.java index e6cdb35f90..8f29ada350 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/VarcharTypeDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/VarcharTypeDescriptor.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.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; import java.sql.CallableStatement; import java.sql.PreparedStatement; @@ -17,7 +17,7 @@ import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.BasicJavaDescriptor; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.internal.JdbcLiteralFormatterCharacterData; +import org.hibernate.type.descriptor.jdbc.internal.JdbcLiteralFormatterCharacterData; import org.hibernate.type.spi.TypeConfiguration; /** @@ -25,14 +25,14 @@ import org.hibernate.type.spi.TypeConfiguration; * * @author Steve Ebersole */ -public class VarcharTypeDescriptor implements SqlTypeDescriptor { +public class VarcharTypeDescriptor implements JdbcTypeDescriptor { public static final VarcharTypeDescriptor INSTANCE = new VarcharTypeDescriptor(); public VarcharTypeDescriptor() { } @Override - public int getSqlType() { + public int getJdbcType() { return Types.VARCHAR; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/internal/JdbcLiteralFormatterBinary.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/internal/JdbcLiteralFormatterBinary.java similarity index 87% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/internal/JdbcLiteralFormatterBinary.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/internal/JdbcLiteralFormatterBinary.java index 571d6e1416..acdb578adc 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/internal/JdbcLiteralFormatterBinary.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/internal/JdbcLiteralFormatterBinary.java @@ -4,12 +4,12 @@ * 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.type.descriptor.sql.internal; +package org.hibernate.type.descriptor.jdbc.internal; import org.hibernate.dialect.Dialect; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.spi.BasicJdbcLiteralFormatter; +import org.hibernate.type.descriptor.jdbc.spi.BasicJdbcLiteralFormatter; /** * JdbcLiteralFormatter implementation for handling binary literals diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/internal/JdbcLiteralFormatterBoolean.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/internal/JdbcLiteralFormatterBoolean.java similarity index 87% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/internal/JdbcLiteralFormatterBoolean.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/internal/JdbcLiteralFormatterBoolean.java index 05a64bfed9..8a4321f8bf 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/internal/JdbcLiteralFormatterBoolean.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/internal/JdbcLiteralFormatterBoolean.java @@ -4,12 +4,12 @@ * 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.type.descriptor.sql.internal; +package org.hibernate.type.descriptor.jdbc.internal; import org.hibernate.dialect.Dialect; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.spi.BasicJdbcLiteralFormatter; +import org.hibernate.type.descriptor.jdbc.spi.BasicJdbcLiteralFormatter; /** * JdbcLiteralFormatter implementation for handling boolean literals diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/internal/JdbcLiteralFormatterCharacterData.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/internal/JdbcLiteralFormatterCharacterData.java similarity index 91% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/internal/JdbcLiteralFormatterCharacterData.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/internal/JdbcLiteralFormatterCharacterData.java index e5710b4059..bc0aa0be14 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/internal/JdbcLiteralFormatterCharacterData.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/internal/JdbcLiteralFormatterCharacterData.java @@ -4,12 +4,12 @@ * 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.type.descriptor.sql.internal; +package org.hibernate.type.descriptor.jdbc.internal; import org.hibernate.dialect.Dialect; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.spi.BasicJdbcLiteralFormatter; +import org.hibernate.type.descriptor.jdbc.spi.BasicJdbcLiteralFormatter; /** * JdbcLiteralFormatter implementation for handling character data diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/internal/JdbcLiteralFormatterNumericData.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/internal/JdbcLiteralFormatterNumericData.java similarity index 88% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/internal/JdbcLiteralFormatterNumericData.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/internal/JdbcLiteralFormatterNumericData.java index e4c1967574..8773e9b8a5 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/internal/JdbcLiteralFormatterNumericData.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/internal/JdbcLiteralFormatterNumericData.java @@ -4,12 +4,12 @@ * 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.type.descriptor.sql.internal; +package org.hibernate.type.descriptor.jdbc.internal; import org.hibernate.dialect.Dialect; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.spi.BasicJdbcLiteralFormatter; +import org.hibernate.type.descriptor.jdbc.spi.BasicJdbcLiteralFormatter; /** * @author Steve Ebersole diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/internal/JdbcLiteralFormatterTemporal.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/internal/JdbcLiteralFormatterTemporal.java similarity index 94% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/internal/JdbcLiteralFormatterTemporal.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/internal/JdbcLiteralFormatterTemporal.java index 11ce93a292..0d2258cd9f 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/internal/JdbcLiteralFormatterTemporal.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/internal/JdbcLiteralFormatterTemporal.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.type.descriptor.sql.internal; +package org.hibernate.type.descriptor.jdbc.internal; import java.time.temporal.TemporalAccessor; import java.util.TimeZone; @@ -13,7 +13,7 @@ import javax.persistence.TemporalType; import org.hibernate.dialect.Dialect; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.spi.BasicJdbcLiteralFormatter; +import org.hibernate.type.descriptor.jdbc.spi.BasicJdbcLiteralFormatter; /** * @author Steve Ebersole diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/internal/SqlTypeDescriptorBaseline.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/internal/JdbcTypeDescriptorBaseline.java similarity index 50% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/internal/SqlTypeDescriptorBaseline.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/internal/JdbcTypeDescriptorBaseline.java index 0d6131b153..f8c8cff368 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/internal/SqlTypeDescriptorBaseline.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/internal/JdbcTypeDescriptorBaseline.java @@ -4,43 +4,43 @@ * 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.type.descriptor.sql.internal; +package org.hibernate.type.descriptor.jdbc.internal; -import org.hibernate.type.descriptor.sql.BigIntTypeDescriptor; -import org.hibernate.type.descriptor.sql.BinaryTypeDescriptor; -import org.hibernate.type.descriptor.sql.BlobTypeDescriptor; -import org.hibernate.type.descriptor.sql.BooleanTypeDescriptor; -import org.hibernate.type.descriptor.sql.CharTypeDescriptor; -import org.hibernate.type.descriptor.sql.ClobTypeDescriptor; -import org.hibernate.type.descriptor.sql.DateTypeDescriptor; -import org.hibernate.type.descriptor.sql.DecimalTypeDescriptor; -import org.hibernate.type.descriptor.sql.DoubleTypeDescriptor; -import org.hibernate.type.descriptor.sql.FloatTypeDescriptor; -import org.hibernate.type.descriptor.sql.IntegerTypeDescriptor; -import org.hibernate.type.descriptor.sql.LongNVarcharTypeDescriptor; -import org.hibernate.type.descriptor.sql.LongVarbinaryTypeDescriptor; -import org.hibernate.type.descriptor.sql.LongVarcharTypeDescriptor; -import org.hibernate.type.descriptor.sql.NCharTypeDescriptor; -import org.hibernate.type.descriptor.sql.NClobTypeDescriptor; -import org.hibernate.type.descriptor.sql.NVarcharTypeDescriptor; -import org.hibernate.type.descriptor.sql.NumericTypeDescriptor; -import org.hibernate.type.descriptor.sql.RealTypeDescriptor; -import org.hibernate.type.descriptor.sql.SmallIntTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.TimeTypeDescriptor; -import org.hibernate.type.descriptor.sql.TimestampTypeDescriptor; -import org.hibernate.type.descriptor.sql.TinyIntTypeDescriptor; -import org.hibernate.type.descriptor.sql.VarbinaryTypeDescriptor; -import org.hibernate.type.descriptor.sql.VarcharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.BigIntTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.BinaryTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.BlobTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.BooleanTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.CharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.ClobTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.DateTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.DecimalTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.DoubleTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.FloatTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.IntegerTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.LongNVarcharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.LongVarbinaryTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.LongVarcharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.NCharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.NClobTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.NVarcharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.NumericTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.RealTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.SmallIntTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.TimeTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.TimestampTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.TinyIntTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.VarbinaryTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.VarcharTypeDescriptor; /** - * Registers the base {@link SqlTypeDescriptor} instances. + * Registers the base {@link JdbcTypeDescriptor} instances. * * @author Chris Cranford */ -public class SqlTypeDescriptorBaseline { +public class JdbcTypeDescriptorBaseline { public interface BaselineTarget { - void addDescriptor(SqlTypeDescriptor descriptor); + void addDescriptor(JdbcTypeDescriptor descriptor); } public static void prime(BaselineTarget target) { diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/package-info.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/package-info.java similarity index 96% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/package-info.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/package-info.java index 24e6772e1f..d828d3d5c1 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/package-info.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/package-info.java @@ -23,4 +23,4 @@ * * @see java.sql.Types */ -package org.hibernate.type.descriptor.sql; +package org.hibernate.type.descriptor.jdbc; diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/spi/AbstractJdbcLiteralFormatter.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/spi/AbstractJdbcLiteralFormatter.java similarity index 87% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/spi/AbstractJdbcLiteralFormatter.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/spi/AbstractJdbcLiteralFormatter.java index f1ea00c829..ded3847f3b 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/spi/AbstractJdbcLiteralFormatter.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/spi/AbstractJdbcLiteralFormatter.java @@ -4,10 +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.type.descriptor.sql.spi; +package org.hibernate.type.descriptor.jdbc.spi; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.JdbcLiteralFormatter; +import org.hibernate.type.descriptor.jdbc.JdbcLiteralFormatter; /** * Abstract JdbcLiteralFormatter implementation managing the JavaTypeDescriptor diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/spi/BasicJdbcLiteralFormatter.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/spi/BasicJdbcLiteralFormatter.java similarity index 95% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/spi/BasicJdbcLiteralFormatter.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/spi/BasicJdbcLiteralFormatter.java index faa09e2084..b65a7b700a 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/spi/BasicJdbcLiteralFormatter.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/spi/BasicJdbcLiteralFormatter.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.type.descriptor.sql.spi; +package org.hibernate.type.descriptor.jdbc.spi; import org.hibernate.type.descriptor.WrapperOptions; diff --git a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/spi/SqlTypeDescriptorRegistry.java b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/spi/JdbcTypeDescriptorRegistry.java similarity index 57% rename from hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/spi/SqlTypeDescriptorRegistry.java rename to hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/spi/JdbcTypeDescriptorRegistry.java index b57cbab85a..86813e0c0f 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/descriptor/sql/spi/SqlTypeDescriptorRegistry.java +++ b/hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/spi/JdbcTypeDescriptorRegistry.java @@ -4,58 +4,58 @@ * 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.type.descriptor.sql.spi; +package org.hibernate.type.descriptor.jdbc.spi; import java.io.Serializable; import java.util.concurrent.ConcurrentHashMap; import org.hibernate.type.descriptor.JdbcTypeNameMapper; -import org.hibernate.type.descriptor.sql.JdbcTypeFamilyInformation; -import org.hibernate.type.descriptor.sql.ObjectSqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.internal.SqlTypeDescriptorBaseline; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeFamilyInformation; +import org.hibernate.type.descriptor.jdbc.ObjectJdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.internal.JdbcTypeDescriptorBaseline; import org.hibernate.type.spi.TypeConfiguration; import org.jboss.logging.Logger; /** - * Basically a map from JDBC type code (int) -> {@link SqlTypeDescriptor} + * Basically a map from JDBC type code (int) -> {@link JdbcTypeDescriptor} * * @author Steve Ebersole * @author Andrea Boriero * * @since 5.3 */ -public class SqlTypeDescriptorRegistry implements SqlTypeDescriptorBaseline.BaselineTarget, Serializable { - private static final Logger log = Logger.getLogger( SqlTypeDescriptorRegistry.class ); +public class JdbcTypeDescriptorRegistry implements JdbcTypeDescriptorBaseline.BaselineTarget, Serializable { + private static final Logger log = Logger.getLogger( JdbcTypeDescriptorRegistry.class ); - private ConcurrentHashMap descriptorMap = new ConcurrentHashMap<>(); + private ConcurrentHashMap descriptorMap = new ConcurrentHashMap<>(); - public SqlTypeDescriptorRegistry(TypeConfiguration typeConfiguration) { + public JdbcTypeDescriptorRegistry(TypeConfiguration typeConfiguration) { // this.typeConfiguration = typeConfiguration; - SqlTypeDescriptorBaseline.prime( this ); + JdbcTypeDescriptorBaseline.prime( this ); } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // baseline descriptors @Override - public void addDescriptor(SqlTypeDescriptor sqlTypeDescriptor) { - final SqlTypeDescriptor previous = descriptorMap.put( sqlTypeDescriptor.getSqlType(), sqlTypeDescriptor ); - if ( previous != null && previous != sqlTypeDescriptor ) { - log.debugf( "addDescriptor(%s) replaced previous registration(%s)", sqlTypeDescriptor, previous ); + public void addDescriptor(JdbcTypeDescriptor jdbcTypeDescriptor) { + final JdbcTypeDescriptor previous = descriptorMap.put( jdbcTypeDescriptor.getJdbcTypeCode(), jdbcTypeDescriptor ); + if ( previous != null && previous != jdbcTypeDescriptor ) { + log.debugf( "addDescriptor(%s) replaced previous registration(%s)", jdbcTypeDescriptor, previous ); } } - public void addDescriptor(int typeCode, SqlTypeDescriptor sqlTypeDescriptor) { - final SqlTypeDescriptor previous = descriptorMap.put( typeCode, sqlTypeDescriptor ); - if ( previous != null && previous != sqlTypeDescriptor ) { - log.debugf( "addDescriptor(%d, %s) replaced previous registration(%s)", typeCode, sqlTypeDescriptor, previous ); + public void addDescriptor(int typeCode, JdbcTypeDescriptor jdbcTypeDescriptor) { + final JdbcTypeDescriptor previous = descriptorMap.put( typeCode, jdbcTypeDescriptor ); + if ( previous != null && previous != jdbcTypeDescriptor ) { + log.debugf( "addDescriptor(%d, %s) replaced previous registration(%s)", typeCode, jdbcTypeDescriptor, previous ); } } - public SqlTypeDescriptor getDescriptor(int jdbcTypeCode) { - SqlTypeDescriptor descriptor = descriptorMap.get( jdbcTypeCode ); + public JdbcTypeDescriptor getDescriptor(int jdbcTypeCode) { + JdbcTypeDescriptor descriptor = descriptorMap.get( jdbcTypeCode ); if ( descriptor != null ) { return descriptor; } @@ -72,7 +72,7 @@ public class SqlTypeDescriptorRegistry implements SqlTypeDescriptorBaseline.Base if ( family != null ) { for ( int potentialAlternateTypeCode : family.getTypeCodes() ) { if ( potentialAlternateTypeCode != jdbcTypeCode ) { - final SqlTypeDescriptor potentialAlternateDescriptor = descriptorMap.get( potentialAlternateTypeCode ); + final JdbcTypeDescriptor potentialAlternateDescriptor = descriptorMap.get( potentialAlternateTypeCode ); if ( potentialAlternateDescriptor != null ) { // todo (6.0) : add a SqlTypeDescriptor#canBeAssignedFrom method ? return potentialAlternateDescriptor; @@ -89,7 +89,7 @@ public class SqlTypeDescriptorRegistry implements SqlTypeDescriptorBaseline.Base } // finally, create a new descriptor mapping to getObject/setObject for this type code... - final ObjectSqlTypeDescriptor fallBackDescriptor = new ObjectSqlTypeDescriptor( jdbcTypeCode ); + final ObjectJdbcTypeDescriptor fallBackDescriptor = new ObjectJdbcTypeDescriptor( jdbcTypeCode ); addDescriptor( fallBackDescriptor ); return fallBackDescriptor; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/internal/StandardBasicTypeImpl.java b/hibernate-core/src/main/java/org/hibernate/type/internal/StandardBasicTypeImpl.java index 9aa08af5dd..87da0ef689 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/internal/StandardBasicTypeImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/type/internal/StandardBasicTypeImpl.java @@ -15,8 +15,8 @@ import org.hibernate.type.BasicType; import org.hibernate.type.SqlTypeDescriptorIndicatorCapable; import org.hibernate.type.descriptor.java.BooleanTypeDescriptor; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; /** * @author Steve Ebersole @@ -27,7 +27,7 @@ public class StandardBasicTypeImpl implements SqlTypeDescriptorIndicatorCapable { public static final String[] NO_REG_KEYS = ArrayHelper.EMPTY_STRING_ARRAY; - public StandardBasicTypeImpl(JavaTypeDescriptor jtd, SqlTypeDescriptor std) { + public StandardBasicTypeImpl(JavaTypeDescriptor jtd, JdbcTypeDescriptor std) { //noinspection unchecked super( std, jtd ); } @@ -45,9 +45,9 @@ public class StandardBasicTypeImpl } @Override - public BasicType resolveIndicatedType(SqlTypeDescriptorIndicators indicators) { - final SqlTypeDescriptor recommendedSqlType = getJavaTypeDescriptor().getJdbcRecommendedSqlType( indicators ); - if ( recommendedSqlType == getSqlTypeDescriptor() ) { + public BasicType resolveIndicatedType(JdbcTypeDescriptorIndicators indicators) { + final JdbcTypeDescriptor recommendedSqlType = getJavaTypeDescriptor().getRecommendedJdbcType( indicators ); + if ( recommendedSqlType == getJdbcTypeDescriptor() ) { return this; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/spi/TypeConfiguration.java b/hibernate-core/src/main/java/org/hibernate/type/spi/TypeConfiguration.java index 01ff25434e..a8504fb386 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/spi/TypeConfiguration.java +++ b/hibernate-core/src/main/java/org/hibernate/type/spi/TypeConfiguration.java @@ -50,9 +50,9 @@ import org.hibernate.type.SingleColumnType; import org.hibernate.type.StandardBasicTypes; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; import org.hibernate.type.descriptor.java.spi.JavaTypeDescriptorRegistry; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; -import org.hibernate.type.descriptor.sql.spi.SqlTypeDescriptorRegistry; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry; import org.hibernate.type.internal.StandardBasicTypeImpl; import java.sql.Time; @@ -92,7 +92,7 @@ public class TypeConfiguration implements SessionFactoryObserver, Serializable { // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // things available during both boot and runtime lifecycle phases private final transient JavaTypeDescriptorRegistry javaTypeDescriptorRegistry; - private final transient SqlTypeDescriptorRegistry sqlTypeDescriptorRegistry; + private final transient JdbcTypeDescriptorRegistry jdbcTypeDescriptorRegistry; private final transient BasicTypeRegistry basicTypeRegistry; private final transient Map> jdbcToHibernateTypeContributionMap = new HashMap<>(); @@ -101,7 +101,7 @@ public class TypeConfiguration implements SessionFactoryObserver, Serializable { this.scope = new Scope( this ); this.javaTypeDescriptorRegistry = new JavaTypeDescriptorRegistry( this ); - this.sqlTypeDescriptorRegistry = new SqlTypeDescriptorRegistry( this ); + this.jdbcTypeDescriptorRegistry = new JdbcTypeDescriptorRegistry( this ); this.basicTypeRegistry = new BasicTypeRegistry( this ); StandardBasicTypes.prime( this ); @@ -120,11 +120,11 @@ public class TypeConfiguration implements SessionFactoryObserver, Serializable { return javaTypeDescriptorRegistry; } - public SqlTypeDescriptorRegistry getSqlTypeDescriptorRegistry() { - return sqlTypeDescriptorRegistry; + public JdbcTypeDescriptorRegistry getJdbcTypeDescriptorRegistry() { + return jdbcTypeDescriptorRegistry; } - public SqlTypeDescriptorIndicators getCurrentBaseSqlTypeIndicators() { + public JdbcTypeDescriptorIndicators getCurrentBaseSqlTypeIndicators() { return scope.getCurrentBaseSqlTypeIndicators(); } @@ -324,7 +324,7 @@ public class TypeConfiguration implements SessionFactoryObserver, Serializable { private String sessionFactoryName; private String sessionFactoryUuid; - private transient SqlTypeDescriptorIndicators currentSqlTypeIndicators = new SqlTypeDescriptorIndicators() { + private transient JdbcTypeDescriptorIndicators currentSqlTypeIndicators = new JdbcTypeDescriptorIndicators() { @Override public TypeConfiguration getTypeConfiguration() { return typeConfiguration; @@ -340,7 +340,7 @@ public class TypeConfiguration implements SessionFactoryObserver, Serializable { this.typeConfiguration = typeConfiguration; } - public SqlTypeDescriptorIndicators getCurrentBaseSqlTypeIndicators() { + public JdbcTypeDescriptorIndicators getCurrentBaseSqlTypeIndicators() { return currentSqlTypeIndicators; } @@ -575,7 +575,7 @@ public class TypeConfiguration implements SessionFactoryObserver, Serializable { javaType, javaTypeDescriptor -> new StandardBasicTypeImpl<>( javaTypeDescriptor, - javaTypeDescriptor.getJdbcRecommendedSqlType( getCurrentBaseSqlTypeIndicators() ) + javaTypeDescriptor.getRecommendedJdbcType( getCurrentBaseSqlTypeIndicators() ) ) ); } @@ -607,12 +607,12 @@ public class TypeConfiguration implements SessionFactoryObserver, Serializable { if ( type == null ) { return null; } - return getSqlTemporalType( type.getExpressableJavaTypeDescriptor().getJdbcRecommendedSqlType( getCurrentBaseSqlTypeIndicators() ) ); + return getSqlTemporalType( type.getExpressableJavaTypeDescriptor().getRecommendedJdbcType( getCurrentBaseSqlTypeIndicators() ) ); } public static TemporalType getSqlTemporalType(MappingModelExpressable type) { if ( type instanceof BasicValuedMapping ) { - return getSqlTemporalType( ( (BasicValuedMapping) type ).getJdbcMapping().getSqlTypeDescriptor() ); + return getSqlTemporalType( ( (BasicValuedMapping) type ).getJdbcMapping().getJdbcTypeDescriptor() ); } else if (type instanceof SingleColumnType) { return getSqlTemporalType( ((SingleColumnType) type).sqlType() ); @@ -620,7 +620,7 @@ public class TypeConfiguration implements SessionFactoryObserver, Serializable { return null; } - public static TemporalType getSqlTemporalType(SqlTypeDescriptor descriptor) { + public static TemporalType getSqlTemporalType(JdbcTypeDescriptor descriptor) { return getSqlTemporalType( descriptor.getJdbcTypeCode() ); } diff --git a/hibernate-core/src/test/java/org/hibernate/jpa/test/query/NativeQueryResultTypeAutoDiscoveryTest.java b/hibernate-core/src/test/java/org/hibernate/jpa/test/query/NativeQueryResultTypeAutoDiscoveryTest.java index c1e9ea9353..6159515d72 100644 --- a/hibernate-core/src/test/java/org/hibernate/jpa/test/query/NativeQueryResultTypeAutoDiscoveryTest.java +++ b/hibernate-core/src/test/java/org/hibernate/jpa/test/query/NativeQueryResultTypeAutoDiscoveryTest.java @@ -54,20 +54,20 @@ import org.hibernate.type.descriptor.java.FloatTypeDescriptor; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; import org.hibernate.type.descriptor.java.PrimitiveByteArrayTypeDescriptor; import org.hibernate.type.descriptor.java.StringTypeDescriptor; -import org.hibernate.type.descriptor.sql.BasicBinder; -import org.hibernate.type.descriptor.sql.BasicExtractor; -import org.hibernate.type.descriptor.sql.BinaryTypeDescriptor; -import org.hibernate.type.descriptor.sql.CharTypeDescriptor; -import org.hibernate.type.descriptor.sql.JdbcLiteralFormatter; -import org.hibernate.type.descriptor.sql.NumericTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.BasicBinder; +import org.hibernate.type.descriptor.jdbc.BasicExtractor; +import org.hibernate.type.descriptor.jdbc.BinaryTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.CharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcLiteralFormatter; +import org.hibernate.type.descriptor.jdbc.NumericTypeDescriptor; import org.hibernate.testing.RequiresDialect; import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.CustomRunner; import org.hibernate.testing.transaction.TransactionUtil; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.spi.BasicJdbcLiteralFormatter; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.spi.BasicJdbcLiteralFormatter; import org.hibernate.type.spi.TypeConfiguration; import org.junit.After; import org.junit.Assert; @@ -554,7 +554,7 @@ public class NativeQueryResultTypeAutoDiscoveryTest { public static final String NAME = "float_as_real"; public FloatAsRealType() { - super( org.hibernate.type.descriptor.sql.RealTypeDescriptor.INSTANCE, FloatTypeDescriptor.INSTANCE ); + super( org.hibernate.type.descriptor.jdbc.RealTypeDescriptor.INSTANCE, FloatTypeDescriptor.INSTANCE ); } @Override @@ -609,13 +609,13 @@ public class NativeQueryResultTypeAutoDiscoveryTest { } -class BitTypeDescriptor implements SqlTypeDescriptor { +class BitTypeDescriptor implements JdbcTypeDescriptor { public static final BitTypeDescriptor INSTANCE = new BitTypeDescriptor(); public BitTypeDescriptor() { } - public int getSqlType() { + public int getJdbcType() { return Types.BIT; } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/basic/CollectionAsBasicTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/basic/CollectionAsBasicTest.java index 902ca311c4..8d90fe95c7 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/basic/CollectionAsBasicTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/basic/CollectionAsBasicTest.java @@ -24,7 +24,7 @@ import org.hibernate.type.AbstractSingleColumnStandardBasicType; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.AbstractClassTypeDescriptor; import org.hibernate.type.descriptor.java.MutableMutabilityPlan; -import org.hibernate.type.descriptor.sql.VarcharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.VarcharTypeDescriptor; import org.junit.jupiter.api.Test; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/basics/CustomTypeResolutionTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/basics/CustomTypeResolutionTests.java index 824b6076a3..cc14b32e35 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/basics/CustomTypeResolutionTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/basics/CustomTypeResolutionTests.java @@ -33,10 +33,10 @@ import org.hibernate.type.CustomType; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; import org.hibernate.type.descriptor.java.UrlTypeDescriptor; -import org.hibernate.type.descriptor.sql.CharTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; -import org.hibernate.type.descriptor.sql.VarcharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.CharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.VarcharTypeDescriptor; import org.hibernate.usertype.UserType; import org.hibernate.testing.orm.junit.DomainModel; @@ -275,7 +275,7 @@ public class CustomTypeResolutionTests { public static final GenderJtd INSTANCE = new GenderJtd(); @Override - public SqlTypeDescriptor getJdbcRecommendedSqlType(SqlTypeDescriptorIndicators context) { + public JdbcTypeDescriptor getRecommendedJdbcType(JdbcTypeDescriptorIndicators context) { return CharTypeDescriptor.INSTANCE; } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/basics/EnumResolutionTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/basics/EnumResolutionTests.java index 13e26a9581..f8352e2caf 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/basics/EnumResolutionTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/basics/EnumResolutionTests.java @@ -167,12 +167,12 @@ public class EnumResolutionTests { final BasicValue.Resolution resolution = ( (BasicValue) property.getValue() ).resolve(); // verify the interpretations used for reading - assertThat( resolution.getRelationalSqlTypeDescriptor().getJdbcTypeCode(), is( jdbcCode ) ); + assertThat( resolution.getJdbcTypeDescriptor().getJdbcTypeCode(), is( jdbcCode ) ); assertThat( resolution.getRelationalJavaDescriptor().getJavaTypeClass(), equalTo( jdbcJavaType ) ); assertThat( resolution.getDomainJavaDescriptor().getJavaTypeClass(), equalTo( Values.class ) ); final JdbcMapping jdbcMapping = resolution.getJdbcMapping(); - assertThat( jdbcMapping.getSqlTypeDescriptor(), equalTo( resolution.getRelationalSqlTypeDescriptor() ) ); + assertThat( jdbcMapping.getJdbcTypeDescriptor(), equalTo( resolution.getJdbcTypeDescriptor() ) ); assertThat( jdbcMapping.getJavaTypeDescriptor(), equalTo( resolution.getRelationalJavaDescriptor() ) ); converterChecker.accept( resolution.getValueConverter() ); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/basics/sql/SqlTypeTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/basics/sql/JdbcTypeTests.java similarity index 75% rename from hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/basics/sql/SqlTypeTests.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/basics/sql/JdbcTypeTests.java index e8fcebe472..6dcd2c4377 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/basics/sql/SqlTypeTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/basics/sql/JdbcTypeTests.java @@ -15,9 +15,9 @@ import javax.persistence.Lob; import javax.persistence.Table; import org.hibernate.annotations.Nationalized; -import org.hibernate.annotations.SqlType; -import org.hibernate.annotations.SqlTypeCode; -import org.hibernate.annotations.SqlTypeRegistration; +import org.hibernate.annotations.JdbcType; +import org.hibernate.annotations.JdbcTypeCode; +import org.hibernate.annotations.JdbcTypeRegistration; import org.hibernate.mapping.BasicValue; import org.hibernate.mapping.PersistentClass; import org.hibernate.mapping.Property; @@ -25,12 +25,12 @@ import org.hibernate.mapping.Value; import org.hibernate.type.descriptor.ValueBinder; import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.ClobTypeDescriptor; -import org.hibernate.type.descriptor.sql.NClobTypeDescriptor; -import org.hibernate.type.descriptor.sql.NVarcharTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.TinyIntTypeDescriptor; -import org.hibernate.type.descriptor.sql.VarcharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.ClobTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.NClobTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.NVarcharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.TinyIntTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.VarcharTypeDescriptor; import org.hibernate.testing.orm.junit.DomainModel; import org.hibernate.testing.orm.junit.DomainModelScope; @@ -44,9 +44,9 @@ import static org.hamcrest.MatcherAssert.assertThat; * @author Steve Ebersole */ @DomainModel( - annotatedClasses = SqlTypeTests.SimpleEntity.class + annotatedClasses = JdbcTypeTests.SimpleEntity.class ) -public class SqlTypeTests { +public class JdbcTypeTests { @Test public void verifyResolutions(DomainModelScope scope) { @@ -73,11 +73,11 @@ public class SqlTypeTests { supportsNationalizedTypes ? NClobTypeDescriptor.class : ClobTypeDescriptor.class ); - verifyResolution( entityBinding.getProperty( "customType" ), CustomSqlTypeDescriptor.class ); - verifyResolution( entityBinding.getProperty( "customTypeRegistration" ), RegisteredCustomSqlTypeDescriptor.class ); + verifyResolution( entityBinding.getProperty( "customType" ), CustomJdbcTypeDescriptor.class ); + verifyResolution( entityBinding.getProperty( "customTypeRegistration" ), RegisteredCustomJdbcTypeDescriptor.class ); } - private void verifyResolution(Property property, Class expectedSqlTypeDescriptor) { + private void verifyResolution(Property property, Class expectedSqlTypeDescriptor) { verifyResolution( property, sqlTypeDescriptor -> { @@ -88,27 +88,27 @@ public class SqlTypeTests { private void verifyResolution( Property property, - Consumer stdVerifier) { + Consumer stdVerifier) { final Value value = property.getValue(); assertThat( value, instanceOf( BasicValue.class ) ); final BasicValue basicValue = (BasicValue) value; final BasicValue.Resolution resolution = basicValue.resolve(); - stdVerifier.accept( resolution.getRelationalSqlTypeDescriptor() ); + stdVerifier.accept( resolution.getJdbcTypeDescriptor() ); } @Entity( name = "SimpleEntity" ) @Table( name = "simple_entity" ) - @SqlTypeRegistration( value = RegisteredCustomSqlTypeDescriptor.class, registrationCode = Integer.MAX_VALUE - 1 ) + @JdbcTypeRegistration( value = RegisteredCustomJdbcTypeDescriptor.class, registrationCode = Integer.MAX_VALUE - 1 ) @SuppressWarnings("unused") public static class SimpleEntity { @Id private Integer id; - @SqlTypeCode( Types.CLOB ) + @JdbcTypeCode( Types.CLOB ) private String materializedClob; - @SqlTypeCode( Types.NCLOB ) + @JdbcTypeCode( Types.NCLOB ) private String materializedNClob; @Lob @@ -124,16 +124,16 @@ public class SqlTypeTests { @Nationalized private Clob nationalizedClob; - @SqlType( CustomSqlTypeDescriptor.class ) + @JdbcType( CustomJdbcTypeDescriptor.class ) private Integer customType; - @SqlTypeCode( Integer.MAX_VALUE - 1 ) + @JdbcTypeCode( Integer.MAX_VALUE - 1 ) private Integer customTypeRegistration; } - public static class CustomSqlTypeDescriptor implements SqlTypeDescriptor { + public static class CustomJdbcTypeDescriptor implements JdbcTypeDescriptor { @Override - public int getSqlType() { + public int getJdbcType() { return Types.TINYINT; } @@ -153,6 +153,6 @@ public class SqlTypeTests { } } - public static class RegisteredCustomSqlTypeDescriptor extends CustomSqlTypeDescriptor { + public static class RegisteredCustomJdbcTypeDescriptor extends CustomJdbcTypeDescriptor { } } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/basics/sql/MapKeySqlTypeTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/basics/sql/MapKeyJdbcTypeTests.java similarity index 63% rename from hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/basics/sql/MapKeySqlTypeTests.java rename to hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/basics/sql/MapKeyJdbcTypeTests.java index 4f29c7f7b7..84896026b3 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/basics/sql/MapKeySqlTypeTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/basics/sql/MapKeyJdbcTypeTests.java @@ -13,18 +13,18 @@ import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; -import org.hibernate.annotations.MapKeySqlType; -import org.hibernate.annotations.MapKeySqlTypeCode; -import org.hibernate.annotations.SqlType; -import org.hibernate.annotations.SqlTypeCode; +import org.hibernate.annotations.MapKeyJdbcType; +import org.hibernate.annotations.MapKeyJdbcTypeCode; +import org.hibernate.annotations.JdbcType; +import org.hibernate.annotations.JdbcTypeCode; import org.hibernate.mapping.BasicValue; import org.hibernate.mapping.PersistentClass; import org.hibernate.mapping.Property; -import org.hibernate.type.descriptor.sql.IntegerTypeDescriptor; -import org.hibernate.type.descriptor.sql.NVarcharTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.TinyIntTypeDescriptor; -import org.hibernate.type.descriptor.sql.VarcharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.IntegerTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.NVarcharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.TinyIntTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.VarcharTypeDescriptor; import org.hibernate.testing.orm.junit.DomainModel; import org.hibernate.testing.orm.junit.DomainModelScope; @@ -36,8 +36,8 @@ import static org.hamcrest.MatcherAssert.assertThat; /** * @author Steve Ebersole */ -@DomainModel( annotatedClasses = MapKeySqlTypeTests.MyEntity.class ) -public class MapKeySqlTypeTests { +@DomainModel( annotatedClasses = MapKeyJdbcTypeTests.MyEntity.class ) +public class MapKeyJdbcTypeTests { @Test public void verifyResolutions(DomainModelScope scope) { @@ -51,8 +51,8 @@ public class MapKeySqlTypeTests { private void verifyResolutions( Property property, - Class keyStd, - Class valueStd) { + Class keyStd, + Class valueStd) { assertThat( property.getValue(), instanceOf( org.hibernate.mapping.Map.class ) ); final org.hibernate.mapping.Map mapValue = (org.hibernate.mapping.Map) property.getValue(); @@ -60,16 +60,16 @@ public class MapKeySqlTypeTests { assertThat( mapValue.getIndex(), instanceOf( BasicValue.class ) ); final BasicValue indexValue = (BasicValue) mapValue.getIndex(); final BasicValue.Resolution indexResolution = indexValue.resolve(); - assertThat( indexResolution.getRelationalSqlTypeDescriptor(), instanceOf( keyStd ) ); - assertThat( indexResolution.getJdbcMapping().getSqlTypeDescriptor(), instanceOf( keyStd ) ); - assertThat( indexResolution.getLegacyResolvedBasicType().getSqlTypeDescriptor(), instanceOf( keyStd ) ); + assertThat( indexResolution.getJdbcTypeDescriptor(), instanceOf( keyStd ) ); + assertThat( indexResolution.getJdbcMapping().getJdbcTypeDescriptor(), instanceOf( keyStd ) ); + assertThat( indexResolution.getLegacyResolvedBasicType().getJdbcTypeDescriptor(), instanceOf( keyStd ) ); assertThat( mapValue.getElement(), instanceOf( BasicValue.class ) ); final BasicValue elementValue = (BasicValue) mapValue.getElement(); final BasicValue.Resolution elementResolution = elementValue.resolve(); - assertThat( elementResolution.getRelationalSqlTypeDescriptor(), instanceOf( valueStd ) ); - assertThat( elementResolution.getJdbcMapping().getSqlTypeDescriptor(), instanceOf( valueStd ) ); - assertThat( elementResolution.getLegacyResolvedBasicType().getSqlTypeDescriptor(), instanceOf( valueStd ) ); + assertThat( elementResolution.getJdbcTypeDescriptor(), instanceOf( valueStd ) ); + assertThat( elementResolution.getJdbcMapping().getJdbcTypeDescriptor(), instanceOf( valueStd ) ); + assertThat( elementResolution.getLegacyResolvedBasicType().getJdbcTypeDescriptor(), instanceOf( valueStd ) ); } @Entity( name = "MyEntity" ) @@ -82,13 +82,13 @@ public class MapKeySqlTypeTests { private Map baseMap; @ElementCollection - @SqlTypeCode( Types.NVARCHAR ) - @MapKeySqlTypeCode( @SqlTypeCode( Types.TINYINT ) ) + @JdbcTypeCode( Types.NVARCHAR ) + @MapKeyJdbcTypeCode( @JdbcTypeCode( Types.TINYINT ) ) private Map sqlTypeCodeMap; @ElementCollection - @SqlTypeCode( Types.NVARCHAR ) - @MapKeySqlType( @SqlType( TinyIntTypeDescriptor.class ) ) + @JdbcTypeCode( Types.NVARCHAR ) + @MapKeyJdbcType( @JdbcType( TinyIntTypeDescriptor.class ) ) private Map sqlTypeMap; } } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/basics/sql/package-info.java b/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/basics/sql/package-info.java index 2670105158..42fb620e04 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/basics/sql/package-info.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/basics/sql/package-info.java @@ -6,9 +6,9 @@ */ /** - * Tests for {@link org.hibernate.annotations.SqlTypeCode}, {@link org.hibernate.annotations.SqlType}, - * {@link org.hibernate.annotations.SqlTypeRegistration}, {@link org.hibernate.annotations.MapKeySqlType}, - * {@link org.hibernate.annotations.MapKeySqlTypeCode} + * Tests for {@link org.hibernate.annotations.JdbcTypeCode}, {@link org.hibernate.annotations.JdbcType}, + * {@link org.hibernate.annotations.JdbcTypeRegistration}, {@link org.hibernate.annotations.MapKeyJdbcType}, + * {@link org.hibernate.annotations.MapKeyJdbcTypeCode} * * @author Steve Ebersole */ diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/SmokeTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/SmokeTests.java index fd31b0cd7c..0571f10035 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/SmokeTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/SmokeTests.java @@ -90,7 +90,7 @@ public class SmokeTests { assertThat( valueConverter.getDomainJavaDescriptor(), is( genderAttrMapping.getJavaTypeDescriptor() ) ); assertThat( valueConverter.getRelationalJavaDescriptor().getJavaTypeClass(), equalTo( Integer.class ) ); - assertThat( genderAttrMapping.getJdbcMapping().getSqlTypeDescriptor().getJdbcTypeCode(), is( Types.TINYINT ) ); + assertThat( genderAttrMapping.getJdbcMapping().getJdbcTypeDescriptor().getJdbcTypeCode(), is( Types.TINYINT ) ); } { @@ -107,7 +107,7 @@ public class SmokeTests { assertThat( valueConverter.getDomainJavaDescriptor(), is( attrMapping.getJavaTypeDescriptor() ) ); assertThat( valueConverter.getRelationalJavaDescriptor().getJavaTypeClass(), equalTo( String.class ) ); - assertThat( attrMapping.getJdbcMapping().getSqlTypeDescriptor().getJdbcTypeCode(), is( Types.VARCHAR ) ); + assertThat( attrMapping.getJdbcMapping().getJdbcTypeDescriptor().getJdbcTypeCode(), is( Types.VARCHAR ) ); } { @@ -124,7 +124,7 @@ public class SmokeTests { assertThat( valueConverter.getDomainJavaDescriptor(), is( attrMapping.getJavaTypeDescriptor() ) ); assertThat( valueConverter.getRelationalJavaDescriptor().getJavaTypeClass(), equalTo( Character.class ) ); - assertThat( attrMapping.getJdbcMapping().getSqlTypeDescriptor().getJdbcTypeCode(), is( Types.CHAR ) ); + assertThat( attrMapping.getJdbcMapping().getJdbcTypeDescriptor().getJdbcTypeCode(), is( Types.CHAR ) ); } { diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/AndLobTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/AndLobTest.java index ca74c9af9b..34ee555dfe 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/AndLobTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/AndLobTest.java @@ -19,7 +19,6 @@ import org.hibernate.boot.MetadataSources; import org.hibernate.type.Type; import org.hibernate.type.descriptor.converter.AttributeConverterTypeAdapter; -import org.hibernate.testing.junit4.BaseUnitTestCase; import org.hibernate.testing.orm.junit.ServiceRegistry; import org.hibernate.testing.orm.junit.ServiceRegistryScope; @@ -50,7 +49,7 @@ public class AndLobTest { assertThat( typeAdapter.getDomainJtd().getJavaTypeClass(), equalTo( String.class ) ); assertThat( typeAdapter.getRelationalJtd().getJavaTypeClass(), equalTo( Integer.class ) ); - assertThat( typeAdapter.getSqlTypeDescriptor().getJdbcTypeCode(), is( Types.INTEGER ) ); + assertThat( typeAdapter.getJdbcTypeDescriptor().getJdbcTypeCode(), is( Types.INTEGER ) ); } @Converter diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/AttributeConverterTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/AttributeConverterTest.java index 147ee4e58c..0796bfb58e 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/AttributeConverterTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/AttributeConverterTest.java @@ -43,7 +43,7 @@ import org.hibernate.type.Type; import org.hibernate.type.descriptor.converter.AttributeConverterTypeAdapter; import org.hibernate.type.descriptor.java.EnumJavaTypeDescriptor; import org.hibernate.type.descriptor.java.StringTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.boot.MetadataBuildingContextTestingImpl; @@ -126,8 +126,8 @@ public class AttributeConverterTest extends BaseUnitTestCase { assertThat( typeAdapter.getDomainJtd().getJavaTypeClass(), equalTo( String.class ) ); - final SqlTypeDescriptor sqlTypeDescriptor = typeAdapter.getSqlTypeDescriptor(); - assertThat( sqlTypeDescriptor.getJdbcTypeCode(), is( Types.CLOB ) ); + final JdbcTypeDescriptor jdbcTypeDescriptor = typeAdapter.getJdbcTypeDescriptor(); + assertThat( jdbcTypeDescriptor.getJdbcTypeCode(), is( Types.CLOB ) ); } @Test @@ -177,8 +177,8 @@ public class AttributeConverterTest extends BaseUnitTestCase { final AttributeConverterTypeAdapter typeAdapter = (AttributeConverterTypeAdapter) type; assertThat( typeAdapter.getDomainJtd().getJavaTypeClass(), Matchers.equalTo( String.class ) ); - final SqlTypeDescriptor sqlTypeDescriptor = typeAdapter.getSqlTypeDescriptor(); - assertThat( sqlTypeDescriptor.getJdbcTypeCode(), is( Types.CLOB ) ); + final JdbcTypeDescriptor jdbcTypeDescriptor = typeAdapter.getJdbcTypeDescriptor(); + assertThat( jdbcTypeDescriptor.getJdbcTypeCode(), is( Types.CLOB ) ); } finally { StandardServiceRegistryBuilder.destroy( ssr ); @@ -209,8 +209,8 @@ public class AttributeConverterTest extends BaseUnitTestCase { assertThat( typeAdapter.getDomainJtd().getJavaTypeClass(), equalTo( String.class ) ); assertThat( typeAdapter.getRelationalJtd().getJavaTypeClass(), equalTo( Clob.class ) ); - final SqlTypeDescriptor sqlTypeDescriptor = typeAdapter.getSqlTypeDescriptor(); - assertThat( sqlTypeDescriptor.getJdbcTypeCode(), is( Types.CLOB ) ); + final JdbcTypeDescriptor jdbcTypeDescriptor = typeAdapter.getJdbcTypeDescriptor(); + assertThat( jdbcTypeDescriptor.getJdbcTypeCode(), is( Types.CLOB ) ); } finally { StandardServiceRegistryBuilder.destroy( ssr ); @@ -238,7 +238,7 @@ public class AttributeConverterTest extends BaseUnitTestCase { } AbstractStandardBasicType basicType = assertTyping( AbstractStandardBasicType.class, type ); assertSame( StringTypeDescriptor.INSTANCE, basicType.getJavaTypeDescriptor() ); - assertEquals( Types.VARCHAR, basicType.getSqlTypeDescriptor().getSqlType() ); + assertEquals( Types.VARCHAR, basicType.getJdbcTypeDescriptor().getJdbcType() ); } finally { StandardServiceRegistryBuilder.destroy( ssr ); @@ -313,7 +313,7 @@ public class AttributeConverterTest extends BaseUnitTestCase { assertThat( typeAdapter.getDomainJtd().getJavaTypeClass(), equalTo( Integer.class ) ); assertThat( typeAdapter.getRelationalJtd().getJavaTypeClass(), equalTo( String.class ) ); - assertThat( typeAdapter.getSqlTypeDescriptor().getJdbcTypeCode(), is( Types.VARCHAR ) ); + assertThat( typeAdapter.getJdbcTypeDescriptor().getJdbcTypeCode(), is( Types.VARCHAR ) ); } finally { StandardServiceRegistryBuilder.destroy( ssr ); @@ -435,7 +435,7 @@ public class AttributeConverterTest extends BaseUnitTestCase { else { expectedJdbcTypeCode = Types.VARCHAR; } - assertThat( typeAdapter.getSqlTypeDescriptor().getJdbcTypeCode(), is( expectedJdbcTypeCode ) ); + assertThat( typeAdapter.getJdbcTypeDescriptor().getJdbcTypeCode(), is( expectedJdbcTypeCode ) ); // then lets build the SF and verify its use... final SessionFactory sf = metadata.buildSessionFactory(); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/ExplicitJavaTypeDescriptorTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/ExplicitJavaTypeDescriptorTest.java index 019e6ea609..3931de33ac 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/ExplicitJavaTypeDescriptorTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/ExplicitJavaTypeDescriptorTest.java @@ -26,13 +26,11 @@ import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; import org.hibernate.type.descriptor.java.MutabilityPlan; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; -import org.hibernate.testing.FailureExpected; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase; -import org.hibernate.testing.orm.junit.NotImplementedYet; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -327,8 +325,8 @@ public class ExplicitJavaTypeDescriptorTest extends BaseNonConfigCoreFunctionalT } @Override - public SqlTypeDescriptor getJdbcRecommendedSqlType(SqlTypeDescriptorIndicators context) { - return context.getTypeConfiguration().getSqlTypeDescriptorRegistry().getDescriptor( Types.VARCHAR ); + public JdbcTypeDescriptor getRecommendedJdbcType(JdbcTypeDescriptorIndicators context) { + return context.getTypeConfiguration().getJdbcTypeDescriptorRegistry().getDescriptor( Types.VARCHAR ); } @Override diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/custom/CustomTypeConverterTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/custom/CustomTypeConverterTest.java index b4435be7c2..230eb05cbc 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/custom/CustomTypeConverterTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/custom/CustomTypeConverterTest.java @@ -41,8 +41,8 @@ public class CustomTypeConverterTest extends BaseUnitTestCase { final TypeConfiguration bootTypeConfiguration = metadataBuilder.getBootstrapContext().getTypeConfiguration(); bootTypeConfiguration.getJavaTypeDescriptorRegistry() .addDescriptor( MyCustomJavaTypeDescriptor.INSTANCE ); - bootTypeConfiguration.getSqlTypeDescriptorRegistry() - .addDescriptor( MyCustomSqlTypeDescriptor.INSTANCE ); + bootTypeConfiguration.getJdbcTypeDescriptorRegistry() + .addDescriptor( MyCustomJdbcTypeDescriptor.INSTANCE ); performAssertions( metadataBuilder, bootTypeConfiguration ); } @@ -63,8 +63,8 @@ public class CustomTypeConverterTest extends BaseUnitTestCase { ); assertThat( - bootTypeConfiguration.getSqlTypeDescriptorRegistry().getDescriptor( MyCustomSqlTypeDescriptor.INSTANCE.getSqlType() ), - sameInstance( MyCustomSqlTypeDescriptor.INSTANCE ) + bootTypeConfiguration.getJdbcTypeDescriptorRegistry().getDescriptor( MyCustomJdbcTypeDescriptor.INSTANCE.getJdbcType() ), + sameInstance( MyCustomJdbcTypeDescriptor.INSTANCE ) ); final EntityPersister entityPersister = sessionFactory.getMetamodel().entityPersister( MyEntity.class ); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/custom/MyCustomJavaTypeDescriptor.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/custom/MyCustomJavaTypeDescriptor.java index fa98a042e6..b60b7e0423 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/custom/MyCustomJavaTypeDescriptor.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/converted/converter/custom/MyCustomJavaTypeDescriptor.java @@ -11,8 +11,8 @@ import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.BasicJavaDescriptor; import org.hibernate.type.descriptor.java.MutabilityPlan; import org.hibernate.type.descriptor.java.MutableMutabilityPlan; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators; /** * @author Steve Ebersole @@ -39,8 +39,8 @@ public class MyCustomJavaTypeDescriptor implements BasicJavaDescriptor { public static final InetType INSTANCE = new InetType(); public InetType() { - super( InetSqlTypeDescriptor.INSTANCE, InetJavaTypeDescriptor.INSTANCE ); + super( InetJdbcTypeDescriptor.INSTANCE, InetJavaTypeDescriptor.INSTANCE ); } @Override diff --git a/hibernate-core/src/test/java/org/hibernate/test/id/usertype/json/JsonSqlTypeDescriptor.java b/hibernate-core/src/test/java/org/hibernate/test/id/usertype/json/JsonJdbcTypeDescriptor.java similarity index 88% rename from hibernate-core/src/test/java/org/hibernate/test/id/usertype/json/JsonSqlTypeDescriptor.java rename to hibernate-core/src/test/java/org/hibernate/test/id/usertype/json/JsonJdbcTypeDescriptor.java index 67cd193673..b5cceff5de 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/id/usertype/json/JsonSqlTypeDescriptor.java +++ b/hibernate-core/src/test/java/org/hibernate/test/id/usertype/json/JsonJdbcTypeDescriptor.java @@ -18,19 +18,19 @@ import org.hibernate.type.descriptor.ValueBinder; import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.BasicBinder; -import org.hibernate.type.descriptor.sql.BasicExtractor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.BasicBinder; +import org.hibernate.type.descriptor.jdbc.BasicExtractor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; /** * @author Vlad Mihalcea */ -public class JsonSqlTypeDescriptor implements SqlTypeDescriptor { +public class JsonJdbcTypeDescriptor implements JdbcTypeDescriptor { - public static final JsonSqlTypeDescriptor INSTANCE = new JsonSqlTypeDescriptor(); + public static final JsonJdbcTypeDescriptor INSTANCE = new JsonJdbcTypeDescriptor(); @Override - public int getSqlType() { + public int getJdbcType() { return Types.OTHER; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/id/usertype/json/JsonType.java b/hibernate-core/src/test/java/org/hibernate/test/id/usertype/json/JsonType.java index 41de4e7568..6765a7c301 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/id/usertype/json/JsonType.java +++ b/hibernate-core/src/test/java/org/hibernate/test/id/usertype/json/JsonType.java @@ -13,7 +13,7 @@ public class JsonType extends AbstractSingleColumnStandardBasicType { public static final JsonType INSTANCE = new JsonType(); public JsonType() { - super( JsonSqlTypeDescriptor.INSTANCE, JsonJavaTypeDescriptor.INSTANCE ); + super( JsonJdbcTypeDescriptor.INSTANCE, JsonJavaTypeDescriptor.INSTANCE ); } @Override diff --git a/hibernate-core/src/test/java/org/hibernate/test/immutable/ImmutableTest.java b/hibernate-core/src/test/java/org/hibernate/test/immutable/ImmutableTest.java index eae788a4b6..a084dc1c1c 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/immutable/ImmutableTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/immutable/ImmutableTest.java @@ -21,7 +21,7 @@ import org.hibernate.engine.spi.SessionImplementor; import org.hibernate.proxy.HibernateProxy; import org.hibernate.type.AbstractSingleColumnStandardBasicType; import org.hibernate.type.TextType; -import org.hibernate.type.descriptor.sql.ClobTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.ClobTypeDescriptor; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.junit.Test; diff --git a/hibernate-core/src/test/java/org/hibernate/test/jpa/convert/JdbcSqlTypeDescriptorConverterTest.java b/hibernate-core/src/test/java/org/hibernate/test/jpa/convert/JdbcTypeDescriptorConverterTest.java similarity index 97% rename from hibernate-core/src/test/java/org/hibernate/test/jpa/convert/JdbcSqlTypeDescriptorConverterTest.java rename to hibernate-core/src/test/java/org/hibernate/test/jpa/convert/JdbcTypeDescriptorConverterTest.java index 8b39c799c6..6038759cf4 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/jpa/convert/JdbcSqlTypeDescriptorConverterTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/jpa/convert/JdbcTypeDescriptorConverterTest.java @@ -31,7 +31,7 @@ import static org.junit.Assert.assertEquals; /** * @author Chris Cranford */ -public class JdbcSqlTypeDescriptorConverterTest extends BaseEntityManagerFunctionalTestCase { +public class JdbcTypeDescriptorConverterTest extends BaseEntityManagerFunctionalTestCase { @Override protected Class[] getAnnotatedClasses() { return new Class[] { JavaTimeBean.class }; diff --git a/hibernate-core/src/test/java/org/hibernate/test/nationalized/MaterializedNClobBindTest.java b/hibernate-core/src/test/java/org/hibernate/test/nationalized/MaterializedNClobBindTest.java index 9b41b6ada7..0e42f7bb22 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/nationalized/MaterializedNClobBindTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/nationalized/MaterializedNClobBindTest.java @@ -20,7 +20,7 @@ import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.type.MaterializedNClobType; import org.hibernate.type.descriptor.ValueBinder; import org.hibernate.type.descriptor.WrapperOptions; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; import org.hibernate.testing.TestForIssue; import org.junit.Test; @@ -29,7 +29,7 @@ import org.junit.Test; * @author Gail Badner */ public class MaterializedNClobBindTest { - private static final ValueBinder binder = MaterializedNClobType.INSTANCE.getSqlTypeDescriptor().getBinder( + private static final ValueBinder binder = MaterializedNClobType.INSTANCE.getJdbcTypeDescriptor().getBinder( MaterializedNClobType.INSTANCE.getJavaTypeDescriptor() ); @@ -104,7 +104,7 @@ public class MaterializedNClobBindTest { } @Override - public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) { + public JdbcTypeDescriptor remapSqlTypeDescriptor(JdbcTypeDescriptor jdbcTypeDescriptor) { return null; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/onetoone/formula/OneToOneFormulaTest.java b/hibernate-core/src/test/java/org/hibernate/test/onetoone/formula/OneToOneFormulaTest.java index 082ef7edcb..a960de4135 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/onetoone/formula/OneToOneFormulaTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/onetoone/formula/OneToOneFormulaTest.java @@ -18,7 +18,7 @@ import org.hibernate.cfg.Environment; import org.hibernate.dialect.Oracle8iDialect; import org.hibernate.type.AbstractSingleColumnStandardBasicType; import org.hibernate.type.TextType; -import org.hibernate.type.descriptor.sql.ClobTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.ClobTypeDescriptor; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; diff --git a/hibernate-core/src/test/java/org/hibernate/test/type/AbstractJavaTimeTypeTest.java b/hibernate-core/src/test/java/org/hibernate/test/type/AbstractJavaTimeTypeTest.java index 0a3db67312..ede86233ee 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/type/AbstractJavaTimeTypeTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/type/AbstractJavaTimeTypeTest.java @@ -24,7 +24,7 @@ import org.hibernate.cfg.AvailableSettings; import org.hibernate.cfg.Configuration; import org.hibernate.dialect.Dialect; import org.hibernate.dialect.H2Dialect; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; @@ -391,17 +391,17 @@ abstract class AbstractJavaTimeTypeTest extends BaseCoreFunctionalTestCase protected static class AbstractRemappingH2Dialect extends H2Dialect { private final int overriddenSqlTypeCode; - private final SqlTypeDescriptor overriddenSqlTypeDescriptor; + private final JdbcTypeDescriptor overriddenJdbcTypeDescriptor; - public AbstractRemappingH2Dialect(int overriddenSqlTypeCode, SqlTypeDescriptor overriddenSqlTypeDescriptor) { + public AbstractRemappingH2Dialect(int overriddenSqlTypeCode, JdbcTypeDescriptor overriddenJdbcTypeDescriptor) { this.overriddenSqlTypeCode = overriddenSqlTypeCode; - this.overriddenSqlTypeDescriptor = overriddenSqlTypeDescriptor; + this.overriddenJdbcTypeDescriptor = overriddenJdbcTypeDescriptor; } @Override - protected SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) { + protected JdbcTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) { if ( overriddenSqlTypeCode == sqlCode ) { - return overriddenSqlTypeDescriptor; + return overriddenJdbcTypeDescriptor; } else { return super.getSqlTypeDescriptorOverride( sqlCode ); diff --git a/hibernate-core/src/test/java/org/hibernate/test/type/BasicTypeRegistryTest.java b/hibernate-core/src/test/java/org/hibernate/test/type/BasicTypeRegistryTest.java index 689e73f2d1..368746009a 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/type/BasicTypeRegistryTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/type/BasicTypeRegistryTest.java @@ -21,7 +21,7 @@ import org.hibernate.type.CustomType; import org.hibernate.type.UUIDBinaryType; import org.hibernate.type.UUIDCharType; import org.hibernate.type.descriptor.java.StringTypeDescriptor; -import org.hibernate.type.descriptor.sql.VarcharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.VarcharTypeDescriptor; import org.hibernate.type.spi.TypeConfiguration; import org.hibernate.usertype.UserType; diff --git a/hibernate-core/src/test/java/org/hibernate/test/type/LocalDateTest.java b/hibernate-core/src/test/java/org/hibernate/test/type/LocalDateTest.java index 5f370c8b02..c41dbcf093 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/type/LocalDateTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/type/LocalDateTest.java @@ -25,7 +25,7 @@ import org.hibernate.dialect.AbstractHANADialect; import org.hibernate.dialect.MariaDBDialect; import org.hibernate.dialect.MySQL5Dialect; import org.hibernate.dialect.MySQLDialect; -import org.hibernate.type.descriptor.sql.TimestampTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.TimestampTypeDescriptor; import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.TestForIssue; diff --git a/hibernate-core/src/test/java/org/hibernate/test/type/LocalTimeTest.java b/hibernate-core/src/test/java/org/hibernate/test/type/LocalTimeTest.java index 73a5ad6b70..918541aac9 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/type/LocalTimeTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/type/LocalTimeTest.java @@ -26,7 +26,7 @@ import org.hibernate.dialect.AbstractHANADialect; import org.hibernate.dialect.MariaDBDialect; import org.hibernate.dialect.MySQL5Dialect; import org.hibernate.dialect.MySQLDialect; -import org.hibernate.type.descriptor.sql.TimestampTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.TimestampTypeDescriptor; import org.hibernate.testing.SkipForDialect; import org.junit.Test; diff --git a/hibernate-core/src/test/java/org/hibernate/test/type/LongListTypeContributorTest.java b/hibernate-core/src/test/java/org/hibernate/test/type/LongListTypeContributorTest.java index ccfaa92da1..dfbdaf31f6 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/type/LongListTypeContributorTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/type/LongListTypeContributorTest.java @@ -154,7 +154,7 @@ public class LongListTypeContributorTest extends BaseEntityManagerFunctionalTest public static final StringifiedCollectionType INSTANCE = new StringifiedCollectionType(); public StringifiedCollectionType() { - super( org.hibernate.type.descriptor.sql.LongVarcharTypeDescriptor.INSTANCE, + super( org.hibernate.type.descriptor.jdbc.LongVarcharTypeDescriptor.INSTANCE, StringifiedCollectionJavaTypeDescriptor.INSTANCE ); regKeys = new String[]{ LongList.class.getName() }; name = "StringifiedCollection"; diff --git a/hibernate-core/src/test/java/org/hibernate/test/type/OffsetTimeTest.java b/hibernate-core/src/test/java/org/hibernate/test/type/OffsetTimeTest.java index 16bef9c237..e5ade72e2d 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/type/OffsetTimeTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/type/OffsetTimeTest.java @@ -28,8 +28,8 @@ import org.hibernate.dialect.AbstractHANADialect; import org.hibernate.dialect.MariaDBDialect; import org.hibernate.dialect.MySQL5Dialect; import org.hibernate.dialect.MySQLDialect; -import org.hibernate.type.descriptor.sql.BigIntTypeDescriptor; -import org.hibernate.type.descriptor.sql.TimestampTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.BigIntTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.TimestampTypeDescriptor; import org.hibernate.testing.SkipForDialect; import org.junit.Test; diff --git a/hibernate-core/src/test/java/org/hibernate/test/type/StandardBasicTypeTemplateTest.java b/hibernate-core/src/test/java/org/hibernate/test/type/StandardBasicTypeTemplateTest.java index fca1324f82..754e16f240 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/type/StandardBasicTypeTemplateTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/type/StandardBasicTypeTemplateTest.java @@ -11,7 +11,7 @@ import java.net.URL; import org.hibernate.type.BasicType; import org.hibernate.type.StandardBasicTypeTemplate; import org.hibernate.type.descriptor.java.UrlTypeDescriptor; -import org.hibernate.type.descriptor.sql.VarcharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.VarcharTypeDescriptor; import org.hibernate.type.spi.TypeConfiguration; import org.hibernate.testing.junit4.BaseUnitTestCase; diff --git a/hibernate-core/src/test/java/org/hibernate/test/type/contributor/ArrayType.java b/hibernate-core/src/test/java/org/hibernate/test/type/contributor/ArrayType.java index e5e4328bd1..19967b56d6 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/type/contributor/ArrayType.java +++ b/hibernate-core/src/test/java/org/hibernate/test/type/contributor/ArrayType.java @@ -5,7 +5,7 @@ import java.util.Map; import org.hibernate.dialect.Dialect; import org.hibernate.type.AbstractSingleColumnStandardBasicType; import org.hibernate.type.DiscriminatorType; -import org.hibernate.type.descriptor.sql.VarcharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.VarcharTypeDescriptor; import org.hibernate.type.spi.TypeBootstrapContext; /** diff --git a/hibernate-core/src/test/java/org/hibernate/test/typeoverride/H2DialectOverridePrefixedVarcharSqlTypeDesc.java b/hibernate-core/src/test/java/org/hibernate/test/typeoverride/H2DialectOverridePrefixedVarcharSqlTypeDesc.java index 8f0fbe51aa..7bf6dab841 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/typeoverride/H2DialectOverridePrefixedVarcharSqlTypeDesc.java +++ b/hibernate-core/src/test/java/org/hibernate/test/typeoverride/H2DialectOverridePrefixedVarcharSqlTypeDesc.java @@ -7,8 +7,8 @@ package org.hibernate.test.typeoverride; import org.hibernate.dialect.H2Dialect; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.VarcharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.VarcharTypeDescriptor; /** * @@ -16,10 +16,10 @@ import org.hibernate.type.descriptor.sql.VarcharTypeDescriptor; */ public class H2DialectOverridePrefixedVarcharSqlTypeDesc extends H2Dialect { @Override - public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) { - return sqlTypeDescriptor == StoredPrefixedStringType.INSTANCE.getSqlTypeDescriptor() ? + public JdbcTypeDescriptor remapSqlTypeDescriptor(JdbcTypeDescriptor jdbcTypeDescriptor) { + return jdbcTypeDescriptor == StoredPrefixedStringType.INSTANCE.getJdbcTypeDescriptor() ? VarcharTypeDescriptor.INSTANCE : - super.remapSqlTypeDescriptor( sqlTypeDescriptor ); + super.remapSqlTypeDescriptor( jdbcTypeDescriptor ); } } diff --git a/hibernate-core/src/test/java/org/hibernate/test/typeoverride/H2DialectOverrideVarcharSqlCode.java b/hibernate-core/src/test/java/org/hibernate/test/typeoverride/H2DialectOverrideVarcharSqlCode.java index 4de11217d2..91d9d608d6 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/typeoverride/H2DialectOverrideVarcharSqlCode.java +++ b/hibernate-core/src/test/java/org/hibernate/test/typeoverride/H2DialectOverrideVarcharSqlCode.java @@ -9,7 +9,7 @@ package org.hibernate.test.typeoverride; import java.sql.Types; import org.hibernate.dialect.H2Dialect; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; /** * @@ -17,9 +17,9 @@ import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; */ public class H2DialectOverrideVarcharSqlCode extends H2Dialect { @Override - public SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) { + public JdbcTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) { return sqlCode == Types.VARCHAR ? - StoredPrefixedStringType.INSTANCE.getSqlTypeDescriptor() : + StoredPrefixedStringType.INSTANCE.getJdbcTypeDescriptor() : super.getSqlTypeDescriptorOverride( sqlCode ); } } diff --git a/hibernate-core/src/test/java/org/hibernate/test/typeoverride/StoredPrefixedStringType.java b/hibernate-core/src/test/java/org/hibernate/test/typeoverride/StoredPrefixedStringType.java index 853c213b52..7ae8823ee6 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/typeoverride/StoredPrefixedStringType.java +++ b/hibernate-core/src/test/java/org/hibernate/test/typeoverride/StoredPrefixedStringType.java @@ -20,10 +20,10 @@ import org.hibernate.type.descriptor.ValueBinder; import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.BasicBinder; -import org.hibernate.type.descriptor.sql.BasicExtractor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.VarcharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.BasicBinder; +import org.hibernate.type.descriptor.jdbc.BasicExtractor; +import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.VarcharTypeDescriptor; /** * @@ -35,7 +35,7 @@ public class StoredPrefixedStringType public static final String PREFIX = "PRE:"; - public static final SqlTypeDescriptor PREFIXED_VARCHAR_TYPE_DESCRIPTOR = + public static final JdbcTypeDescriptor PREFIXED_VARCHAR_TYPE_DESCRIPTOR = new VarcharTypeDescriptor() { public ValueBinder getBinder(final JavaTypeDescriptor javaTypeDescriptor) { return new BasicBinder( javaTypeDescriptor, this ) { diff --git a/hibernate-core/src/test/java/org/hibernate/test/typeoverride/TypeOverrideTest.java b/hibernate-core/src/test/java/org/hibernate/test/typeoverride/TypeOverrideTest.java index 7d6e3724d4..dd98ed31dd 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/typeoverride/TypeOverrideTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/typeoverride/TypeOverrideTest.java @@ -16,7 +16,7 @@ import org.hibernate.cfg.Configuration; import org.hibernate.dialect.*; import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; -import org.hibernate.type.descriptor.sql.*; +import org.hibernate.type.descriptor.jdbc.*; import org.junit.Test; /** @@ -73,29 +73,29 @@ public class TypeOverrideTest extends BaseCoreFunctionalTestCase { @Test public void testNonStandardSqlTypeDescriptor() { // no override - SqlTypeDescriptor sqlTypeDescriptor = new IntegerTypeDescriptor() { + JdbcTypeDescriptor jdbcTypeDescriptor = new IntegerTypeDescriptor() { @Override public boolean canBeRemapped() { return false; } }; - assertSame( sqlTypeDescriptor, remapSqlTypeDescriptor( sqlTypeDescriptor ) ); + assertSame( jdbcTypeDescriptor, remapSqlTypeDescriptor( jdbcTypeDescriptor ) ); } @Test public void testDialectWithNonStandardSqlTypeDescriptor() { - assertNotSame( VarcharTypeDescriptor.INSTANCE, StoredPrefixedStringType.INSTANCE.getSqlTypeDescriptor() ); + assertNotSame( VarcharTypeDescriptor.INSTANCE, StoredPrefixedStringType.INSTANCE.getJdbcTypeDescriptor() ); final Dialect dialect = new H2DialectOverridePrefixedVarcharSqlTypeDesc(); - final SqlTypeDescriptor remapped = remapSqlTypeDescriptor( dialect, StoredPrefixedStringType.PREFIXED_VARCHAR_TYPE_DESCRIPTOR ); + final JdbcTypeDescriptor remapped = remapSqlTypeDescriptor( dialect, StoredPrefixedStringType.PREFIXED_VARCHAR_TYPE_DESCRIPTOR ); assertSame( VarcharTypeDescriptor.INSTANCE, remapped ); } - private SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) { - return remapSqlTypeDescriptor( sessionFactory().getDialect(), sqlTypeDescriptor ); + private JdbcTypeDescriptor remapSqlTypeDescriptor(JdbcTypeDescriptor jdbcTypeDescriptor) { + return remapSqlTypeDescriptor( sessionFactory().getDialect(), jdbcTypeDescriptor ); } - private SqlTypeDescriptor remapSqlTypeDescriptor(Dialect dialect, SqlTypeDescriptor sqlTypeDescriptor) { - return dialect.remapSqlTypeDescriptor( sqlTypeDescriptor ); + private JdbcTypeDescriptor remapSqlTypeDescriptor(Dialect dialect, JdbcTypeDescriptor jdbcTypeDescriptor) { + return dialect.remapSqlTypeDescriptor( jdbcTypeDescriptor ); } @Test diff --git a/hibernate-core/src/test_legacy/org/hibernate/test/type/descriptor/sql/StringValueMappingTest.java b/hibernate-core/src/test_legacy/org/hibernate/test/type/descriptor/sql/StringValueMappingTest.java index eb9b0db4b4..b7d1fac853 100644 --- a/hibernate-core/src/test_legacy/org/hibernate/test/type/descriptor/sql/StringValueMappingTest.java +++ b/hibernate-core/src/test_legacy/org/hibernate/test/type/descriptor/sql/StringValueMappingTest.java @@ -17,9 +17,9 @@ import org.hibernate.type.descriptor.ValueBinder; import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.StringTypeDescriptor; -import org.hibernate.type.descriptor.sql.ClobTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; -import org.hibernate.type.descriptor.sql.VarcharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.ClobTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.VarcharTypeDescriptor; import org.hibernate.testing.junit4.BaseUnitTestCase; import org.junit.Test; diff --git a/hibernate-envers/src/test/resources/log4j.properties b/hibernate-envers/src/test/resources/log4j.properties index c3a6cd12ce..2d265819cc 100644 --- a/hibernate-envers/src/test/resources/log4j.properties +++ b/hibernate-envers/src/test/resources/log4j.properties @@ -17,8 +17,8 @@ log4j.logger.org.hibernate.test=info log4j.logger.org.hibernate.SQL=debug log4j.logger.org.hibernate.tool.hbm2ddl=debug -log4j.logger.org.hibernate.type.descriptor.sql.BasicBinder=trace -log4j.logger.org.hibernate.type.descriptor.sql.BasicExtractor=trace +log4j.logger.org.hibernate.type.descriptor.jdbc.BasicBinder=trace +log4j.logger.org.hibernate.type.descriptor.jdbc.BasicExtractor=trace log4j.logger.org.hibernate.envers.jaxb=debug diff --git a/hibernate-hikaricp/src/test/resources/log4j.properties b/hibernate-hikaricp/src/test/resources/log4j.properties index eb96581a28..5e77474efb 100644 --- a/hibernate-hikaricp/src/test/resources/log4j.properties +++ b/hibernate-hikaricp/src/test/resources/log4j.properties @@ -34,8 +34,8 @@ log4j.logger.org.hibernate.testing.cache=debug # SQL Logging - HHH-6833 log4j.logger.org.hibernate.SQL=debug -log4j.logger.org.hibernate.type.descriptor.sql.BasicBinder=trace -log4j.logger.org.hibernate.type.descriptor.sql.BasicExtractor=trace +log4j.logger.org.hibernate.type.descriptor.jdbc.BasicBinder=trace +log4j.logger.org.hibernate.type.descriptor.jdbc.BasicExtractor=trace log4j.logger.org.hibernate.hql.internal.ast=debug diff --git a/hibernate-micrometer/src/test/resources/log4j.properties b/hibernate-micrometer/src/test/resources/log4j.properties index 4567cb1105..c65db3f0b3 100644 --- a/hibernate-micrometer/src/test/resources/log4j.properties +++ b/hibernate-micrometer/src/test/resources/log4j.properties @@ -15,5 +15,5 @@ log4j.logger.org.hibernate.stat=trace log4j.logger.org.hibernate.tool.hbm2ddl=trace log4j.logger.org.hibernate.SQL=debug -log4j.logger.org.hibernate.type.descriptor.sql.BasicBinder=trace -log4j.logger.org.hibernate.type.descriptor.sql.BasicExtractor=trace \ No newline at end of file +log4j.logger.org.hibernate.type.descriptor.jdbc.BasicBinder=trace +log4j.logger.org.hibernate.type.descriptor.jdbc.BasicExtractor=trace \ No newline at end of file diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/GeolatteGeometryJavaTypeDescriptor.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/GeolatteGeometryJavaTypeDescriptor.java index a7d448f344..a69b01ad85 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/GeolatteGeometryJavaTypeDescriptor.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/GeolatteGeometryJavaTypeDescriptor.java @@ -11,8 +11,8 @@ import java.sql.Types; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.AbstractTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.SqlTypeDescriptorIndicators; +import org.hibernate.type.descriptor.jdbc.SqlTypeDescriptor; import org.geolatte.geom.Geometry; import org.geolatte.geom.codec.Wkt; diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/GeolatteGeometryType.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/GeolatteGeometryType.java index e22b60113d..3b3e24b92f 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/GeolatteGeometryType.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/GeolatteGeometryType.java @@ -8,7 +8,7 @@ package org.hibernate.spatial; import org.hibernate.type.AbstractSingleColumnStandardBasicType; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.SqlTypeDescriptor; import org.geolatte.geom.Geometry; import org.geolatte.geom.GeometryCollection; diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/JTSGeometryType.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/JTSGeometryType.java index 8136c455b1..80de64fe4c 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/JTSGeometryType.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/JTSGeometryType.java @@ -7,7 +7,7 @@ package org.hibernate.spatial; import org.hibernate.type.AbstractSingleColumnStandardBasicType; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.SqlTypeDescriptor; import org.locationtech.jts.geom.Geometry; diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/db2/DB2GeometryTypeDescriptor.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/db2/DB2GeometryTypeDescriptor.java index 5bb3383e20..ed64f74bb1 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/db2/DB2GeometryTypeDescriptor.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/db2/DB2GeometryTypeDescriptor.java @@ -17,9 +17,9 @@ import org.hibernate.type.descriptor.ValueBinder; import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.BasicBinder; -import org.hibernate.type.descriptor.sql.BasicExtractor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.BasicBinder; +import org.hibernate.type.descriptor.jdbc.BasicExtractor; +import org.hibernate.type.descriptor.jdbc.SqlTypeDescriptor; import org.geolatte.geom.Geometry; import org.geolatte.geom.codec.db.db2.Db2ClobDecoder; diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/h2geodb/GeoDBGeometryTypeDescriptor.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/h2geodb/GeoDBGeometryTypeDescriptor.java index 32518a13c9..77d7f54867 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/h2geodb/GeoDBGeometryTypeDescriptor.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/h2geodb/GeoDBGeometryTypeDescriptor.java @@ -17,9 +17,9 @@ import org.hibernate.type.descriptor.ValueBinder; import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.BasicBinder; -import org.hibernate.type.descriptor.sql.BasicExtractor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.BasicBinder; +import org.hibernate.type.descriptor.jdbc.BasicExtractor; +import org.hibernate.type.descriptor.jdbc.SqlTypeDescriptor; import org.geolatte.geom.Geometry; diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/hana/HANAGeometryTypeDescriptor.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/hana/HANAGeometryTypeDescriptor.java index eb5905453d..8b8e4a451f 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/hana/HANAGeometryTypeDescriptor.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/hana/HANAGeometryTypeDescriptor.java @@ -16,9 +16,9 @@ import org.hibernate.type.descriptor.ValueBinder; import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.BasicBinder; -import org.hibernate.type.descriptor.sql.BasicExtractor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.BasicBinder; +import org.hibernate.type.descriptor.jdbc.BasicExtractor; +import org.hibernate.type.descriptor.jdbc.SqlTypeDescriptor; import org.geolatte.geom.Geometry; diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/hana/HANAPointTypeDescriptor.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/hana/HANAPointTypeDescriptor.java index a2d8d8ad13..add816d167 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/hana/HANAPointTypeDescriptor.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/hana/HANAPointTypeDescriptor.java @@ -16,9 +16,9 @@ import org.hibernate.type.descriptor.ValueBinder; import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.BasicBinder; -import org.hibernate.type.descriptor.sql.BasicExtractor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.BasicBinder; +import org.hibernate.type.descriptor.jdbc.BasicExtractor; +import org.hibernate.type.descriptor.jdbc.SqlTypeDescriptor; import org.geolatte.geom.Point; diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQL56SpatialDialect.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQL56SpatialDialect.java index b6043763e1..464efaefde 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQL56SpatialDialect.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQL56SpatialDialect.java @@ -23,7 +23,7 @@ import org.hibernate.spatial.SpatialDialect; import org.hibernate.spatial.SpatialFunction; import org.hibernate.spatial.SpatialRelation; import org.hibernate.type.StandardBasicTypes; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.SqlTypeDescriptor; /** * Extends the MySQL5Dialect by including support for the spatial operators. diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQL5SpatialDialect.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQL5SpatialDialect.java index 059538a4e9..67bfff3e59 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQL5SpatialDialect.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQL5SpatialDialect.java @@ -17,7 +17,7 @@ import org.hibernate.dialect.function.SQLFunction; import org.hibernate.service.ServiceRegistry; import org.hibernate.spatial.SpatialDialect; import org.hibernate.spatial.SpatialFunction; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.SqlTypeDescriptor; /** * A Dialect for MySQL 5 using InnoDB engine, with support for its spatial features diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQL8SpatialDialect.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQL8SpatialDialect.java index d079f82f0f..2aa9381750 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQL8SpatialDialect.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQL8SpatialDialect.java @@ -20,7 +20,7 @@ import org.hibernate.spatial.JTSGeometryType; import org.hibernate.spatial.SpatialDialect; import org.hibernate.spatial.SpatialFunction; import org.hibernate.spatial.SpatialRelation; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.SqlTypeDescriptor; /** * Created by Karel Maesen, Geovise BVBA on 2019-03-07. diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQLGeometryTypeDescriptor.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQLGeometryTypeDescriptor.java index 91b07116c7..c339be29d5 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQLGeometryTypeDescriptor.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQLGeometryTypeDescriptor.java @@ -17,9 +17,9 @@ import org.hibernate.type.descriptor.ValueBinder; import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.BasicBinder; -import org.hibernate.type.descriptor.sql.BasicExtractor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.BasicBinder; +import org.hibernate.type.descriptor.jdbc.BasicExtractor; +import org.hibernate.type.descriptor.jdbc.SqlTypeDescriptor; import org.geolatte.geom.ByteBuffer; import org.geolatte.geom.ByteOrder; diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/SDOGeometryTypeDescriptor.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/SDOGeometryTypeDescriptor.java index 704d0b0a33..82ae8d1db4 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/SDOGeometryTypeDescriptor.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/SDOGeometryTypeDescriptor.java @@ -12,7 +12,7 @@ import java.sql.Types; import org.hibernate.type.descriptor.ValueBinder; import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.SqlTypeDescriptor; import org.geolatte.geom.codec.db.oracle.OracleJDBCTypeFactory; diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/SDOGeometryValueBinder.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/SDOGeometryValueBinder.java index 6829cd83f5..c6cf0b8990 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/SDOGeometryValueBinder.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/SDOGeometryValueBinder.java @@ -17,7 +17,7 @@ import org.hibernate.HibernateException; import org.hibernate.type.descriptor.ValueBinder; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.SqlTypeDescriptor; import org.geolatte.geom.Geometry; import org.geolatte.geom.codec.db.oracle.Encoders; diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/SDOGeometryValueExtractor.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/SDOGeometryValueExtractor.java index a85bdb44f4..3443025471 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/SDOGeometryValueExtractor.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/oracle/SDOGeometryValueExtractor.java @@ -14,8 +14,8 @@ import java.sql.Struct; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.BasicExtractor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.BasicExtractor; +import org.hibernate.type.descriptor.jdbc.SqlTypeDescriptor; import org.geolatte.geom.Geometry; import org.geolatte.geom.codec.db.oracle.Decoders; diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PGGeometryTypeDescriptor.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PGGeometryTypeDescriptor.java index 2e971e511b..7230cdd2ba 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PGGeometryTypeDescriptor.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PGGeometryTypeDescriptor.java @@ -17,9 +17,9 @@ import org.hibernate.type.descriptor.ValueBinder; import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.BasicBinder; -import org.hibernate.type.descriptor.sql.BasicExtractor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.BasicBinder; +import org.hibernate.type.descriptor.jdbc.BasicExtractor; +import org.hibernate.type.descriptor.jdbc.SqlTypeDescriptor; import org.geolatte.geom.ByteBuffer; import org.geolatte.geom.ByteOrder; diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/sqlserver/SqlServer2008GeometryTypeDescriptor.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/sqlserver/SqlServer2008GeometryTypeDescriptor.java index 12720ff07f..df5b61ace3 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/sqlserver/SqlServer2008GeometryTypeDescriptor.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/sqlserver/SqlServer2008GeometryTypeDescriptor.java @@ -18,9 +18,9 @@ import org.hibernate.type.descriptor.ValueBinder; import org.hibernate.type.descriptor.ValueExtractor; import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.java.JavaTypeDescriptor; -import org.hibernate.type.descriptor.sql.BasicBinder; -import org.hibernate.type.descriptor.sql.BasicExtractor; -import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.BasicBinder; +import org.hibernate.type.descriptor.jdbc.BasicExtractor; +import org.hibernate.type.descriptor.jdbc.SqlTypeDescriptor; import org.geolatte.geom.Geometry; import org.geolatte.geom.codec.db.sqlserver.Decoders; diff --git a/hibernate-testing/src/main/java/org/hibernate/testing/orm/domain/gambit/EntityOfBasics.java b/hibernate-testing/src/main/java/org/hibernate/testing/orm/domain/gambit/EntityOfBasics.java index 7a58f22dd3..251ee48972 100644 --- a/hibernate-testing/src/main/java/org/hibernate/testing/orm/domain/gambit/EntityOfBasics.java +++ b/hibernate-testing/src/main/java/org/hibernate/testing/orm/domain/gambit/EntityOfBasics.java @@ -29,8 +29,7 @@ import javax.persistence.SqlResultSetMapping; import javax.persistence.Temporal; import javax.persistence.TemporalType; -import org.hibernate.annotations.SqlType; -import org.hibernate.annotations.SqlTypeCode; +import org.hibernate.annotations.JdbcTypeCode; /** * @author Steve Ebersole @@ -151,7 +150,7 @@ public class EntityOfBasics { @Convert( converter = GenderConverter.class ) @Column(name = "converted_gender", length = 1) - @SqlTypeCode( Types.CHAR ) + @JdbcTypeCode( Types.CHAR ) public Gender getConvertedGender() { return convertedGender; } @@ -261,7 +260,7 @@ public class EntityOfBasics { this.theBoolean = theBoolean; } - @SqlTypeCode( Types.INTEGER ) + @JdbcTypeCode( Types.INTEGER ) public Boolean isTheNumericBoolean() { return theNumericBoolean; } @@ -270,7 +269,7 @@ public class EntityOfBasics { this.theNumericBoolean = theNumericBoolean; } - @SqlTypeCode( Types.CHAR ) + @JdbcTypeCode( Types.CHAR ) public Boolean isTheStringBoolean() { return theStringBoolean; } diff --git a/hibernate-vibur/src/test/resources/log4j.properties b/hibernate-vibur/src/test/resources/log4j.properties index eb96581a28..5e77474efb 100644 --- a/hibernate-vibur/src/test/resources/log4j.properties +++ b/hibernate-vibur/src/test/resources/log4j.properties @@ -34,8 +34,8 @@ log4j.logger.org.hibernate.testing.cache=debug # SQL Logging - HHH-6833 log4j.logger.org.hibernate.SQL=debug -log4j.logger.org.hibernate.type.descriptor.sql.BasicBinder=trace -log4j.logger.org.hibernate.type.descriptor.sql.BasicExtractor=trace +log4j.logger.org.hibernate.type.descriptor.jdbc.BasicBinder=trace +log4j.logger.org.hibernate.type.descriptor.jdbc.BasicExtractor=trace log4j.logger.org.hibernate.hql.internal.ast=debug diff --git a/migration-guide.adoc b/migration-guide.adoc index bcd790d60f..4d8ef33d61 100644 --- a/migration-guide.adoc +++ b/migration-guide.adoc @@ -13,7 +13,7 @@ earlier versions, see any other pertinent migration guides as well. ==== Influencing SqlTypeDescriptor to use -Discuss `@SqlTypeCode`, `@SqlType`, `@SqlTypeRegistration` +Discuss `JdbcTypeCode`, `JdbcType`, `JdbcTypeRegistration` ==== Influencing JavaTypeDescriptor to use diff --git a/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/collectionbasictype/CommaDelimitedStringsMapType.java b/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/collectionbasictype/CommaDelimitedStringsMapType.java index 28eb1ad601..e5373e0b8d 100644 --- a/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/collectionbasictype/CommaDelimitedStringsMapType.java +++ b/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/collectionbasictype/CommaDelimitedStringsMapType.java @@ -6,11 +6,10 @@ */ package org.hibernate.jpamodelgen.test.collectionbasictype; -import java.util.List; import java.util.Map; import org.hibernate.type.AbstractSingleColumnStandardBasicType; -import org.hibernate.type.descriptor.sql.VarcharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.VarcharTypeDescriptor; /** * @author Vlad Mihalcea diff --git a/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/collectionbasictype/CommaDelimitedStringsType.java b/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/collectionbasictype/CommaDelimitedStringsType.java index c15ac474d0..c85a74d1e2 100644 --- a/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/collectionbasictype/CommaDelimitedStringsType.java +++ b/tooling/metamodel-generator/src/test/java/org/hibernate/jpamodelgen/test/collectionbasictype/CommaDelimitedStringsType.java @@ -9,7 +9,7 @@ package org.hibernate.jpamodelgen.test.collectionbasictype; import java.util.List; import org.hibernate.type.AbstractSingleColumnStandardBasicType; -import org.hibernate.type.descriptor.sql.VarcharTypeDescriptor; +import org.hibernate.type.descriptor.jdbc.VarcharTypeDescriptor; /** * @author Vlad Mihalcea