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