HHH-14870 - Rename {Xyz}TypeDescriptor as {Xyz}Type
* `JavaTypeDescriptor` -> `JavaType` * `JdbcTypeDescriptor` -> `JdbcType`
This commit is contained in:
parent
3a0065eea4
commit
686d8fcbf1
|
@ -5,7 +5,7 @@
|
|||
[[basic-legacy]]
|
||||
== Legacy BasicType resolution
|
||||
|
||||
Versions prior to 6.0 statically combined the `JavaType`, `JdbcTypeDescriptor`, `BasicValueConverter` and
|
||||
Versions prior to 6.0 statically combined the `JavaType`, `JdbcType`, `BasicValueConverter` and
|
||||
`MutabilityPlan` aspects within the `org.hibernate.type.BasicType` contract. Hibernate's legacy strategy for resolving
|
||||
a basic type is based on finding the implementation of `org.hibernate.type.BasicType` to use.
|
||||
|
||||
|
@ -205,8 +205,8 @@ include::{sourcedir}/basic/bitset/BitSetType.java[tags=basic-custom-type-BitSetT
|
|||
----
|
||||
====
|
||||
|
||||
The `AbstractSingleColumnStandardBasicType` requires an `jdbcTypeDescriptor` and a `javaTypeDescriptor`.
|
||||
The `jdbcTypeDescriptor` is `VarcharTypeDescriptor.INSTANCE` because the database column is a VARCHAR.
|
||||
The `AbstractSingleColumnStandardBasicType` requires an `jdbcType` and a `javaTypeDescriptor`.
|
||||
The `jdbcType` is `VarcharTypeDescriptor.INSTANCE` because the database column is a VARCHAR.
|
||||
On the Java side, we need to use a `BitSetJavaType` instance which can be implemented like this:
|
||||
|
||||
[[basic-custom-type-BitSetTypeDescriptor-example]]
|
||||
|
|
|
@ -1557,7 +1557,7 @@ There are many ways to integrate a `TypeContributor`. The most common is to def
|
|||
a Java service (see `java.util.ServiceLoader`).
|
||||
|
||||
`TypeContributor` is passed a `TypeContributions` reference, which allows registration of custom `JavaType`,
|
||||
`JdbcTypeDescriptor` and `BasicType` references.
|
||||
`JdbcType` and `BasicType` references.
|
||||
|
||||
|
||||
|
||||
|
@ -1912,7 +1912,7 @@ than direct serialization. But as `BitSet` is ultimately binary data we would p
|
|||
map this to `VARBINARY` type instead. One way to do that would be to change `BitSetJavaType#getRecommendedJdbcType`
|
||||
to instead return `VARBINARY` descriptor. Another option would be to use a local `@JdbcType` or `@JdbcTypeCode`.
|
||||
|
||||
The following examples for specifying the `JdbcTypeDescriptor` assume our `BitSetJavaType`
|
||||
The following examples for specifying the `JdbcType` assume our `BitSetJavaType`
|
||||
is globally registered.
|
||||
|
||||
We will again store the values as `VARBINARY` in the database. The difference now however is that
|
||||
|
@ -1929,7 +1929,7 @@ include::{sourcedir}/basic/bitset/BitSetJdbcTypeCodeTests.java[tags=basic-bitset
|
|||
----
|
||||
====
|
||||
|
||||
In this example, `@JdbcTypeCode` has been used to indicate that the `JdbcTypeDescriptor` registered for JDBC's
|
||||
In this example, `@JdbcTypeCode` has been used to indicate that the `JdbcType` registered for JDBC's
|
||||
`VARBINARY` type should be used.
|
||||
|
||||
|
||||
|
|
|
@ -11,15 +11,15 @@ import java.sql.Types;
|
|||
import org.hibernate.type.descriptor.ValueBinder;
|
||||
import org.hibernate.type.descriptor.ValueExtractor;
|
||||
import org.hibernate.type.descriptor.java.JavaType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.VarbinaryJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.VarbinaryJdbcType;
|
||||
|
||||
/**
|
||||
* JdbcTypeDescriptor for documentation
|
||||
* JdbcType for documentation
|
||||
*
|
||||
* @author Steve Ebersole
|
||||
*/
|
||||
public class CustomBinaryJdbcType implements JdbcTypeDescriptor {
|
||||
public class CustomBinaryJdbcType implements JdbcType {
|
||||
@Override
|
||||
public int getJdbcTypeCode() {
|
||||
return Types.VARBINARY;
|
||||
|
@ -27,11 +27,11 @@ public class CustomBinaryJdbcType implements JdbcTypeDescriptor {
|
|||
|
||||
@Override
|
||||
public <X> ValueBinder<X> getBinder(JavaType<X> javaTypeDescriptor) {
|
||||
return VarbinaryJdbcTypeDescriptor.INSTANCE.getBinder( javaTypeDescriptor );
|
||||
return VarbinaryJdbcType.INSTANCE.getBinder( javaTypeDescriptor );
|
||||
}
|
||||
|
||||
@Override
|
||||
public <X> ValueExtractor<X> getExtractor(JavaType<X> javaTypeDescriptor) {
|
||||
return VarbinaryJdbcTypeDescriptor.INSTANCE.getExtractor( javaTypeDescriptor );
|
||||
return VarbinaryJdbcType.INSTANCE.getExtractor( javaTypeDescriptor );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ import java.util.BitSet;
|
|||
import org.hibernate.type.descriptor.WrapperOptions;
|
||||
import org.hibernate.type.descriptor.java.AbstractClassJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.java.MutabilityPlan;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators;
|
||||
|
||||
/**
|
||||
|
@ -32,7 +32,7 @@ public class BitSetJavaType extends AbstractClassJavaTypeDescriptor<BitSet> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public JdbcTypeDescriptor getRecommendedJdbcType(JdbcTypeDescriptorIndicators indicators) {
|
||||
public JdbcType getRecommendedJdbcType(JdbcTypeDescriptorIndicators indicators) {
|
||||
return indicators.getTypeConfiguration()
|
||||
.getJdbcTypeDescriptorRegistry()
|
||||
.getDescriptor( Types.VARCHAR );
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.hibernate.sql.ast.tree.Statement;
|
|||
import org.hibernate.sql.exec.spi.JdbcOperation;
|
||||
import org.hibernate.community.dialect.sequence.SequenceInformationExtractorCUBRIDDatabaseImpl;
|
||||
import org.hibernate.tool.schema.extract.spi.SequenceInformationExtractor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry;
|
||||
|
||||
import java.sql.Types;
|
||||
|
@ -108,7 +108,7 @@ public class CUBRIDDialect extends Dialect {
|
|||
}
|
||||
|
||||
@Override
|
||||
public JdbcTypeDescriptor resolveSqlTypeDescriptor(
|
||||
public JdbcType resolveSqlTypeDescriptor(
|
||||
String columnTypeName,
|
||||
int jdbcTypeCode,
|
||||
int precision,
|
||||
|
|
|
@ -35,7 +35,7 @@ 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.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry;
|
||||
|
||||
import java.sql.CallableStatement;
|
||||
|
@ -88,7 +88,7 @@ public class CacheDialect extends Dialect {
|
|||
}
|
||||
|
||||
@Override
|
||||
public JdbcTypeDescriptor resolveSqlTypeDescriptor(
|
||||
public JdbcType resolveSqlTypeDescriptor(
|
||||
String columnTypeName,
|
||||
int jdbcTypeCode,
|
||||
int precision,
|
||||
|
|
|
@ -56,7 +56,7 @@ import org.hibernate.tool.schema.extract.spi.SequenceInformationExtractor;
|
|||
import org.hibernate.type.BasicType;
|
||||
import org.hibernate.type.BasicTypeRegistry;
|
||||
import org.hibernate.type.StandardBasicTypes;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry;
|
||||
|
||||
import java.sql.DatabaseMetaData;
|
||||
|
@ -174,7 +174,7 @@ public class FirebirdDialect extends Dialect {
|
|||
}
|
||||
|
||||
@Override
|
||||
public JdbcTypeDescriptor resolveSqlTypeDescriptor(
|
||||
public JdbcType resolveSqlTypeDescriptor(
|
||||
String columnTypeName,
|
||||
int jdbcTypeCode,
|
||||
int precision,
|
||||
|
|
|
@ -52,7 +52,7 @@ import org.hibernate.tool.schema.extract.spi.SequenceInformationExtractor;
|
|||
import org.hibernate.type.BasicType;
|
||||
import org.hibernate.type.BasicTypeRegistry;
|
||||
import org.hibernate.type.StandardBasicTypes;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry;
|
||||
|
||||
import java.sql.Types;
|
||||
|
@ -176,7 +176,7 @@ public class IngresDialect extends Dialect {
|
|||
}
|
||||
|
||||
@Override
|
||||
public JdbcTypeDescriptor resolveSqlTypeDescriptor(
|
||||
public JdbcType resolveSqlTypeDescriptor(
|
||||
String columnTypeName,
|
||||
int jdbcTypeCode,
|
||||
int precision,
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.hibernate.community.dialect.sequence.SequenceInformationExtractorSAPD
|
|||
import org.hibernate.tool.schema.extract.spi.SequenceInformationExtractor;
|
||||
import org.hibernate.type.BasicType;
|
||||
import org.hibernate.type.StandardBasicTypes;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry;
|
||||
|
||||
import java.sql.DatabaseMetaData;
|
||||
|
@ -65,7 +65,7 @@ public class MaxDBDialect extends Dialect {
|
|||
}
|
||||
|
||||
@Override
|
||||
public JdbcTypeDescriptor resolveSqlTypeDescriptor(
|
||||
public JdbcType resolveSqlTypeDescriptor(
|
||||
String columnTypeName,
|
||||
int jdbcTypeCode,
|
||||
int precision,
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.hibernate.sql.ast.spi.SqlAppender;
|
|||
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.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry;
|
||||
|
||||
import org.jboss.logging.Logger;
|
||||
|
@ -112,7 +112,7 @@ public class RDMSOS2200Dialect extends Dialect {
|
|||
}
|
||||
|
||||
@Override
|
||||
public JdbcTypeDescriptor resolveSqlTypeDescriptor(
|
||||
public JdbcType resolveSqlTypeDescriptor(
|
||||
String columnTypeName,
|
||||
int jdbcTypeCode,
|
||||
int precision,
|
||||
|
|
|
@ -53,9 +53,8 @@ import org.hibernate.sql.exec.spi.JdbcOperation;
|
|||
import org.hibernate.type.BasicType;
|
||||
import org.hibernate.type.BasicTypeRegistry;
|
||||
import org.hibernate.type.StandardBasicTypes;
|
||||
import org.hibernate.type.descriptor.jdbc.BlobJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.ClobJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.BlobJdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.ClobJdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry;
|
||||
|
||||
import static org.hibernate.exception.spi.TemplatedViolatedConstraintNameExtractor.extractUsingTemplate;
|
||||
|
@ -329,8 +328,8 @@ public class SQLiteDialect extends Dialect {
|
|||
super.contributeTypes( typeContributions, serviceRegistry );
|
||||
final JdbcTypeDescriptorRegistry jdbcTypeRegistry = typeContributions.getTypeConfiguration()
|
||||
.getJdbcTypeDescriptorRegistry();
|
||||
jdbcTypeRegistry.addDescriptor( Types.BLOB, BlobJdbcTypeDescriptor.PRIMITIVE_ARRAY_BINDING );
|
||||
jdbcTypeRegistry.addDescriptor( Types.CLOB, ClobJdbcTypeDescriptor.STRING_BINDING );
|
||||
jdbcTypeRegistry.addDescriptor( Types.BLOB, BlobJdbcType.PRIMITIVE_ARRAY_BINDING );
|
||||
jdbcTypeRegistry.addDescriptor( Types.CLOB, ClobJdbcType.STRING_BINDING );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -46,7 +46,7 @@ import org.hibernate.tool.schema.spi.Exporter;
|
|||
import org.hibernate.type.BasicType;
|
||||
import org.hibernate.type.BasicTypeRegistry;
|
||||
import org.hibernate.type.StandardBasicTypes;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry;
|
||||
|
||||
import java.sql.CallableStatement;
|
||||
|
@ -126,7 +126,7 @@ public class TeradataDialect extends Dialect {
|
|||
}
|
||||
|
||||
@Override
|
||||
public JdbcTypeDescriptor resolveSqlTypeDescriptor(
|
||||
public JdbcType resolveSqlTypeDescriptor(
|
||||
String columnTypeName, int jdbcTypeCode,
|
||||
int precision,
|
||||
int scale,
|
||||
|
|
|
@ -36,7 +36,7 @@ import org.hibernate.sql.exec.spi.JdbcOperation;
|
|||
import org.hibernate.community.dialect.sequence.SequenceInformationExtractorTimesTenDatabaseImpl;
|
||||
import org.hibernate.tool.schema.extract.spi.SequenceInformationExtractor;
|
||||
import org.hibernate.type.StandardBasicTypes;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry;
|
||||
|
||||
import java.sql.Types;
|
||||
|
@ -101,7 +101,7 @@ public class TimesTenDialect extends Dialect {
|
|||
}
|
||||
|
||||
@Override
|
||||
public JdbcTypeDescriptor resolveSqlTypeDescriptor(
|
||||
public JdbcType resolveSqlTypeDescriptor(
|
||||
String columnTypeName,
|
||||
int jdbcTypeCode,
|
||||
int precision,
|
||||
|
|
|
@ -20,8 +20,8 @@ import org.hibernate.service.ServiceRegistry;
|
|||
import org.hibernate.sql.ast.spi.SqlAppender;
|
||||
import org.hibernate.type.BasicType;
|
||||
import org.hibernate.type.descriptor.java.DateJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.DateJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.TimestampJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.DateJdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.TimestampJdbcType;
|
||||
import org.hibernate.type.spi.TypeConfiguration;
|
||||
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
|
@ -93,7 +93,7 @@ public class InformixDialectTestCase extends BaseUnitTestCase {
|
|||
);
|
||||
BasicType<?> basicType = (BasicType<?>) sqmExpression.getNodeType();
|
||||
assertEquals( DateJavaTypeDescriptor.INSTANCE, basicType.getJavaTypeDescriptor() );
|
||||
assertEquals( TimestampJdbcTypeDescriptor.INSTANCE, basicType.getJdbcTypeDescriptor() );
|
||||
assertEquals( TimestampJdbcType.INSTANCE, basicType.getJdbcTypeDescriptor() );
|
||||
|
||||
SqlAppender appender = new StringBuilderSqlAppender();
|
||||
sqmExpression.getRenderingSupport().render( appender, Collections.emptyList(), null );
|
||||
|
@ -112,7 +112,7 @@ public class InformixDialectTestCase extends BaseUnitTestCase {
|
|||
);
|
||||
BasicType<?> basicType = (BasicType<?>) sqmExpression.getNodeType();
|
||||
assertEquals( DateJavaTypeDescriptor.INSTANCE, basicType.getJavaTypeDescriptor() );
|
||||
assertEquals( DateJdbcTypeDescriptor.INSTANCE, basicType.getJdbcTypeDescriptor() );
|
||||
assertEquals( DateJdbcType.INSTANCE, basicType.getJdbcTypeDescriptor() );
|
||||
|
||||
SqlAppender appender = new StringBuilderSqlAppender();
|
||||
sqmExpression.getRenderingSupport().render( appender, Collections.emptyList(), null );
|
||||
|
|
|
@ -8,7 +8,7 @@ package org.hibernate.annotations;
|
|||
|
||||
import java.lang.annotation.Retention;
|
||||
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
|
||||
import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
|
||||
import static java.lang.annotation.ElementType.FIELD;
|
||||
|
@ -16,7 +16,7 @@ import static java.lang.annotation.ElementType.METHOD;
|
|||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
/**
|
||||
* Form of {@link JdbcType} used to describe the foreign-key part of an ANY mapping.
|
||||
* Form of {@link org.hibernate.annotations.JdbcType} used to describe the foreign-key part of an ANY mapping.
|
||||
*
|
||||
* @see Any
|
||||
* @see AnyKeyJdbcTypeCode
|
||||
|
@ -29,7 +29,7 @@ public @interface AnyKeyJdbcType {
|
|||
/**
|
||||
* The descriptor to use for the key column
|
||||
*
|
||||
* @see JdbcType#value
|
||||
* @see org.hibernate.annotations.JdbcType#value
|
||||
*/
|
||||
Class<? extends JdbcTypeDescriptor> value();
|
||||
Class<? extends JdbcType> value();
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ 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.JdbcType;
|
||||
|
||||
import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
|
||||
import static java.lang.annotation.ElementType.FIELD;
|
||||
|
@ -17,7 +17,7 @@ import static java.lang.annotation.ElementType.METHOD;
|
|||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
/**
|
||||
* Form of {@link JdbcType} for describing the id of an id-bag mapping
|
||||
* Form of {@link org.hibernate.annotations.JdbcType} for describing the id of an id-bag mapping
|
||||
*
|
||||
* @since 6.0
|
||||
*/
|
||||
|
@ -28,7 +28,7 @@ public @interface CollectionIdJdbcType {
|
|||
/**
|
||||
* The descriptor to use for the mapped column
|
||||
*
|
||||
* @see JdbcType#value
|
||||
* @see org.hibernate.annotations.JdbcType#value
|
||||
*/
|
||||
Class<? extends JdbcTypeDescriptor> value();
|
||||
Class<? extends JdbcType> value();
|
||||
}
|
||||
|
|
|
@ -9,8 +9,6 @@ package org.hibernate.annotations;
|
|||
import java.lang.annotation.Inherited;
|
||||
import java.lang.annotation.Retention;
|
||||
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
|
||||
import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
|
||||
import static java.lang.annotation.ElementType.FIELD;
|
||||
import static java.lang.annotation.ElementType.METHOD;
|
||||
|
|
|
@ -9,15 +9,13 @@ package org.hibernate.annotations;
|
|||
import java.lang.annotation.Inherited;
|
||||
import java.lang.annotation.Retention;
|
||||
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
|
||||
import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
|
||||
import static java.lang.annotation.ElementType.FIELD;
|
||||
import static java.lang.annotation.ElementType.METHOD;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
/**
|
||||
* Specifies an explicit {@link JdbcTypeDescriptor} to use for a particular column mapping.<ul>
|
||||
* Specifies an explicit {@link org.hibernate.type.descriptor.jdbc.JdbcType} to use for a particular column mapping.<ul>
|
||||
* <li>
|
||||
* When applied to a Map-valued attribute, describes the Map value. Use
|
||||
* {@link MapKeyJdbcType} to describe the key instead
|
||||
|
@ -55,7 +53,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
|||
@Retention(RUNTIME)
|
||||
public @interface JdbcType {
|
||||
/**
|
||||
* The {@link JdbcTypeDescriptor} to use for the mapped column
|
||||
* The {@link org.hibernate.type.descriptor.jdbc.JdbcType} to use for the mapped column
|
||||
*/
|
||||
Class<? extends JdbcTypeDescriptor> value();
|
||||
Class<? extends org.hibernate.type.descriptor.jdbc.JdbcType> value();
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ 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.JdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry;
|
||||
|
||||
import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
|
||||
|
@ -41,13 +41,13 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
|||
* </ul>
|
||||
*
|
||||
* This code is generally as one of the values defined in {@link java.sql.Types}, but are not
|
||||
* limited to these. The code is resolved against an internal registry of {@link JdbcTypeDescriptor}
|
||||
* limited to these. The code is resolved against an internal registry of {@link JdbcType}
|
||||
* references. See the user-guide for additional details.
|
||||
*
|
||||
* See <a href="package-summary.html#basic-value-mapping"/> for high-level discussion
|
||||
* of basic value mapping.
|
||||
*
|
||||
* @see JdbcTypeDescriptor
|
||||
* @see JdbcType
|
||||
* @see JdbcTypeDescriptorRegistry
|
||||
* @see MapKeyJdbcTypeCode
|
||||
* @see CollectionIdJdbcTypeCode
|
||||
|
@ -61,7 +61,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
|||
public @interface JdbcTypeCode {
|
||||
/**
|
||||
* The standard {@linkplain java.sql.Types JDBC Types} code or a custom code.
|
||||
* This ultimately decides which {@link JdbcTypeDescriptor}
|
||||
* This ultimately decides which {@link JdbcType}
|
||||
* is used to "understand" the described SQL data type
|
||||
*/
|
||||
int value();
|
||||
|
|
|
@ -10,7 +10,7 @@ import java.lang.annotation.Inherited;
|
|||
import java.lang.annotation.Repeatable;
|
||||
import java.lang.annotation.Retention;
|
||||
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry;
|
||||
|
||||
import static java.lang.annotation.ElementType.PACKAGE;
|
||||
|
@ -41,13 +41,13 @@ public @interface JdbcTypeRegistration {
|
|||
/**
|
||||
* The descriptor to register
|
||||
*/
|
||||
Class<? extends JdbcTypeDescriptor> value();
|
||||
Class<? extends JdbcType> 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 JdbcTypeDescriptor#getJdbcTypeCode}
|
||||
* By default we will use {@link JdbcType#getJdbcTypeCode}
|
||||
*/
|
||||
int registrationCode() default Integer.MIN_VALUE;
|
||||
}
|
||||
|
|
|
@ -9,15 +9,13 @@ package org.hibernate.annotations;
|
|||
import java.lang.annotation.Inherited;
|
||||
import java.lang.annotation.Retention;
|
||||
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
|
||||
import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
|
||||
import static java.lang.annotation.ElementType.FIELD;
|
||||
import static java.lang.annotation.ElementType.METHOD;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
/**
|
||||
* Form of {@link JdbcType} for describing the column mapping for the index of a List or array
|
||||
* Form of {@link org.hibernate.annotations.JdbcType} for describing the column mapping for the index of a List or array
|
||||
*
|
||||
* @since 6.0
|
||||
*/
|
||||
|
@ -28,7 +26,7 @@ public @interface ListIndexJdbcType {
|
|||
/**
|
||||
* The descriptor to use for the list-index column
|
||||
*
|
||||
* @see JdbcType#value
|
||||
* @see org.hibernate.annotations.JdbcType#value
|
||||
*/
|
||||
Class<? extends JdbcTypeDescriptor> value();
|
||||
Class<? extends org.hibernate.type.descriptor.jdbc.JdbcType> value();
|
||||
}
|
||||
|
|
|
@ -9,15 +9,13 @@ package org.hibernate.annotations;
|
|||
import java.lang.annotation.Inherited;
|
||||
import java.lang.annotation.Retention;
|
||||
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
|
||||
import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
|
||||
import static java.lang.annotation.ElementType.FIELD;
|
||||
import static java.lang.annotation.ElementType.METHOD;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
/**
|
||||
* Form of {@link JdbcType} for describing the key of a Map
|
||||
* Form of {@link org.hibernate.annotations.JdbcType} for describing the key of a Map
|
||||
*
|
||||
* @since 6.0
|
||||
*/
|
||||
|
@ -28,7 +26,7 @@ public @interface MapKeyJdbcType {
|
|||
/**
|
||||
* The descriptor to use for the map-key column
|
||||
*
|
||||
* @see JdbcType#value
|
||||
* @see org.hibernate.annotations.JdbcType#value
|
||||
*/
|
||||
Class<? extends JdbcTypeDescriptor> value();
|
||||
Class<? extends org.hibernate.type.descriptor.jdbc.JdbcType> value();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* 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.annotations.internal;
|
||||
|
||||
import org.hibernate.type.descriptor.WrapperOptions;
|
||||
import org.hibernate.type.descriptor.java.BasicJavaType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators;
|
||||
|
||||
public class NoJavaType implements BasicJavaType<Void> {
|
||||
@Override
|
||||
public JdbcType getRecommendedJdbcType(JdbcTypeDescriptorIndicators context) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public <X> X unwrap(Void value, Class<X> type, WrapperOptions options) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public <X> Void wrap(X value, WrapperOptions options) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* 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.annotations.internal;
|
||||
|
||||
import org.hibernate.type.descriptor.ValueBinder;
|
||||
import org.hibernate.type.descriptor.ValueExtractor;
|
||||
import org.hibernate.type.descriptor.java.JavaType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
|
||||
public class NoJdbcType implements JdbcType {
|
||||
@Override
|
||||
public int getJdbcTypeCode() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public <X> ValueBinder<X> getBinder(JavaType<X> javaTypeDescriptor) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public <X> ValueExtractor<X> getExtractor(JavaType<X> javaTypeDescriptor) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
|
@ -103,7 +103,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.JavaType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.spi.TypeConfiguration;
|
||||
|
||||
import jakarta.persistence.AttributeConverter;
|
||||
|
@ -397,8 +397,8 @@ public class InFlightMetadataCollectorImpl implements InFlightMetadataCollector
|
|||
}
|
||||
|
||||
@Override
|
||||
public void addJdbcTypeRegistration(int typeCode, JdbcTypeDescriptor jdbcTypeDescriptor) {
|
||||
getTypeConfiguration().getJdbcTypeDescriptorRegistry().addDescriptor( typeCode, jdbcTypeDescriptor );
|
||||
public void addJdbcTypeRegistration(int typeCode, JdbcType jdbcType) {
|
||||
getTypeConfiguration().getJdbcTypeDescriptorRegistry().addDescriptor( typeCode, jdbcType );
|
||||
}
|
||||
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
|
|
@ -73,7 +73,7 @@ import org.hibernate.query.sqm.function.SqmFunctionDescriptor;
|
|||
import org.hibernate.service.ServiceRegistry;
|
||||
import org.hibernate.type.BasicType;
|
||||
import org.hibernate.type.descriptor.java.JavaType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.spi.TypeConfiguration;
|
||||
import org.hibernate.usertype.UserType;
|
||||
|
||||
|
@ -288,7 +288,7 @@ public class MetadataBuilderImpl implements MetadataBuilderImplementor, TypeCont
|
|||
}
|
||||
|
||||
@Override
|
||||
public void contributeJdbcTypeDescriptor(JdbcTypeDescriptor descriptor) {
|
||||
public void contributeJdbcTypeDescriptor(JdbcType descriptor) {
|
||||
this.bootstrapContext.getTypeConfiguration().getJdbcTypeDescriptorRegistry().addDescriptor( descriptor );
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import org.hibernate.type.StandardBasicTypeTemplate;
|
|||
import org.hibernate.type.descriptor.java.JavaType;
|
||||
import org.hibernate.type.descriptor.java.spi.JavaTypeDescriptorRegistry;
|
||||
import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.spi.TypeConfiguration;
|
||||
import org.hibernate.usertype.UserType;
|
||||
|
||||
|
@ -30,20 +30,20 @@ public interface TypeContributions {
|
|||
void contributeJavaTypeDescriptor(JavaType descriptor);
|
||||
|
||||
/**
|
||||
* Add the JdbcTypeDescriptor to the {@link TypeConfiguration}'s
|
||||
* Add the JdbcType to the {@link TypeConfiguration}'s
|
||||
* {@link JdbcTypeDescriptorRegistry}
|
||||
*/
|
||||
void contributeJdbcTypeDescriptor(JdbcTypeDescriptor descriptor);
|
||||
void contributeJdbcTypeDescriptor(JdbcType 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 JavaType}, {@link JdbcTypeDescriptor} and a concept of a "value
|
||||
* of {@link JavaType}, {@link JdbcType} 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 JavaType} and
|
||||
* {@link JdbcTypeDescriptor} implementations (or write your own for custom types)
|
||||
* {@link JdbcType} implementations (or write your own for custom types)
|
||||
* and use {@link StandardBasicTypeTemplate} to combine those with
|
||||
* registration keys and call {@link #contributeType(BasicType)} instead
|
||||
*/
|
||||
|
@ -55,7 +55,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 JavaType}. To get as close as possible to 6.0 in 5.3 use
|
||||
* existing {@link JavaType} and {@link JdbcTypeDescriptor}
|
||||
* existing {@link JavaType} and {@link JdbcType}
|
||||
* implementations (or write your own for custom impls) and use
|
||||
* {@link StandardBasicTypeTemplate} to combine those with registration keys
|
||||
* and call {@link #contributeType(BasicType)} instead
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.hibernate.type.Type;
|
|||
import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan;
|
||||
import org.hibernate.type.descriptor.java.JavaType;
|
||||
import org.hibernate.type.descriptor.java.MutabilityPlan;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators;
|
||||
import org.hibernate.type.spi.TypeConfiguration;
|
||||
import org.hibernate.type.spi.TypeConfigurationAware;
|
||||
|
@ -212,7 +212,7 @@ public class TypeDefinition implements Serializable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public JdbcTypeDescriptor getJdbcTypeDescriptor() {
|
||||
public JdbcType getJdbcTypeDescriptor() {
|
||||
return resolvedBasicType.getJdbcTypeDescriptor();
|
||||
}
|
||||
|
||||
|
@ -238,7 +238,7 @@ public class TypeDefinition implements Serializable {
|
|||
final JavaType<Serializable> jtd = typeConfiguration
|
||||
.getJavaTypeDescriptorRegistry()
|
||||
.resolveDescriptor( typeImplementorClass );
|
||||
final JdbcTypeDescriptor jdbcType = typeConfiguration.getJdbcTypeDescriptorRegistry().getDescriptor( Types.VARBINARY );
|
||||
final JdbcType jdbcType = typeConfiguration.getJdbcTypeDescriptorRegistry().getDescriptor( Types.VARBINARY );
|
||||
final BasicType<Serializable> resolved = typeConfiguration.getBasicTypeRegistry().resolve( jtd, jdbcType );
|
||||
final SerializableType legacyType = new SerializableType( typeImplementorClass );
|
||||
|
||||
|
@ -264,7 +264,7 @@ public class TypeDefinition implements Serializable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public JdbcTypeDescriptor getJdbcTypeDescriptor() {
|
||||
public JdbcType getJdbcTypeDescriptor() {
|
||||
return resolved.getJdbcTypeDescriptor();
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ import org.hibernate.type.BasicType;
|
|||
import org.hibernate.type.ConvertedBasicType;
|
||||
import org.hibernate.type.descriptor.java.JavaType;
|
||||
import org.hibernate.type.descriptor.java.MutabilityPlan;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators;
|
||||
|
||||
/**
|
||||
|
@ -58,7 +58,7 @@ public class ConvertedBasicTypeResolution<J> implements BasicValue.Resolution<J>
|
|||
}
|
||||
|
||||
@Override
|
||||
public JdbcTypeDescriptor getJdbcTypeDescriptor() {
|
||||
public JdbcType getJdbcTypeDescriptor() {
|
||||
return adapted.getJdbcTypeDescriptor();
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ import org.hibernate.type.CustomType;
|
|||
import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan;
|
||||
import org.hibernate.type.descriptor.java.JavaType;
|
||||
import org.hibernate.type.descriptor.java.MutabilityPlan;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
|
||||
/**
|
||||
* @author Steve Ebersole
|
||||
|
@ -23,19 +23,19 @@ public class EnumeratedValueResolution<E extends Enum<E>> implements BasicValue.
|
|||
private final CustomType enumTypeMapping;
|
||||
private final JavaType<E> domainJtd;
|
||||
private final JavaType<?> jdbcJtd;
|
||||
private final JdbcTypeDescriptor jdbcTypeDescriptor;
|
||||
private final JdbcType jdbcType;
|
||||
private final EnumValueConverter<E,?> valueConverter;
|
||||
|
||||
public EnumeratedValueResolution(
|
||||
CustomType enumTypeMapping,
|
||||
JavaType<E> domainJtd,
|
||||
JavaType<?> jdbcJtd,
|
||||
JdbcTypeDescriptor jdbcTypeDescriptor,
|
||||
JdbcType jdbcType,
|
||||
EnumValueConverter<E, ?> valueConverter) {
|
||||
this.enumTypeMapping = enumTypeMapping;
|
||||
this.domainJtd = domainJtd;
|
||||
this.jdbcJtd = jdbcJtd;
|
||||
this.jdbcTypeDescriptor = jdbcTypeDescriptor;
|
||||
this.jdbcType = jdbcType;
|
||||
this.valueConverter = valueConverter;
|
||||
}
|
||||
|
||||
|
@ -60,8 +60,8 @@ public class EnumeratedValueResolution<E extends Enum<E>> implements BasicValue.
|
|||
}
|
||||
|
||||
@Override
|
||||
public JdbcTypeDescriptor getJdbcTypeDescriptor() {
|
||||
return jdbcTypeDescriptor;
|
||||
public JdbcType getJdbcTypeDescriptor() {
|
||||
return jdbcType;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -12,7 +12,7 @@ import org.hibernate.metamodel.model.convert.spi.BasicValueConverter;
|
|||
import org.hibernate.type.BasicType;
|
||||
import org.hibernate.type.descriptor.java.JavaType;
|
||||
import org.hibernate.type.descriptor.java.MutabilityPlan;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
|
||||
/**
|
||||
* @author Steve Ebersole
|
||||
|
@ -20,7 +20,7 @@ import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
|||
public class InferredBasicValueResolution<J> implements BasicValue.Resolution<J> {
|
||||
private JavaType<J> domainJtd;
|
||||
private JavaType<J> relationalJtd;
|
||||
private JdbcTypeDescriptor jdbcTypeDescriptor;
|
||||
private JdbcType jdbcType;
|
||||
|
||||
private MutabilityPlan mutabilityPlan;
|
||||
|
||||
|
@ -33,7 +33,7 @@ public class InferredBasicValueResolution<J> implements BasicValue.Resolution<J>
|
|||
JdbcMapping jdbcMapping,
|
||||
JavaType<J> domainJtd,
|
||||
JavaType<J> relationalJtd,
|
||||
JdbcTypeDescriptor jdbcTypeDescriptor,
|
||||
JdbcType jdbcType,
|
||||
BasicValueConverter valueConverter,
|
||||
BasicType<J> legacyType,
|
||||
MutabilityPlan mutabilityPlan) {
|
||||
|
@ -41,7 +41,7 @@ public class InferredBasicValueResolution<J> implements BasicValue.Resolution<J>
|
|||
this.legacyType = legacyType;
|
||||
this.domainJtd = domainJtd;
|
||||
this.relationalJtd = relationalJtd;
|
||||
this.jdbcTypeDescriptor = jdbcTypeDescriptor;
|
||||
this.jdbcType = jdbcType;
|
||||
this.valueConverter = valueConverter;
|
||||
this.mutabilityPlan = mutabilityPlan == null ? domainJtd.getMutabilityPlan() : mutabilityPlan;
|
||||
}
|
||||
|
@ -67,8 +67,8 @@ public class InferredBasicValueResolution<J> implements BasicValue.Resolution<J>
|
|||
}
|
||||
|
||||
@Override
|
||||
public JdbcTypeDescriptor getJdbcTypeDescriptor() {
|
||||
return jdbcTypeDescriptor;
|
||||
public JdbcType getJdbcTypeDescriptor() {
|
||||
return jdbcType;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -31,10 +31,10 @@ import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan;
|
|||
import org.hibernate.type.descriptor.java.JavaType;
|
||||
import org.hibernate.type.descriptor.java.SerializableJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.java.TemporalJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators;
|
||||
import org.hibernate.type.descriptor.jdbc.ObjectJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.TinyIntJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.ObjectJdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.TinyIntJdbcType;
|
||||
import org.hibernate.type.spi.TypeConfiguration;
|
||||
|
||||
/**
|
||||
|
@ -48,7 +48,7 @@ public class InferredBasicValueResolver {
|
|||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
public static BasicValue.Resolution from(
|
||||
Function<TypeConfiguration, BasicJavaType> explicitJavaTypeAccess,
|
||||
Function<TypeConfiguration, JdbcTypeDescriptor> explicitSqlTypeAccess,
|
||||
Function<TypeConfiguration, JdbcType> explicitSqlTypeAccess,
|
||||
Type resolvedJavaType,
|
||||
Supplier<JavaType> reflectedJtdResolver,
|
||||
JdbcTypeDescriptorIndicators stdIndicators,
|
||||
|
@ -59,7 +59,7 @@ public class InferredBasicValueResolver {
|
|||
TypeConfiguration typeConfiguration) {
|
||||
|
||||
final BasicJavaType explicitJavaType = explicitJavaTypeAccess != null ? explicitJavaTypeAccess.apply( typeConfiguration ) : null;
|
||||
final JdbcTypeDescriptor explicitJdbcType = explicitSqlTypeAccess != null ? explicitSqlTypeAccess.apply( typeConfiguration ) : null;
|
||||
final JdbcType explicitJdbcType = explicitSqlTypeAccess != null ? explicitSqlTypeAccess.apply( typeConfiguration ) : null;
|
||||
|
||||
final BasicJavaType reflectedJtd = (BasicJavaType) reflectedJtdResolver.get();
|
||||
|
||||
|
@ -74,7 +74,7 @@ public class InferredBasicValueResolver {
|
|||
// we have an explicit JavaTypeDescriptor
|
||||
|
||||
if ( explicitJdbcType != null ) {
|
||||
// we also have an explicit JdbcTypeDescriptor
|
||||
// we also have an explicit JdbcType
|
||||
|
||||
jdbcMapping = typeConfiguration.getBasicTypeRegistry().resolve(
|
||||
explicitJavaType,
|
||||
|
@ -83,9 +83,9 @@ public class InferredBasicValueResolver {
|
|||
legacyType = jdbcMapping;
|
||||
}
|
||||
else {
|
||||
// we need to infer the JdbcTypeDescriptor and use that to build the value-mapping
|
||||
final JdbcTypeDescriptor inferredJdbcType = explicitJavaType.getRecommendedJdbcType( stdIndicators );
|
||||
if ( inferredJdbcType instanceof ObjectJdbcTypeDescriptor ) {
|
||||
// we need to infer the JdbcType and use that to build the value-mapping
|
||||
final JdbcType inferredJdbcType = explicitJavaType.getRecommendedJdbcType( stdIndicators );
|
||||
if ( inferredJdbcType instanceof ObjectJdbcType ) {
|
||||
// have a "fallback" JDBC type... see if we can decide a better choice
|
||||
|
||||
if ( explicitJavaType instanceof EnumJavaTypeDescriptor ) {
|
||||
|
@ -131,7 +131,7 @@ public class InferredBasicValueResolver {
|
|||
else if ( reflectedJtd != null ) {
|
||||
// we were able to determine the "reflected java-type"
|
||||
if ( explicitJdbcType != null ) {
|
||||
// we also have an explicit JdbcTypeDescriptor
|
||||
// we also have an explicit JdbcType
|
||||
|
||||
jdbcMapping = typeConfiguration.getBasicTypeRegistry().resolve(
|
||||
reflectedJtd,
|
||||
|
@ -269,7 +269,7 @@ public class InferredBasicValueResolver {
|
|||
public static InferredBasicValueResolution fromEnum(
|
||||
EnumJavaTypeDescriptor enumJavaDescriptor,
|
||||
BasicJavaType explicitJavaType,
|
||||
JdbcTypeDescriptor explicitJdbcType,
|
||||
JdbcType explicitJdbcType,
|
||||
JdbcTypeDescriptorIndicators stdIndicators,
|
||||
TypeConfiguration typeConfiguration) {
|
||||
final EnumType enumStyle = stdIndicators.getEnumeratedType() != null
|
||||
|
@ -295,12 +295,12 @@ public class InferredBasicValueResolver {
|
|||
relationalJtd = typeConfiguration.getJavaTypeDescriptorRegistry().getDescriptor( relationalJavaType );
|
||||
}
|
||||
|
||||
final JdbcTypeDescriptor jdbcTypeDescriptor = explicitJdbcType != null ? explicitJdbcType : relationalJtd.getRecommendedJdbcType( stdIndicators );
|
||||
final JdbcType jdbcType = explicitJdbcType != null ? explicitJdbcType : relationalJtd.getRecommendedJdbcType( stdIndicators );
|
||||
|
||||
//noinspection unchecked
|
||||
final NamedEnumValueConverter valueConverter = new NamedEnumValueConverter(
|
||||
enumJavaDescriptor,
|
||||
jdbcTypeDescriptor,
|
||||
jdbcType,
|
||||
relationalJtd
|
||||
);
|
||||
|
||||
|
@ -313,14 +313,14 @@ public class InferredBasicValueResolver {
|
|||
|
||||
final CustomType legacyEnumTypeWrapper = new CustomType( legacyEnumType, typeConfiguration );
|
||||
|
||||
final JdbcMapping jdbcMapping = typeConfiguration.getBasicTypeRegistry().resolve( relationalJtd, jdbcTypeDescriptor );
|
||||
final JdbcMapping jdbcMapping = typeConfiguration.getBasicTypeRegistry().resolve( relationalJtd, jdbcType );
|
||||
|
||||
//noinspection unchecked
|
||||
return new InferredBasicValueResolution(
|
||||
jdbcMapping,
|
||||
enumJavaDescriptor,
|
||||
relationalJtd,
|
||||
jdbcTypeDescriptor,
|
||||
jdbcType,
|
||||
valueConverter,
|
||||
legacyEnumTypeWrapper,
|
||||
ImmutableMutabilityPlan.INSTANCE
|
||||
|
@ -343,12 +343,12 @@ public class InferredBasicValueResolver {
|
|||
relationalJtd = typeConfiguration.getJavaTypeDescriptorRegistry().getDescriptor( Integer.class );
|
||||
}
|
||||
|
||||
final JdbcTypeDescriptor jdbcTypeDescriptor = explicitJdbcType != null ? explicitJdbcType : TinyIntJdbcTypeDescriptor.INSTANCE;
|
||||
final JdbcType jdbcType = explicitJdbcType != null ? explicitJdbcType : TinyIntJdbcType.INSTANCE;
|
||||
|
||||
//noinspection unchecked
|
||||
final OrdinalEnumValueConverter valueConverter = new OrdinalEnumValueConverter(
|
||||
enumJavaDescriptor,
|
||||
jdbcTypeDescriptor,
|
||||
jdbcType,
|
||||
relationalJtd
|
||||
);
|
||||
|
||||
|
@ -361,14 +361,14 @@ public class InferredBasicValueResolver {
|
|||
|
||||
final CustomType legacyEnumTypeWrapper = new CustomType( legacyEnumType, typeConfiguration );
|
||||
|
||||
final JdbcMapping jdbcMapping = typeConfiguration.getBasicTypeRegistry().resolve( relationalJtd, jdbcTypeDescriptor );
|
||||
final JdbcMapping jdbcMapping = typeConfiguration.getBasicTypeRegistry().resolve( relationalJtd, jdbcType );
|
||||
|
||||
//noinspection unchecked
|
||||
return new InferredBasicValueResolution(
|
||||
jdbcMapping,
|
||||
enumJavaDescriptor,
|
||||
relationalJtd,
|
||||
jdbcTypeDescriptor,
|
||||
jdbcType,
|
||||
valueConverter,
|
||||
legacyEnumTypeWrapper,
|
||||
ImmutableMutabilityPlan.INSTANCE
|
||||
|
@ -384,7 +384,7 @@ public class InferredBasicValueResolver {
|
|||
public static InferredBasicValueResolution fromTemporal(
|
||||
TemporalJavaTypeDescriptor reflectedJtd,
|
||||
BasicJavaType explicitJavaType,
|
||||
JdbcTypeDescriptor explicitJdbcType,
|
||||
JdbcType explicitJdbcType,
|
||||
Type resolvedJavaType,
|
||||
JdbcTypeDescriptorIndicators stdIndicators,
|
||||
TypeConfiguration typeConfiguration) {
|
||||
|
@ -411,15 +411,15 @@ public class InferredBasicValueResolver {
|
|||
);
|
||||
}
|
||||
|
||||
final JdbcTypeDescriptor jdbcTypeDescriptor = explicitJdbcType != null ? explicitJdbcType : explicitTemporalJtd.getRecommendedJdbcType( stdIndicators );
|
||||
final JdbcType jdbcType = explicitJdbcType != null ? explicitJdbcType : explicitTemporalJtd.getRecommendedJdbcType( stdIndicators );
|
||||
|
||||
final BasicType jdbcMapping = typeConfiguration.getBasicTypeRegistry().resolve( explicitTemporalJtd, jdbcTypeDescriptor );
|
||||
final BasicType jdbcMapping = typeConfiguration.getBasicTypeRegistry().resolve( explicitTemporalJtd, jdbcType );
|
||||
|
||||
return new InferredBasicValueResolution(
|
||||
jdbcMapping,
|
||||
explicitTemporalJtd,
|
||||
explicitTemporalJtd,
|
||||
jdbcTypeDescriptor,
|
||||
jdbcType,
|
||||
null,
|
||||
jdbcMapping,
|
||||
explicitJavaType.getMutabilityPlan()
|
||||
|
@ -427,7 +427,7 @@ public class InferredBasicValueResolver {
|
|||
}
|
||||
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Case #2 - explicit JdbcTypeDescriptor
|
||||
// Case #2 - explicit JdbcType
|
||||
//
|
||||
// - still a special case because we want to perform the new resolution
|
||||
// due to the new annotations being used
|
||||
|
@ -459,7 +459,7 @@ public class InferredBasicValueResolver {
|
|||
}
|
||||
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Case #3 - no explicit JavaTypeDescriptor or JdbcTypeDescriptor
|
||||
// Case #3 - no explicit JavaTypeDescriptor or JdbcType
|
||||
//
|
||||
// - for the moment continue to use the legacy resolution to registered
|
||||
// BasicType
|
||||
|
|
|
@ -15,7 +15,7 @@ import org.hibernate.metamodel.model.convert.spi.BasicValueConverter;
|
|||
import org.hibernate.type.BasicType;
|
||||
import org.hibernate.type.descriptor.java.JavaType;
|
||||
import org.hibernate.type.descriptor.java.MutabilityPlan;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.spi.TypeConfiguration;
|
||||
|
||||
/**
|
||||
|
@ -75,7 +75,7 @@ public class NamedBasicTypeResolution<J> implements BasicValue.Resolution<J> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public JdbcTypeDescriptor getJdbcTypeDescriptor() {
|
||||
public JdbcType getJdbcTypeDescriptor() {
|
||||
return basicType.getJdbcTypeDescriptor();
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.hibernate.type.descriptor.java.BasicJavaType;
|
|||
import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan;
|
||||
import org.hibernate.type.descriptor.java.JavaType;
|
||||
import org.hibernate.type.descriptor.java.MutabilityPlan;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators;
|
||||
import org.hibernate.type.spi.TypeConfiguration;
|
||||
|
||||
|
@ -38,7 +38,7 @@ public class NamedConverterResolution<J> implements BasicValue.Resolution<J> {
|
|||
public static NamedConverterResolution from(
|
||||
ConverterDescriptor converterDescriptor,
|
||||
Function<TypeConfiguration, BasicJavaType> explicitJtdAccess,
|
||||
Function<TypeConfiguration, JdbcTypeDescriptor> explicitStdAccess,
|
||||
Function<TypeConfiguration, JdbcType> explicitStdAccess,
|
||||
Function<TypeConfiguration, MutabilityPlan> explicitMutabilityPlanAccess,
|
||||
JdbcTypeDescriptorIndicators sqlTypeIndicators,
|
||||
JpaAttributeConverterCreationContext converterCreationContext,
|
||||
|
@ -56,7 +56,7 @@ public class NamedConverterResolution<J> implements BasicValue.Resolution<J> {
|
|||
public static NamedConverterResolution from(
|
||||
String name,
|
||||
Function<TypeConfiguration, BasicJavaType> explicitJtdAccess,
|
||||
Function<TypeConfiguration, JdbcTypeDescriptor> explicitStdAccess,
|
||||
Function<TypeConfiguration, JdbcType> explicitStdAccess,
|
||||
Function<TypeConfiguration, MutabilityPlan> explicitMutabilityPlanAccess,
|
||||
JdbcTypeDescriptorIndicators sqlTypeIndicators,
|
||||
JpaAttributeConverterCreationContext converterCreationContext,
|
||||
|
@ -85,7 +85,7 @@ public class NamedConverterResolution<J> implements BasicValue.Resolution<J> {
|
|||
|
||||
private static NamedConverterResolution fromInternal(
|
||||
Function<TypeConfiguration, BasicJavaType> explicitJtdAccess,
|
||||
Function<TypeConfiguration, JdbcTypeDescriptor> explicitStdAccess,
|
||||
Function<TypeConfiguration, JdbcType> explicitStdAccess,
|
||||
Function<TypeConfiguration, MutabilityPlan> explicitMutabilityPlanAccess,
|
||||
JpaAttributeConverter converter, JdbcTypeDescriptorIndicators sqlTypeIndicators,
|
||||
MetadataBuildingContext context) {
|
||||
|
@ -99,13 +99,13 @@ public class NamedConverterResolution<J> implements BasicValue.Resolution<J> {
|
|||
? explicitJtd
|
||||
: converter.getDomainJavaDescriptor();
|
||||
|
||||
final JdbcTypeDescriptor explicitJdbcType = explicitStdAccess != null
|
||||
final JdbcType explicitJdbcType = explicitStdAccess != null
|
||||
? explicitStdAccess.apply( typeConfiguration )
|
||||
: null;
|
||||
|
||||
final JavaType relationalJtd = converter.getRelationalJavaDescriptor();
|
||||
|
||||
final JdbcTypeDescriptor jdbcType = explicitJdbcType != null
|
||||
final JdbcType jdbcType = explicitJdbcType != null
|
||||
? explicitJdbcType
|
||||
: relationalJtd.getRecommendedJdbcType( sqlTypeIndicators );
|
||||
|
||||
|
@ -138,7 +138,7 @@ public class NamedConverterResolution<J> implements BasicValue.Resolution<J> {
|
|||
|
||||
private final JavaType domainJtd;
|
||||
private final JavaType relationalJtd;
|
||||
private final JdbcTypeDescriptor jdbcTypeDescriptor;
|
||||
private final JdbcType jdbcType;
|
||||
|
||||
private final JpaAttributeConverter valueConverter;
|
||||
private final MutabilityPlan mutabilityPlan;
|
||||
|
@ -151,7 +151,7 @@ public class NamedConverterResolution<J> implements BasicValue.Resolution<J> {
|
|||
public NamedConverterResolution(
|
||||
JavaType domainJtd,
|
||||
JavaType relationalJtd,
|
||||
JdbcTypeDescriptor jdbcTypeDescriptor,
|
||||
JdbcType jdbcType,
|
||||
JpaAttributeConverter valueConverter,
|
||||
MutabilityPlan mutabilityPlan,
|
||||
TypeConfiguration typeConfiguration) {
|
||||
|
@ -161,8 +161,8 @@ public class NamedConverterResolution<J> implements BasicValue.Resolution<J> {
|
|||
assert relationalJtd != null;
|
||||
this.relationalJtd = relationalJtd;
|
||||
|
||||
assert jdbcTypeDescriptor != null;
|
||||
this.jdbcTypeDescriptor = jdbcTypeDescriptor;
|
||||
assert jdbcType != null;
|
||||
this.jdbcType = jdbcType;
|
||||
|
||||
assert valueConverter != null;
|
||||
this.valueConverter = valueConverter;
|
||||
|
@ -172,7 +172,7 @@ public class NamedConverterResolution<J> implements BasicValue.Resolution<J> {
|
|||
|
||||
this.jdbcMapping = typeConfiguration.getBasicTypeRegistry().resolve(
|
||||
relationalJtd,
|
||||
jdbcTypeDescriptor
|
||||
jdbcType
|
||||
);
|
||||
// this.jdbcMapping = new JdbcMapping() {
|
||||
// private final ValueExtractor extractor = relationalStd.getExtractor( relationalJtd );
|
||||
|
@ -216,7 +216,7 @@ public class NamedConverterResolution<J> implements BasicValue.Resolution<J> {
|
|||
relationalJtd.getJavaType().getTypeName()
|
||||
),
|
||||
valueConverter,
|
||||
jdbcTypeDescriptor,
|
||||
jdbcType,
|
||||
relationalJtd,
|
||||
domainJtd,
|
||||
mutabilityPlan
|
||||
|
@ -241,8 +241,8 @@ public class NamedConverterResolution<J> implements BasicValue.Resolution<J> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public JdbcTypeDescriptor getJdbcTypeDescriptor() {
|
||||
return jdbcTypeDescriptor;
|
||||
public JdbcType getJdbcTypeDescriptor() {
|
||||
return jdbcType;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -15,7 +15,7 @@ import org.hibernate.type.BasicType;
|
|||
import org.hibernate.type.CustomType;
|
||||
import org.hibernate.type.descriptor.java.JavaType;
|
||||
import org.hibernate.type.descriptor.java.MutabilityPlan;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
|
||||
/**
|
||||
* @author Steve Ebersole
|
||||
|
@ -52,7 +52,7 @@ public class UserTypeResolution implements BasicValue.Resolution {
|
|||
}
|
||||
|
||||
@Override
|
||||
public JdbcTypeDescriptor getJdbcTypeDescriptor() {
|
||||
public JdbcType getJdbcTypeDescriptor() {
|
||||
return userTypeAdapter.getJdbcTypeDescriptor();
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import org.hibernate.type.descriptor.java.BasicJavaType;
|
|||
import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan;
|
||||
import org.hibernate.type.descriptor.java.JavaType;
|
||||
import org.hibernate.type.descriptor.java.MutabilityPlan;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators;
|
||||
import org.hibernate.type.spi.TypeConfiguration;
|
||||
|
||||
|
@ -37,7 +37,7 @@ public class VersionResolution<E> implements BasicValue.Resolution<E> {
|
|||
public static <E> VersionResolution<E> from(
|
||||
Function<TypeConfiguration, java.lang.reflect.Type> implicitJavaTypeAccess,
|
||||
Function<TypeConfiguration, BasicJavaType> explicitJtdAccess,
|
||||
Function<TypeConfiguration, JdbcTypeDescriptor> explicitStdAccess,
|
||||
Function<TypeConfiguration, JdbcType> explicitStdAccess,
|
||||
TimeZoneStorageType timeZoneStorageType,
|
||||
TypeConfiguration typeConfiguration,
|
||||
@SuppressWarnings("unused") MetadataBuildingContext context) {
|
||||
|
@ -48,7 +48,7 @@ public class VersionResolution<E> implements BasicValue.Resolution<E> {
|
|||
final JavaType registered = typeConfiguration.getJavaTypeDescriptorRegistry().resolveDescriptor( implicitJavaType );
|
||||
final BasicJavaType jtd = (BasicJavaType) registered;
|
||||
|
||||
final JdbcTypeDescriptor recommendedJdbcType = jtd.getRecommendedJdbcType(
|
||||
final JdbcType recommendedJdbcType = jtd.getRecommendedJdbcType(
|
||||
new JdbcTypeDescriptorIndicators() {
|
||||
@Override
|
||||
public TypeConfiguration getTypeConfiguration() {
|
||||
|
@ -87,18 +87,18 @@ public class VersionResolution<E> implements BasicValue.Resolution<E> {
|
|||
}
|
||||
|
||||
private final JavaType jtd;
|
||||
private final JdbcTypeDescriptor jdbcTypeDescriptor;
|
||||
private final JdbcType jdbcType;
|
||||
|
||||
private final JdbcMapping jdbcMapping;
|
||||
private final BasicType legacyType;
|
||||
|
||||
public VersionResolution(
|
||||
JavaType javaTypeDescriptor,
|
||||
JdbcTypeDescriptor jdbcTypeDescriptor,
|
||||
JdbcType jdbcType,
|
||||
JdbcMapping jdbcMapping,
|
||||
BasicType legacyType) {
|
||||
this.jtd = javaTypeDescriptor;
|
||||
this.jdbcTypeDescriptor = jdbcTypeDescriptor;
|
||||
this.jdbcType = jdbcType;
|
||||
this.jdbcMapping = jdbcMapping;
|
||||
this.legacyType = legacyType;
|
||||
}
|
||||
|
@ -126,8 +126,8 @@ public class VersionResolution<E> implements BasicValue.Resolution<E> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public JdbcTypeDescriptor getJdbcTypeDescriptor() {
|
||||
return jdbcTypeDescriptor;
|
||||
public JdbcType getJdbcTypeDescriptor() {
|
||||
return jdbcType;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -47,7 +47,7 @@ import org.hibernate.type.BasicTypeRegistry;
|
|||
import org.hibernate.type.CustomType;
|
||||
import org.hibernate.type.descriptor.java.JavaType;
|
||||
import org.hibernate.type.descriptor.java.spi.JavaTypeDescriptorRegistry;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry;
|
||||
import org.hibernate.type.internal.NamedBasicTypeImpl;
|
||||
import org.hibernate.type.spi.TypeConfiguration;
|
||||
|
@ -398,7 +398,7 @@ public class MetadataBuildingProcess {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void contributeJdbcTypeDescriptor(JdbcTypeDescriptor descriptor) {
|
||||
public void contributeJdbcTypeDescriptor(JdbcType descriptor) {
|
||||
bootstrapContext.getTypeConfiguration().getJdbcTypeDescriptorRegistry().addDescriptor( descriptor );
|
||||
}
|
||||
|
||||
|
@ -432,7 +432,7 @@ public class MetadataBuildingProcess {
|
|||
.getJdbcTypeDescriptorRegistry();
|
||||
final JavaTypeDescriptorRegistry javaTypeRegistry = bootstrapContext.getTypeConfiguration()
|
||||
.getJavaTypeDescriptorRegistry();
|
||||
final JdbcTypeDescriptor timestampDescriptor = jdbcTypeRegistry.getDescriptor( Types.TIMESTAMP );
|
||||
final JdbcType timestampDescriptor = jdbcTypeRegistry.getDescriptor( Types.TIMESTAMP );
|
||||
final BasicTypeRegistry basicTypeRegistry = bootstrapContext.getTypeConfiguration().getBasicTypeRegistry();
|
||||
final BasicType<?> offsetDateTimeType = new NamedBasicTypeImpl<>(
|
||||
javaTypeRegistry.getDescriptor( OffsetDateTime.class ),
|
||||
|
|
|
@ -50,7 +50,7 @@ import org.hibernate.mapping.MappedSuperclass;
|
|||
import org.hibernate.mapping.PersistentClass;
|
||||
import org.hibernate.mapping.Table;
|
||||
import org.hibernate.type.descriptor.java.JavaType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
|
||||
import jakarta.persistence.AttributeConverter;
|
||||
|
||||
|
@ -317,7 +317,7 @@ public interface InFlightMetadataCollector extends Mapping, MetadataImplementor
|
|||
void registerValueMappingResolver(Function<MetadataBuildingContext,Boolean> resolver);
|
||||
|
||||
void addJavaTypeRegistration(Class<?> javaType, JavaType<?> jtd);
|
||||
void addJdbcTypeRegistration(int typeCode, JdbcTypeDescriptor jdbcTypeDescriptor);
|
||||
void addJdbcTypeRegistration(int typeCode, JdbcType jdbcType);
|
||||
|
||||
interface DelayedPropertyReferenceHandler extends Serializable {
|
||||
void process(InFlightMetadataCollector metadataCollector);
|
||||
|
|
|
@ -120,7 +120,7 @@ import org.hibernate.mapping.ToOne;
|
|||
import org.hibernate.mapping.UnionSubclass;
|
||||
import org.hibernate.resource.beans.spi.ManagedBeanRegistry;
|
||||
import org.hibernate.type.descriptor.java.BasicJavaType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
|
||||
import jakarta.persistence.AttributeOverride;
|
||||
import jakarta.persistence.AttributeOverrides;
|
||||
|
@ -887,13 +887,13 @@ public final class AnnotationBinder {
|
|||
MetadataBuildingContext context,
|
||||
ManagedBeanRegistry managedBeanRegistry,
|
||||
JdbcTypeRegistration annotation) {
|
||||
final Class<? extends JdbcTypeDescriptor> jdbcTypeClass = annotation.value();
|
||||
final JdbcTypeDescriptor jdbcTypeDescriptor = managedBeanRegistry.getBean( jdbcTypeClass ).getBeanInstance();
|
||||
final Class<? extends JdbcType> jdbcTypeClass = annotation.value();
|
||||
final JdbcType jdbcType = managedBeanRegistry.getBean( jdbcTypeClass ).getBeanInstance();
|
||||
|
||||
final int typeCode = annotation.registrationCode() == Integer.MIN_VALUE
|
||||
? jdbcTypeDescriptor.getJdbcTypeCode()
|
||||
? jdbcType.getJdbcTypeCode()
|
||||
: annotation.registrationCode();
|
||||
context.getMetadataCollector().addJdbcTypeRegistration( typeCode, jdbcTypeDescriptor );
|
||||
context.getMetadataCollector().addJdbcTypeRegistration( typeCode, jdbcType );
|
||||
}
|
||||
|
||||
private static void handleJavaTypeDescriptorRegistration(
|
||||
|
|
|
@ -33,7 +33,6 @@ import org.hibernate.annotations.CollectionIdJdbcTypeCode;
|
|||
import org.hibernate.annotations.CollectionIdMutability;
|
||||
import org.hibernate.annotations.CustomType;
|
||||
import org.hibernate.annotations.Immutable;
|
||||
import org.hibernate.annotations.JdbcType;
|
||||
import org.hibernate.annotations.JdbcTypeCode;
|
||||
import org.hibernate.annotations.ListIndexJavaType;
|
||||
import org.hibernate.annotations.ListIndexJdbcType;
|
||||
|
@ -79,7 +78,7 @@ import org.hibernate.type.descriptor.java.BasicJavaType;
|
|||
import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan;
|
||||
import org.hibernate.type.descriptor.java.JavaType;
|
||||
import org.hibernate.type.descriptor.java.MutabilityPlan;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators;
|
||||
import org.hibernate.type.spi.TypeConfiguration;
|
||||
import org.hibernate.usertype.DynamicParameterizedType;
|
||||
|
@ -145,7 +144,7 @@ public class BasicValueBinder<T> implements JdbcTypeDescriptorIndicators {
|
|||
private Class<? extends UserType<?>> explicitCustomType;
|
||||
private Map explicitLocalTypeParams;
|
||||
|
||||
private Function<TypeConfiguration, JdbcTypeDescriptor> explicitJdbcTypeAccess;
|
||||
private Function<TypeConfiguration, JdbcType> explicitJdbcTypeAccess;
|
||||
private Function<TypeConfiguration, BasicJavaType> explicitJavaTypeAccess;
|
||||
private Function<TypeConfiguration, MutabilityPlan> explicitMutabilityAccess;
|
||||
private Function<TypeConfiguration, java.lang.reflect.Type> implicitJavaTypeAccess;
|
||||
|
@ -428,9 +427,9 @@ public class BasicValueBinder<T> implements JdbcTypeDescriptorIndicators {
|
|||
explicitJdbcTypeAccess = (typeConfiguration) -> {
|
||||
final CollectionIdJdbcType jdbcTypeAnn = findAnnotation( modelXProperty, CollectionIdJdbcType.class );
|
||||
if ( jdbcTypeAnn != null ) {
|
||||
final Class<? extends JdbcTypeDescriptor> jdbcType = normalizeJdbcType( jdbcTypeAnn.value() );
|
||||
final Class<? extends JdbcType> jdbcType = normalizeJdbcType( jdbcTypeAnn.value() );
|
||||
if ( jdbcType != null ) {
|
||||
final ManagedBean<? extends JdbcTypeDescriptor> managedBean = beanRegistry.getBean( jdbcType );
|
||||
final ManagedBean<? extends JdbcType> managedBean = beanRegistry.getBean( jdbcType );
|
||||
return managedBean.getBeanInstance();
|
||||
}
|
||||
}
|
||||
|
@ -524,9 +523,9 @@ public class BasicValueBinder<T> implements JdbcTypeDescriptorIndicators {
|
|||
explicitJdbcTypeAccess = typeConfiguration -> {
|
||||
final MapKeyJdbcType jdbcTypeAnn = findAnnotation( mapAttribute, MapKeyJdbcType.class );
|
||||
if ( jdbcTypeAnn != null ) {
|
||||
final Class<? extends JdbcTypeDescriptor> jdbcTypeImpl = normalizeJdbcType( jdbcTypeAnn.value() );
|
||||
final Class<? extends JdbcType> jdbcTypeImpl = normalizeJdbcType( jdbcTypeAnn.value() );
|
||||
if ( jdbcTypeImpl != null ) {
|
||||
final ManagedBean<? extends JdbcTypeDescriptor> jdbcTypeBean = managedBeanRegistry.getBean( jdbcTypeImpl );
|
||||
final ManagedBean<? extends JdbcType> jdbcTypeBean = managedBeanRegistry.getBean( jdbcTypeImpl );
|
||||
return jdbcTypeBean.getBeanInstance();
|
||||
}
|
||||
}
|
||||
|
@ -629,9 +628,9 @@ public class BasicValueBinder<T> implements JdbcTypeDescriptorIndicators {
|
|||
explicitJdbcTypeAccess = (typeConfiguration) -> {
|
||||
final ListIndexJdbcType jdbcTypeAnn = findAnnotation( listAttribute, ListIndexJdbcType.class );
|
||||
if ( jdbcTypeAnn != null ) {
|
||||
final Class<? extends JdbcTypeDescriptor> jdbcType = normalizeJdbcType( jdbcTypeAnn.value() );
|
||||
final Class<? extends JdbcType> jdbcType = normalizeJdbcType( jdbcTypeAnn.value() );
|
||||
if ( jdbcType != null ) {
|
||||
final ManagedBean<? extends JdbcTypeDescriptor> bean = beanRegistry.getBean( jdbcType );
|
||||
final ManagedBean<? extends JdbcType> bean = beanRegistry.getBean( jdbcType );
|
||||
return bean.getBeanInstance();
|
||||
}
|
||||
}
|
||||
|
@ -895,10 +894,10 @@ public class BasicValueBinder<T> implements JdbcTypeDescriptorIndicators {
|
|||
normalJdbcTypeDetails( modelXProperty, buildingContext );
|
||||
normalMutabilityDetails( modelXProperty, buildingContext );
|
||||
|
||||
// layer AnyDiscriminator into the JdbcTypeDescriptor resolution
|
||||
final Function<TypeConfiguration, JdbcTypeDescriptor> originalJdbcTypeResolution = explicitJdbcTypeAccess;
|
||||
// layer AnyDiscriminator into the JdbcType resolution
|
||||
final Function<TypeConfiguration, JdbcType> originalJdbcTypeResolution = explicitJdbcTypeAccess;
|
||||
this.explicitJdbcTypeAccess = (typeConfiguration) -> {
|
||||
final JdbcTypeDescriptor originalResolution = originalJdbcTypeResolution.apply( typeConfiguration );
|
||||
final JdbcType originalResolution = originalJdbcTypeResolution.apply( typeConfiguration );
|
||||
if ( originalResolution != null ) {
|
||||
return originalResolution;
|
||||
}
|
||||
|
@ -943,9 +942,9 @@ public class BasicValueBinder<T> implements JdbcTypeDescriptorIndicators {
|
|||
explicitJdbcTypeAccess = (typeConfiguration) -> {
|
||||
final AnyKeyJdbcType jdbcTypeAnn = findAnnotation( modelXProperty, AnyKeyJdbcType.class );
|
||||
if ( jdbcTypeAnn != null ) {
|
||||
final Class<? extends JdbcTypeDescriptor> jdbcType = normalizeJdbcType( jdbcTypeAnn.value() );
|
||||
final Class<? extends JdbcType> jdbcType = normalizeJdbcType( jdbcTypeAnn.value() );
|
||||
if ( jdbcType != null ) {
|
||||
final ManagedBean<? extends JdbcTypeDescriptor> jtdBean = managedBeanRegistry.getBean( jdbcType );
|
||||
final ManagedBean<? extends JdbcType> jtdBean = managedBeanRegistry.getBean( jdbcType );
|
||||
return jtdBean.getBeanInstance();
|
||||
}
|
||||
}
|
||||
|
@ -969,11 +968,11 @@ public class BasicValueBinder<T> implements JdbcTypeDescriptorIndicators {
|
|||
.getServiceRegistry()
|
||||
.getService( ManagedBeanRegistry.class );
|
||||
|
||||
final JdbcType jdbcTypeAnn = findAnnotation( attributeXProperty, JdbcType.class );
|
||||
final org.hibernate.annotations.JdbcType jdbcTypeAnn = findAnnotation( attributeXProperty, org.hibernate.annotations.JdbcType.class );
|
||||
if ( jdbcTypeAnn != null ) {
|
||||
final Class<? extends JdbcTypeDescriptor> jdbcType = normalizeJdbcType( jdbcTypeAnn.value() );
|
||||
final Class<? extends JdbcType> jdbcType = normalizeJdbcType( jdbcTypeAnn.value() );
|
||||
if ( jdbcType != null ) {
|
||||
final ManagedBean<? extends JdbcTypeDescriptor> jdbcTypeBean = managedBeanRegistry.getBean( jdbcType );
|
||||
final ManagedBean<? extends JdbcType> jdbcTypeBean = managedBeanRegistry.getBean( jdbcType );
|
||||
return jdbcTypeBean.getBeanInstance();
|
||||
}
|
||||
}
|
||||
|
@ -1097,7 +1096,7 @@ public class BasicValueBinder<T> implements JdbcTypeDescriptorIndicators {
|
|||
return userType;
|
||||
}
|
||||
|
||||
private Class<? extends JdbcTypeDescriptor> normalizeJdbcType(Class<? extends JdbcTypeDescriptor> jdbcType) {
|
||||
private Class<? extends JdbcType> normalizeJdbcType(Class<? extends JdbcType> jdbcType) {
|
||||
if ( jdbcType == null ) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -285,13 +285,13 @@ public abstract class AbstractHANADialect extends Dialect {
|
|||
}
|
||||
}
|
||||
|
||||
private static class HANAStreamBlobTypeDescriptor implements JdbcTypeDescriptor {
|
||||
private static class HANAStreamBlobType implements JdbcType {
|
||||
|
||||
private static final long serialVersionUID = -2476600722093442047L;
|
||||
|
||||
final int maxLobPrefetchSize;
|
||||
|
||||
public HANAStreamBlobTypeDescriptor(int maxLobPrefetchSize) {
|
||||
public HANAStreamBlobType(int maxLobPrefetchSize) {
|
||||
this.maxLobPrefetchSize = maxLobPrefetchSize;
|
||||
}
|
||||
|
||||
|
@ -302,7 +302,7 @@ public abstract class AbstractHANADialect extends Dialect {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "HANAStreamBlobTypeDescriptor";
|
||||
return "HANAStreamBlobType";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -355,7 +355,7 @@ public abstract class AbstractHANADialect extends Dialect {
|
|||
@Override
|
||||
protected X doExtract(ResultSet rs, int paramIndex, WrapperOptions options) throws SQLException {
|
||||
Blob rsBlob = rs.getBlob( paramIndex );
|
||||
if ( rsBlob == null || rsBlob.length() < HANAStreamBlobTypeDescriptor.this.maxLobPrefetchSize ) {
|
||||
if ( rsBlob == null || rsBlob.length() < HANAStreamBlobType.this.maxLobPrefetchSize ) {
|
||||
return javaTypeDescriptor.wrap( rsBlob, options );
|
||||
}
|
||||
Blob blob = new MaterializedBlob( DataHelper.extractBytes( rsBlob.getBinaryStream() ) );
|
||||
|
@ -384,7 +384,7 @@ public abstract class AbstractHANADialect extends Dialect {
|
|||
// using non-contextual lob creation and HANA then closes our StringReader.
|
||||
// see test case LobLocatorTest
|
||||
|
||||
private static class HANAClobJdbcTypeDescriptor extends ClobJdbcTypeDescriptor {
|
||||
private static class HANAClobJdbcType extends ClobJdbcType {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "HANAClobTypeDescriptor";
|
||||
|
@ -396,7 +396,7 @@ public abstract class AbstractHANADialect extends Dialect {
|
|||
final int maxLobPrefetchSize;
|
||||
final boolean useUnicodeStringTypes;
|
||||
|
||||
public HANAClobJdbcTypeDescriptor(int maxLobPrefetchSize, boolean useUnicodeStringTypes) {
|
||||
public HANAClobJdbcType(int maxLobPrefetchSize, boolean useUnicodeStringTypes) {
|
||||
this.maxLobPrefetchSize = maxLobPrefetchSize;
|
||||
this.useUnicodeStringTypes = useUnicodeStringTypes;
|
||||
}
|
||||
|
@ -449,14 +449,14 @@ public abstract class AbstractHANADialect extends Dialect {
|
|||
@Override
|
||||
protected X doExtract(ResultSet rs, int paramIndex, WrapperOptions options) throws SQLException {
|
||||
Clob rsClob;
|
||||
if ( HANAClobJdbcTypeDescriptor.this.useUnicodeStringTypes ) {
|
||||
if ( HANAClobJdbcType.this.useUnicodeStringTypes ) {
|
||||
rsClob = rs.getNClob( paramIndex );
|
||||
}
|
||||
else {
|
||||
rsClob = rs.getClob( paramIndex );
|
||||
}
|
||||
|
||||
if ( rsClob == null || rsClob.length() < HANAClobJdbcTypeDescriptor.this.maxLobPrefetchSize ) {
|
||||
if ( rsClob == null || rsClob.length() < HANAClobJdbcType.this.maxLobPrefetchSize ) {
|
||||
return javaTypeDescriptor.wrap( rsClob, options );
|
||||
}
|
||||
Clob clob = new MaterializedNClob( DataHelper.extractString( rsClob ) );
|
||||
|
@ -484,14 +484,14 @@ public abstract class AbstractHANADialect extends Dialect {
|
|||
}
|
||||
}
|
||||
|
||||
private static class HANANClobJdbcTypeDescriptor extends NClobJdbcTypeDescriptor {
|
||||
private static class HANANClobJdbcType extends NClobJdbcType {
|
||||
|
||||
/** serial version uid. */
|
||||
private static final long serialVersionUID = 5651116091681647859L;
|
||||
|
||||
final int maxLobPrefetchSize;
|
||||
|
||||
public HANANClobJdbcTypeDescriptor(int maxLobPrefetchSize) {
|
||||
public HANANClobJdbcType(int maxLobPrefetchSize) {
|
||||
this.maxLobPrefetchSize = maxLobPrefetchSize;
|
||||
}
|
||||
|
||||
|
@ -548,7 +548,7 @@ public abstract class AbstractHANADialect extends Dialect {
|
|||
@Override
|
||||
protected X doExtract(ResultSet rs, int paramIndex, WrapperOptions options) throws SQLException {
|
||||
NClob rsNClob = rs.getNClob( paramIndex );
|
||||
if ( rsNClob == null || rsNClob.length() < HANANClobJdbcTypeDescriptor.this.maxLobPrefetchSize ) {
|
||||
if ( rsNClob == null || rsNClob.length() < HANANClobJdbcType.this.maxLobPrefetchSize ) {
|
||||
return javaTypeDescriptor.wrap( rsNClob, options );
|
||||
}
|
||||
NClob nClob = new MaterializedNClob( DataHelper.extractString( rsNClob ) );
|
||||
|
@ -572,17 +572,17 @@ public abstract class AbstractHANADialect extends Dialect {
|
|||
}
|
||||
}
|
||||
|
||||
public static class HANABlobTypeDescriptor implements JdbcTypeDescriptor {
|
||||
public static class HANABlobType implements JdbcType {
|
||||
|
||||
private static final long serialVersionUID = 5874441715643764323L;
|
||||
|
||||
final int maxLobPrefetchSize;
|
||||
|
||||
final HANAStreamBlobTypeDescriptor hanaStreamBlobTypeDescriptor;
|
||||
final HANAStreamBlobType hanaStreamBlobTypeDescriptor;
|
||||
|
||||
public HANABlobTypeDescriptor(int maxLobPrefetchSize) {
|
||||
public HANABlobType(int maxLobPrefetchSize) {
|
||||
this.maxLobPrefetchSize = maxLobPrefetchSize;
|
||||
this.hanaStreamBlobTypeDescriptor = new HANAStreamBlobTypeDescriptor( maxLobPrefetchSize );
|
||||
this.hanaStreamBlobTypeDescriptor = new HANAStreamBlobType( maxLobPrefetchSize );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -597,7 +597,7 @@ public abstract class AbstractHANADialect extends Dialect {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "HANABlobTypeDescriptor";
|
||||
return "HANABlobType";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -607,7 +607,7 @@ public abstract class AbstractHANADialect extends Dialect {
|
|||
@Override
|
||||
protected X doExtract(ResultSet rs, int paramIndex, WrapperOptions options) throws SQLException {
|
||||
Blob rsBlob = rs.getBlob( paramIndex );
|
||||
if ( rsBlob == null || rsBlob.length() < HANABlobTypeDescriptor.this.maxLobPrefetchSize ) {
|
||||
if ( rsBlob == null || rsBlob.length() < HANABlobType.this.maxLobPrefetchSize ) {
|
||||
return javaTypeDescriptor.wrap( rsBlob, options );
|
||||
}
|
||||
Blob blob = new MaterializedBlob( DataHelper.extractBytes( rsBlob.getBinaryStream() ) );
|
||||
|
@ -632,26 +632,26 @@ public abstract class AbstractHANADialect extends Dialect {
|
|||
|
||||
@Override
|
||||
protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException {
|
||||
JdbcTypeDescriptor descriptor = BlobJdbcTypeDescriptor.BLOB_BINDING;
|
||||
JdbcType descriptor = BlobJdbcType.BLOB_BINDING;
|
||||
if ( byte[].class.isInstance( value ) ) {
|
||||
// performance shortcut for binding BLOB data in byte[] format
|
||||
descriptor = BlobJdbcTypeDescriptor.PRIMITIVE_ARRAY_BINDING;
|
||||
descriptor = BlobJdbcType.PRIMITIVE_ARRAY_BINDING;
|
||||
}
|
||||
else if ( options.useStreamForLobBinding() ) {
|
||||
descriptor = HANABlobTypeDescriptor.this.hanaStreamBlobTypeDescriptor;
|
||||
descriptor = HANABlobType.this.hanaStreamBlobTypeDescriptor;
|
||||
}
|
||||
descriptor.getBinder( javaTypeDescriptor ).bind( st, value, index, options );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doBind(CallableStatement st, X value, String name, WrapperOptions options) throws SQLException {
|
||||
JdbcTypeDescriptor descriptor = BlobJdbcTypeDescriptor.BLOB_BINDING;
|
||||
JdbcType descriptor = BlobJdbcType.BLOB_BINDING;
|
||||
if ( byte[].class.isInstance( value ) ) {
|
||||
// performance shortcut for binding BLOB data in byte[] format
|
||||
descriptor = BlobJdbcTypeDescriptor.PRIMITIVE_ARRAY_BINDING;
|
||||
descriptor = BlobJdbcType.PRIMITIVE_ARRAY_BINDING;
|
||||
}
|
||||
else if ( options.useStreamForLobBinding() ) {
|
||||
descriptor = HANABlobTypeDescriptor.this.hanaStreamBlobTypeDescriptor;
|
||||
descriptor = HANABlobType.this.hanaStreamBlobTypeDescriptor;
|
||||
}
|
||||
descriptor.getBinder( javaTypeDescriptor ).bind( st, value, name, options );
|
||||
}
|
||||
|
@ -678,11 +678,11 @@ public abstract class AbstractHANADialect extends Dialect {
|
|||
private static final Boolean USE_LEGACY_BOOLEAN_TYPE_DEFAULT_VALUE = Boolean.FALSE;
|
||||
private static final Boolean TREAT_DOUBLE_TYPED_FIELDS_AS_DECIMAL_DEFAULT_VALUE = Boolean.FALSE;
|
||||
|
||||
private HANANClobJdbcTypeDescriptor nClobTypeDescriptor = new HANANClobJdbcTypeDescriptor( MAX_LOB_PREFETCH_SIZE_DEFAULT_VALUE );
|
||||
private HANANClobJdbcType nClobTypeDescriptor = new HANANClobJdbcType( MAX_LOB_PREFETCH_SIZE_DEFAULT_VALUE );
|
||||
|
||||
private HANABlobTypeDescriptor blobTypeDescriptor = new HANABlobTypeDescriptor( MAX_LOB_PREFETCH_SIZE_DEFAULT_VALUE );
|
||||
private HANABlobType blobTypeDescriptor = new HANABlobType( MAX_LOB_PREFETCH_SIZE_DEFAULT_VALUE );
|
||||
|
||||
private HANAClobJdbcTypeDescriptor clobTypeDescriptor;
|
||||
private HANAClobJdbcType clobTypeDescriptor;
|
||||
|
||||
private boolean useLegacyBooleanType = USE_LEGACY_BOOLEAN_TYPE_DEFAULT_VALUE.booleanValue();
|
||||
private boolean useUnicodeStringTypes;
|
||||
|
@ -733,7 +733,7 @@ public abstract class AbstractHANADialect extends Dialect {
|
|||
super();
|
||||
|
||||
this.useUnicodeStringTypes = useUnicodeStringTypesDefault().booleanValue();
|
||||
this.clobTypeDescriptor = new HANAClobJdbcTypeDescriptor(
|
||||
this.clobTypeDescriptor = new HANAClobJdbcType(
|
||||
MAX_LOB_PREFETCH_SIZE_DEFAULT_VALUE,
|
||||
useUnicodeStringTypesDefault().booleanValue()
|
||||
);
|
||||
|
@ -1400,11 +1400,11 @@ public abstract class AbstractHANADialect extends Dialect {
|
|||
Integer.valueOf( maxLobPrefetchSizeDefault ) ).intValue();
|
||||
|
||||
if ( this.nClobTypeDescriptor.getMaxLobPrefetchSize() != maxLobPrefetchSize ) {
|
||||
this.nClobTypeDescriptor = new HANANClobJdbcTypeDescriptor( maxLobPrefetchSize );
|
||||
this.nClobTypeDescriptor = new HANANClobJdbcType( maxLobPrefetchSize );
|
||||
}
|
||||
|
||||
if ( this.blobTypeDescriptor.getMaxLobPrefetchSize() != maxLobPrefetchSize ) {
|
||||
this.blobTypeDescriptor = new HANABlobTypeDescriptor( maxLobPrefetchSize );
|
||||
this.blobTypeDescriptor = new HANABlobType( maxLobPrefetchSize );
|
||||
}
|
||||
|
||||
if ( supportsAsciiStringTypes() ) {
|
||||
|
@ -1425,7 +1425,7 @@ public abstract class AbstractHANADialect extends Dialect {
|
|||
|
||||
if ( this.clobTypeDescriptor.getMaxLobPrefetchSize() != maxLobPrefetchSize
|
||||
|| this.clobTypeDescriptor.isUseUnicodeStringTypes() != this.useUnicodeStringTypes ) {
|
||||
this.clobTypeDescriptor = new HANAClobJdbcTypeDescriptor( maxLobPrefetchSize, this.useUnicodeStringTypes );
|
||||
this.clobTypeDescriptor = new HANAClobJdbcType( maxLobPrefetchSize, this.useUnicodeStringTypes );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1449,7 +1449,7 @@ public abstract class AbstractHANADialect extends Dialect {
|
|||
.register(
|
||||
new BasicTypeImpl<>(
|
||||
DoubleJavaTypeDescriptor.INSTANCE,
|
||||
NumericJdbcTypeDescriptor.INSTANCE
|
||||
NumericJdbcType.INSTANCE
|
||||
),
|
||||
Double.class.getName()
|
||||
);
|
||||
|
@ -1473,15 +1473,15 @@ public abstract class AbstractHANADialect extends Dialect {
|
|||
.add( StandardBasicTypes.BIG_DECIMAL.getName() );
|
||||
jdbcTypeRegistry.addDescriptor(
|
||||
Types.FLOAT,
|
||||
NumericJdbcTypeDescriptor.INSTANCE
|
||||
NumericJdbcType.INSTANCE
|
||||
);
|
||||
jdbcTypeRegistry.addDescriptor(
|
||||
Types.REAL,
|
||||
NumericJdbcTypeDescriptor.INSTANCE
|
||||
NumericJdbcType.INSTANCE
|
||||
);
|
||||
jdbcTypeRegistry.addDescriptor(
|
||||
Types.DOUBLE,
|
||||
NumericJdbcTypeDescriptor.INSTANCE
|
||||
NumericJdbcType.INSTANCE
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1489,17 +1489,17 @@ public abstract class AbstractHANADialect extends Dialect {
|
|||
jdbcTypeRegistry.addDescriptor( Types.NCLOB, this.nClobTypeDescriptor );
|
||||
jdbcTypeRegistry.addDescriptor( Types.BLOB, this.blobTypeDescriptor );
|
||||
// tinyint is unsigned on HANA
|
||||
jdbcTypeRegistry.addDescriptor( Types.TINYINT, SmallIntJdbcTypeDescriptor.INSTANCE );
|
||||
jdbcTypeRegistry.addDescriptor( Types.TINYINT, SmallIntJdbcType.INSTANCE );
|
||||
if ( isUseUnicodeStringTypes() ) {
|
||||
jdbcTypeRegistry.addDescriptor( Types.VARCHAR, NVarcharJdbcTypeDescriptor.INSTANCE );
|
||||
jdbcTypeRegistry.addDescriptor( Types.CHAR, NCharJdbcTypeDescriptor.INSTANCE );
|
||||
jdbcTypeRegistry.addDescriptor( Types.VARCHAR, NVarcharJdbcType.INSTANCE );
|
||||
jdbcTypeRegistry.addDescriptor( Types.CHAR, NCharJdbcType.INSTANCE );
|
||||
}
|
||||
if ( this.treatDoubleTypedFieldsAsDecimal ) {
|
||||
jdbcTypeRegistry.addDescriptor( Types.DOUBLE, DecimalJdbcTypeDescriptor.INSTANCE );
|
||||
jdbcTypeRegistry.addDescriptor( Types.DOUBLE, DecimalJdbcType.INSTANCE );
|
||||
}
|
||||
}
|
||||
|
||||
public JdbcTypeDescriptor getBlobTypeDescriptor() {
|
||||
public JdbcType getBlobTypeDescriptor() {
|
||||
return this.blobTypeDescriptor;
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.hibernate.query.sqm.mutation.internal.idtable.TempIdTableExporter;
|
|||
import org.hibernate.query.sqm.mutation.spi.SqmMultiTableMutationStrategy;
|
||||
import org.hibernate.sql.ast.spi.SqlAppender;
|
||||
import org.hibernate.type.descriptor.java.PrimitiveByteArrayJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry;
|
||||
|
||||
import java.sql.CallableStatement;
|
||||
|
@ -71,7 +71,7 @@ public abstract class AbstractTransactSQLDialect extends Dialect {
|
|||
}
|
||||
|
||||
@Override
|
||||
public JdbcTypeDescriptor resolveSqlTypeDescriptor(
|
||||
public JdbcType resolveSqlTypeDescriptor(
|
||||
String columnTypeName,
|
||||
int jdbcTypeCode,
|
||||
int precision,
|
||||
|
|
|
@ -509,11 +509,11 @@ public class DB2Dialect extends Dialect {
|
|||
.getJdbcTypeDescriptorRegistry();
|
||||
|
||||
if ( version < 1100 ) {
|
||||
jdbcTypeRegistry.addDescriptor( Types.BOOLEAN, SmallIntJdbcTypeDescriptor.INSTANCE );
|
||||
jdbcTypeRegistry.addDescriptor( Types.BOOLEAN, SmallIntJdbcType.INSTANCE );
|
||||
// Binary literals were only added in 11. See https://www.ibm.com/support/knowledgecenter/SSEPGG_11.1.0/com.ibm.db2.luw.sql.ref.doc/doc/r0000731.html#d79816e393
|
||||
jdbcTypeRegistry.addDescriptor( Types.VARBINARY, VarbinaryJdbcTypeDescriptor.INSTANCE_WITHOUT_LITERALS );
|
||||
jdbcTypeRegistry.addDescriptor( Types.VARBINARY, VarbinaryJdbcType.INSTANCE_WITHOUT_LITERALS );
|
||||
if ( version < 970 ) {
|
||||
jdbcTypeRegistry.addDescriptor( Types.NUMERIC, DecimalJdbcTypeDescriptor.INSTANCE );
|
||||
jdbcTypeRegistry.addDescriptor( Types.NUMERIC, DecimalJdbcType.INSTANCE );
|
||||
}
|
||||
}
|
||||
// See HHH-12753
|
||||
|
@ -521,23 +521,23 @@ public class DB2Dialect extends Dialect {
|
|||
// support the N-variant methods like NClob or NString.
|
||||
// Therefore here we overwrite the sql type descriptors to
|
||||
// use the non-N variants which are supported.
|
||||
jdbcTypeRegistry.addDescriptor( Types.NCHAR, CharJdbcTypeDescriptor.INSTANCE );
|
||||
jdbcTypeRegistry.addDescriptor( Types.NCHAR, CharJdbcType.INSTANCE );
|
||||
jdbcTypeRegistry.addDescriptor(
|
||||
Types.NCLOB,
|
||||
useInputStreamToInsertBlob()
|
||||
? ClobJdbcTypeDescriptor.STREAM_BINDING
|
||||
: ClobJdbcTypeDescriptor.CLOB_BINDING
|
||||
? ClobJdbcType.STREAM_BINDING
|
||||
: ClobJdbcType.CLOB_BINDING
|
||||
);
|
||||
jdbcTypeRegistry.addDescriptor( Types.NVARCHAR, VarcharJdbcTypeDescriptor.INSTANCE );
|
||||
jdbcTypeRegistry.addDescriptor( Types.NUMERIC, DecimalJdbcTypeDescriptor.INSTANCE );
|
||||
jdbcTypeRegistry.addDescriptor( Types.NVARCHAR, VarcharJdbcType.INSTANCE );
|
||||
jdbcTypeRegistry.addDescriptor( Types.NUMERIC, DecimalJdbcType.INSTANCE );
|
||||
|
||||
// DB2 requires a custom binder for binding untyped nulls that resolves the type through the statement
|
||||
typeContributions.contributeJdbcTypeDescriptor( ObjectNullResolvingJdbcTypeDescriptor.INSTANCE );
|
||||
typeContributions.contributeJdbcTypeDescriptor( ObjectNullResolvingJdbcType.INSTANCE );
|
||||
|
||||
// Until we remove StandardBasicTypes, we have to keep this
|
||||
typeContributions.contributeType(
|
||||
new JavaObjectType(
|
||||
ObjectNullResolvingJdbcTypeDescriptor.INSTANCE,
|
||||
ObjectNullResolvingJdbcType.INSTANCE,
|
||||
typeContributions.getTypeConfiguration()
|
||||
.getJavaTypeDescriptorRegistry()
|
||||
.getDescriptor( Object.class )
|
||||
|
|
|
@ -57,11 +57,10 @@ import org.hibernate.type.BasicType;
|
|||
import org.hibernate.type.BasicTypeRegistry;
|
||||
import org.hibernate.type.JavaObjectType;
|
||||
import org.hibernate.type.StandardBasicTypes;
|
||||
import org.hibernate.type.descriptor.jdbc.DecimalJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.ObjectNullResolvingJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.SmallIntJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.TimestampJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.DecimalJdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.ObjectNullResolvingJdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.SmallIntJdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.TimestampJdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry;
|
||||
|
||||
import java.sql.DatabaseMetaData;
|
||||
|
@ -504,18 +503,18 @@ public class DerbyDialect extends Dialect {
|
|||
final JdbcTypeDescriptorRegistry jdbcTypeRegistry = typeContributions.getTypeConfiguration()
|
||||
.getJdbcTypeDescriptorRegistry();
|
||||
if ( getVersion() < 1070 ) {
|
||||
jdbcTypeRegistry.addDescriptor( Types.BOOLEAN, SmallIntJdbcTypeDescriptor.INSTANCE );
|
||||
jdbcTypeRegistry.addDescriptor( Types.BOOLEAN, SmallIntJdbcType.INSTANCE );
|
||||
}
|
||||
jdbcTypeRegistry.addDescriptor( Types.NUMERIC, DecimalJdbcTypeDescriptor.INSTANCE );
|
||||
jdbcTypeRegistry.addDescriptor( Types.TIMESTAMP_WITH_TIMEZONE, TimestampJdbcTypeDescriptor.INSTANCE );
|
||||
jdbcTypeRegistry.addDescriptor( Types.NUMERIC, DecimalJdbcType.INSTANCE );
|
||||
jdbcTypeRegistry.addDescriptor( Types.TIMESTAMP_WITH_TIMEZONE, TimestampJdbcType.INSTANCE );
|
||||
|
||||
// Derby requires a custom binder for binding untyped nulls that resolves the type through the statement
|
||||
typeContributions.contributeJdbcTypeDescriptor( ObjectNullResolvingJdbcTypeDescriptor.INSTANCE );
|
||||
typeContributions.contributeJdbcTypeDescriptor( ObjectNullResolvingJdbcType.INSTANCE );
|
||||
|
||||
// Until we remove StandardBasicTypes, we have to keep this
|
||||
typeContributions.contributeType(
|
||||
new JavaObjectType(
|
||||
ObjectNullResolvingJdbcTypeDescriptor.INSTANCE,
|
||||
ObjectNullResolvingJdbcType.INSTANCE,
|
||||
typeContributions.getTypeConfiguration()
|
||||
.getJavaTypeDescriptorRegistry()
|
||||
.getDescriptor( Object.class )
|
||||
|
|
|
@ -79,12 +79,12 @@ import org.hibernate.type.StandardBasicTypes;
|
|||
import org.hibernate.type.Type;
|
||||
import org.hibernate.type.descriptor.java.JavaType;
|
||||
import org.hibernate.type.descriptor.java.PrimitiveByteArrayJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.ClobJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.LongNVarcharJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.NCharJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.NClobJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.NVarcharJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.ClobJdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.LongNVarcharJdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.NCharJdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.NClobJdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.NVarcharJdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry;
|
||||
|
||||
import jakarta.persistence.TemporalType;
|
||||
|
@ -241,7 +241,7 @@ public abstract class Dialect implements ConversionContext {
|
|||
sizeStrategy = new SizeStrategyImpl();
|
||||
}
|
||||
|
||||
public JdbcTypeDescriptor resolveSqlTypeDescriptor(
|
||||
public JdbcType resolveSqlTypeDescriptor(
|
||||
String columnTypeName,
|
||||
int jdbcTypeCode,
|
||||
int precision,
|
||||
|
@ -999,16 +999,16 @@ public abstract class Dialect implements ConversionContext {
|
|||
|
||||
final NationalizationSupport nationalizationSupport = getNationalizationSupport();
|
||||
if ( nationalizationSupport == NationalizationSupport.EXPLICIT ) {
|
||||
typeContributions.contributeJdbcTypeDescriptor( NCharJdbcTypeDescriptor.INSTANCE );
|
||||
typeContributions.contributeJdbcTypeDescriptor( NVarcharJdbcTypeDescriptor.INSTANCE );
|
||||
typeContributions.contributeJdbcTypeDescriptor( LongNVarcharJdbcTypeDescriptor.INSTANCE );
|
||||
typeContributions.contributeJdbcTypeDescriptor( NClobJdbcTypeDescriptor.DEFAULT );
|
||||
typeContributions.contributeJdbcTypeDescriptor( NCharJdbcType.INSTANCE );
|
||||
typeContributions.contributeJdbcTypeDescriptor( NVarcharJdbcType.INSTANCE );
|
||||
typeContributions.contributeJdbcTypeDescriptor( LongNVarcharJdbcType.INSTANCE );
|
||||
typeContributions.contributeJdbcTypeDescriptor( NClobJdbcType.DEFAULT );
|
||||
}
|
||||
|
||||
if ( useInputStreamToInsertBlob() ) {
|
||||
typeContributions.getTypeConfiguration().getJdbcTypeDescriptorRegistry().addDescriptor(
|
||||
Types.CLOB,
|
||||
ClobJdbcTypeDescriptor.STREAM_BINDING
|
||||
ClobJdbcType.STREAM_BINDING
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -1032,12 +1032,12 @@ public abstract class Dialect implements ConversionContext {
|
|||
return paren>0 ? result.substring(0, paren) : result;
|
||||
}
|
||||
|
||||
public String getRawTypeName(JdbcTypeDescriptor jdbcTypeDescriptor) throws HibernateException {
|
||||
return getRawTypeName( jdbcTypeDescriptor.getJdbcTypeCode() );
|
||||
public String getRawTypeName(JdbcType jdbcType) throws HibernateException {
|
||||
return getRawTypeName( jdbcType.getJdbcTypeCode() );
|
||||
}
|
||||
|
||||
public String getTypeName(JdbcTypeDescriptor jdbcTypeDescriptor) throws HibernateException {
|
||||
return getTypeName( jdbcTypeDescriptor.getDefaultSqlTypeCode() );
|
||||
public String getTypeName(JdbcType jdbcType) throws HibernateException {
|
||||
return getTypeName( jdbcType.getDefaultSqlTypeCode() );
|
||||
}
|
||||
|
||||
public String getTypeName(int code) throws HibernateException {
|
||||
|
@ -1095,14 +1095,14 @@ public abstract class Dialect implements ConversionContext {
|
|||
* Get the name of the database type associated with the given
|
||||
* <tt>SqlTypeDescriptor</tt>.
|
||||
*
|
||||
* @param jdbcTypeDescriptor the SQL type
|
||||
* @param jdbcType the SQL type
|
||||
* @param size the length, precision, scale of the column
|
||||
*
|
||||
* @return the database type name
|
||||
*
|
||||
*/
|
||||
public String getTypeName(JdbcTypeDescriptor jdbcTypeDescriptor, Size size) {
|
||||
return getTypeName( jdbcTypeDescriptor.getJdbcTypeCode(), size );
|
||||
public String getTypeName(JdbcType jdbcType, Size size) {
|
||||
return getTypeName( jdbcType.getJdbcTypeCode(), size );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3421,12 +3421,12 @@ public abstract class Dialect implements ConversionContext {
|
|||
public interface SizeStrategy {
|
||||
/**
|
||||
* Resolve the {@link Size} to use for columns of the given
|
||||
* {@link JdbcTypeDescriptor SQL type} and {@link JavaType Java type}.
|
||||
* {@link JdbcType SQL type} and {@link JavaType Java type}.
|
||||
*
|
||||
* @return a non-null {@link Size}
|
||||
*/
|
||||
Size resolveSize(
|
||||
JdbcTypeDescriptor jdbcType,
|
||||
JdbcType jdbcType,
|
||||
JavaType<?> javaType,
|
||||
Integer precision,
|
||||
Integer scale,
|
||||
|
@ -3436,7 +3436,7 @@ public abstract class Dialect implements ConversionContext {
|
|||
public class SizeStrategyImpl implements SizeStrategy {
|
||||
@Override
|
||||
public Size resolveSize(
|
||||
JdbcTypeDescriptor jdbcType,
|
||||
JdbcType jdbcType,
|
||||
JavaType<?> javaType,
|
||||
Integer precision,
|
||||
Integer scale,
|
||||
|
|
|
@ -57,8 +57,8 @@ import org.hibernate.sql.exec.spi.JdbcOperation;
|
|||
import org.hibernate.type.NullType;
|
||||
import org.hibernate.type.StandardBasicTypes;
|
||||
import org.hibernate.type.descriptor.java.JavaType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.NullJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.NullJdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry;
|
||||
|
||||
import java.sql.CallableStatement;
|
||||
|
@ -191,7 +191,7 @@ public class MySQLDialect extends Dialect {
|
|||
sizeStrategy = new SizeStrategyImpl() {
|
||||
@Override
|
||||
public Size resolveSize(
|
||||
JdbcTypeDescriptor jdbcType,
|
||||
JdbcType jdbcType,
|
||||
JavaType<?> javaType,
|
||||
Integer precision,
|
||||
Integer scale,
|
||||
|
@ -298,7 +298,7 @@ public class MySQLDialect extends Dialect {
|
|||
}
|
||||
|
||||
@Override
|
||||
public JdbcTypeDescriptor resolveSqlTypeDescriptor(
|
||||
public JdbcType resolveSqlTypeDescriptor(
|
||||
String columnTypeName,
|
||||
int jdbcTypeCode,
|
||||
int precision,
|
||||
|
@ -401,12 +401,12 @@ public class MySQLDialect extends Dialect {
|
|||
super.contributeTypes( typeContributions, serviceRegistry );
|
||||
|
||||
// MySQL requires a custom binder for binding untyped nulls with the NULL type
|
||||
typeContributions.contributeJdbcTypeDescriptor( NullJdbcTypeDescriptor.INSTANCE );
|
||||
typeContributions.contributeJdbcTypeDescriptor( NullJdbcType.INSTANCE );
|
||||
|
||||
// Until we remove StandardBasicTypes, we have to keep this
|
||||
typeContributions.contributeType(
|
||||
new NullType(
|
||||
NullJdbcTypeDescriptor.INSTANCE,
|
||||
NullJdbcType.INSTANCE,
|
||||
typeContributions.getTypeConfiguration()
|
||||
.getJavaTypeDescriptorRegistry()
|
||||
.getDescriptor( Object.class )
|
||||
|
|
|
@ -60,10 +60,10 @@ import org.hibernate.type.JavaObjectType;
|
|||
import org.hibernate.type.NullType;
|
||||
import org.hibernate.type.StandardBasicTypes;
|
||||
import org.hibernate.type.descriptor.java.PrimitiveByteArrayJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.BlobJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.NullJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.ObjectNullAsNullTypeJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.BlobJdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.NullJdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.ObjectNullAsNullTypeJdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry;
|
||||
|
||||
import java.sql.CallableStatement;
|
||||
|
@ -601,7 +601,7 @@ public class OracleDialect extends Dialect {
|
|||
}
|
||||
|
||||
@Override
|
||||
public JdbcTypeDescriptor resolveSqlTypeDescriptor(
|
||||
public JdbcType resolveSqlTypeDescriptor(
|
||||
String columnTypeName,
|
||||
int jdbcTypeCode,
|
||||
int precision,
|
||||
|
@ -665,21 +665,21 @@ public class OracleDialect extends Dialect {
|
|||
false
|
||||
);
|
||||
|
||||
BlobJdbcTypeDescriptor descriptor = preferLong ?
|
||||
BlobJdbcTypeDescriptor.PRIMITIVE_ARRAY_BINDING :
|
||||
BlobJdbcTypeDescriptor.DEFAULT;
|
||||
BlobJdbcType descriptor = preferLong ?
|
||||
BlobJdbcType.PRIMITIVE_ARRAY_BINDING :
|
||||
BlobJdbcType.DEFAULT;
|
||||
|
||||
typeContributions.contributeJdbcTypeDescriptor( descriptor );
|
||||
}
|
||||
|
||||
// Oracle requires a custom binder for binding untyped nulls with the NULL type
|
||||
typeContributions.contributeJdbcTypeDescriptor( NullJdbcTypeDescriptor.INSTANCE );
|
||||
typeContributions.contributeJdbcTypeDescriptor( ObjectNullAsNullTypeJdbcTypeDescriptor.INSTANCE );
|
||||
typeContributions.contributeJdbcTypeDescriptor( NullJdbcType.INSTANCE );
|
||||
typeContributions.contributeJdbcTypeDescriptor( ObjectNullAsNullTypeJdbcType.INSTANCE );
|
||||
|
||||
// Until we remove StandardBasicTypes, we have to keep this
|
||||
typeContributions.contributeType(
|
||||
new NullType(
|
||||
NullJdbcTypeDescriptor.INSTANCE,
|
||||
NullJdbcType.INSTANCE,
|
||||
typeContributions.getTypeConfiguration()
|
||||
.getJavaTypeDescriptorRegistry()
|
||||
.getDescriptor( Object.class )
|
||||
|
@ -687,7 +687,7 @@ public class OracleDialect extends Dialect {
|
|||
);
|
||||
typeContributions.contributeType(
|
||||
new JavaObjectType(
|
||||
ObjectNullAsNullTypeJdbcTypeDescriptor.INSTANCE,
|
||||
ObjectNullAsNullTypeJdbcType.INSTANCE,
|
||||
typeContributions.getTypeConfiguration()
|
||||
.getJavaTypeDescriptorRegistry()
|
||||
.getDescriptor( Object.class )
|
||||
|
|
|
@ -67,9 +67,9 @@ import org.hibernate.type.JavaObjectType;
|
|||
import org.hibernate.type.PostgresUUIDType;
|
||||
import org.hibernate.type.StandardBasicTypes;
|
||||
import org.hibernate.type.descriptor.java.PrimitiveByteArrayJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.BlobJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.ClobJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.ObjectNullAsBinaryTypeJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.BlobJdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.ClobJdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.ObjectNullAsBinaryTypeJdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry;
|
||||
|
||||
import static org.hibernate.exception.spi.TemplatedViolatedConstraintNameExtractor.extractUsingTemplate;
|
||||
|
@ -934,8 +934,8 @@ public class PostgreSQLDialect extends Dialect {
|
|||
// with @Lob will attempt to use
|
||||
// BlobTypeDescriptor.PRIMITIVE_ARRAY_BINDING. Since the
|
||||
// dialect uses oid for Blobs, byte arrays cannot be used.
|
||||
jdbcTypeRegistry.addDescriptor( Types.BLOB, BlobJdbcTypeDescriptor.BLOB_BINDING );
|
||||
jdbcTypeRegistry.addDescriptor( Types.CLOB, ClobJdbcTypeDescriptor.CLOB_BINDING );
|
||||
jdbcTypeRegistry.addDescriptor( Types.BLOB, BlobJdbcType.BLOB_BINDING );
|
||||
jdbcTypeRegistry.addDescriptor( Types.CLOB, ClobJdbcType.CLOB_BINDING );
|
||||
|
||||
if ( getVersion() >= 820 ) {
|
||||
// HHH-9562
|
||||
|
@ -943,12 +943,12 @@ public class PostgreSQLDialect extends Dialect {
|
|||
}
|
||||
|
||||
// PostgreSQL requires a custom binder for binding untyped nulls as VARBINARY
|
||||
typeContributions.contributeJdbcTypeDescriptor( ObjectNullAsBinaryTypeJdbcTypeDescriptor.INSTANCE );
|
||||
typeContributions.contributeJdbcTypeDescriptor( ObjectNullAsBinaryTypeJdbcType.INSTANCE );
|
||||
|
||||
// Until we remove StandardBasicTypes, we have to keep this
|
||||
typeContributions.contributeType(
|
||||
new JavaObjectType(
|
||||
ObjectNullAsBinaryTypeJdbcTypeDescriptor.INSTANCE,
|
||||
ObjectNullAsBinaryTypeJdbcType.INSTANCE,
|
||||
typeContributions.getTypeConfiguration()
|
||||
.getJavaTypeDescriptorRegistry()
|
||||
.getDescriptor( Object.class )
|
||||
|
|
|
@ -50,7 +50,7 @@ import org.hibernate.type.BasicType;
|
|||
import org.hibernate.type.BasicTypeRegistry;
|
||||
import org.hibernate.type.StandardBasicTypes;
|
||||
import org.hibernate.type.descriptor.java.PrimitiveByteArrayJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.SmallIntJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.SmallIntJdbcType;
|
||||
|
||||
import java.sql.DatabaseMetaData;
|
||||
import java.sql.SQLException;
|
||||
|
@ -165,7 +165,7 @@ public class SQLServerDialect extends AbstractTransactSQLDialect {
|
|||
|
||||
typeContributions.getTypeConfiguration().getJdbcTypeDescriptorRegistry().addDescriptor(
|
||||
Types.TINYINT,
|
||||
SmallIntJdbcTypeDescriptor.INSTANCE
|
||||
SmallIntJdbcType.INSTANCE
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -36,9 +36,9 @@ 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.java.JavaType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.TimestampJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.TinyIntJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.TimestampJdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.TinyIntJdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry;
|
||||
|
||||
import static org.hibernate.exception.spi.TemplatedViolatedConstraintNameExtractor.extractUsingTemplate;
|
||||
|
@ -108,7 +108,7 @@ public class SybaseASEDialect extends SybaseDialect {
|
|||
sizeStrategy = new SizeStrategyImpl() {
|
||||
@Override
|
||||
public Size resolveSize(
|
||||
JdbcTypeDescriptor jdbcType,
|
||||
JdbcType jdbcType,
|
||||
JavaType<?> javaType,
|
||||
Integer precision,
|
||||
Integer scale,
|
||||
|
@ -190,10 +190,10 @@ public class SybaseASEDialect extends SybaseDialect {
|
|||
|
||||
final JdbcTypeDescriptorRegistry jdbcTypeRegistry = typeContributions.getTypeConfiguration()
|
||||
.getJdbcTypeDescriptorRegistry();
|
||||
jdbcTypeRegistry.addDescriptor( Types.BOOLEAN, TinyIntJdbcTypeDescriptor.INSTANCE );
|
||||
jdbcTypeRegistry.addDescriptor( Types.BOOLEAN, TinyIntJdbcType.INSTANCE );
|
||||
// At least the jTDS driver does not support this type code
|
||||
if ( jtdsDriver ) {
|
||||
jdbcTypeRegistry.addDescriptor( Types.TIMESTAMP_WITH_TIMEZONE, TimestampJdbcTypeDescriptor.INSTANCE );
|
||||
jdbcTypeRegistry.addDescriptor( Types.TIMESTAMP_WITH_TIMEZONE, TimestampJdbcType.INSTANCE );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -39,12 +39,11 @@ import org.hibernate.sql.ast.tree.Statement;
|
|||
import org.hibernate.sql.ast.tree.select.SelectStatement;
|
||||
import org.hibernate.sql.exec.spi.JdbcOperation;
|
||||
import org.hibernate.type.JavaObjectType;
|
||||
import org.hibernate.type.descriptor.jdbc.BlobJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.ClobJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.NClobJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.ObjectNullAsNullTypeJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.SmallIntJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.BlobJdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.ClobJdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.ObjectNullAsNullTypeJdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.SmallIntJdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry;
|
||||
|
||||
import java.sql.DatabaseMetaData;
|
||||
|
@ -86,7 +85,7 @@ public class SybaseDialect extends AbstractTransactSQLDialect {
|
|||
}
|
||||
|
||||
@Override
|
||||
public JdbcTypeDescriptor resolveSqlTypeDescriptor(
|
||||
public JdbcType resolveSqlTypeDescriptor(
|
||||
String columnTypeName,
|
||||
int jdbcTypeCode,
|
||||
int precision,
|
||||
|
@ -167,29 +166,29 @@ public class SybaseDialect extends AbstractTransactSQLDialect {
|
|||
final JdbcTypeDescriptorRegistry jdbcTypeRegistry = typeContributions.getTypeConfiguration()
|
||||
.getJdbcTypeDescriptorRegistry();
|
||||
if ( jtdsDriver ) {
|
||||
jdbcTypeRegistry.addDescriptor( Types.TINYINT, SmallIntJdbcTypeDescriptor.INSTANCE );
|
||||
jdbcTypeRegistry.addDescriptor( Types.TINYINT, SmallIntJdbcType.INSTANCE );
|
||||
|
||||
// The jTDS driver doesn't support the JDBC4 signatures using 'long length' for stream bindings
|
||||
jdbcTypeRegistry.addDescriptor( Types.CLOB, ClobJdbcTypeDescriptor.CLOB_BINDING );
|
||||
jdbcTypeRegistry.addDescriptor( Types.CLOB, ClobJdbcType.CLOB_BINDING );
|
||||
|
||||
// The jTDS driver doesn't support nationalized types
|
||||
jdbcTypeRegistry.addDescriptor( Types.NCLOB, ClobJdbcTypeDescriptor.CLOB_BINDING );
|
||||
jdbcTypeRegistry.addDescriptor( Types.NVARCHAR, ClobJdbcTypeDescriptor.CLOB_BINDING );
|
||||
jdbcTypeRegistry.addDescriptor( Types.NCLOB, ClobJdbcType.CLOB_BINDING );
|
||||
jdbcTypeRegistry.addDescriptor( Types.NVARCHAR, ClobJdbcType.CLOB_BINDING );
|
||||
}
|
||||
else {
|
||||
// Some Sybase drivers cannot support getClob. See HHH-7889
|
||||
jdbcTypeRegistry.addDescriptor( Types.CLOB, ClobJdbcTypeDescriptor.STREAM_BINDING_EXTRACTING );
|
||||
jdbcTypeRegistry.addDescriptor( Types.CLOB, ClobJdbcType.STREAM_BINDING_EXTRACTING );
|
||||
}
|
||||
|
||||
jdbcTypeRegistry.addDescriptor( Types.BLOB, BlobJdbcTypeDescriptor.PRIMITIVE_ARRAY_BINDING );
|
||||
jdbcTypeRegistry.addDescriptor( Types.BLOB, BlobJdbcType.PRIMITIVE_ARRAY_BINDING );
|
||||
|
||||
// Sybase requires a custom binder for binding untyped nulls with the NULL type
|
||||
typeContributions.contributeJdbcTypeDescriptor( ObjectNullAsNullTypeJdbcTypeDescriptor.INSTANCE );
|
||||
typeContributions.contributeJdbcTypeDescriptor( ObjectNullAsNullTypeJdbcType.INSTANCE );
|
||||
|
||||
// Until we remove StandardBasicTypes, we have to keep this
|
||||
typeContributions.contributeType(
|
||||
new JavaObjectType(
|
||||
ObjectNullAsNullTypeJdbcTypeDescriptor.INSTANCE,
|
||||
ObjectNullAsNullTypeJdbcType.INSTANCE,
|
||||
typeContributions.getTypeConfiguration()
|
||||
.getJavaTypeDescriptorRegistry()
|
||||
.getDescriptor( Object.class )
|
||||
|
|
|
@ -10,7 +10,6 @@ import java.util.TimeZone;
|
|||
|
||||
import org.hibernate.engine.jdbc.LobCreator;
|
||||
import org.hibernate.type.descriptor.WrapperOptions;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
|
||||
/**
|
||||
* @author Christian Beikov
|
||||
|
|
|
@ -58,7 +58,6 @@ 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.jdbc.JdbcTypeDescriptor;
|
||||
|
||||
/**
|
||||
* This class is meant to be extended.
|
||||
|
|
|
@ -34,7 +34,6 @@ import org.hibernate.SessionException;
|
|||
import org.hibernate.Transaction;
|
||||
import org.hibernate.cache.spi.CacheTransactionSynchronization;
|
||||
import org.hibernate.engine.internal.SessionEventListenerManagerImpl;
|
||||
import org.hibernate.engine.jdbc.LobCreationContext;
|
||||
import org.hibernate.engine.jdbc.LobCreator;
|
||||
import org.hibernate.engine.jdbc.connections.spi.JdbcConnectionAccess;
|
||||
import org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl;
|
||||
|
@ -79,7 +78,6 @@ 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.jdbc.JdbcTypeDescriptor;
|
||||
|
||||
/**
|
||||
* Base class for SharedSessionContract/SharedSessionContractImplementor
|
||||
|
|
|
@ -49,7 +49,7 @@ import org.hibernate.type.Type;
|
|||
import org.hibernate.type.descriptor.java.BasicJavaType;
|
||||
import org.hibernate.type.descriptor.java.JavaType;
|
||||
import org.hibernate.type.descriptor.java.MutabilityPlan;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators;
|
||||
import org.hibernate.type.spi.TypeConfiguration;
|
||||
import org.hibernate.type.spi.TypeConfigurationAware;
|
||||
|
@ -78,7 +78,7 @@ public class BasicValue extends SimpleValue implements JdbcTypeDescriptorIndicat
|
|||
private Map explicitLocalTypeParams;
|
||||
|
||||
private Function<TypeConfiguration, BasicJavaType> explicitJavaTypeAccess;
|
||||
private Function<TypeConfiguration, JdbcTypeDescriptor> explicitJdbcTypeAccess;
|
||||
private Function<TypeConfiguration, JdbcType> explicitJdbcTypeAccess;
|
||||
private Function<TypeConfiguration, MutabilityPlan> explicitMutabilityPlanAccess;
|
||||
private Function<TypeConfiguration, java.lang.reflect.Type> implicitJavaTypeAccess;
|
||||
|
||||
|
@ -152,7 +152,7 @@ public class BasicValue extends SimpleValue implements JdbcTypeDescriptorIndicat
|
|||
this.explicitJavaTypeAccess = explicitJavaTypeAccess;
|
||||
}
|
||||
|
||||
public void setExplicitJdbcTypeAccess(Function<TypeConfiguration, JdbcTypeDescriptor> jdbcTypeAccess) {
|
||||
public void setExplicitJdbcTypeAccess(Function<TypeConfiguration, JdbcType> jdbcTypeAccess) {
|
||||
this.explicitJdbcTypeAccess = jdbcTypeAccess;
|
||||
}
|
||||
|
||||
|
@ -390,7 +390,7 @@ public class BasicValue extends SimpleValue implements JdbcTypeDescriptorIndicat
|
|||
|
||||
if ( jtd == null ) {
|
||||
if ( explicitJdbcTypeAccess != null ) {
|
||||
final JdbcTypeDescriptor jdbcType = explicitJdbcTypeAccess.apply( typeConfiguration );
|
||||
final JdbcType jdbcType = explicitJdbcTypeAccess.apply( typeConfiguration );
|
||||
if ( jdbcType != null ) {
|
||||
jtd = jdbcType.getJdbcRecommendedJavaTypeMapping( null, null, typeConfiguration );
|
||||
}
|
||||
|
@ -467,7 +467,7 @@ public class BasicValue extends SimpleValue implements JdbcTypeDescriptorIndicat
|
|||
EnumType enumerationStyle,
|
||||
Function<TypeConfiguration, java.lang.reflect.Type> implicitJavaTypeAccess,
|
||||
Function<TypeConfiguration, BasicJavaType> explicitJtdAccess,
|
||||
Function<TypeConfiguration, JdbcTypeDescriptor> explicitStdAccess,
|
||||
Function<TypeConfiguration, JdbcType> explicitStdAccess,
|
||||
Function<TypeConfiguration, MutabilityPlan> explicitMutabilityPlanAccess,
|
||||
ConverterDescriptor converterDescriptor,
|
||||
Map localTypeParams,
|
||||
|
@ -774,7 +774,7 @@ public class BasicValue extends SimpleValue implements JdbcTypeDescriptorIndicat
|
|||
* The JavaTypeDescriptor for the relational value as part of
|
||||
* the relational model (its JDBC representation)
|
||||
*/
|
||||
JdbcTypeDescriptor getJdbcTypeDescriptor();
|
||||
JdbcType getJdbcTypeDescriptor();
|
||||
|
||||
/**
|
||||
* Converter, if any, to convert values between the
|
||||
|
|
|
@ -49,10 +49,10 @@ 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.AttributeConverterJdbcTypeDescriptorAdapter;
|
||||
import org.hibernate.type.descriptor.converter.AttributeConverterJdbcTypeAdapter;
|
||||
import org.hibernate.type.descriptor.converter.AttributeConverterTypeAdapter;
|
||||
import org.hibernate.type.descriptor.java.BasicJavaType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators;
|
||||
import org.hibernate.type.descriptor.jdbc.LobTypeMappings;
|
||||
import org.hibernate.type.descriptor.jdbc.NationalizedTypeMappings;
|
||||
|
@ -667,7 +667,7 @@ 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 JdbcTypeDescriptor recommendedJdbcType = jpaAttributeConverter.getRelationalJavaTypeDescriptor().getRecommendedJdbcType(
|
||||
final JdbcType recommendedJdbcType = jpaAttributeConverter.getRelationalJavaTypeDescriptor().getRecommendedJdbcType(
|
||||
// todo (6.0) : handle the other JdbcRecommendedSqlTypeMappingContext methods
|
||||
new JdbcTypeDescriptorIndicators() {
|
||||
@Override
|
||||
|
@ -706,15 +706,15 @@ public abstract class SimpleValue implements KeyValue {
|
|||
jdbcTypeCode = NationalizedTypeMappings.toNationalizedTypeCode( jdbcTypeCode );
|
||||
}
|
||||
|
||||
final JdbcTypeDescriptor jdbcTypeDescriptor = metadata.getTypeConfiguration()
|
||||
final JdbcType jdbcType = metadata.getTypeConfiguration()
|
||||
.getJdbcTypeDescriptorRegistry()
|
||||
.getDescriptor( jdbcTypeCode );
|
||||
|
||||
// and finally construct the adapter, which injects the AttributeConverter calls into the binding/extraction
|
||||
// process...
|
||||
final JdbcTypeDescriptor jdbcTypeDescriptorAdapter = new AttributeConverterJdbcTypeDescriptorAdapter(
|
||||
final JdbcType jdbcTypeAdapter = new AttributeConverterJdbcTypeAdapter(
|
||||
jpaAttributeConverter,
|
||||
jdbcTypeDescriptor,
|
||||
jdbcType,
|
||||
jpaAttributeConverter.getRelationalJavaTypeDescriptor()
|
||||
);
|
||||
|
||||
|
@ -730,7 +730,7 @@ public abstract class SimpleValue implements KeyValue {
|
|||
name,
|
||||
description,
|
||||
jpaAttributeConverter,
|
||||
jdbcTypeDescriptorAdapter,
|
||||
jdbcTypeAdapter,
|
||||
jpaAttributeConverter.getRelationalJavaTypeDescriptor(),
|
||||
jpaAttributeConverter.getDomainJavaTypeDescriptor(),
|
||||
null
|
||||
|
|
|
@ -14,7 +14,7 @@ import org.hibernate.query.CastType;
|
|||
import org.hibernate.type.descriptor.ValueBinder;
|
||||
import org.hibernate.type.descriptor.ValueExtractor;
|
||||
import org.hibernate.type.descriptor.java.JavaType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
|
||||
/**
|
||||
* Models the type of a thing that can be used as an expression in a SQL query
|
||||
|
@ -32,7 +32,7 @@ public interface JdbcMapping extends MappingType, JdbcMappingContainer {
|
|||
* The descriptor for the SQL type represented by this
|
||||
* expressable type
|
||||
*/
|
||||
JdbcTypeDescriptor getJdbcTypeDescriptor();
|
||||
JdbcType getJdbcTypeDescriptor();
|
||||
|
||||
default CastType getCastType() {
|
||||
return getJdbcTypeDescriptor().getCastType();
|
||||
|
|
|
@ -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.JavaType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
|
||||
/**
|
||||
* BasicValueConverter handling the conversion of an enum based on
|
||||
|
@ -29,7 +29,7 @@ import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
|||
*/
|
||||
public class NamedEnumValueConverter<E extends Enum<E>> implements EnumValueConverter<E,String>, Serializable {
|
||||
private final EnumJavaTypeDescriptor<E> domainTypeDescriptor;
|
||||
private final JdbcTypeDescriptor jdbcTypeDescriptor;
|
||||
private final JdbcType jdbcType;
|
||||
private final JavaType<String> relationalTypeDescriptor;
|
||||
|
||||
private transient ValueExtractor<String> valueExtractor;
|
||||
|
@ -37,14 +37,14 @@ public class NamedEnumValueConverter<E extends Enum<E>> implements EnumValueConv
|
|||
|
||||
public NamedEnumValueConverter(
|
||||
EnumJavaTypeDescriptor<E> domainTypeDescriptor,
|
||||
JdbcTypeDescriptor jdbcTypeDescriptor,
|
||||
JdbcType jdbcType,
|
||||
JavaType<String> relationalTypeDescriptor) {
|
||||
this.domainTypeDescriptor = domainTypeDescriptor;
|
||||
this.jdbcTypeDescriptor = jdbcTypeDescriptor;
|
||||
this.jdbcType = jdbcType;
|
||||
this.relationalTypeDescriptor = relationalTypeDescriptor;
|
||||
|
||||
this.valueExtractor = jdbcTypeDescriptor.getExtractor( relationalTypeDescriptor );
|
||||
this.valueBinder = jdbcTypeDescriptor.getBinder( relationalTypeDescriptor );
|
||||
this.valueExtractor = jdbcType.getExtractor( relationalTypeDescriptor );
|
||||
this.valueBinder = jdbcType.getBinder( relationalTypeDescriptor );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -69,7 +69,7 @@ public class NamedEnumValueConverter<E extends Enum<E>> implements EnumValueConv
|
|||
|
||||
@Override
|
||||
public int getJdbcTypeCode() {
|
||||
return jdbcTypeDescriptor.getJdbcTypeCode();
|
||||
return jdbcType.getJdbcTypeCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -81,8 +81,8 @@ public class NamedEnumValueConverter<E extends Enum<E>> implements EnumValueConv
|
|||
private void readObject(ObjectInputStream stream) throws ClassNotFoundException, IOException {
|
||||
stream.defaultReadObject();
|
||||
|
||||
this.valueExtractor = jdbcTypeDescriptor.getExtractor( relationalTypeDescriptor );
|
||||
this.valueBinder = jdbcTypeDescriptor.getBinder( relationalTypeDescriptor );
|
||||
this.valueExtractor = jdbcType.getExtractor( relationalTypeDescriptor );
|
||||
this.valueBinder = jdbcType.getBinder( relationalTypeDescriptor );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -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.JavaType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
|
||||
/**
|
||||
* BasicValueConverter handling the conversion of an enum based on
|
||||
|
@ -30,7 +30,7 @@ import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
|||
public class OrdinalEnumValueConverter<E extends Enum<E>> implements EnumValueConverter<E,Integer>, Serializable {
|
||||
|
||||
private final EnumJavaTypeDescriptor<E> enumJavaDescriptor;
|
||||
private final JdbcTypeDescriptor jdbcTypeDescriptor;
|
||||
private final JdbcType jdbcType;
|
||||
private final JavaType<Integer> relationalJavaDescriptor;
|
||||
|
||||
private transient ValueExtractor<Integer> valueExtractor;
|
||||
|
@ -38,14 +38,14 @@ public class OrdinalEnumValueConverter<E extends Enum<E>> implements EnumValueCo
|
|||
|
||||
public OrdinalEnumValueConverter(
|
||||
EnumJavaTypeDescriptor<E> enumJavaDescriptor,
|
||||
JdbcTypeDescriptor jdbcTypeDescriptor,
|
||||
JdbcType jdbcType,
|
||||
JavaType<Integer> relationalJavaDescriptor) {
|
||||
this.enumJavaDescriptor = enumJavaDescriptor;
|
||||
this.jdbcTypeDescriptor = jdbcTypeDescriptor;
|
||||
this.jdbcType = jdbcType;
|
||||
this.relationalJavaDescriptor = relationalJavaDescriptor;
|
||||
|
||||
this.valueExtractor = jdbcTypeDescriptor.getExtractor( relationalJavaDescriptor );
|
||||
this.valueBinder = jdbcTypeDescriptor.getBinder( relationalJavaDescriptor );
|
||||
this.valueExtractor = jdbcType.getExtractor( relationalJavaDescriptor );
|
||||
this.valueBinder = jdbcType.getBinder( relationalJavaDescriptor );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -85,8 +85,8 @@ public class OrdinalEnumValueConverter<E extends Enum<E>> implements EnumValueCo
|
|||
private void readObject(ObjectInputStream stream) throws ClassNotFoundException, IOException {
|
||||
stream.defaultReadObject();
|
||||
|
||||
this.valueExtractor = jdbcTypeDescriptor.getExtractor( relationalJavaDescriptor );
|
||||
this.valueBinder = jdbcTypeDescriptor.getBinder( relationalJavaDescriptor );
|
||||
this.valueExtractor = jdbcType.getExtractor( relationalJavaDescriptor );
|
||||
this.valueBinder = jdbcType.getBinder( relationalJavaDescriptor );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -10,7 +10,7 @@ import java.sql.CallableStatement;
|
|||
import java.sql.SQLException;
|
||||
|
||||
import org.hibernate.engine.spi.SharedSessionContractImplementor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
|
||||
/**
|
||||
* Specialization of DomainType for types that can be used as a
|
||||
|
@ -31,7 +31,7 @@ public interface AllowableOutputParameterType<J> extends AllowableParameterType<
|
|||
/**
|
||||
* Descriptor for the SQL type mapped by this type.
|
||||
*/
|
||||
JdbcTypeDescriptor getJdbcTypeDescriptor();
|
||||
JdbcType getJdbcTypeDescriptor();
|
||||
|
||||
/**
|
||||
* Perform the extraction
|
||||
|
|
|
@ -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.JavaType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
|
||||
/**
|
||||
* @author Emmanuel Bernard
|
||||
|
@ -45,7 +45,7 @@ public class BasicTypeImpl<J> implements BasicDomainType<J>, Serializable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public JdbcTypeDescriptor getJdbcTypeDescriptor() {
|
||||
public JdbcType getJdbcTypeDescriptor() {
|
||||
throw new NotYetImplementedFor6Exception( getClass() );
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.hibernate.type.descriptor.WrapperOptions;
|
|||
import org.hibernate.type.descriptor.java.ClassJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.java.JavaType;
|
||||
import org.hibernate.type.descriptor.java.StringJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
|
||||
/**
|
||||
* TODO : javadoc
|
||||
|
@ -248,7 +248,7 @@ public class DiscriminatorType<T> extends AbstractType implements BasicType<T>,
|
|||
}
|
||||
|
||||
@Override
|
||||
public JdbcTypeDescriptor getJdbcTypeDescriptor() {
|
||||
public JdbcType getJdbcTypeDescriptor() {
|
||||
return underlyingType.getJdbcTypeDescriptor();
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,6 @@ import org.hibernate.engine.jdbc.LobCreator;
|
|||
import org.hibernate.engine.spi.SessionFactoryImplementor;
|
||||
import org.hibernate.engine.spi.SharedSessionContractImplementor;
|
||||
import org.hibernate.type.descriptor.WrapperOptions;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -22,7 +22,7 @@ import org.hibernate.sql.exec.internal.JdbcCallParameterExtractorImpl;
|
|||
import org.hibernate.sql.exec.internal.JdbcCallRefCursorExtractorImpl;
|
||||
import org.hibernate.sql.exec.spi.JdbcCallFunctionReturn;
|
||||
import org.hibernate.type.descriptor.java.BasicJavaType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.spi.TypeConfiguration;
|
||||
|
||||
/**
|
||||
|
@ -60,7 +60,7 @@ public class FunctionReturnImpl implements FunctionReturnImplementor {
|
|||
else {
|
||||
|
||||
final TypeConfiguration typeConfiguration = persistenceContext.getFactory().getMetamodel().getTypeConfiguration();
|
||||
final JdbcTypeDescriptor sqlTypeDescriptor = typeConfiguration.getJdbcTypeDescriptorRegistry()
|
||||
final JdbcType sqlTypeDescriptor = typeConfiguration.getJdbcTypeDescriptorRegistry()
|
||||
.getDescriptor( getJdbcTypeCode() );
|
||||
final BasicJavaType javaTypeMapping = sqlTypeDescriptor
|
||||
.getJdbcRecommendedJavaTypeMapping( null, null, typeConfiguration );
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.hibernate.query.spi.QueryParameterBinding;
|
|||
import org.hibernate.type.BasicType;
|
||||
import org.hibernate.type.ProcedureParameterNamedBinder;
|
||||
import org.hibernate.type.descriptor.ValueBinder;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.spi.TypeConfiguration;
|
||||
|
||||
import org.jboss.logging.Logger;
|
||||
|
@ -168,7 +168,7 @@ public class ProcedureParameterImpl<T> extends AbstractQueryParameter<T> impleme
|
|||
// This will cause a failure if there are other parameters bound by
|
||||
// name and the dialect does not support "mixed" named/positional parameters;
|
||||
// e.g., Oracle.
|
||||
final JdbcTypeDescriptor recommendedJdbcType = typeToUse.getExpressableJavaTypeDescriptor()
|
||||
final JdbcType recommendedJdbcType = typeToUse.getExpressableJavaTypeDescriptor()
|
||||
.getRecommendedJdbcType( typeConfiguration.getCurrentBaseSqlTypeIndicators() );
|
||||
|
||||
if ( procedureCall.getParameterStrategy() == ParameterStrategy.NAMED &&
|
||||
|
|
|
@ -81,7 +81,7 @@ import org.hibernate.sql.exec.internal.CallbackImpl;
|
|||
import org.hibernate.sql.exec.spi.Callback;
|
||||
import org.hibernate.sql.exec.spi.ExecutionContext;
|
||||
import org.hibernate.type.BasicType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
|
||||
/**
|
||||
* {@link Query} implementation based on an SQM
|
||||
|
@ -359,20 +359,20 @@ public class QuerySqmImpl<R>
|
|||
final Class<?> javaTypeClass = sqmExpressable.getExpressableJavaTypeDescriptor().getJavaTypeClass();
|
||||
if ( ! resultClass.isAssignableFrom( javaTypeClass ) ) {
|
||||
// Special case for date because we always report java.util.Date as expression type
|
||||
// But the expected resultClass could be a subtype of that, so we need to check the JdbcTypeDescriptor
|
||||
// But the expected resultClass could be a subtype of that, so we need to check the JdbcType
|
||||
if ( javaTypeClass == Date.class ) {
|
||||
JdbcTypeDescriptor jdbcTypeDescriptor = null;
|
||||
JdbcType jdbcType = null;
|
||||
if ( sqmExpressable instanceof BasicDomainType<?> ) {
|
||||
jdbcTypeDescriptor = ( (BasicDomainType<?>) sqmExpressable ).getJdbcTypeDescriptor();
|
||||
jdbcType = ( (BasicDomainType<?>) sqmExpressable ).getJdbcTypeDescriptor();
|
||||
}
|
||||
else if ( sqmExpressable instanceof SqmPathSource<?> ) {
|
||||
final DomainType<?> domainType = ( (SqmPathSource<?>) sqmExpressable ).getSqmPathType();
|
||||
if ( domainType instanceof BasicDomainType<?> ) {
|
||||
jdbcTypeDescriptor = ( (BasicDomainType<?>) domainType ).getJdbcTypeDescriptor();
|
||||
jdbcType = ( (BasicDomainType<?>) domainType ).getJdbcTypeDescriptor();
|
||||
}
|
||||
}
|
||||
if ( jdbcTypeDescriptor != null ) {
|
||||
switch ( jdbcTypeDescriptor.getJdbcTypeCode() ) {
|
||||
if ( jdbcType != null ) {
|
||||
switch ( jdbcType.getJdbcTypeCode() ) {
|
||||
case Types.DATE:
|
||||
if ( resultClass.isAssignableFrom( java.sql.Date.class ) ) {
|
||||
return;
|
||||
|
|
|
@ -151,11 +151,9 @@ import org.hibernate.sql.exec.spi.JdbcUpdate;
|
|||
import org.hibernate.sql.results.internal.SqlSelectionImpl;
|
||||
import org.hibernate.sql.results.jdbc.internal.JdbcValuesMappingProducerStandard;
|
||||
import org.hibernate.type.BasicType;
|
||||
import org.hibernate.type.IntegerType;
|
||||
import org.hibernate.type.StandardBasicTypes;
|
||||
import org.hibernate.type.descriptor.WrapperOptions;
|
||||
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;
|
||||
|
|
|
@ -17,7 +17,7 @@ import org.hibernate.metamodel.model.domain.BasicDomainType;
|
|||
import org.hibernate.sql.exec.spi.JdbcCallParameterExtractor;
|
||||
import org.hibernate.sql.exec.spi.JdbcCallParameterRegistration;
|
||||
import org.hibernate.sql.exec.spi.JdbcParameterBinder;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
|
||||
/**
|
||||
* @author Steve Ebersole
|
||||
|
@ -115,7 +115,7 @@ public class JdbcCallParameterRegistrationImpl implements JdbcCallParameterRegis
|
|||
private void registerOutputParameter(
|
||||
CallableStatement callableStatement,
|
||||
SharedSessionContractImplementor session) {
|
||||
final JdbcTypeDescriptor sqlTypeDescriptor = ( (BasicDomainType) ormType ).getJdbcTypeDescriptor();
|
||||
final JdbcType sqlTypeDescriptor = ( (BasicDomainType) ormType ).getJdbcTypeDescriptor();
|
||||
try {
|
||||
if ( name != null ) {
|
||||
callableStatement.registerOutParameter( name, sqlTypeDescriptor.getJdbcTypeCode() );
|
||||
|
|
|
@ -18,7 +18,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.JavaType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators;
|
||||
import org.hibernate.type.spi.TypeConfiguration;
|
||||
|
||||
|
@ -90,7 +90,7 @@ public interface ResultSetAccess extends JdbcValuesMetadata {
|
|||
scale,
|
||||
displaySize
|
||||
);
|
||||
final JdbcTypeDescriptor resolvedJdbcTypeDescriptor = dialect
|
||||
final JdbcType resolvedJdbcType = dialect
|
||||
.resolveSqlTypeDescriptor(
|
||||
columnTypeName,
|
||||
columnType,
|
||||
|
@ -99,11 +99,11 @@ public interface ResultSetAccess extends JdbcValuesMetadata {
|
|||
typeConfiguration.getJdbcTypeDescriptorRegistry()
|
||||
);
|
||||
final JavaType<J> javaTypeDescriptor;
|
||||
final JdbcTypeDescriptor jdbcTypeDescriptor;
|
||||
final JdbcType jdbcType;
|
||||
// If there is an explicit JavaTypeDescriptor, then prefer its recommended JDBC type
|
||||
if ( explicitJavaTypeDescriptor != null ) {
|
||||
javaTypeDescriptor = explicitJavaTypeDescriptor;
|
||||
jdbcTypeDescriptor = explicitJavaTypeDescriptor.getRecommendedJdbcType(
|
||||
jdbcType = explicitJavaTypeDescriptor.getRecommendedJdbcType(
|
||||
new JdbcTypeDescriptorIndicators() {
|
||||
@Override
|
||||
public TypeConfiguration getTypeConfiguration() {
|
||||
|
@ -117,20 +117,20 @@ public interface ResultSetAccess extends JdbcValuesMetadata {
|
|||
|
||||
@Override
|
||||
public EnumType getEnumeratedType() {
|
||||
return resolvedJdbcTypeDescriptor.isNumber() ? EnumType.ORDINAL : EnumType.STRING;
|
||||
return resolvedJdbcType.isNumber() ? EnumType.ORDINAL : EnumType.STRING;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
else {
|
||||
jdbcTypeDescriptor = resolvedJdbcTypeDescriptor;
|
||||
javaTypeDescriptor = jdbcTypeDescriptor.getJdbcRecommendedJavaTypeMapping(
|
||||
jdbcType = resolvedJdbcType;
|
||||
javaTypeDescriptor = jdbcType.getJdbcRecommendedJavaTypeMapping(
|
||||
length,
|
||||
scale,
|
||||
typeConfiguration
|
||||
);
|
||||
}
|
||||
return typeConfiguration.getBasicTypeRegistry().resolve( javaTypeDescriptor, jdbcTypeDescriptor );
|
||||
return typeConfiguration.getBasicTypeRegistry().resolve( javaTypeDescriptor, jdbcType );
|
||||
}
|
||||
catch (SQLException e) {
|
||||
throw jdbcServices.getSqlExceptionHelper().convert(
|
||||
|
|
|
@ -12,7 +12,7 @@ import java.sql.SQLException;
|
|||
import org.hibernate.HibernateException;
|
||||
import org.hibernate.engine.spi.SharedSessionContractImplementor;
|
||||
import org.hibernate.type.descriptor.java.JavaType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
|
||||
/**
|
||||
* TODO : javadoc
|
||||
|
@ -23,8 +23,8 @@ public abstract class AbstractSingleColumnStandardBasicType<T>
|
|||
extends AbstractStandardBasicType<T>
|
||||
implements SingleColumnType<T> {
|
||||
|
||||
public AbstractSingleColumnStandardBasicType(JdbcTypeDescriptor jdbcTypeDescriptor, JavaType<T> javaTypeDescriptor) {
|
||||
super( jdbcTypeDescriptor, javaTypeDescriptor );
|
||||
public AbstractSingleColumnStandardBasicType(JdbcType jdbcType, JavaType<T> javaTypeDescriptor) {
|
||||
super( jdbcType, javaTypeDescriptor );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.hibernate.type.descriptor.ValueExtractor;
|
|||
import org.hibernate.type.descriptor.WrapperOptions;
|
||||
import org.hibernate.type.descriptor.java.JavaType;
|
||||
import org.hibernate.type.descriptor.java.MutabilityPlan;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
|
||||
/**
|
||||
* Convenience base class for {@link BasicType} implementations
|
||||
|
@ -46,7 +46,7 @@ public abstract class AbstractStandardBasicType<T>
|
|||
|
||||
// Don't use final here. Need to initialize after-the-fact
|
||||
// by DynamicParameterizedTypes.
|
||||
private JdbcTypeDescriptor jdbcTypeDescriptor;
|
||||
private JdbcType jdbcType;
|
||||
private JavaType<T> javaTypeDescriptor;
|
||||
// sqlTypes need always to be in sync with sqlTypeDescriptor
|
||||
private int[] sqlTypes;
|
||||
|
@ -54,13 +54,13 @@ public abstract class AbstractStandardBasicType<T>
|
|||
private ValueBinder<T> jdbcValueBinder;
|
||||
private ValueExtractor<T> jdbcValueExtractor;
|
||||
|
||||
public AbstractStandardBasicType(JdbcTypeDescriptor jdbcTypeDescriptor, JavaType<T> javaTypeDescriptor) {
|
||||
this.jdbcTypeDescriptor = jdbcTypeDescriptor;
|
||||
this.sqlTypes = new int[] { jdbcTypeDescriptor.getDefaultSqlTypeCode() };
|
||||
public AbstractStandardBasicType(JdbcType jdbcType, JavaType<T> javaTypeDescriptor) {
|
||||
this.jdbcType = jdbcType;
|
||||
this.sqlTypes = new int[] { jdbcType.getDefaultSqlTypeCode() };
|
||||
this.javaTypeDescriptor = javaTypeDescriptor;
|
||||
|
||||
this.jdbcValueBinder = jdbcTypeDescriptor.getBinder( javaTypeDescriptor );
|
||||
this.jdbcValueExtractor = jdbcTypeDescriptor.getExtractor( javaTypeDescriptor );
|
||||
this.jdbcValueBinder = jdbcType.getBinder( javaTypeDescriptor );
|
||||
this.jdbcValueExtractor = jdbcType.getExtractor( javaTypeDescriptor );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -143,13 +143,13 @@ public abstract class AbstractStandardBasicType<T>
|
|||
this.jdbcValueExtractor = getJdbcTypeDescriptor().getExtractor( javaTypeDescriptor );
|
||||
}
|
||||
|
||||
public final JdbcTypeDescriptor getJdbcTypeDescriptor() {
|
||||
return jdbcTypeDescriptor;
|
||||
public final JdbcType getJdbcTypeDescriptor() {
|
||||
return jdbcType;
|
||||
}
|
||||
|
||||
public final void setSqlTypeDescriptor(JdbcTypeDescriptor jdbcTypeDescriptor) {
|
||||
this.jdbcTypeDescriptor = jdbcTypeDescriptor;
|
||||
this.sqlTypes = new int[] { jdbcTypeDescriptor.getDefaultSqlTypeCode() };
|
||||
public final void setSqlTypeDescriptor(JdbcType jdbcType) {
|
||||
this.jdbcType = jdbcType;
|
||||
this.sqlTypes = new int[] { jdbcType.getDefaultSqlTypeCode() };
|
||||
|
||||
this.jdbcValueBinder = getJdbcTypeDescriptor().getBinder( javaTypeDescriptor );
|
||||
this.jdbcValueExtractor = getJdbcTypeDescriptor().getExtractor( javaTypeDescriptor );
|
||||
|
@ -300,7 +300,7 @@ public abstract class AbstractStandardBasicType<T>
|
|||
|
||||
@SuppressWarnings({ "unchecked" })
|
||||
protected void nullSafeSet(PreparedStatement st, Object value, int index, WrapperOptions options) throws SQLException {
|
||||
jdbcTypeDescriptor.getBinder( javaTypeDescriptor ).bind( st, ( T ) value, index, options );
|
||||
jdbcType.getBinder( javaTypeDescriptor ).bind( st, ( T ) value, index, options );
|
||||
}
|
||||
|
||||
public void set(PreparedStatement st, T value, int index, SharedSessionContractImplementor session) throws HibernateException, SQLException {
|
||||
|
@ -403,7 +403,7 @@ public abstract class AbstractStandardBasicType<T>
|
|||
|
||||
@Override
|
||||
public T extract(CallableStatement statement, int startIndex, final SharedSessionContractImplementor session) throws SQLException {
|
||||
return jdbcTypeDescriptor.getExtractor( javaTypeDescriptor ).extract(
|
||||
return jdbcType.getExtractor( javaTypeDescriptor ).extract(
|
||||
statement,
|
||||
startIndex,
|
||||
session
|
||||
|
@ -412,7 +412,7 @@ public abstract class AbstractStandardBasicType<T>
|
|||
|
||||
@Override
|
||||
public T extract(CallableStatement statement, String paramName, final SharedSessionContractImplementor session) throws SQLException {
|
||||
return jdbcTypeDescriptor.getExtractor( javaTypeDescriptor ).extract(
|
||||
return jdbcType.getExtractor( javaTypeDescriptor ).extract(
|
||||
statement,
|
||||
paramName,
|
||||
session
|
||||
|
@ -436,7 +436,7 @@ public abstract class AbstractStandardBasicType<T>
|
|||
|
||||
@SuppressWarnings("unchecked")
|
||||
protected final void nullSafeSet(CallableStatement st, Object value, String name, WrapperOptions options) throws SQLException {
|
||||
jdbcTypeDescriptor.getBinder( javaTypeDescriptor ).bind( st, (T) value, name, options );
|
||||
jdbcType.getBinder( javaTypeDescriptor ).bind( st, (T) value, name, options );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -446,8 +446,8 @@ public abstract class AbstractStandardBasicType<T>
|
|||
|
||||
@Override
|
||||
public CastType getCastType() {
|
||||
final JdbcTypeDescriptor jdbcTypeDescriptor = getJdbcTypeDescriptor();
|
||||
final int jdbcTypeCode = jdbcTypeDescriptor.getJdbcTypeCode();
|
||||
final JdbcType jdbcType = getJdbcTypeDescriptor();
|
||||
final int jdbcTypeCode = jdbcType.getJdbcTypeCode();
|
||||
switch ( jdbcTypeCode ) {
|
||||
case Types.BIT:
|
||||
case Types.SMALLINT:
|
||||
|
@ -470,6 +470,6 @@ public abstract class AbstractStandardBasicType<T>
|
|||
}
|
||||
break;
|
||||
}
|
||||
return jdbcTypeDescriptor.getCastType();
|
||||
return jdbcType.getCastType();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
package org.hibernate.type;
|
||||
|
||||
import org.hibernate.type.descriptor.java.JavaType;
|
||||
import org.hibernate.type.descriptor.jdbc.AdjustableJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.AdjustableJdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators;
|
||||
|
||||
/**
|
||||
|
@ -21,15 +21,15 @@ public interface AdjustableBasicType<J> extends BasicType<J> {
|
|||
* Perform the adjustment
|
||||
*/
|
||||
default <X> BasicType<X> resolveIndicatedType(JdbcTypeDescriptorIndicators indicators, JavaType<X> domainJtd) {
|
||||
final JdbcTypeDescriptor jdbcTypeDescriptor = getJdbcTypeDescriptor();
|
||||
if ( jdbcTypeDescriptor instanceof AdjustableJdbcTypeDescriptor ) {
|
||||
final JdbcTypeDescriptor resolvedJdbcTypeDescriptor = ( (AdjustableJdbcTypeDescriptor) jdbcTypeDescriptor ).resolveIndicatedType(
|
||||
final JdbcType jdbcType = getJdbcTypeDescriptor();
|
||||
if ( jdbcType instanceof AdjustableJdbcType ) {
|
||||
final JdbcType resolvedJdbcType = ( (AdjustableJdbcType) jdbcType ).resolveIndicatedType(
|
||||
indicators,
|
||||
domainJtd
|
||||
);
|
||||
if ( resolvedJdbcTypeDescriptor != jdbcTypeDescriptor ) {
|
||||
if ( resolvedJdbcType != jdbcType ) {
|
||||
return indicators.getTypeConfiguration().getBasicTypeRegistry()
|
||||
.resolve( domainJtd, resolvedJdbcTypeDescriptor, getName() );
|
||||
.resolve( domainJtd, resolvedJdbcType, getName() );
|
||||
}
|
||||
}
|
||||
return (BasicType<X>) this;
|
||||
|
|
|
@ -18,7 +18,7 @@ import org.hibernate.internal.util.StringHelper;
|
|||
import org.hibernate.internal.util.collections.CollectionHelper;
|
||||
import org.hibernate.metamodel.model.convert.spi.BasicValueConverter;
|
||||
import org.hibernate.type.descriptor.java.JavaType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.internal.ConvertedBasicTypeImpl;
|
||||
import org.hibernate.type.internal.ImmutableConvertedBasicTypeImpl;
|
||||
import org.hibernate.type.internal.ImmutableNamedBasicTypeImpl;
|
||||
|
@ -37,7 +37,7 @@ public class BasicTypeRegistry implements Serializable {
|
|||
|
||||
private final TypeConfiguration typeConfiguration;
|
||||
|
||||
private final Map<JdbcTypeDescriptor, Map<JavaType<?>, BasicType<?>>> registryValues = new ConcurrentHashMap<>();
|
||||
private final Map<JdbcType, Map<JavaType<?>, BasicType<?>>> registryValues = new ConcurrentHashMap<>();
|
||||
private boolean primed;
|
||||
|
||||
private final Map<String, BasicType<?>> typesByName = new ConcurrentHashMap<>();
|
||||
|
@ -73,7 +73,7 @@ public class BasicTypeRegistry implements Serializable {
|
|||
final JavaType<Object> javaTypeDescriptor = typeConfiguration.getJavaTypeDescriptorRegistry().getDescriptor(
|
||||
typeReference.getJavaType()
|
||||
);
|
||||
final JdbcTypeDescriptor jdbcTypeDescriptor = typeConfiguration.getJdbcTypeDescriptorRegistry().getDescriptor(
|
||||
final JdbcType jdbcType = typeConfiguration.getJdbcTypeDescriptorRegistry().getDescriptor(
|
||||
typeReference.getSqlTypeCode()
|
||||
);
|
||||
final BasicType<?> type;
|
||||
|
@ -81,14 +81,14 @@ public class BasicTypeRegistry implements Serializable {
|
|||
if ( typeReference.isForceImmutable() ) {
|
||||
type = new ImmutableNamedBasicTypeImpl<>(
|
||||
javaTypeDescriptor,
|
||||
jdbcTypeDescriptor,
|
||||
jdbcType,
|
||||
typeReference.getName()
|
||||
);
|
||||
}
|
||||
else {
|
||||
type = new NamedBasicTypeImpl<>(
|
||||
javaTypeDescriptor,
|
||||
jdbcTypeDescriptor,
|
||||
jdbcType,
|
||||
typeReference.getName()
|
||||
);
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ public class BasicTypeRegistry implements Serializable {
|
|||
//noinspection unchecked
|
||||
type = new ImmutableConvertedBasicTypeImpl<>(
|
||||
javaTypeDescriptor,
|
||||
jdbcTypeDescriptor,
|
||||
jdbcType,
|
||||
typeReference.getName(),
|
||||
(BasicValueConverter<Object, ?>) typeReference.getConverter()
|
||||
);
|
||||
|
@ -107,7 +107,7 @@ public class BasicTypeRegistry implements Serializable {
|
|||
//noinspection unchecked
|
||||
type = new ConvertedBasicTypeImpl<>(
|
||||
javaTypeDescriptor,
|
||||
jdbcTypeDescriptor,
|
||||
jdbcType,
|
||||
typeReference.getName(),
|
||||
(BasicValueConverter<Object, ?>) typeReference.getConverter()
|
||||
);
|
||||
|
@ -155,7 +155,7 @@ public class BasicTypeRegistry implements Serializable {
|
|||
* Find an existing BasicType registration for the given JavaTypeDescriptor and
|
||||
* SqlTypeDescriptor combo or create (and register) one.
|
||||
*/
|
||||
public <J> BasicType<J> resolve(JavaType<J> jtdToUse, JdbcTypeDescriptor stdToUse) {
|
||||
public <J> BasicType<J> resolve(JavaType<J> jtdToUse, JdbcType stdToUse) {
|
||||
return resolve(
|
||||
jtdToUse,
|
||||
stdToUse,
|
||||
|
@ -163,7 +163,7 @@ public class BasicTypeRegistry implements Serializable {
|
|||
);
|
||||
}
|
||||
|
||||
public <J> BasicType<J> resolve(JavaType<J> jtdToUse, JdbcTypeDescriptor stdToUse, String baseTypeName) {
|
||||
public <J> BasicType<J> resolve(JavaType<J> jtdToUse, JdbcType stdToUse, String baseTypeName) {
|
||||
return resolve(
|
||||
jtdToUse,
|
||||
stdToUse,
|
||||
|
@ -175,7 +175,7 @@ public class BasicTypeRegistry implements Serializable {
|
|||
* Find an existing BasicType registration for the given JavaTypeDescriptor and
|
||||
* SqlTypeDescriptor combo or create (and register) one.
|
||||
*/
|
||||
public <J> BasicType<J> resolve(JavaType<J> jtdToUse, JdbcTypeDescriptor stdToUse, Supplier<BasicType<J>> creator) {
|
||||
public <J> BasicType<J> resolve(JavaType<J> jtdToUse, JdbcType stdToUse, Supplier<BasicType<J>> creator) {
|
||||
final Map<JavaType<?>, BasicType<?>> typeByJtdForStd = registryValues.computeIfAbsent(
|
||||
stdToUse,
|
||||
sqlTypeDescriptor -> new ConcurrentHashMap<>()
|
||||
|
|
|
@ -9,7 +9,7 @@ package org.hibernate.type;
|
|||
import java.math.BigDecimal;
|
||||
|
||||
import org.hibernate.type.descriptor.java.BigDecimalJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.NumericJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.NumericJdbcType;
|
||||
|
||||
/**
|
||||
* A type that maps between a {@link java.sql.Types#NUMERIC NUMERIC} and {@link BigDecimal}.
|
||||
|
@ -21,7 +21,7 @@ public class BigDecimalType extends AbstractSingleColumnStandardBasicType<BigDec
|
|||
public static final BigDecimalType INSTANCE = new BigDecimalType();
|
||||
|
||||
public BigDecimalType() {
|
||||
super( NumericJdbcTypeDescriptor.INSTANCE, BigDecimalJavaTypeDescriptor.INSTANCE );
|
||||
super( NumericJdbcType.INSTANCE, BigDecimalJavaTypeDescriptor.INSTANCE );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -9,7 +9,7 @@ package org.hibernate.type;
|
|||
import java.math.BigInteger;
|
||||
|
||||
import org.hibernate.type.descriptor.java.BigIntegerJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.NumericJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.NumericJdbcType;
|
||||
|
||||
/**
|
||||
* A type that maps between a {@link java.sql.Types#NUMERIC NUMERIC} and {@link BigInteger}.
|
||||
|
@ -23,7 +23,7 @@ public class BigIntegerType
|
|||
public static final BigIntegerType INSTANCE = new BigIntegerType();
|
||||
|
||||
public BigIntegerType() {
|
||||
super( NumericJdbcTypeDescriptor.INSTANCE, BigIntegerJavaTypeDescriptor.INSTANCE );
|
||||
super( NumericJdbcType.INSTANCE, BigIntegerJavaTypeDescriptor.INSTANCE );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -9,7 +9,7 @@ package org.hibernate.type;
|
|||
import java.sql.Types;
|
||||
|
||||
import org.hibernate.type.descriptor.java.PrimitiveByteArrayJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.VarbinaryJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.VarbinaryJdbcType;
|
||||
|
||||
/**
|
||||
* A type that maps between a {@link Types#VARBINARY VARBINARY} and {@code byte[]}
|
||||
|
@ -28,7 +28,7 @@ public class BinaryType
|
|||
}
|
||||
|
||||
public BinaryType() {
|
||||
super( VarbinaryJdbcTypeDescriptor.INSTANCE, PrimitiveByteArrayJavaTypeDescriptor.INSTANCE );
|
||||
super( VarbinaryJdbcType.INSTANCE, PrimitiveByteArrayJavaTypeDescriptor.INSTANCE );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -9,7 +9,7 @@ package org.hibernate.type;
|
|||
import java.sql.Blob;
|
||||
|
||||
import org.hibernate.type.descriptor.java.BlobJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.BlobJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.BlobJdbcType;
|
||||
|
||||
/**
|
||||
* A type that maps between {@link java.sql.Types#BLOB BLOB} and {@link Blob}
|
||||
|
@ -21,7 +21,7 @@ public class BlobType extends AbstractSingleColumnStandardBasicType<Blob> {
|
|||
public static final BlobType INSTANCE = new BlobType();
|
||||
|
||||
public BlobType() {
|
||||
super( BlobJdbcTypeDescriptor.DEFAULT, BlobJavaTypeDescriptor.INSTANCE );
|
||||
super( BlobJdbcType.DEFAULT, BlobJavaTypeDescriptor.INSTANCE );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -11,8 +11,8 @@ import java.sql.Types;
|
|||
import org.hibernate.Incubating;
|
||||
import org.hibernate.type.descriptor.java.BooleanJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.java.JavaType;
|
||||
import org.hibernate.type.descriptor.jdbc.BooleanJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.BooleanJdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
|
||||
/**
|
||||
* A type that maps between {@link Types#BOOLEAN BOOLEAN} and {@link Boolean}
|
||||
|
@ -26,16 +26,16 @@ public class BooleanType
|
|||
public static final BooleanType INSTANCE = new BooleanType();
|
||||
|
||||
public BooleanType() {
|
||||
this( BooleanJdbcTypeDescriptor.INSTANCE, BooleanJavaTypeDescriptor.INSTANCE );
|
||||
this( BooleanJdbcType.INSTANCE, BooleanJavaTypeDescriptor.INSTANCE );
|
||||
}
|
||||
|
||||
protected BooleanType(JdbcTypeDescriptor jdbcTypeDescriptor, BooleanJavaTypeDescriptor javaTypeDescriptor) {
|
||||
super( jdbcTypeDescriptor, javaTypeDescriptor );
|
||||
protected BooleanType(JdbcType jdbcType, BooleanJavaTypeDescriptor javaTypeDescriptor) {
|
||||
super( jdbcType, javaTypeDescriptor );
|
||||
}
|
||||
|
||||
@Incubating
|
||||
public BooleanType(JdbcTypeDescriptor jdbcTypeDescriptor, JavaType<Boolean> javaTypeDescriptor) {
|
||||
super( jdbcTypeDescriptor, javaTypeDescriptor );
|
||||
public BooleanType(JdbcType jdbcType, JavaType<Boolean> javaTypeDescriptor) {
|
||||
super( jdbcType, javaTypeDescriptor );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
package org.hibernate.type;
|
||||
|
||||
import org.hibernate.type.descriptor.java.ByteJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.TinyIntJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.TinyIntJdbcType;
|
||||
|
||||
/**
|
||||
* A type that maps between {@link java.sql.Types#TINYINT TINYINT} and {@link Byte}
|
||||
|
@ -21,7 +21,7 @@ public class ByteType
|
|||
public static final ByteType INSTANCE = new ByteType();
|
||||
|
||||
public ByteType() {
|
||||
super( TinyIntJdbcTypeDescriptor.INSTANCE, ByteJavaTypeDescriptor.INSTANCE );
|
||||
super( TinyIntJdbcType.INSTANCE, ByteJavaTypeDescriptor.INSTANCE );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -9,7 +9,7 @@ package org.hibernate.type;
|
|||
import java.util.Calendar;
|
||||
|
||||
import org.hibernate.type.descriptor.java.CalendarDateJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.DateJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.DateJdbcType;
|
||||
|
||||
/**
|
||||
* A type mapping {@link java.sql.Types#DATE DATE} and {@link Calendar}
|
||||
|
@ -22,7 +22,7 @@ public class CalendarDateType
|
|||
public static final CalendarDateType INSTANCE = new CalendarDateType();
|
||||
|
||||
public CalendarDateType() {
|
||||
super( DateJdbcTypeDescriptor.INSTANCE, CalendarDateJavaTypeDescriptor.INSTANCE );
|
||||
super( DateJdbcType.INSTANCE, CalendarDateJavaTypeDescriptor.INSTANCE );
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
|
|
|
@ -9,7 +9,7 @@ package org.hibernate.type;
|
|||
import java.util.Calendar;
|
||||
|
||||
import org.hibernate.type.descriptor.java.CalendarTimeJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.TimeJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.TimeJdbcType;
|
||||
|
||||
/**
|
||||
* A type mapping {@link java.sql.Types#TIME TIME} and {@link Calendar}.
|
||||
|
@ -24,7 +24,7 @@ public class CalendarTimeType
|
|||
public static final CalendarTimeType INSTANCE = new CalendarTimeType();
|
||||
|
||||
public CalendarTimeType() {
|
||||
super( TimeJdbcTypeDescriptor.INSTANCE, CalendarTimeJavaTypeDescriptor.INSTANCE );
|
||||
super( TimeJdbcType.INSTANCE, CalendarTimeJavaTypeDescriptor.INSTANCE );
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
|
|
|
@ -10,7 +10,7 @@ import java.util.Calendar;
|
|||
import java.util.GregorianCalendar;
|
||||
|
||||
import org.hibernate.type.descriptor.java.CalendarJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.TimestampJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.TimestampJdbcType;
|
||||
|
||||
/**
|
||||
* A type that maps between {@link java.sql.Types#TIMESTAMP TIMESTAMP} and {@link Calendar}
|
||||
|
@ -24,7 +24,7 @@ public class CalendarType
|
|||
public static final CalendarType INSTANCE = new CalendarType();
|
||||
|
||||
public CalendarType() {
|
||||
super( TimestampJdbcTypeDescriptor.INSTANCE, CalendarJavaTypeDescriptor.INSTANCE );
|
||||
super( TimestampJdbcType.INSTANCE, CalendarJavaTypeDescriptor.INSTANCE );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -9,7 +9,7 @@ package org.hibernate.type;
|
|||
import java.sql.Types;
|
||||
|
||||
import org.hibernate.type.descriptor.java.PrimitiveCharacterArrayJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.VarcharJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.VarcharJdbcType;
|
||||
|
||||
/**
|
||||
* A type that maps between {@link Types#VARCHAR VARCHAR} and {@code char[]}
|
||||
|
@ -23,7 +23,7 @@ public class CharArrayType
|
|||
public static final CharArrayType INSTANCE = new CharArrayType();
|
||||
|
||||
public CharArrayType() {
|
||||
super( VarcharJdbcTypeDescriptor.INSTANCE, PrimitiveCharacterArrayJavaTypeDescriptor.INSTANCE );
|
||||
super( VarcharJdbcType.INSTANCE, PrimitiveCharacterArrayJavaTypeDescriptor.INSTANCE );
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
|
|
|
@ -9,7 +9,7 @@ package org.hibernate.type;
|
|||
import java.sql.Types;
|
||||
|
||||
import org.hibernate.type.descriptor.java.CharacterArrayJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.ClobJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.ClobJdbcType;
|
||||
|
||||
/**
|
||||
* A type that maps between {@link Types#CLOB CLOB} and {@link Character Character[]}
|
||||
|
@ -25,7 +25,7 @@ public class CharacterArrayClobType
|
|||
public static final CharacterArrayClobType INSTANCE = new CharacterArrayClobType();
|
||||
|
||||
public CharacterArrayClobType() {
|
||||
super( ClobJdbcTypeDescriptor.DEFAULT, CharacterArrayJavaTypeDescriptor.INSTANCE );
|
||||
super( ClobJdbcType.DEFAULT, CharacterArrayJavaTypeDescriptor.INSTANCE );
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
|
|
|
@ -9,7 +9,7 @@ package org.hibernate.type;
|
|||
import java.sql.Types;
|
||||
|
||||
import org.hibernate.type.descriptor.java.CharacterArrayJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.NClobJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.NClobJdbcType;
|
||||
|
||||
/**
|
||||
* A type that maps between {@link Types#NCLOB NCLOB} and {@link Character Character[]}
|
||||
|
@ -25,7 +25,7 @@ public class CharacterArrayNClobType
|
|||
public static final CharacterArrayNClobType INSTANCE = new CharacterArrayNClobType();
|
||||
|
||||
public CharacterArrayNClobType() {
|
||||
super( NClobJdbcTypeDescriptor.DEFAULT, CharacterArrayJavaTypeDescriptor.INSTANCE );
|
||||
super( NClobJdbcType.DEFAULT, CharacterArrayJavaTypeDescriptor.INSTANCE );
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
|
|
|
@ -9,7 +9,7 @@ package org.hibernate.type;
|
|||
import java.sql.Types;
|
||||
|
||||
import org.hibernate.type.descriptor.java.CharacterArrayJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.VarcharJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.VarcharJdbcType;
|
||||
|
||||
/**
|
||||
* A type that maps between {@link Types#VARCHAR VARCHAR} and {@link Character Character[]}
|
||||
|
@ -23,7 +23,7 @@ public class CharacterArrayType
|
|||
public static final CharacterArrayType INSTANCE = new CharacterArrayType();
|
||||
|
||||
public CharacterArrayType() {
|
||||
super( VarcharJdbcTypeDescriptor.INSTANCE, CharacterArrayJavaTypeDescriptor.INSTANCE );
|
||||
super( VarcharJdbcType.INSTANCE, CharacterArrayJavaTypeDescriptor.INSTANCE );
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
package org.hibernate.type;
|
||||
|
||||
import org.hibernate.type.descriptor.java.CharacterJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.NCharJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.NCharJdbcType;
|
||||
|
||||
/**
|
||||
* A type that maps between {@link java.sql.Types#NCHAR NCHAR(1)} and {@link Character}
|
||||
|
@ -21,7 +21,7 @@ public class CharacterNCharType
|
|||
public static final CharacterNCharType INSTANCE = new CharacterNCharType();
|
||||
|
||||
public CharacterNCharType() {
|
||||
super( NCharJdbcTypeDescriptor.INSTANCE, CharacterJavaTypeDescriptor.INSTANCE );
|
||||
super( NCharJdbcType.INSTANCE, CharacterJavaTypeDescriptor.INSTANCE );
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
|
|
|
@ -9,7 +9,7 @@ package org.hibernate.type;
|
|||
import java.sql.Types;
|
||||
|
||||
import org.hibernate.type.descriptor.java.CharacterJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.CharJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.CharJdbcType;
|
||||
|
||||
/**
|
||||
* A type that maps between {@link Types#CHAR CHAR(1)} and {@link Character}
|
||||
|
@ -24,7 +24,7 @@ public class CharacterType
|
|||
public static final CharacterType INSTANCE = new CharacterType();
|
||||
|
||||
public CharacterType() {
|
||||
super( CharJdbcTypeDescriptor.INSTANCE, CharacterJavaTypeDescriptor.INSTANCE );
|
||||
super( CharJdbcType.INSTANCE, CharacterJavaTypeDescriptor.INSTANCE );
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
package org.hibernate.type;
|
||||
import org.hibernate.type.descriptor.java.ClassJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.VarcharJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.VarcharJdbcType;
|
||||
|
||||
/**
|
||||
* A type that maps between {@link java.sql.Types#VARCHAR VARCHAR} and {@link Class}
|
||||
|
@ -18,7 +18,7 @@ public class ClassType extends AbstractSingleColumnStandardBasicType<Class> {
|
|||
public static final ClassType INSTANCE = new ClassType();
|
||||
|
||||
public ClassType() {
|
||||
super( VarcharJdbcTypeDescriptor.INSTANCE, ClassJavaTypeDescriptor.INSTANCE );
|
||||
super( VarcharJdbcType.INSTANCE, ClassJavaTypeDescriptor.INSTANCE );
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
|
|
|
@ -10,7 +10,7 @@ import java.sql.Clob;
|
|||
import java.sql.Types;
|
||||
|
||||
import org.hibernate.type.descriptor.java.ClobJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.ClobJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.ClobJdbcType;
|
||||
|
||||
/**
|
||||
* A type that maps between {@link Types#CLOB CLOB} and {@link Clob}
|
||||
|
@ -22,7 +22,7 @@ public class ClobType extends AbstractSingleColumnStandardBasicType<Clob> implem
|
|||
public static final ClobType INSTANCE = new ClobType();
|
||||
|
||||
public ClobType() {
|
||||
super( ClobJdbcTypeDescriptor.DEFAULT, ClobJavaTypeDescriptor.INSTANCE );
|
||||
super( ClobJdbcType.DEFAULT, ClobJavaTypeDescriptor.INSTANCE );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -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.JavaType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.spi.TypeConfiguration;
|
||||
|
||||
/**
|
||||
|
@ -766,7 +766,7 @@ public class ComponentType extends AbstractType implements CompositeType, Proced
|
|||
}
|
||||
|
||||
@Override
|
||||
public JdbcTypeDescriptor getJdbcTypeDescriptor() {
|
||||
public JdbcType getJdbcTypeDescriptor() {
|
||||
throw new NotYetImplementedFor6Exception( getClass() );
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ package org.hibernate.type;
|
|||
import java.util.Currency;
|
||||
|
||||
import org.hibernate.type.descriptor.java.CurrencyJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.VarcharJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.VarcharJdbcType;
|
||||
|
||||
/**
|
||||
* A type that maps between {@link java.sql.Types#VARCHAR VARCHAR} and {@link Currency}
|
||||
|
@ -23,7 +23,7 @@ public class CurrencyType
|
|||
public static final CurrencyType INSTANCE = new CurrencyType();
|
||||
|
||||
public CurrencyType() {
|
||||
super( VarcharJdbcTypeDescriptor.INSTANCE, CurrencyJavaTypeDescriptor.INSTANCE );
|
||||
super( VarcharJdbcType.INSTANCE, CurrencyJavaTypeDescriptor.INSTANCE );
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.hibernate.type.descriptor.ValueExtractor;
|
|||
import org.hibernate.type.descriptor.java.BasicJavaType;
|
||||
import org.hibernate.type.descriptor.java.JavaType;
|
||||
import org.hibernate.type.descriptor.java.JavaTypedExpressable;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.internal.UserTypeJavaTypeWrapper;
|
||||
import org.hibernate.type.internal.UserTypeSqlTypeAdapter;
|
||||
import org.hibernate.type.internal.UserTypeVersionJavaTypeWrapper;
|
||||
|
@ -60,7 +60,7 @@ public class CustomType
|
|||
private final String name;
|
||||
|
||||
private final BasicJavaType<Object> mappedJavaTypeDescriptor;
|
||||
private final JdbcTypeDescriptor jdbcTypeDescriptor;
|
||||
private final JdbcType jdbcType;
|
||||
|
||||
private final ValueExtractor<Object> valueExtractor;
|
||||
private final ValueBinder<Object> valueBinder;
|
||||
|
@ -91,11 +91,11 @@ public class CustomType
|
|||
this.mappedJavaTypeDescriptor = new UserTypeJavaTypeWrapper<>( userType );
|
||||
}
|
||||
|
||||
// create a JdbcTypeDescriptor adapter that uses the UserType binde/extract handling
|
||||
this.jdbcTypeDescriptor = new UserTypeSqlTypeAdapter<>( userType, mappedJavaTypeDescriptor );
|
||||
// create a JdbcType adapter that uses the UserType binde/extract handling
|
||||
this.jdbcType = new UserTypeSqlTypeAdapter<>( userType, mappedJavaTypeDescriptor );
|
||||
|
||||
this.valueExtractor = jdbcTypeDescriptor.getExtractor( mappedJavaTypeDescriptor );
|
||||
this.valueBinder = jdbcTypeDescriptor.getBinder( mappedJavaTypeDescriptor );
|
||||
this.valueExtractor = jdbcType.getExtractor( mappedJavaTypeDescriptor );
|
||||
this.valueBinder = jdbcType.getBinder( mappedJavaTypeDescriptor );
|
||||
|
||||
if ( userType instanceof Sized ) {
|
||||
final Sized sized = (Sized) userType;
|
||||
|
@ -125,13 +125,13 @@ public class CustomType
|
|||
}
|
||||
|
||||
@Override
|
||||
public JdbcTypeDescriptor getJdbcTypeDescriptor() {
|
||||
return jdbcTypeDescriptor;
|
||||
public JdbcType getJdbcTypeDescriptor() {
|
||||
return jdbcType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSqlTypeCodes(Mapping pi) {
|
||||
return new int[] { jdbcTypeDescriptor.getDefaultSqlTypeCode() };
|
||||
return new int[] { jdbcType.getDefaultSqlTypeCode() };
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -9,7 +9,7 @@ package org.hibernate.type;
|
|||
import java.util.Date;
|
||||
|
||||
import org.hibernate.type.descriptor.java.JdbcDateJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.DateJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.DateJdbcType;
|
||||
|
||||
/**
|
||||
* A type that maps between {@link java.sql.Types#DATE DATE} and {@link java.sql.Date}
|
||||
|
@ -23,7 +23,7 @@ public class DateType
|
|||
public static final DateType INSTANCE = new DateType();
|
||||
|
||||
public DateType() {
|
||||
super( DateJdbcTypeDescriptor.INSTANCE, JdbcDateJavaTypeDescriptor.INSTANCE );
|
||||
super( DateJdbcType.INSTANCE, JdbcDateJavaTypeDescriptor.INSTANCE );
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
|
|
|
@ -13,8 +13,8 @@ import org.hibernate.type.descriptor.java.DbTimestampJavaTypeDescriptor;
|
|||
import org.hibernate.type.descriptor.java.JavaType;
|
||||
import org.hibernate.type.descriptor.java.JdbcTimestampJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.java.TemporalJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.TimestampJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.TimestampJdbcType;
|
||||
|
||||
import org.jboss.logging.Logger;
|
||||
|
||||
|
@ -38,11 +38,11 @@ public class DbTimestampType extends TimestampType {
|
|||
);
|
||||
|
||||
public DbTimestampType() {
|
||||
this( TimestampJdbcTypeDescriptor.INSTANCE, JdbcTimestampJavaTypeDescriptor.INSTANCE );
|
||||
this( TimestampJdbcType.INSTANCE, JdbcTimestampJavaTypeDescriptor.INSTANCE );
|
||||
}
|
||||
|
||||
public DbTimestampType(JdbcTypeDescriptor jdbcTypeDescriptor, JavaType<Date> javaTypeDescriptor) {
|
||||
super( jdbcTypeDescriptor, new DbTimestampJavaTypeDescriptor<>( (TemporalJavaTypeDescriptor<Date>) javaTypeDescriptor ) );
|
||||
public DbTimestampType(JdbcType jdbcType, JavaType<Date> javaTypeDescriptor) {
|
||||
super( jdbcType, new DbTimestampJavaTypeDescriptor<>( (TemporalJavaTypeDescriptor<Date>) javaTypeDescriptor ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
package org.hibernate.type;
|
||||
|
||||
import org.hibernate.type.descriptor.java.DoubleJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.DoubleJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.DoubleJdbcType;
|
||||
|
||||
/**
|
||||
* A type that maps between {@link java.sql.Types#DOUBLE DOUBLE} and {@link Double}
|
||||
|
@ -20,7 +20,7 @@ public class DoubleType
|
|||
public static final DoubleType INSTANCE = new DoubleType();
|
||||
|
||||
public DoubleType() {
|
||||
super( DoubleJdbcTypeDescriptor.INSTANCE, DoubleJavaTypeDescriptor.INSTANCE );
|
||||
super( DoubleJdbcType.INSTANCE, DoubleJavaTypeDescriptor.INSTANCE );
|
||||
}
|
||||
@Override
|
||||
public String getName() {
|
||||
|
|
|
@ -9,7 +9,7 @@ package org.hibernate.type;
|
|||
import java.time.Duration;
|
||||
|
||||
import org.hibernate.type.descriptor.java.DurationJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.NumericJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.NumericJdbcType;
|
||||
|
||||
/**
|
||||
* @author Steve Ebersole
|
||||
|
@ -22,7 +22,7 @@ public class DurationType
|
|||
public static final DurationType INSTANCE = new DurationType();
|
||||
|
||||
public DurationType() {
|
||||
super( NumericJdbcTypeDescriptor.INSTANCE, DurationJavaTypeDescriptor.INSTANCE );
|
||||
super( NumericJdbcType.INSTANCE, DurationJavaTypeDescriptor.INSTANCE );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.hibernate.type.descriptor.ValueBinder;
|
|||
import org.hibernate.type.descriptor.ValueExtractor;
|
||||
import org.hibernate.type.descriptor.java.BasicJavaType;
|
||||
import org.hibernate.type.descriptor.java.EnumJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcType;
|
||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators;
|
||||
import org.hibernate.type.spi.TypeConfiguration;
|
||||
import org.hibernate.type.spi.TypeConfigurationAware;
|
||||
|
@ -80,7 +80,7 @@ public class EnumType<T extends Enum<T>>
|
|||
private Class<T> enumClass;
|
||||
|
||||
private EnumValueConverter<T,Object> enumValueConverter;
|
||||
private JdbcTypeDescriptor jdbcTypeDescriptor;
|
||||
private JdbcType jdbcType;
|
||||
private ValueExtractor<T> jdbcValueExtractor;
|
||||
private ValueBinder<T> jdbcValueBinder;
|
||||
|
||||
|
@ -97,9 +97,9 @@ public class EnumType<T extends Enum<T>>
|
|||
this.typeConfiguration = typeConfiguration;
|
||||
|
||||
this.enumValueConverter = enumValueConverter;
|
||||
this.jdbcTypeDescriptor = typeConfiguration.getJdbcTypeDescriptorRegistry().getDescriptor( enumValueConverter.getJdbcTypeCode() );
|
||||
this.jdbcValueExtractor = jdbcTypeDescriptor.getExtractor( enumValueConverter.getRelationalJavaDescriptor() );
|
||||
this.jdbcValueBinder = jdbcTypeDescriptor.getBinder( enumValueConverter.getRelationalJavaDescriptor() );
|
||||
this.jdbcType = typeConfiguration.getJdbcTypeDescriptorRegistry().getDescriptor( enumValueConverter.getJdbcTypeCode() );
|
||||
this.jdbcValueExtractor = jdbcType.getExtractor( enumValueConverter.getRelationalJavaDescriptor() );
|
||||
this.jdbcValueBinder = jdbcType.getBinder( enumValueConverter.getRelationalJavaDescriptor() );
|
||||
}
|
||||
|
||||
public EnumValueConverter getEnumValueConverter() {
|
||||
|
@ -152,23 +152,23 @@ public class EnumType<T extends Enum<T>>
|
|||
enumJavaDescriptor
|
||||
);
|
||||
|
||||
final JdbcTypeDescriptor jdbcTypeDescriptor = relationalJtd.getRecommendedJdbcType( indicators );
|
||||
final JdbcType jdbcType = relationalJtd.getRecommendedJdbcType( indicators );
|
||||
|
||||
if ( isOrdinal ) {
|
||||
this.enumValueConverter = new OrdinalEnumValueConverter(
|
||||
enumJavaDescriptor,
|
||||
jdbcTypeDescriptor,
|
||||
jdbcType,
|
||||
relationalJtd
|
||||
);
|
||||
}
|
||||
else {
|
||||
this.enumValueConverter = new NamedEnumValueConverter(
|
||||
enumJavaDescriptor,
|
||||
jdbcTypeDescriptor,
|
||||
jdbcType,
|
||||
relationalJtd
|
||||
);
|
||||
}
|
||||
this.jdbcTypeDescriptor = jdbcTypeDescriptor;
|
||||
this.jdbcType = jdbcType;
|
||||
}
|
||||
else {
|
||||
final String enumClassName = (String) parameters.get( ENUM );
|
||||
|
@ -180,10 +180,10 @@ public class EnumType<T extends Enum<T>>
|
|||
}
|
||||
|
||||
this.enumValueConverter = interpretParameters( parameters );
|
||||
this.jdbcTypeDescriptor = typeConfiguration.getJdbcTypeDescriptorRegistry().getDescriptor( enumValueConverter.getJdbcTypeCode() );
|
||||
this.jdbcType = typeConfiguration.getJdbcTypeDescriptorRegistry().getDescriptor( enumValueConverter.getJdbcTypeCode() );
|
||||
}
|
||||
this.jdbcValueExtractor = (ValueExtractor) jdbcTypeDescriptor.getExtractor( enumValueConverter.getRelationalJavaDescriptor() );
|
||||
this.jdbcValueBinder = (ValueBinder) jdbcTypeDescriptor.getBinder( enumValueConverter.getRelationalJavaDescriptor() );
|
||||
this.jdbcValueExtractor = (ValueExtractor) jdbcType.getExtractor( enumValueConverter.getRelationalJavaDescriptor() );
|
||||
this.jdbcValueBinder = (ValueBinder) jdbcType.getBinder( enumValueConverter.getRelationalJavaDescriptor() );
|
||||
|
||||
if ( LOG.isDebugEnabled() ) {
|
||||
LOG.debugf(
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
package org.hibernate.type;
|
||||
|
||||
import org.hibernate.type.descriptor.java.FloatTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.FloatJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.FloatJdbcType;
|
||||
|
||||
/**
|
||||
* A type that maps between {@link java.sql.Types#FLOAT FLOAT} and {@link Float}
|
||||
|
@ -20,7 +20,7 @@ public class FloatType extends AbstractSingleColumnStandardBasicType<Float> {
|
|||
|
||||
|
||||
public FloatType() {
|
||||
super( FloatJdbcTypeDescriptor.INSTANCE, FloatTypeDescriptor.INSTANCE );
|
||||
super( FloatJdbcType.INSTANCE, FloatTypeDescriptor.INSTANCE );
|
||||
}
|
||||
@Override
|
||||
public String getName() {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
package org.hibernate.type;
|
||||
import org.hibernate.type.descriptor.java.PrimitiveByteArrayJavaTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.LongVarbinaryJdbcTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.jdbc.LongVarbinaryJdbcType;
|
||||
|
||||
/**
|
||||
* A type that maps between {@link java.sql.Types#LONGVARBINARY LONGVARBINARY} and {@code byte[]}
|
||||
|
@ -20,7 +20,7 @@ public class ImageType extends AbstractSingleColumnStandardBasicType<byte[]> {
|
|||
public static final ImageType INSTANCE = new ImageType();
|
||||
|
||||
public ImageType() {
|
||||
super( LongVarbinaryJdbcTypeDescriptor.INSTANCE, PrimitiveByteArrayJavaTypeDescriptor.INSTANCE );
|
||||
super( LongVarbinaryJdbcType.INSTANCE, PrimitiveByteArrayJavaTypeDescriptor.INSTANCE );
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue