HHH-14870 - Rename {Xyz}TypeDescriptor as {Xyz}Type
* `JavaTypeDescriptor` -> `JavaType` * `JdbcTypeDescriptor` -> `JdbcType`
This commit is contained in:
parent
7b61966882
commit
3a0065eea4
|
@ -5,7 +5,7 @@
|
||||||
[[basic-legacy]]
|
[[basic-legacy]]
|
||||||
== Legacy BasicType resolution
|
== Legacy BasicType resolution
|
||||||
|
|
||||||
Versions prior to 6.0 statically combined the `JavaTypeDescriptor`, `JdbcTypeDescriptor`, `BasicValueConverter` and
|
Versions prior to 6.0 statically combined the `JavaType`, `JdbcTypeDescriptor`, `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.
|
||||||
|
|
||||||
|
|
|
@ -1556,7 +1556,7 @@ system.
|
||||||
There are many ways to integrate a `TypeContributor`. The most common is to define the `TypeContributor` as
|
There are many ways to integrate a `TypeContributor`. The most common is to define the `TypeContributor` as
|
||||||
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 `JavaTypeDescriptor`,
|
`TypeContributor` is passed a `TypeContributions` reference, which allows registration of custom `JavaType`,
|
||||||
`JdbcTypeDescriptor` and `BasicType` references.
|
`JdbcTypeDescriptor` and `BasicType` references.
|
||||||
|
|
||||||
|
|
||||||
|
@ -1618,7 +1618,7 @@ If the Java type is not known to Hibernate, you will encounter the following mes
|
||||||
> Consider registering a custom JavaTypeDescriptor or at least implementing equals/hashCode.
|
> Consider registering a custom JavaTypeDescriptor or at least implementing equals/hashCode.
|
||||||
|
|
||||||
A Java type is "known" if it has an entry in the `JavaTypeDescriptorRegistry`. While Hibernate does load many JDK types into
|
A Java type is "known" if it has an entry in the `JavaTypeDescriptorRegistry`. While Hibernate does load many JDK types into
|
||||||
the `JavaTypeDescriptorRegistry`, an application can also expand the `JavaTypeDescriptorRegistry` by adding new `JavaTypeDescriptor`
|
the `JavaTypeDescriptorRegistry`, an application can also expand the `JavaTypeDescriptorRegistry` by adding new `JavaType`
|
||||||
entries. This way, Hibernate will also know how to handle a specific Java Object type at the JDBC level.
|
entries. This way, Hibernate will also know how to handle a specific Java Object type at the JDBC level.
|
||||||
|
|
||||||
|
|
||||||
|
@ -1867,7 +1867,7 @@ See also <<basic-jpa-convert-mutability>>.
|
||||||
[[basic-bitset-java-type]]
|
[[basic-bitset-java-type]]
|
||||||
===== Using a custom `JavaTypeDescriptor`
|
===== Using a custom `JavaTypeDescriptor`
|
||||||
|
|
||||||
As covered in <<basic-mapping-explicit>>, we will define a `JavaTypeDescriptor`
|
As covered in <<basic-mapping-explicit>>, we will define a `JavaType`
|
||||||
for `BitSet` that maps values to `VARCHAR` for storage by default.
|
for `BitSet` that maps values to `VARCHAR` for storage by default.
|
||||||
|
|
||||||
[[basic-bitset-example-java-type]]
|
[[basic-bitset-example-java-type]]
|
||||||
|
@ -1891,7 +1891,7 @@ include::{sourcedir}/basic/bitset/BitSetJavaTypeTests.java[tags=basic-bitset-exa
|
||||||
----
|
----
|
||||||
====
|
====
|
||||||
|
|
||||||
Or we can apply it globally using `@JavaTypeRegistration`. This allows the registered `JavaTypeDescriptor`
|
Or we can apply it globally using `@JavaTypeRegistration`. This allows the registered `JavaType`
|
||||||
to be used as the default whenever we encounter the `BitSet` type
|
to be used as the default whenever we encounter the `BitSet` type
|
||||||
|
|
||||||
[[basic-bitset-example-java-type-global]]
|
[[basic-bitset-example-java-type-global]]
|
||||||
|
|
|
@ -32,9 +32,7 @@ import jakarta.persistence.EntityManagerFactory;
|
||||||
import jakarta.persistence.Id;
|
import jakarta.persistence.Id;
|
||||||
import jakarta.persistence.JoinColumn;
|
import jakarta.persistence.JoinColumn;
|
||||||
import jakarta.persistence.MapKeyColumn;
|
import jakarta.persistence.MapKeyColumn;
|
||||||
import jakarta.persistence.MapKeyTemporal;
|
|
||||||
import jakarta.persistence.Table;
|
import jakarta.persistence.Table;
|
||||||
import jakarta.persistence.TemporalType;
|
|
||||||
|
|
||||||
import static org.hibernate.testing.transaction.TransactionUtil.doInJPA;
|
import static org.hibernate.testing.transaction.TransactionUtil.doInJPA;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
|
@ -10,7 +10,7 @@ import java.sql.Types;
|
||||||
|
|
||||||
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.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||||
import org.hibernate.type.descriptor.jdbc.VarbinaryJdbcTypeDescriptor;
|
import org.hibernate.type.descriptor.jdbc.VarbinaryJdbcTypeDescriptor;
|
||||||
|
|
||||||
|
@ -26,12 +26,12 @@ public class CustomBinaryJdbcType implements JdbcTypeDescriptor {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <X> ValueBinder<X> getBinder(JavaTypeDescriptor<X> javaTypeDescriptor) {
|
public <X> ValueBinder<X> getBinder(JavaType<X> javaTypeDescriptor) {
|
||||||
return VarbinaryJdbcTypeDescriptor.INSTANCE.getBinder( javaTypeDescriptor );
|
return VarbinaryJdbcTypeDescriptor.INSTANCE.getBinder( javaTypeDescriptor );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <X> ValueExtractor<X> getExtractor(JavaTypeDescriptor<X> javaTypeDescriptor) {
|
public <X> ValueExtractor<X> getExtractor(JavaType<X> javaTypeDescriptor) {
|
||||||
return VarbinaryJdbcTypeDescriptor.INSTANCE.getExtractor( javaTypeDescriptor );
|
return VarbinaryJdbcTypeDescriptor.INSTANCE.getExtractor( javaTypeDescriptor );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,10 +19,7 @@ import org.hibernate.query.sqm.function.SqmFunctionDescriptor;
|
||||||
import org.hibernate.service.ServiceRegistry;
|
import org.hibernate.service.ServiceRegistry;
|
||||||
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.StandardBasicTypes;
|
|
||||||
import org.hibernate.type.descriptor.java.DateJavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.DateJavaTypeDescriptor;
|
||||||
import org.hibernate.type.descriptor.java.JdbcDateJavaTypeDescriptor;
|
|
||||||
import org.hibernate.type.descriptor.java.JdbcTimestampJavaTypeDescriptor;
|
|
||||||
import org.hibernate.type.descriptor.jdbc.DateJdbcTypeDescriptor;
|
import org.hibernate.type.descriptor.jdbc.DateJdbcTypeDescriptor;
|
||||||
import org.hibernate.type.descriptor.jdbc.TimestampJdbcTypeDescriptor;
|
import org.hibernate.type.descriptor.jdbc.TimestampJdbcTypeDescriptor;
|
||||||
import org.hibernate.type.spi.TypeConfiguration;
|
import org.hibernate.type.spi.TypeConfiguration;
|
||||||
|
|
|
@ -8,6 +8,8 @@ package org.hibernate.annotations;
|
||||||
|
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
|
|
||||||
|
import org.hibernate.type.descriptor.java.BasicJavaType;
|
||||||
|
|
||||||
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;
|
||||||
|
@ -16,7 +18,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||||
/**
|
/**
|
||||||
* Specifies the Java Class to use for the foreign-key handling related to an ANY mapping.
|
* Specifies the Java Class to use for the foreign-key handling related to an ANY mapping.
|
||||||
*
|
*
|
||||||
* The specified class is resolved to a {@link org.hibernate.type.descriptor.java.BasicJavaTypeDescriptor}
|
* The specified class is resolved to a {@link BasicJavaType}
|
||||||
* via the {@link org.hibernate.type.descriptor.java.spi.JavaTypeDescriptorRegistry}
|
* via the {@link org.hibernate.type.descriptor.java.spi.JavaTypeDescriptorRegistry}
|
||||||
*
|
*
|
||||||
* @see Any
|
* @see Any
|
||||||
|
|
|
@ -8,7 +8,7 @@ package org.hibernate.annotations;
|
||||||
|
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
|
|
||||||
import org.hibernate.type.descriptor.java.BasicJavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.BasicJavaType;
|
||||||
|
|
||||||
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;
|
||||||
|
@ -31,5 +31,5 @@ public @interface AnyKeyJavaType {
|
||||||
*
|
*
|
||||||
* @see JavaType#value
|
* @see JavaType#value
|
||||||
*/
|
*/
|
||||||
Class<? extends BasicJavaTypeDescriptor<?>> value();
|
Class<? extends BasicJavaType<?>> value();
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ package org.hibernate.annotations;
|
||||||
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.java.BasicJavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.BasicJavaType;
|
||||||
|
|
||||||
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;
|
||||||
|
@ -30,5 +30,5 @@ public @interface CollectionIdJavaType {
|
||||||
*
|
*
|
||||||
* @see JavaType#value
|
* @see JavaType#value
|
||||||
*/
|
*/
|
||||||
Class<? extends BasicJavaTypeDescriptor<?>> value();
|
Class<? extends BasicJavaType<?>> value();
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ package org.hibernate.annotations;
|
||||||
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.java.BasicJavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.BasicJavaType;
|
||||||
|
|
||||||
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;
|
||||||
|
@ -53,7 +53,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||||
@Retention(RUNTIME)
|
@Retention(RUNTIME)
|
||||||
public @interface JavaType {
|
public @interface JavaType {
|
||||||
/**
|
/**
|
||||||
* The {@link BasicJavaTypeDescriptor} to use for the mapped column
|
* The {@link BasicJavaType} to use for the mapped column
|
||||||
*/
|
*/
|
||||||
Class<? extends BasicJavaTypeDescriptor<?>> value();
|
Class<? extends BasicJavaType<?>> value();
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ import java.lang.annotation.Inherited;
|
||||||
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.java.BasicJavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.BasicJavaType;
|
||||||
|
|
||||||
import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
|
import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
|
||||||
import static java.lang.annotation.ElementType.PACKAGE;
|
import static java.lang.annotation.ElementType.PACKAGE;
|
||||||
|
@ -40,5 +40,5 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||||
public @interface JavaTypeRegistration {
|
public @interface JavaTypeRegistration {
|
||||||
Class<?> javaType();
|
Class<?> javaType();
|
||||||
|
|
||||||
Class<? extends BasicJavaTypeDescriptor<?>> descriptorClass();
|
Class<? extends BasicJavaType<?>> descriptorClass();
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ package org.hibernate.annotations;
|
||||||
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.java.BasicJavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.BasicJavaType;
|
||||||
|
|
||||||
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;
|
||||||
|
@ -30,5 +30,5 @@ public @interface ListIndexJavaType {
|
||||||
*
|
*
|
||||||
* @see JavaType#value
|
* @see JavaType#value
|
||||||
*/
|
*/
|
||||||
Class<? extends BasicJavaTypeDescriptor<?>> value();
|
Class<? extends BasicJavaType<?>> value();
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ package org.hibernate.annotations;
|
||||||
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.java.BasicJavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.BasicJavaType;
|
||||||
|
|
||||||
import jakarta.persistence.MapKeyClass;
|
import jakarta.persistence.MapKeyClass;
|
||||||
|
|
||||||
|
@ -34,5 +34,5 @@ public @interface MapKeyJavaType {
|
||||||
*
|
*
|
||||||
* @see JavaType#value
|
* @see JavaType#value
|
||||||
*/
|
*/
|
||||||
Class<? extends BasicJavaTypeDescriptor<?>> value();
|
Class<? extends BasicJavaType<?>> value();
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,7 +102,7 @@ import org.hibernate.mapping.Table;
|
||||||
import org.hibernate.mapping.UniqueKey;
|
import org.hibernate.mapping.UniqueKey;
|
||||||
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.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||||
import org.hibernate.type.spi.TypeConfiguration;
|
import org.hibernate.type.spi.TypeConfiguration;
|
||||||
|
|
||||||
|
@ -392,7 +392,7 @@ public class InFlightMetadataCollectorImpl implements InFlightMetadataCollector
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addJavaTypeRegistration(Class<?> javaType, JavaTypeDescriptor<?> jtd) {
|
public void addJavaTypeRegistration(Class<?> javaType, JavaType<?> jtd) {
|
||||||
getTypeConfiguration().getJavaTypeDescriptorRegistry().addBaselineDescriptor( javaType, jtd );
|
getTypeConfiguration().getJavaTypeDescriptorRegistry().addBaselineDescriptor( javaType, jtd );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ import org.hibernate.internal.util.collections.CollectionHelper;
|
||||||
import org.hibernate.query.sqm.function.SqmFunctionDescriptor;
|
import org.hibernate.query.sqm.function.SqmFunctionDescriptor;
|
||||||
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.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||||
import org.hibernate.type.spi.TypeConfiguration;
|
import org.hibernate.type.spi.TypeConfiguration;
|
||||||
import org.hibernate.usertype.UserType;
|
import org.hibernate.usertype.UserType;
|
||||||
|
@ -283,7 +283,7 @@ public class MetadataBuilderImpl implements MetadataBuilderImplementor, TypeCont
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void contributeJavaTypeDescriptor(JavaTypeDescriptor descriptor) {
|
public void contributeJavaTypeDescriptor(JavaType descriptor) {
|
||||||
this.bootstrapContext.getTypeConfiguration().getJavaTypeDescriptorRegistry().addDescriptor( descriptor );
|
this.bootstrapContext.getTypeConfiguration().getJavaTypeDescriptorRegistry().addDescriptor( descriptor );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,10 +8,10 @@ package org.hibernate.boot.model;
|
||||||
|
|
||||||
import org.hibernate.type.BasicType;
|
import org.hibernate.type.BasicType;
|
||||||
import org.hibernate.type.StandardBasicTypeTemplate;
|
import org.hibernate.type.StandardBasicTypeTemplate;
|
||||||
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
import org.hibernate.type.descriptor.java.spi.JavaTypeDescriptorRegistry;
|
import org.hibernate.type.descriptor.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.JdbcTypeDescriptor;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
|
||||||
import org.hibernate.type.spi.TypeConfiguration;
|
import org.hibernate.type.spi.TypeConfiguration;
|
||||||
import org.hibernate.usertype.UserType;
|
import org.hibernate.usertype.UserType;
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ public interface TypeContributions {
|
||||||
* Add the JavaTypeDescriptor to the {@link TypeConfiguration}'s
|
* Add the JavaTypeDescriptor to the {@link TypeConfiguration}'s
|
||||||
* {@link JavaTypeDescriptorRegistry}
|
* {@link JavaTypeDescriptorRegistry}
|
||||||
*/
|
*/
|
||||||
void contributeJavaTypeDescriptor(JavaTypeDescriptor descriptor);
|
void contributeJavaTypeDescriptor(JavaType descriptor);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add the JdbcTypeDescriptor to the {@link TypeConfiguration}'s
|
* Add the JdbcTypeDescriptor to the {@link TypeConfiguration}'s
|
||||||
|
@ -40,9 +40,9 @@ public interface TypeContributions {
|
||||||
/**
|
/**
|
||||||
* @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 JavaTypeDescriptor}, {@link JdbcTypeDescriptor} and a concept of a "value
|
* of {@link JavaType}, {@link JdbcTypeDescriptor} 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 JavaTypeDescriptor} and
|
* close as possible in 5.3 use existing {@link JavaType} and
|
||||||
* {@link JdbcTypeDescriptor} implementations (or write your own for custom types)
|
* {@link JdbcTypeDescriptor} implementations (or write your own for custom types)
|
||||||
* and use {@link StandardBasicTypeTemplate} to combine those with
|
* and use {@link StandardBasicTypeTemplate} to combine those with
|
||||||
* registration keys and call {@link #contributeType(BasicType)} instead
|
* registration keys and call {@link #contributeType(BasicType)} instead
|
||||||
|
@ -54,8 +54,8 @@ public interface TypeContributions {
|
||||||
* @deprecated (since 5.3) Use {@link #contributeType(BasicType)} instead.
|
* @deprecated (since 5.3) Use {@link #contributeType(BasicType)} instead.
|
||||||
* {@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 JavaTypeDescriptor}. 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 JavaTypeDescriptor} and {@link JdbcTypeDescriptor}
|
* existing {@link JavaType} and {@link JdbcTypeDescriptor}
|
||||||
* 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
|
||||||
|
|
|
@ -30,7 +30,7 @@ import org.hibernate.type.CustomType;
|
||||||
import org.hibernate.type.SerializableType;
|
import org.hibernate.type.SerializableType;
|
||||||
import org.hibernate.type.Type;
|
import org.hibernate.type.Type;
|
||||||
import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan;
|
import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
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.JdbcTypeDescriptor;
|
||||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators;
|
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators;
|
||||||
|
@ -202,12 +202,12 @@ public class TypeDefinition implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<Object> getDomainJavaDescriptor() {
|
public JavaType<Object> getDomainJavaDescriptor() {
|
||||||
return resolvedBasicType.getMappedJavaTypeDescriptor();
|
return resolvedBasicType.getMappedJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getRelationalJavaDescriptor() {
|
public JavaType<?> getRelationalJavaDescriptor() {
|
||||||
return resolvedBasicType.getMappedJavaTypeDescriptor();
|
return resolvedBasicType.getMappedJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -235,7 +235,7 @@ public class TypeDefinition implements Serializable {
|
||||||
// Series of backward compatible special cases
|
// Series of backward compatible special cases
|
||||||
|
|
||||||
if ( Serializable.class.isAssignableFrom( typeImplementorClass ) ) {
|
if ( Serializable.class.isAssignableFrom( typeImplementorClass ) ) {
|
||||||
final JavaTypeDescriptor<Serializable> jtd = typeConfiguration
|
final JavaType<Serializable> jtd = typeConfiguration
|
||||||
.getJavaTypeDescriptorRegistry()
|
.getJavaTypeDescriptorRegistry()
|
||||||
.resolveDescriptor( typeImplementorClass );
|
.resolveDescriptor( typeImplementorClass );
|
||||||
final JdbcTypeDescriptor jdbcType = typeConfiguration.getJdbcTypeDescriptorRegistry().getDescriptor( Types.VARBINARY );
|
final JdbcTypeDescriptor jdbcType = typeConfiguration.getJdbcTypeDescriptorRegistry().getDescriptor( Types.VARBINARY );
|
||||||
|
@ -254,12 +254,12 @@ public class TypeDefinition implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<Object> getDomainJavaDescriptor() {
|
public JavaType<Object> getDomainJavaDescriptor() {
|
||||||
return (JavaTypeDescriptor) resolved.getMappedJavaTypeDescriptor();
|
return (JavaType) resolved.getMappedJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getRelationalJavaDescriptor() {
|
public JavaType<?> getRelationalJavaDescriptor() {
|
||||||
return resolved.getMappedJavaTypeDescriptor();
|
return resolved.getMappedJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ package org.hibernate.boot.model;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.hibernate.type.descriptor.java.BasicJavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.BasicJavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Chris Cranford
|
* @author Chris Cranford
|
||||||
|
@ -23,7 +23,7 @@ public interface TypeDefinitionRegistry {
|
||||||
}
|
}
|
||||||
|
|
||||||
TypeDefinition resolve(String typeName);
|
TypeDefinition resolve(String typeName);
|
||||||
TypeDefinition resolveAutoApplied(BasicJavaTypeDescriptor<?> jtd);
|
TypeDefinition resolveAutoApplied(BasicJavaType<?> jtd);
|
||||||
|
|
||||||
TypeDefinitionRegistry register(TypeDefinition typeDefinition);
|
TypeDefinitionRegistry register(TypeDefinition typeDefinition);
|
||||||
TypeDefinitionRegistry register(TypeDefinition typeDefinition, DuplicationStrategy duplicationStrategy);
|
TypeDefinitionRegistry register(TypeDefinition typeDefinition, DuplicationStrategy duplicationStrategy);
|
||||||
|
|
|
@ -11,7 +11,7 @@ import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.hibernate.internal.util.StringHelper;
|
import org.hibernate.internal.util.StringHelper;
|
||||||
import org.hibernate.type.descriptor.java.BasicJavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.BasicJavaType;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ public class TypeDefinitionRegistryStandardImpl implements TypeDefinitionRegistr
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TypeDefinition resolveAutoApplied(BasicJavaTypeDescriptor<?> jtd) {
|
public TypeDefinition resolveAutoApplied(BasicJavaType<?> jtd) {
|
||||||
// For now, check the definition map for a entry keyed by the JTD name.
|
// For now, check the definition map for a entry keyed by the JTD name.
|
||||||
// Ultimately should maybe have TypeDefinition or the registry keep explicit track of
|
// Ultimately should maybe have TypeDefinition or the registry keep explicit track of
|
||||||
// auto-applied defs
|
// auto-applied defs
|
||||||
|
|
|
@ -18,7 +18,7 @@ import org.hibernate.boot.model.convert.spi.JpaAttributeConverterCreationContext
|
||||||
import org.hibernate.metamodel.model.convert.internal.JpaAttributeConverterImpl;
|
import org.hibernate.metamodel.model.convert.internal.JpaAttributeConverterImpl;
|
||||||
import org.hibernate.metamodel.model.convert.spi.JpaAttributeConverter;
|
import org.hibernate.metamodel.model.convert.spi.JpaAttributeConverter;
|
||||||
import org.hibernate.resource.beans.spi.ManagedBean;
|
import org.hibernate.resource.beans.spi.ManagedBean;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
import com.fasterxml.classmate.ResolvedType;
|
import com.fasterxml.classmate.ResolvedType;
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ public abstract class AbstractConverterDescriptor implements ConverterDescriptor
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||||
public JpaAttributeConverter createJpaAttributeConverter(JpaAttributeConverterCreationContext context) {
|
public JpaAttributeConverter createJpaAttributeConverter(JpaAttributeConverterCreationContext context) {
|
||||||
final JavaTypeDescriptor<Object> converterJtd = context
|
final JavaType<Object> converterJtd = context
|
||||||
.getJavaTypeDescriptorRegistry()
|
.getJavaTypeDescriptorRegistry()
|
||||||
.getDescriptor( getAttributeConverterClass() );
|
.getDescriptor( getAttributeConverterClass() );
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ import org.hibernate.metamodel.mapping.JdbcMapping;
|
||||||
import org.hibernate.metamodel.model.convert.spi.BasicValueConverter;
|
import org.hibernate.metamodel.model.convert.spi.BasicValueConverter;
|
||||||
import org.hibernate.type.BasicType;
|
import org.hibernate.type.BasicType;
|
||||||
import org.hibernate.type.ConvertedBasicType;
|
import org.hibernate.type.ConvertedBasicType;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
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.JdbcTypeDescriptor;
|
||||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators;
|
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators;
|
||||||
|
@ -48,12 +48,12 @@ public class ConvertedBasicTypeResolution<J> implements BasicValue.Resolution<J>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<J> getDomainJavaDescriptor() {
|
public JavaType<J> getDomainJavaDescriptor() {
|
||||||
return basicType.getValueConverter().getDomainJavaDescriptor();
|
return basicType.getValueConverter().getDomainJavaDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getRelationalJavaDescriptor() {
|
public JavaType<?> getRelationalJavaDescriptor() {
|
||||||
return basicType.getValueConverter().getRelationalJavaDescriptor();
|
return basicType.getValueConverter().getRelationalJavaDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ import org.hibernate.metamodel.model.convert.spi.EnumValueConverter;
|
||||||
import org.hibernate.type.BasicType;
|
import org.hibernate.type.BasicType;
|
||||||
import org.hibernate.type.CustomType;
|
import org.hibernate.type.CustomType;
|
||||||
import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan;
|
import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
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.JdbcTypeDescriptor;
|
||||||
|
|
||||||
|
@ -21,15 +21,15 @@ import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||||
*/
|
*/
|
||||||
public class EnumeratedValueResolution<E extends Enum<E>> implements BasicValue.Resolution<E> {
|
public class EnumeratedValueResolution<E extends Enum<E>> implements BasicValue.Resolution<E> {
|
||||||
private final CustomType enumTypeMapping;
|
private final CustomType enumTypeMapping;
|
||||||
private final JavaTypeDescriptor<E> domainJtd;
|
private final JavaType<E> domainJtd;
|
||||||
private final JavaTypeDescriptor<?> jdbcJtd;
|
private final JavaType<?> jdbcJtd;
|
||||||
private final JdbcTypeDescriptor jdbcTypeDescriptor;
|
private final JdbcTypeDescriptor jdbcTypeDescriptor;
|
||||||
private final EnumValueConverter<E,?> valueConverter;
|
private final EnumValueConverter<E,?> valueConverter;
|
||||||
|
|
||||||
public EnumeratedValueResolution(
|
public EnumeratedValueResolution(
|
||||||
CustomType enumTypeMapping,
|
CustomType enumTypeMapping,
|
||||||
JavaTypeDescriptor<E> domainJtd,
|
JavaType<E> domainJtd,
|
||||||
JavaTypeDescriptor<?> jdbcJtd,
|
JavaType<?> jdbcJtd,
|
||||||
JdbcTypeDescriptor jdbcTypeDescriptor,
|
JdbcTypeDescriptor jdbcTypeDescriptor,
|
||||||
EnumValueConverter<E, ?> valueConverter) {
|
EnumValueConverter<E, ?> valueConverter) {
|
||||||
this.enumTypeMapping = enumTypeMapping;
|
this.enumTypeMapping = enumTypeMapping;
|
||||||
|
@ -50,12 +50,12 @@ public class EnumeratedValueResolution<E extends Enum<E>> implements BasicValue.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<E> getDomainJavaDescriptor() {
|
public JavaType<E> getDomainJavaDescriptor() {
|
||||||
return domainJtd;
|
return domainJtd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getRelationalJavaDescriptor() {
|
public JavaType<?> getRelationalJavaDescriptor() {
|
||||||
return jdbcJtd;
|
return jdbcJtd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ import org.hibernate.mapping.BasicValue;
|
||||||
import org.hibernate.metamodel.mapping.JdbcMapping;
|
import org.hibernate.metamodel.mapping.JdbcMapping;
|
||||||
import org.hibernate.metamodel.model.convert.spi.BasicValueConverter;
|
import org.hibernate.metamodel.model.convert.spi.BasicValueConverter;
|
||||||
import org.hibernate.type.BasicType;
|
import org.hibernate.type.BasicType;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
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.JdbcTypeDescriptor;
|
||||||
|
|
||||||
|
@ -18,8 +18,8 @@ import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
*/
|
*/
|
||||||
public class InferredBasicValueResolution<J> implements BasicValue.Resolution<J> {
|
public class InferredBasicValueResolution<J> implements BasicValue.Resolution<J> {
|
||||||
private JavaTypeDescriptor<J> domainJtd;
|
private JavaType<J> domainJtd;
|
||||||
private JavaTypeDescriptor<J> relationalJtd;
|
private JavaType<J> relationalJtd;
|
||||||
private JdbcTypeDescriptor jdbcTypeDescriptor;
|
private JdbcTypeDescriptor jdbcTypeDescriptor;
|
||||||
|
|
||||||
private MutabilityPlan mutabilityPlan;
|
private MutabilityPlan mutabilityPlan;
|
||||||
|
@ -31,8 +31,8 @@ public class InferredBasicValueResolution<J> implements BasicValue.Resolution<J>
|
||||||
|
|
||||||
public InferredBasicValueResolution(
|
public InferredBasicValueResolution(
|
||||||
JdbcMapping jdbcMapping,
|
JdbcMapping jdbcMapping,
|
||||||
JavaTypeDescriptor<J> domainJtd,
|
JavaType<J> domainJtd,
|
||||||
JavaTypeDescriptor<J> relationalJtd,
|
JavaType<J> relationalJtd,
|
||||||
JdbcTypeDescriptor jdbcTypeDescriptor,
|
JdbcTypeDescriptor jdbcTypeDescriptor,
|
||||||
BasicValueConverter valueConverter,
|
BasicValueConverter valueConverter,
|
||||||
BasicType<J> legacyType,
|
BasicType<J> legacyType,
|
||||||
|
@ -57,12 +57,12 @@ public class InferredBasicValueResolution<J> implements BasicValue.Resolution<J>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<J> getDomainJavaDescriptor() {
|
public JavaType<J> getDomainJavaDescriptor() {
|
||||||
return domainJtd;
|
return domainJtd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getRelationalJavaDescriptor() {
|
public JavaType<?> getRelationalJavaDescriptor() {
|
||||||
return relationalJtd;
|
return relationalJtd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,10 +25,10 @@ import org.hibernate.type.AdjustableBasicType;
|
||||||
import org.hibernate.type.BasicType;
|
import org.hibernate.type.BasicType;
|
||||||
import org.hibernate.type.CustomType;
|
import org.hibernate.type.CustomType;
|
||||||
import org.hibernate.type.SerializableType;
|
import org.hibernate.type.SerializableType;
|
||||||
import org.hibernate.type.descriptor.java.BasicJavaTypeDescriptor;
|
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.java.ImmutableMutabilityPlan;
|
import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
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.JdbcTypeDescriptor;
|
||||||
|
@ -47,10 +47,10 @@ public class InferredBasicValueResolver {
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||||
public static BasicValue.Resolution from(
|
public static BasicValue.Resolution from(
|
||||||
Function<TypeConfiguration, BasicJavaTypeDescriptor> explicitJavaTypeAccess,
|
Function<TypeConfiguration, BasicJavaType> explicitJavaTypeAccess,
|
||||||
Function<TypeConfiguration, JdbcTypeDescriptor> explicitSqlTypeAccess,
|
Function<TypeConfiguration, JdbcTypeDescriptor> explicitSqlTypeAccess,
|
||||||
Type resolvedJavaType,
|
Type resolvedJavaType,
|
||||||
Supplier<JavaTypeDescriptor> reflectedJtdResolver,
|
Supplier<JavaType> reflectedJtdResolver,
|
||||||
JdbcTypeDescriptorIndicators stdIndicators,
|
JdbcTypeDescriptorIndicators stdIndicators,
|
||||||
Table table,
|
Table table,
|
||||||
Selectable selectable,
|
Selectable selectable,
|
||||||
|
@ -58,10 +58,10 @@ public class InferredBasicValueResolver {
|
||||||
String propertyName,
|
String propertyName,
|
||||||
TypeConfiguration typeConfiguration) {
|
TypeConfiguration typeConfiguration) {
|
||||||
|
|
||||||
final BasicJavaTypeDescriptor 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 JdbcTypeDescriptor explicitJdbcType = explicitSqlTypeAccess != null ? explicitSqlTypeAccess.apply( typeConfiguration ) : null;
|
||||||
|
|
||||||
final BasicJavaTypeDescriptor reflectedJtd = (BasicJavaTypeDescriptor) reflectedJtdResolver.get();
|
final BasicJavaType reflectedJtd = (BasicJavaType) reflectedJtdResolver.get();
|
||||||
|
|
||||||
// NOTE : the distinction that is made below wrt `explicitJavaType` and `reflectedJtd` is
|
// NOTE : the distinction that is made below wrt `explicitJavaType` and `reflectedJtd` is
|
||||||
// needed temporarily to trigger "legacy resolution" versus "ORM6 resolution. Yes, it
|
// needed temporarily to trigger "legacy resolution" versus "ORM6 resolution. Yes, it
|
||||||
|
@ -204,7 +204,7 @@ public class InferredBasicValueResolver {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final BasicJavaTypeDescriptor recommendedJtd = explicitJdbcType.getJdbcRecommendedJavaTypeMapping(
|
final BasicJavaType recommendedJtd = explicitJdbcType.getJdbcRecommendedJavaTypeMapping(
|
||||||
length,
|
length,
|
||||||
scale,
|
scale,
|
||||||
typeConfiguration
|
typeConfiguration
|
||||||
|
@ -254,7 +254,7 @@ public class InferredBasicValueResolver {
|
||||||
public static BasicType<?> resolveSqlTypeIndicators(
|
public static BasicType<?> resolveSqlTypeIndicators(
|
||||||
JdbcTypeDescriptorIndicators stdIndicators,
|
JdbcTypeDescriptorIndicators stdIndicators,
|
||||||
BasicType<?> resolved,
|
BasicType<?> resolved,
|
||||||
JavaTypeDescriptor<?> domainJtd) {
|
JavaType<?> domainJtd) {
|
||||||
if ( resolved instanceof AdjustableBasicType ) {
|
if ( resolved instanceof AdjustableBasicType ) {
|
||||||
final AdjustableBasicType indicatorCapable = (AdjustableBasicType) resolved;
|
final AdjustableBasicType indicatorCapable = (AdjustableBasicType) resolved;
|
||||||
final BasicType indicatedType = indicatorCapable.resolveIndicatedType( stdIndicators, domainJtd );
|
final BasicType indicatedType = indicatorCapable.resolveIndicatedType( stdIndicators, domainJtd );
|
||||||
|
@ -268,7 +268,7 @@ public class InferredBasicValueResolver {
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
public static InferredBasicValueResolution fromEnum(
|
public static InferredBasicValueResolution fromEnum(
|
||||||
EnumJavaTypeDescriptor enumJavaDescriptor,
|
EnumJavaTypeDescriptor enumJavaDescriptor,
|
||||||
BasicJavaTypeDescriptor explicitJavaType,
|
BasicJavaType explicitJavaType,
|
||||||
JdbcTypeDescriptor explicitJdbcType,
|
JdbcTypeDescriptor explicitJdbcType,
|
||||||
JdbcTypeDescriptorIndicators stdIndicators,
|
JdbcTypeDescriptorIndicators stdIndicators,
|
||||||
TypeConfiguration typeConfiguration) {
|
TypeConfiguration typeConfiguration) {
|
||||||
|
@ -278,7 +278,7 @@ public class InferredBasicValueResolver {
|
||||||
|
|
||||||
switch ( enumStyle ) {
|
switch ( enumStyle ) {
|
||||||
case STRING: {
|
case STRING: {
|
||||||
final JavaTypeDescriptor<?> relationalJtd;
|
final JavaType<?> relationalJtd;
|
||||||
if ( explicitJavaType != null ) {
|
if ( explicitJavaType != null ) {
|
||||||
if ( ! String.class.isAssignableFrom( explicitJavaType.getJavaTypeClass() ) ) {
|
if ( ! String.class.isAssignableFrom( explicitJavaType.getJavaTypeClass() ) ) {
|
||||||
throw new MappingException(
|
throw new MappingException(
|
||||||
|
@ -327,7 +327,7 @@ public class InferredBasicValueResolver {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
case ORDINAL: {
|
case ORDINAL: {
|
||||||
final JavaTypeDescriptor<Integer> relationalJtd;
|
final JavaType<Integer> relationalJtd;
|
||||||
if ( explicitJavaType != null ) {
|
if ( explicitJavaType != null ) {
|
||||||
if ( ! Integer.class.isAssignableFrom( explicitJavaType.getJavaTypeClass() ) ) {
|
if ( ! Integer.class.isAssignableFrom( explicitJavaType.getJavaTypeClass() ) ) {
|
||||||
throw new MappingException(
|
throw new MappingException(
|
||||||
|
@ -383,7 +383,7 @@ public class InferredBasicValueResolver {
|
||||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||||
public static InferredBasicValueResolution fromTemporal(
|
public static InferredBasicValueResolution fromTemporal(
|
||||||
TemporalJavaTypeDescriptor reflectedJtd,
|
TemporalJavaTypeDescriptor reflectedJtd,
|
||||||
BasicJavaTypeDescriptor explicitJavaType,
|
BasicJavaType explicitJavaType,
|
||||||
JdbcTypeDescriptor explicitJdbcType,
|
JdbcTypeDescriptor explicitJdbcType,
|
||||||
Type resolvedJavaType,
|
Type resolvedJavaType,
|
||||||
JdbcTypeDescriptorIndicators stdIndicators,
|
JdbcTypeDescriptorIndicators stdIndicators,
|
||||||
|
|
|
@ -13,7 +13,7 @@ import org.hibernate.mapping.BasicValue;
|
||||||
import org.hibernate.metamodel.mapping.JdbcMapping;
|
import org.hibernate.metamodel.mapping.JdbcMapping;
|
||||||
import org.hibernate.metamodel.model.convert.spi.BasicValueConverter;
|
import org.hibernate.metamodel.model.convert.spi.BasicValueConverter;
|
||||||
import org.hibernate.type.BasicType;
|
import org.hibernate.type.BasicType;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
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.JdbcTypeDescriptor;
|
||||||
import org.hibernate.type.spi.TypeConfiguration;
|
import org.hibernate.type.spi.TypeConfiguration;
|
||||||
|
@ -22,7 +22,7 @@ import org.hibernate.type.spi.TypeConfiguration;
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
*/
|
*/
|
||||||
public class NamedBasicTypeResolution<J> implements BasicValue.Resolution<J> {
|
public class NamedBasicTypeResolution<J> implements BasicValue.Resolution<J> {
|
||||||
private final JavaTypeDescriptor<J> domainJtd;
|
private final JavaType<J> domainJtd;
|
||||||
|
|
||||||
private final BasicType basicType;
|
private final BasicType basicType;
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ public class NamedBasicTypeResolution<J> implements BasicValue.Resolution<J> {
|
||||||
private final MutabilityPlan<J> mutabilityPlan;
|
private final MutabilityPlan<J> mutabilityPlan;
|
||||||
|
|
||||||
public NamedBasicTypeResolution(
|
public NamedBasicTypeResolution(
|
||||||
JavaTypeDescriptor<J> domainJtd,
|
JavaType<J> domainJtd,
|
||||||
BasicType basicType,
|
BasicType basicType,
|
||||||
BasicValueConverter valueConverter,
|
BasicValueConverter valueConverter,
|
||||||
Function<TypeConfiguration, MutabilityPlan> explicitMutabilityPlanAccess,
|
Function<TypeConfiguration, MutabilityPlan> explicitMutabilityPlanAccess,
|
||||||
|
@ -63,12 +63,12 @@ public class NamedBasicTypeResolution<J> implements BasicValue.Resolution<J> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<J> getDomainJavaDescriptor() {
|
public JavaType<J> getDomainJavaDescriptor() {
|
||||||
return domainJtd;
|
return domainJtd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getRelationalJavaDescriptor() {
|
public JavaType<?> getRelationalJavaDescriptor() {
|
||||||
return valueConverter == null
|
return valueConverter == null
|
||||||
? basicType.getJavaTypeDescriptor()
|
? basicType.getJavaTypeDescriptor()
|
||||||
: valueConverter.getRelationalJavaDescriptor();
|
: valueConverter.getRelationalJavaDescriptor();
|
||||||
|
|
|
@ -21,9 +21,9 @@ import org.hibernate.metamodel.model.convert.spi.JpaAttributeConverter;
|
||||||
import org.hibernate.type.BasicType;
|
import org.hibernate.type.BasicType;
|
||||||
import org.hibernate.type.descriptor.converter.AttributeConverterMutabilityPlanImpl;
|
import org.hibernate.type.descriptor.converter.AttributeConverterMutabilityPlanImpl;
|
||||||
import org.hibernate.type.descriptor.converter.AttributeConverterTypeAdapter;
|
import org.hibernate.type.descriptor.converter.AttributeConverterTypeAdapter;
|
||||||
import org.hibernate.type.descriptor.java.BasicJavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.BasicJavaType;
|
||||||
import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan;
|
import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
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.JdbcTypeDescriptor;
|
||||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators;
|
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators;
|
||||||
|
@ -37,7 +37,7 @@ public class NamedConverterResolution<J> implements BasicValue.Resolution<J> {
|
||||||
|
|
||||||
public static NamedConverterResolution from(
|
public static NamedConverterResolution from(
|
||||||
ConverterDescriptor converterDescriptor,
|
ConverterDescriptor converterDescriptor,
|
||||||
Function<TypeConfiguration, BasicJavaTypeDescriptor> explicitJtdAccess,
|
Function<TypeConfiguration, BasicJavaType> explicitJtdAccess,
|
||||||
Function<TypeConfiguration, JdbcTypeDescriptor> explicitStdAccess,
|
Function<TypeConfiguration, JdbcTypeDescriptor> explicitStdAccess,
|
||||||
Function<TypeConfiguration, MutabilityPlan> explicitMutabilityPlanAccess,
|
Function<TypeConfiguration, MutabilityPlan> explicitMutabilityPlanAccess,
|
||||||
JdbcTypeDescriptorIndicators sqlTypeIndicators,
|
JdbcTypeDescriptorIndicators sqlTypeIndicators,
|
||||||
|
@ -55,7 +55,7 @@ public class NamedConverterResolution<J> implements BasicValue.Resolution<J> {
|
||||||
|
|
||||||
public static NamedConverterResolution from(
|
public static NamedConverterResolution from(
|
||||||
String name,
|
String name,
|
||||||
Function<TypeConfiguration, BasicJavaTypeDescriptor> explicitJtdAccess,
|
Function<TypeConfiguration, BasicJavaType> explicitJtdAccess,
|
||||||
Function<TypeConfiguration, JdbcTypeDescriptor> explicitStdAccess,
|
Function<TypeConfiguration, JdbcTypeDescriptor> explicitStdAccess,
|
||||||
Function<TypeConfiguration, MutabilityPlan> explicitMutabilityPlanAccess,
|
Function<TypeConfiguration, MutabilityPlan> explicitMutabilityPlanAccess,
|
||||||
JdbcTypeDescriptorIndicators sqlTypeIndicators,
|
JdbcTypeDescriptorIndicators sqlTypeIndicators,
|
||||||
|
@ -84,18 +84,18 @@ public class NamedConverterResolution<J> implements BasicValue.Resolution<J> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static NamedConverterResolution fromInternal(
|
private static NamedConverterResolution fromInternal(
|
||||||
Function<TypeConfiguration, BasicJavaTypeDescriptor> explicitJtdAccess,
|
Function<TypeConfiguration, BasicJavaType> explicitJtdAccess,
|
||||||
Function<TypeConfiguration, JdbcTypeDescriptor> explicitStdAccess,
|
Function<TypeConfiguration, JdbcTypeDescriptor> explicitStdAccess,
|
||||||
Function<TypeConfiguration, MutabilityPlan> explicitMutabilityPlanAccess,
|
Function<TypeConfiguration, MutabilityPlan> explicitMutabilityPlanAccess,
|
||||||
JpaAttributeConverter converter, JdbcTypeDescriptorIndicators sqlTypeIndicators,
|
JpaAttributeConverter converter, JdbcTypeDescriptorIndicators sqlTypeIndicators,
|
||||||
MetadataBuildingContext context) {
|
MetadataBuildingContext context) {
|
||||||
final TypeConfiguration typeConfiguration = context.getBootstrapContext().getTypeConfiguration();
|
final TypeConfiguration typeConfiguration = context.getBootstrapContext().getTypeConfiguration();
|
||||||
|
|
||||||
final JavaTypeDescriptor explicitJtd = explicitJtdAccess != null
|
final JavaType explicitJtd = explicitJtdAccess != null
|
||||||
? explicitJtdAccess.apply( typeConfiguration )
|
? explicitJtdAccess.apply( typeConfiguration )
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
final JavaTypeDescriptor domainJtd = explicitJtd != null
|
final JavaType domainJtd = explicitJtd != null
|
||||||
? explicitJtd
|
? explicitJtd
|
||||||
: converter.getDomainJavaDescriptor();
|
: converter.getDomainJavaDescriptor();
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ public class NamedConverterResolution<J> implements BasicValue.Resolution<J> {
|
||||||
? explicitStdAccess.apply( typeConfiguration )
|
? explicitStdAccess.apply( typeConfiguration )
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
final JavaTypeDescriptor relationalJtd = converter.getRelationalJavaDescriptor();
|
final JavaType relationalJtd = converter.getRelationalJavaDescriptor();
|
||||||
|
|
||||||
final JdbcTypeDescriptor jdbcType = explicitJdbcType != null
|
final JdbcTypeDescriptor jdbcType = explicitJdbcType != null
|
||||||
? explicitJdbcType
|
? explicitJdbcType
|
||||||
|
@ -136,8 +136,8 @@ public class NamedConverterResolution<J> implements BasicValue.Resolution<J> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private final JavaTypeDescriptor domainJtd;
|
private final JavaType domainJtd;
|
||||||
private final JavaTypeDescriptor relationalJtd;
|
private final JavaType relationalJtd;
|
||||||
private final JdbcTypeDescriptor jdbcTypeDescriptor;
|
private final JdbcTypeDescriptor jdbcTypeDescriptor;
|
||||||
|
|
||||||
private final JpaAttributeConverter valueConverter;
|
private final JpaAttributeConverter valueConverter;
|
||||||
|
@ -149,8 +149,8 @@ public class NamedConverterResolution<J> implements BasicValue.Resolution<J> {
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public NamedConverterResolution(
|
public NamedConverterResolution(
|
||||||
JavaTypeDescriptor domainJtd,
|
JavaType domainJtd,
|
||||||
JavaTypeDescriptor relationalJtd,
|
JavaType relationalJtd,
|
||||||
JdbcTypeDescriptor jdbcTypeDescriptor,
|
JdbcTypeDescriptor jdbcTypeDescriptor,
|
||||||
JpaAttributeConverter valueConverter,
|
JpaAttributeConverter valueConverter,
|
||||||
MutabilityPlan mutabilityPlan,
|
MutabilityPlan mutabilityPlan,
|
||||||
|
@ -230,13 +230,13 @@ public class NamedConverterResolution<J> implements BasicValue.Resolution<J> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<J> getDomainJavaDescriptor() {
|
public JavaType<J> getDomainJavaDescriptor() {
|
||||||
//noinspection unchecked
|
//noinspection unchecked
|
||||||
return domainJtd;
|
return domainJtd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getRelationalJavaDescriptor() {
|
public JavaType<?> getRelationalJavaDescriptor() {
|
||||||
return relationalJtd;
|
return relationalJtd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ import org.hibernate.metamodel.mapping.JdbcMapping;
|
||||||
import org.hibernate.metamodel.model.convert.spi.BasicValueConverter;
|
import org.hibernate.metamodel.model.convert.spi.BasicValueConverter;
|
||||||
import org.hibernate.type.BasicType;
|
import org.hibernate.type.BasicType;
|
||||||
import org.hibernate.type.CustomType;
|
import org.hibernate.type.CustomType;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
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.JdbcTypeDescriptor;
|
||||||
|
|
||||||
|
@ -42,12 +42,12 @@ public class UserTypeResolution implements BasicValue.Resolution {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getDomainJavaDescriptor() {
|
public JavaType<?> getDomainJavaDescriptor() {
|
||||||
return userTypeAdapter.getJavaTypeDescriptor();
|
return userTypeAdapter.getJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getRelationalJavaDescriptor() {
|
public JavaType<?> getRelationalJavaDescriptor() {
|
||||||
return userTypeAdapter.getJavaTypeDescriptor();
|
return userTypeAdapter.getJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ import org.hibernate.metamodel.model.convert.spi.BasicValueConverter;
|
||||||
import org.hibernate.type.AbstractSingleColumnStandardBasicType;
|
import org.hibernate.type.AbstractSingleColumnStandardBasicType;
|
||||||
import org.hibernate.type.descriptor.ValueBinder;
|
import org.hibernate.type.descriptor.ValueBinder;
|
||||||
import org.hibernate.type.descriptor.WrapperOptions;
|
import org.hibernate.type.descriptor.WrapperOptions;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
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.JdbcTypeDescriptorIndicators;
|
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators;
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ public class ValueConverterTypeAdapter<J> extends AbstractSingleColumnStandardBa
|
||||||
JdbcTypeDescriptorIndicators indicators) {
|
JdbcTypeDescriptorIndicators indicators) {
|
||||||
super(
|
super(
|
||||||
converter.getRelationalJavaDescriptor().getRecommendedJdbcType( indicators ),
|
converter.getRelationalJavaDescriptor().getRecommendedJdbcType( indicators ),
|
||||||
(JavaTypeDescriptor) converter.getRelationalJavaDescriptor()
|
(JavaType) converter.getRelationalJavaDescriptor()
|
||||||
);
|
);
|
||||||
|
|
||||||
this.description = description;
|
this.description = description;
|
||||||
|
@ -76,7 +76,7 @@ public class ValueConverterTypeAdapter<J> extends AbstractSingleColumnStandardBa
|
||||||
@Override
|
@Override
|
||||||
public boolean isEqual(Object one, Object another) {
|
public boolean isEqual(Object one, Object another) {
|
||||||
//noinspection unchecked
|
//noinspection unchecked
|
||||||
return ( (JavaTypeDescriptor<Object>) converter.getDomainJavaDescriptor() ).areEqual( one, another );
|
return ( (JavaType<Object>) converter.getDomainJavaDescriptor() ).areEqual( one, another );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -16,9 +16,9 @@ import org.hibernate.mapping.BasicValue;
|
||||||
import org.hibernate.metamodel.mapping.JdbcMapping;
|
import org.hibernate.metamodel.mapping.JdbcMapping;
|
||||||
import org.hibernate.metamodel.model.convert.spi.BasicValueConverter;
|
import org.hibernate.metamodel.model.convert.spi.BasicValueConverter;
|
||||||
import org.hibernate.type.BasicType;
|
import org.hibernate.type.BasicType;
|
||||||
import org.hibernate.type.descriptor.java.BasicJavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.BasicJavaType;
|
||||||
import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan;
|
import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
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.JdbcTypeDescriptor;
|
||||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators;
|
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators;
|
||||||
|
@ -36,7 +36,7 @@ public class VersionResolution<E> implements BasicValue.Resolution<E> {
|
||||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||||
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, BasicJavaTypeDescriptor> explicitJtdAccess,
|
Function<TypeConfiguration, BasicJavaType> explicitJtdAccess,
|
||||||
Function<TypeConfiguration, JdbcTypeDescriptor> explicitStdAccess,
|
Function<TypeConfiguration, JdbcTypeDescriptor> explicitStdAccess,
|
||||||
TimeZoneStorageType timeZoneStorageType,
|
TimeZoneStorageType timeZoneStorageType,
|
||||||
TypeConfiguration typeConfiguration,
|
TypeConfiguration typeConfiguration,
|
||||||
|
@ -45,8 +45,8 @@ public class VersionResolution<E> implements BasicValue.Resolution<E> {
|
||||||
// todo (6.0) : add support for Dialect-specific interpretation?
|
// todo (6.0) : add support for Dialect-specific interpretation?
|
||||||
|
|
||||||
final java.lang.reflect.Type implicitJavaType = implicitJavaTypeAccess.apply( typeConfiguration );
|
final java.lang.reflect.Type implicitJavaType = implicitJavaTypeAccess.apply( typeConfiguration );
|
||||||
final JavaTypeDescriptor registered = typeConfiguration.getJavaTypeDescriptorRegistry().resolveDescriptor( implicitJavaType );
|
final JavaType registered = typeConfiguration.getJavaTypeDescriptorRegistry().resolveDescriptor( implicitJavaType );
|
||||||
final BasicJavaTypeDescriptor jtd = (BasicJavaTypeDescriptor) registered;
|
final BasicJavaType jtd = (BasicJavaType) registered;
|
||||||
|
|
||||||
final JdbcTypeDescriptor recommendedJdbcType = jtd.getRecommendedJdbcType(
|
final JdbcTypeDescriptor recommendedJdbcType = jtd.getRecommendedJdbcType(
|
||||||
new JdbcTypeDescriptorIndicators() {
|
new JdbcTypeDescriptorIndicators() {
|
||||||
|
@ -86,14 +86,14 @@ public class VersionResolution<E> implements BasicValue.Resolution<E> {
|
||||||
return new VersionResolution<>( jtd, recommendedJdbcType, basicType, legacyType );
|
return new VersionResolution<>( jtd, recommendedJdbcType, basicType, legacyType );
|
||||||
}
|
}
|
||||||
|
|
||||||
private final JavaTypeDescriptor jtd;
|
private final JavaType jtd;
|
||||||
private final JdbcTypeDescriptor jdbcTypeDescriptor;
|
private final JdbcTypeDescriptor jdbcTypeDescriptor;
|
||||||
|
|
||||||
private final JdbcMapping jdbcMapping;
|
private final JdbcMapping jdbcMapping;
|
||||||
private final BasicType legacyType;
|
private final BasicType legacyType;
|
||||||
|
|
||||||
public VersionResolution(
|
public VersionResolution(
|
||||||
JavaTypeDescriptor javaTypeDescriptor,
|
JavaType javaTypeDescriptor,
|
||||||
JdbcTypeDescriptor jdbcTypeDescriptor,
|
JdbcTypeDescriptor jdbcTypeDescriptor,
|
||||||
JdbcMapping jdbcMapping,
|
JdbcMapping jdbcMapping,
|
||||||
BasicType legacyType) {
|
BasicType legacyType) {
|
||||||
|
@ -116,12 +116,12 @@ public class VersionResolution<E> implements BasicValue.Resolution<E> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public JavaTypeDescriptor<E> getDomainJavaDescriptor() {
|
public JavaType<E> getDomainJavaDescriptor() {
|
||||||
return jtd;
|
return jtd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getRelationalJavaDescriptor() {
|
public JavaType<?> getRelationalJavaDescriptor() {
|
||||||
return jtd;
|
return jtd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ import org.hibernate.engine.jdbc.spi.JdbcServices;
|
||||||
import org.hibernate.type.BasicType;
|
import org.hibernate.type.BasicType;
|
||||||
import org.hibernate.type.BasicTypeRegistry;
|
import org.hibernate.type.BasicTypeRegistry;
|
||||||
import org.hibernate.type.CustomType;
|
import org.hibernate.type.CustomType;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
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.JdbcTypeDescriptor;
|
||||||
import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry;
|
import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry;
|
||||||
|
@ -364,7 +364,7 @@ public class MetadataBuildingProcess {
|
||||||
public void contributeType(BasicType type) {
|
public void contributeType(BasicType type) {
|
||||||
getBasicTypeRegistry().register( type );
|
getBasicTypeRegistry().register( type );
|
||||||
|
|
||||||
final JavaTypeDescriptor<?> jtd;
|
final JavaType<?> jtd;
|
||||||
if ( type instanceof CustomType ) {
|
if ( type instanceof CustomType ) {
|
||||||
final CustomType customType = (CustomType) type;
|
final CustomType customType = (CustomType) type;
|
||||||
jtd = customType.getJavaTypeDescriptor();
|
jtd = customType.getJavaTypeDescriptor();
|
||||||
|
@ -376,7 +376,7 @@ public class MetadataBuildingProcess {
|
||||||
conditionallyRegisterJtd( jtd );
|
conditionallyRegisterJtd( jtd );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void conditionallyRegisterJtd(JavaTypeDescriptor jtd) {
|
private void conditionallyRegisterJtd(JavaType jtd) {
|
||||||
final JavaTypeDescriptorRegistry jtdRegistry = getTypeConfiguration().getJavaTypeDescriptorRegistry();
|
final JavaTypeDescriptorRegistry jtdRegistry = getTypeConfiguration().getJavaTypeDescriptorRegistry();
|
||||||
jtdRegistry.resolveDescriptor( jtd.getJavaTypeClass(), () -> jtd );
|
jtdRegistry.resolveDescriptor( jtd.getJavaTypeClass(), () -> jtd );
|
||||||
}
|
}
|
||||||
|
@ -393,7 +393,7 @@ public class MetadataBuildingProcess {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void contributeJavaTypeDescriptor(JavaTypeDescriptor descriptor) {
|
public void contributeJavaTypeDescriptor(JavaType descriptor) {
|
||||||
bootstrapContext.getTypeConfiguration().getJavaTypeDescriptorRegistry().addDescriptor( descriptor );
|
bootstrapContext.getTypeConfiguration().getJavaTypeDescriptorRegistry().addDescriptor( descriptor );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ import org.hibernate.query.named.NamedResultSetMappingMemento;
|
||||||
import org.hibernate.query.named.ResultMemento;
|
import org.hibernate.query.named.ResultMemento;
|
||||||
import org.hibernate.query.named.ResultMementoInstantiation.ArgumentMemento;
|
import org.hibernate.query.named.ResultMementoInstantiation.ArgumentMemento;
|
||||||
import org.hibernate.sql.results.graph.entity.EntityValuedFetchable;
|
import org.hibernate.sql.results.graph.entity.EntityValuedFetchable;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
|
@ -219,7 +219,7 @@ public class SqlResultSetMappingDescriptor implements NamedResultSetMappingDescr
|
||||||
);
|
);
|
||||||
|
|
||||||
final SessionFactoryImplementor sessionFactory = resolutionContext.getSessionFactory();
|
final SessionFactoryImplementor sessionFactory = resolutionContext.getSessionFactory();
|
||||||
final JavaTypeDescriptor<?> targetJtd = sessionFactory.getTypeConfiguration()
|
final JavaType<?> targetJtd = sessionFactory.getTypeConfiguration()
|
||||||
.getJavaTypeDescriptorRegistry()
|
.getJavaTypeDescriptorRegistry()
|
||||||
.getDescriptor( targetJavaType );
|
.getDescriptor( targetJavaType );
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ import org.hibernate.mapping.Join;
|
||||||
import org.hibernate.mapping.MappedSuperclass;
|
import org.hibernate.mapping.MappedSuperclass;
|
||||||
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.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||||
|
|
||||||
import jakarta.persistence.AttributeConverter;
|
import jakarta.persistence.AttributeConverter;
|
||||||
|
@ -316,7 +316,7 @@ public interface InFlightMetadataCollector extends Mapping, MetadataImplementor
|
||||||
|
|
||||||
void registerValueMappingResolver(Function<MetadataBuildingContext,Boolean> resolver);
|
void registerValueMappingResolver(Function<MetadataBuildingContext,Boolean> resolver);
|
||||||
|
|
||||||
void addJavaTypeRegistration(Class<?> javaType, JavaTypeDescriptor<?> jtd);
|
void addJavaTypeRegistration(Class<?> javaType, JavaType<?> jtd);
|
||||||
void addJdbcTypeRegistration(int typeCode, JdbcTypeDescriptor jdbcTypeDescriptor);
|
void addJdbcTypeRegistration(int typeCode, JdbcTypeDescriptor jdbcTypeDescriptor);
|
||||||
|
|
||||||
interface DelayedPropertyReferenceHandler extends Serializable {
|
interface DelayedPropertyReferenceHandler extends Serializable {
|
||||||
|
|
|
@ -119,7 +119,7 @@ import org.hibernate.mapping.Subclass;
|
||||||
import org.hibernate.mapping.ToOne;
|
import org.hibernate.mapping.ToOne;
|
||||||
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.BasicJavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.BasicJavaType;
|
||||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||||
|
|
||||||
import jakarta.persistence.AttributeOverride;
|
import jakarta.persistence.AttributeOverride;
|
||||||
|
@ -900,8 +900,8 @@ public final class AnnotationBinder {
|
||||||
MetadataBuildingContext context,
|
MetadataBuildingContext context,
|
||||||
ManagedBeanRegistry managedBeanRegistry,
|
ManagedBeanRegistry managedBeanRegistry,
|
||||||
JavaTypeRegistration annotation) {
|
JavaTypeRegistration annotation) {
|
||||||
final Class<? extends BasicJavaTypeDescriptor<?>> jtdClass = annotation.descriptorClass();
|
final Class<? extends BasicJavaType<?>> jtdClass = annotation.descriptorClass();
|
||||||
final BasicJavaTypeDescriptor<?> jtd = managedBeanRegistry.getBean( jtdClass ).getBeanInstance();
|
final BasicJavaType<?> jtd = managedBeanRegistry.getBean( jtdClass ).getBeanInstance();
|
||||||
context.getMetadataCollector().addJavaTypeRegistration( annotation.javaType(), jtd );
|
context.getMetadataCollector().addJavaTypeRegistration( annotation.javaType(), jtd );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ import org.hibernate.mapping.SyntheticProperty;
|
||||||
import org.hibernate.mapping.Table;
|
import org.hibernate.mapping.Table;
|
||||||
import org.hibernate.mapping.ToOne;
|
import org.hibernate.mapping.ToOne;
|
||||||
import org.hibernate.mapping.Value;
|
import org.hibernate.mapping.Value;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
|
@ -985,7 +985,7 @@ public class BinderHelper {
|
||||||
discriminatorValueBinder.fillSimpleValue();
|
discriminatorValueBinder.fillSimpleValue();
|
||||||
discriminatorColumns[0].linkWithValue( discriminatorDescriptor );
|
discriminatorColumns[0].linkWithValue( discriminatorDescriptor );
|
||||||
|
|
||||||
final JavaTypeDescriptor<?> discriminatorJavaType = discriminatorDescriptor
|
final JavaType<?> discriminatorJavaType = discriminatorDescriptor
|
||||||
.resolve()
|
.resolve()
|
||||||
.getRelationalJavaDescriptor();
|
.getRelationalJavaDescriptor();
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,6 @@ import org.hibernate.annotations.CollectionIdJdbcTypeCode;
|
||||||
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.JavaType;
|
|
||||||
import org.hibernate.annotations.JdbcType;
|
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;
|
||||||
|
@ -76,9 +75,9 @@ import org.hibernate.resource.beans.spi.ManagedBean;
|
||||||
import org.hibernate.resource.beans.spi.ManagedBeanRegistry;
|
import org.hibernate.resource.beans.spi.ManagedBeanRegistry;
|
||||||
import org.hibernate.type.BasicType;
|
import org.hibernate.type.BasicType;
|
||||||
import org.hibernate.type.SerializableToBlobType;
|
import org.hibernate.type.SerializableToBlobType;
|
||||||
import org.hibernate.type.descriptor.java.BasicJavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.BasicJavaType;
|
||||||
import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan;
|
import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
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.JdbcTypeDescriptor;
|
||||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators;
|
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators;
|
||||||
|
@ -147,7 +146,7 @@ public class BasicValueBinder<T> implements JdbcTypeDescriptorIndicators {
|
||||||
private Map explicitLocalTypeParams;
|
private Map explicitLocalTypeParams;
|
||||||
|
|
||||||
private Function<TypeConfiguration, JdbcTypeDescriptor> explicitJdbcTypeAccess;
|
private Function<TypeConfiguration, JdbcTypeDescriptor> explicitJdbcTypeAccess;
|
||||||
private Function<TypeConfiguration, BasicJavaTypeDescriptor> 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;
|
||||||
|
|
||||||
|
@ -416,9 +415,9 @@ public class BasicValueBinder<T> implements JdbcTypeDescriptorIndicators {
|
||||||
explicitJavaTypeAccess = (typeConfiguration) -> {
|
explicitJavaTypeAccess = (typeConfiguration) -> {
|
||||||
final CollectionIdJavaType javaTypeAnn = findAnnotation( modelXProperty, CollectionIdJavaType.class );
|
final CollectionIdJavaType javaTypeAnn = findAnnotation( modelXProperty, CollectionIdJavaType.class );
|
||||||
if ( javaTypeAnn != null ) {
|
if ( javaTypeAnn != null ) {
|
||||||
final Class<? extends BasicJavaTypeDescriptor<?>> javaType = normalizeJavaType( javaTypeAnn.value() );
|
final Class<? extends BasicJavaType<?>> javaType = normalizeJavaType( javaTypeAnn.value() );
|
||||||
if ( javaType != null ) {
|
if ( javaType != null ) {
|
||||||
final ManagedBean<? extends BasicJavaTypeDescriptor<?>> bean = beanRegistry.getBean( javaType );
|
final ManagedBean<? extends BasicJavaType<?>> bean = beanRegistry.getBean( javaType );
|
||||||
return bean.getBeanInstance();
|
return bean.getBeanInstance();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -546,16 +545,16 @@ public class BasicValueBinder<T> implements JdbcTypeDescriptorIndicators {
|
||||||
explicitJavaTypeAccess = typeConfiguration -> {
|
explicitJavaTypeAccess = typeConfiguration -> {
|
||||||
final MapKeyJavaType javaTypeAnn = findAnnotation( mapAttribute, MapKeyJavaType.class );
|
final MapKeyJavaType javaTypeAnn = findAnnotation( mapAttribute, MapKeyJavaType.class );
|
||||||
if ( javaTypeAnn != null ) {
|
if ( javaTypeAnn != null ) {
|
||||||
final Class<? extends BasicJavaTypeDescriptor<?>> jdbcTypeImpl = normalizeJavaType( javaTypeAnn.value() );
|
final Class<? extends BasicJavaType<?>> jdbcTypeImpl = normalizeJavaType( javaTypeAnn.value() );
|
||||||
if ( jdbcTypeImpl != null ) {
|
if ( jdbcTypeImpl != null ) {
|
||||||
final ManagedBean<? extends BasicJavaTypeDescriptor> jdbcTypeBean = managedBeanRegistry.getBean( jdbcTypeImpl );
|
final ManagedBean<? extends BasicJavaType> jdbcTypeBean = managedBeanRegistry.getBean( jdbcTypeImpl );
|
||||||
return jdbcTypeBean.getBeanInstance();
|
return jdbcTypeBean.getBeanInstance();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final MapKeyClass mapKeyClassAnn = mapAttribute.getAnnotation( MapKeyClass.class );
|
final MapKeyClass mapKeyClassAnn = mapAttribute.getAnnotation( MapKeyClass.class );
|
||||||
if ( mapKeyClassAnn != null ) {
|
if ( mapKeyClassAnn != null ) {
|
||||||
return (BasicJavaTypeDescriptor) typeConfiguration.getJavaTypeDescriptorRegistry().getDescriptor( mapKeyClassAnn.value() );
|
return (BasicJavaType) typeConfiguration.getJavaTypeDescriptorRegistry().getDescriptor( mapKeyClassAnn.value() );
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@ -617,9 +616,9 @@ public class BasicValueBinder<T> implements JdbcTypeDescriptorIndicators {
|
||||||
explicitJavaTypeAccess = (typeConfiguration) -> {
|
explicitJavaTypeAccess = (typeConfiguration) -> {
|
||||||
final ListIndexJavaType javaTypeAnn = findAnnotation( listAttribute, ListIndexJavaType.class );
|
final ListIndexJavaType javaTypeAnn = findAnnotation( listAttribute, ListIndexJavaType.class );
|
||||||
if ( javaTypeAnn != null ) {
|
if ( javaTypeAnn != null ) {
|
||||||
final Class<? extends BasicJavaTypeDescriptor<?>> javaType = normalizeJavaType( javaTypeAnn.value() );
|
final Class<? extends BasicJavaType<?>> javaType = normalizeJavaType( javaTypeAnn.value() );
|
||||||
if ( javaType != null ) {
|
if ( javaType != null ) {
|
||||||
final ManagedBean<? extends BasicJavaTypeDescriptor<?>> bean = beanRegistry.getBean( javaType );
|
final ManagedBean<? extends BasicJavaType<?>> bean = beanRegistry.getBean( javaType );
|
||||||
return bean.getBeanInstance();
|
return bean.getBeanInstance();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -805,14 +804,14 @@ public class BasicValueBinder<T> implements JdbcTypeDescriptorIndicators {
|
||||||
if ( elementCollectionAnn != null
|
if ( elementCollectionAnn != null
|
||||||
&& elementCollectionAnn.targetClass() != null
|
&& elementCollectionAnn.targetClass() != null
|
||||||
&& elementCollectionAnn.targetClass() != void.class ) {
|
&& elementCollectionAnn.targetClass() != void.class ) {
|
||||||
final Function<TypeConfiguration, BasicJavaTypeDescriptor> original = explicitJavaTypeAccess;
|
final Function<TypeConfiguration, BasicJavaType> original = explicitJavaTypeAccess;
|
||||||
explicitJavaTypeAccess = (typeConfiguration) -> {
|
explicitJavaTypeAccess = (typeConfiguration) -> {
|
||||||
final BasicJavaTypeDescriptor originalResult = original.apply( typeConfiguration );
|
final BasicJavaType originalResult = original.apply( typeConfiguration );
|
||||||
if ( originalResult != null ) {
|
if ( originalResult != null ) {
|
||||||
return originalResult;
|
return originalResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (BasicJavaTypeDescriptor) typeConfiguration
|
return (BasicJavaType) typeConfiguration
|
||||||
.getJavaTypeDescriptorRegistry()
|
.getJavaTypeDescriptorRegistry()
|
||||||
.getDescriptor( elementCollectionAnn.targetClass() );
|
.getDescriptor( elementCollectionAnn.targetClass() );
|
||||||
};
|
};
|
||||||
|
@ -905,7 +904,7 @@ public class BasicValueBinder<T> implements JdbcTypeDescriptorIndicators {
|
||||||
}
|
}
|
||||||
|
|
||||||
final Class<?> hintedJavaType = (Class<?>) implicitJavaTypeAccess.apply( typeConfiguration );
|
final Class<?> hintedJavaType = (Class<?>) implicitJavaTypeAccess.apply( typeConfiguration );
|
||||||
final JavaTypeDescriptor<Object> hintedDescriptor = typeConfiguration
|
final JavaType<Object> hintedDescriptor = typeConfiguration
|
||||||
.getJavaTypeDescriptorRegistry()
|
.getJavaTypeDescriptorRegistry()
|
||||||
.getDescriptor( hintedJavaType );
|
.getDescriptor( hintedJavaType );
|
||||||
return hintedDescriptor.getRecommendedJdbcType( typeConfiguration.getCurrentBaseSqlTypeIndicators() );
|
return hintedDescriptor.getRecommendedJdbcType( typeConfiguration.getCurrentBaseSqlTypeIndicators() );
|
||||||
|
@ -922,10 +921,10 @@ public class BasicValueBinder<T> implements JdbcTypeDescriptorIndicators {
|
||||||
explicitJavaTypeAccess = (typeConfiguration) -> {
|
explicitJavaTypeAccess = (typeConfiguration) -> {
|
||||||
final AnyKeyJavaType javaTypeAnn = findAnnotation( modelXProperty, AnyKeyJavaType.class );
|
final AnyKeyJavaType javaTypeAnn = findAnnotation( modelXProperty, AnyKeyJavaType.class );
|
||||||
if ( javaTypeAnn != null ) {
|
if ( javaTypeAnn != null ) {
|
||||||
final Class<? extends BasicJavaTypeDescriptor<?>> javaType = normalizeJavaType( javaTypeAnn.value() );
|
final Class<? extends BasicJavaType<?>> javaType = normalizeJavaType( javaTypeAnn.value() );
|
||||||
|
|
||||||
if ( javaType != null ) {
|
if ( javaType != null ) {
|
||||||
final ManagedBean<? extends BasicJavaTypeDescriptor<?>> jtdBean = managedBeanRegistry.getBean( javaType );
|
final ManagedBean<? extends BasicJavaType<?>> jtdBean = managedBeanRegistry.getBean( javaType );
|
||||||
return jtdBean.getBeanInstance();
|
return jtdBean.getBeanInstance();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -933,7 +932,7 @@ public class BasicValueBinder<T> implements JdbcTypeDescriptorIndicators {
|
||||||
final AnyKeyJavaClass javaClassAnn = findAnnotation( modelXProperty, AnyKeyJavaClass.class );
|
final AnyKeyJavaClass javaClassAnn = findAnnotation( modelXProperty, AnyKeyJavaClass.class );
|
||||||
if ( javaClassAnn != null ) {
|
if ( javaClassAnn != null ) {
|
||||||
//noinspection rawtypes
|
//noinspection rawtypes
|
||||||
return (BasicJavaTypeDescriptor) typeConfiguration
|
return (BasicJavaType) typeConfiguration
|
||||||
.getJavaTypeDescriptorRegistry()
|
.getJavaTypeDescriptorRegistry()
|
||||||
.getDescriptor( javaClassAnn.value() );
|
.getDescriptor( javaClassAnn.value() );
|
||||||
}
|
}
|
||||||
|
@ -1056,19 +1055,19 @@ public class BasicValueBinder<T> implements JdbcTypeDescriptorIndicators {
|
||||||
.getService( ManagedBeanRegistry.class );
|
.getService( ManagedBeanRegistry.class );
|
||||||
|
|
||||||
explicitJavaTypeAccess = typeConfiguration -> {
|
explicitJavaTypeAccess = typeConfiguration -> {
|
||||||
final JavaType javaTypeAnn = findAnnotation( attributeXProperty, JavaType.class );
|
final org.hibernate.annotations.JavaType javaTypeAnn = findAnnotation( attributeXProperty, org.hibernate.annotations.JavaType.class );
|
||||||
if ( javaTypeAnn != null ) {
|
if ( javaTypeAnn != null ) {
|
||||||
final Class<? extends BasicJavaTypeDescriptor<?>> javaType = normalizeJavaType( javaTypeAnn.value() );
|
final Class<? extends BasicJavaType<?>> javaType = normalizeJavaType( javaTypeAnn.value() );
|
||||||
|
|
||||||
if ( javaType != null ) {
|
if ( javaType != null ) {
|
||||||
final ManagedBean<? extends BasicJavaTypeDescriptor<?>> jtdBean = managedBeanRegistry.getBean( javaType );
|
final ManagedBean<? extends BasicJavaType<?>> jtdBean = managedBeanRegistry.getBean( javaType );
|
||||||
return jtdBean.getBeanInstance();
|
return jtdBean.getBeanInstance();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final Target targetAnn = findAnnotation( attributeXProperty, Target.class );
|
final Target targetAnn = findAnnotation( attributeXProperty, Target.class );
|
||||||
if ( targetAnn != null ) {
|
if ( targetAnn != null ) {
|
||||||
return (BasicJavaTypeDescriptor) typeConfiguration
|
return (BasicJavaType) typeConfiguration
|
||||||
.getJavaTypeDescriptorRegistry()
|
.getJavaTypeDescriptorRegistry()
|
||||||
.getDescriptor( targetAnn.value() );
|
.getDescriptor( targetAnn.value() );
|
||||||
}
|
}
|
||||||
|
@ -1106,7 +1105,7 @@ public class BasicValueBinder<T> implements JdbcTypeDescriptorIndicators {
|
||||||
return jdbcType;
|
return jdbcType;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Class<? extends BasicJavaTypeDescriptor<?>> normalizeJavaType(Class<? extends BasicJavaTypeDescriptor<?>> javaType) {
|
private static Class<? extends BasicJavaType<?>> normalizeJavaType(Class<? extends BasicJavaType<?>> javaType) {
|
||||||
if ( javaType == null ) {
|
if ( javaType == null ) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ import org.hibernate.type.descriptor.ValueExtractor;
|
||||||
import org.hibernate.type.descriptor.WrapperOptions;
|
import org.hibernate.type.descriptor.WrapperOptions;
|
||||||
import org.hibernate.type.descriptor.java.DataHelper;
|
import org.hibernate.type.descriptor.java.DataHelper;
|
||||||
import org.hibernate.type.descriptor.java.DoubleJavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.DoubleJavaTypeDescriptor;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
import org.hibernate.type.descriptor.jdbc.*;
|
import org.hibernate.type.descriptor.jdbc.*;
|
||||||
import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry;
|
import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry;
|
||||||
import org.hibernate.type.internal.BasicTypeImpl;
|
import org.hibernate.type.internal.BasicTypeImpl;
|
||||||
|
@ -311,7 +311,7 @@ public abstract class AbstractHANADialect extends Dialect {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <X> ValueBinder<X> getBinder(JavaTypeDescriptor<X> javaTypeDescriptor) {
|
public <X> ValueBinder<X> getBinder(JavaType<X> javaTypeDescriptor) {
|
||||||
return new BasicBinder<X>( javaTypeDescriptor, this ) {
|
return new BasicBinder<X>( javaTypeDescriptor, this ) {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -349,7 +349,7 @@ public abstract class AbstractHANADialect extends Dialect {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <X> ValueExtractor<X> getExtractor(JavaTypeDescriptor<X> javaTypeDescriptor) {
|
public <X> ValueExtractor<X> getExtractor(JavaType<X> javaTypeDescriptor) {
|
||||||
return new BasicExtractor<X>( javaTypeDescriptor, this ) {
|
return new BasicExtractor<X>( javaTypeDescriptor, this ) {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -402,7 +402,7 @@ public abstract class AbstractHANADialect extends Dialect {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <X> BasicBinder<X> getClobBinder(final JavaTypeDescriptor<X> javaTypeDescriptor) {
|
public <X> BasicBinder<X> getClobBinder(final JavaType<X> javaTypeDescriptor) {
|
||||||
return new BasicBinder<X>( javaTypeDescriptor, this ) {
|
return new BasicBinder<X>( javaTypeDescriptor, this ) {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -443,7 +443,7 @@ public abstract class AbstractHANADialect extends Dialect {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <X> ValueExtractor<X> getExtractor(JavaTypeDescriptor<X> javaTypeDescriptor) {
|
public <X> ValueExtractor<X> getExtractor(JavaType<X> javaTypeDescriptor) {
|
||||||
return new BasicExtractor<X>( javaTypeDescriptor, this ) {
|
return new BasicExtractor<X>( javaTypeDescriptor, this ) {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -501,7 +501,7 @@ public abstract class AbstractHANADialect extends Dialect {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <X> BasicBinder<X> getNClobBinder(final JavaTypeDescriptor<X> javaTypeDescriptor) {
|
public <X> BasicBinder<X> getNClobBinder(final JavaType<X> javaTypeDescriptor) {
|
||||||
return new BasicBinder<X>( javaTypeDescriptor, this ) {
|
return new BasicBinder<X>( javaTypeDescriptor, this ) {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -542,7 +542,7 @@ public abstract class AbstractHANADialect extends Dialect {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <X> ValueExtractor<X> getExtractor(JavaTypeDescriptor<X> javaTypeDescriptor) {
|
public <X> ValueExtractor<X> getExtractor(JavaType<X> javaTypeDescriptor) {
|
||||||
return new BasicExtractor<X>( javaTypeDescriptor, this ) {
|
return new BasicExtractor<X>( javaTypeDescriptor, this ) {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -601,7 +601,7 @@ public abstract class AbstractHANADialect extends Dialect {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <X> ValueExtractor<X> getExtractor(final JavaTypeDescriptor<X> javaTypeDescriptor) {
|
public <X> ValueExtractor<X> getExtractor(final JavaType<X> javaTypeDescriptor) {
|
||||||
return new BasicExtractor<X>( javaTypeDescriptor, this ) {
|
return new BasicExtractor<X>( javaTypeDescriptor, this ) {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -627,7 +627,7 @@ public abstract class AbstractHANADialect extends Dialect {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <X> BasicBinder<X> getBinder(final JavaTypeDescriptor<X> javaTypeDescriptor) {
|
public <X> BasicBinder<X> getBinder(final JavaType<X> javaTypeDescriptor) {
|
||||||
return new BasicBinder<X>( javaTypeDescriptor, this ) {
|
return new BasicBinder<X>( javaTypeDescriptor, this ) {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -77,7 +77,7 @@ 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.Type;
|
import org.hibernate.type.Type;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
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.ClobJdbcTypeDescriptor;
|
||||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||||
|
@ -3421,13 +3421,13 @@ public abstract class Dialect implements ConversionContext {
|
||||||
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 JavaTypeDescriptor Java type}.
|
* {@link JdbcTypeDescriptor 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,
|
JdbcTypeDescriptor jdbcType,
|
||||||
JavaTypeDescriptor<?> javaType,
|
JavaType<?> javaType,
|
||||||
Integer precision,
|
Integer precision,
|
||||||
Integer scale,
|
Integer scale,
|
||||||
Long length);
|
Long length);
|
||||||
|
@ -3437,7 +3437,7 @@ public abstract class Dialect implements ConversionContext {
|
||||||
@Override
|
@Override
|
||||||
public Size resolveSize(
|
public Size resolveSize(
|
||||||
JdbcTypeDescriptor jdbcType,
|
JdbcTypeDescriptor jdbcType,
|
||||||
JavaTypeDescriptor<?> javaType,
|
JavaType<?> javaType,
|
||||||
Integer precision,
|
Integer precision,
|
||||||
Integer scale,
|
Integer scale,
|
||||||
Long length) {
|
Long length) {
|
||||||
|
|
|
@ -56,7 +56,7 @@ 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.NullType;
|
import org.hibernate.type.NullType;
|
||||||
import org.hibernate.type.StandardBasicTypes;
|
import org.hibernate.type.StandardBasicTypes;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||||
import org.hibernate.type.descriptor.jdbc.NullJdbcTypeDescriptor;
|
import org.hibernate.type.descriptor.jdbc.NullJdbcTypeDescriptor;
|
||||||
import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry;
|
import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeDescriptorRegistry;
|
||||||
|
@ -192,7 +192,7 @@ public class MySQLDialect extends Dialect {
|
||||||
@Override
|
@Override
|
||||||
public Size resolveSize(
|
public Size resolveSize(
|
||||||
JdbcTypeDescriptor jdbcType,
|
JdbcTypeDescriptor jdbcType,
|
||||||
JavaTypeDescriptor<?> javaType,
|
JavaType<?> javaType,
|
||||||
Integer precision,
|
Integer precision,
|
||||||
Integer scale,
|
Integer scale,
|
||||||
Long length) {
|
Long length) {
|
||||||
|
|
|
@ -50,12 +50,10 @@ 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.java.PrimitiveByteArrayJavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.PrimitiveByteArrayJavaTypeDescriptor;
|
||||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
|
||||||
import org.hibernate.type.descriptor.jdbc.SmallIntJdbcTypeDescriptor;
|
import org.hibernate.type.descriptor.jdbc.SmallIntJdbcTypeDescriptor;
|
||||||
|
|
||||||
import java.sql.DatabaseMetaData;
|
import java.sql.DatabaseMetaData;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.sql.Timestamp;
|
|
||||||
import java.sql.Types;
|
import java.sql.Types;
|
||||||
import java.time.temporal.ChronoField;
|
import java.time.temporal.ChronoField;
|
||||||
import java.time.temporal.TemporalAccessor;
|
import java.time.temporal.TemporalAccessor;
|
||||||
|
|
|
@ -35,7 +35,7 @@ import org.hibernate.sql.ast.SqlAstTranslatorFactory;
|
||||||
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.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||||
import org.hibernate.type.descriptor.jdbc.TimestampJdbcTypeDescriptor;
|
import org.hibernate.type.descriptor.jdbc.TimestampJdbcTypeDescriptor;
|
||||||
import org.hibernate.type.descriptor.jdbc.TinyIntJdbcTypeDescriptor;
|
import org.hibernate.type.descriptor.jdbc.TinyIntJdbcTypeDescriptor;
|
||||||
|
@ -109,7 +109,7 @@ public class SybaseASEDialect extends SybaseDialect {
|
||||||
@Override
|
@Override
|
||||||
public Size resolveSize(
|
public Size resolveSize(
|
||||||
JdbcTypeDescriptor jdbcType,
|
JdbcTypeDescriptor jdbcType,
|
||||||
JavaTypeDescriptor<?> javaType,
|
JavaType<?> javaType,
|
||||||
Integer precision,
|
Integer precision,
|
||||||
Integer scale,
|
Integer scale,
|
||||||
Long length) {
|
Long length) {
|
||||||
|
|
|
@ -15,9 +15,9 @@ import org.hibernate.engine.spi.VersionValue;
|
||||||
import org.hibernate.property.access.spi.Getter;
|
import org.hibernate.property.access.spi.Getter;
|
||||||
import org.hibernate.type.BasicType;
|
import org.hibernate.type.BasicType;
|
||||||
import org.hibernate.type.Type;
|
import org.hibernate.type.Type;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
import org.hibernate.type.descriptor.java.VersionJavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.VersionJavaType;
|
||||||
import org.hibernate.type.descriptor.java.spi.PrimitiveJavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.spi.PrimitiveJavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper for dealing with unsaved value handling
|
* Helper for dealing with unsaved value handling
|
||||||
|
@ -68,9 +68,9 @@ public class UnsavedValueFactory {
|
||||||
final Object defaultValue = identifierGetter.get( instantiate( constructor ) );
|
final Object defaultValue = identifierGetter.get( instantiate( constructor ) );
|
||||||
return new IdentifierValue( defaultValue );
|
return new IdentifierValue( defaultValue );
|
||||||
}
|
}
|
||||||
final JavaTypeDescriptor<?> jtd;
|
final JavaType<?> jtd;
|
||||||
if ( identifierGetter != null && ( identifierType instanceof BasicType<?> ) && ( jtd = ( (BasicType<?>) identifierType ).getJavaTypeDescriptor() ) instanceof PrimitiveJavaTypeDescriptor ) {
|
if ( identifierGetter != null && ( identifierType instanceof BasicType<?> ) && ( jtd = ( (BasicType<?>) identifierType ).getJavaTypeDescriptor() ) instanceof PrimitiveJavaType ) {
|
||||||
final Object defaultValue = ( (PrimitiveJavaTypeDescriptor<?>) jtd ).getDefaultValue();
|
final Object defaultValue = ( (PrimitiveJavaType<?>) jtd ).getDefaultValue();
|
||||||
return new IdentifierValue( defaultValue );
|
return new IdentifierValue( defaultValue );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -118,7 +118,7 @@ public class UnsavedValueFactory {
|
||||||
public static <X> VersionValue getUnsavedVersionValue(
|
public static <X> VersionValue getUnsavedVersionValue(
|
||||||
String versionUnsavedValue,
|
String versionUnsavedValue,
|
||||||
Getter versionGetter,
|
Getter versionGetter,
|
||||||
VersionJavaTypeDescriptor<X> versionType,
|
VersionJavaType<X> versionType,
|
||||||
Constructor constructor) {
|
Constructor constructor) {
|
||||||
|
|
||||||
if ( versionUnsavedValue == null ) {
|
if ( versionUnsavedValue == null ) {
|
||||||
|
|
|
@ -9,7 +9,7 @@ package org.hibernate.engine.internal;
|
||||||
import org.hibernate.engine.spi.SharedSessionContractImplementor;
|
import org.hibernate.engine.spi.SharedSessionContractImplementor;
|
||||||
import org.hibernate.internal.CoreMessageLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.persister.entity.EntityPersister;
|
import org.hibernate.persister.entity.EntityPersister;
|
||||||
import org.hibernate.type.descriptor.java.VersionJavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.VersionJavaType;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
|
@ -31,21 +31,21 @@ public final class Versioning {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create an initial optimistic locking value according the {@link VersionJavaTypeDescriptor}
|
* Create an initial optimistic locking value according the {@link VersionJavaType}
|
||||||
* contract for the version property.
|
* contract for the version property.
|
||||||
*
|
*
|
||||||
* @param versionType The version type.
|
* @param versionType The version type.
|
||||||
* @param session The originating session
|
* @param session The originating session
|
||||||
* @return The initial optimistic locking value
|
* @return The initial optimistic locking value
|
||||||
*/
|
*/
|
||||||
private static Object seed(VersionJavaTypeDescriptor<Object> versionType, SharedSessionContractImplementor session) {
|
private static Object seed(VersionJavaType<Object> versionType, SharedSessionContractImplementor session) {
|
||||||
final Object seed = versionType.seed( session );
|
final Object seed = versionType.seed( session );
|
||||||
LOG.tracef( "Seeding: %s", seed );
|
LOG.tracef( "Seeding: %s", seed );
|
||||||
return seed;
|
return seed;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create an initial optimistic locking value according the {@link VersionJavaTypeDescriptor}
|
* Create an initial optimistic locking value according the {@link VersionJavaType}
|
||||||
* contract for the version property <b>if required</b> and inject it into
|
* contract for the version property <b>if required</b> and inject it into
|
||||||
* the snapshot state.
|
* the snapshot state.
|
||||||
*
|
*
|
||||||
|
@ -59,7 +59,7 @@ public final class Versioning {
|
||||||
public static boolean seedVersion(
|
public static boolean seedVersion(
|
||||||
Object[] fields,
|
Object[] fields,
|
||||||
int versionProperty,
|
int versionProperty,
|
||||||
VersionJavaTypeDescriptor<Object> versionType,
|
VersionJavaType<Object> versionType,
|
||||||
SharedSessionContractImplementor session) {
|
SharedSessionContractImplementor session) {
|
||||||
final Object initialVersion = fields[versionProperty];
|
final Object initialVersion = fields[versionProperty];
|
||||||
if (
|
if (
|
||||||
|
@ -80,14 +80,14 @@ public final class Versioning {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate the next increment in the optimistic locking value according
|
* Generate the next increment in the optimistic locking value according
|
||||||
* the {@link VersionJavaTypeDescriptor} contract for the version property.
|
* the {@link VersionJavaType} contract for the version property.
|
||||||
*
|
*
|
||||||
* @param version The current version
|
* @param version The current version
|
||||||
* @param versionType The version type
|
* @param versionType The version type
|
||||||
* @param session The originating session
|
* @param session The originating session
|
||||||
* @return The incremented optimistic locking value.
|
* @return The incremented optimistic locking value.
|
||||||
*/
|
*/
|
||||||
public static Object increment(Object version, VersionJavaTypeDescriptor<Object> versionType, SharedSessionContractImplementor session) {
|
public static Object increment(Object version, VersionJavaType<Object> versionType, SharedSessionContractImplementor session) {
|
||||||
final Object next = versionType.next( version, session );
|
final Object next = versionType.next( version, session );
|
||||||
if ( LOG.isTraceEnabled() ) {
|
if ( LOG.isTraceEnabled() ) {
|
||||||
LOG.tracef(
|
LOG.tracef(
|
||||||
|
|
|
@ -31,7 +31,7 @@ import org.hibernate.resource.jdbc.spi.JdbcSessionOwner;
|
||||||
import org.hibernate.resource.transaction.spi.TransactionCoordinator;
|
import org.hibernate.resource.transaction.spi.TransactionCoordinator;
|
||||||
import org.hibernate.resource.transaction.spi.TransactionCoordinatorBuilder.Options;
|
import org.hibernate.resource.transaction.spi.TransactionCoordinatorBuilder.Options;
|
||||||
import org.hibernate.type.descriptor.WrapperOptions;
|
import org.hibernate.type.descriptor.WrapperOptions;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
import org.hibernate.type.spi.TypeConfiguration;
|
import org.hibernate.type.spi.TypeConfiguration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -64,7 +64,7 @@ import org.hibernate.type.spi.TypeConfiguration;
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
*/
|
*/
|
||||||
public interface SharedSessionContractImplementor
|
public interface SharedSessionContractImplementor
|
||||||
extends SharedSessionContract, JdbcSessionOwner, Options, LobCreationContext, WrapperOptions, QueryProducerImplementor, JavaTypeDescriptor.CoercionContext {
|
extends SharedSessionContract, JdbcSessionOwner, Options, LobCreationContext, WrapperOptions, QueryProducerImplementor, JavaType.CoercionContext {
|
||||||
|
|
||||||
// todo : this is the shared contract between Session and StatelessSession, but it defines methods that StatelessSession does not implement
|
// todo : this is the shared contract between Session and StatelessSession, but it defines methods that StatelessSession does not implement
|
||||||
// (it just throws UnsupportedOperationException). To me it seems like it is better to properly isolate those methods
|
// (it just throws UnsupportedOperationException). To me it seems like it is better to properly isolate those methods
|
||||||
|
|
|
@ -36,7 +36,7 @@ import org.hibernate.proxy.HibernateProxy;
|
||||||
import org.hibernate.proxy.LazyInitializer;
|
import org.hibernate.proxy.LazyInitializer;
|
||||||
import org.hibernate.stat.spi.StatisticsImplementor;
|
import org.hibernate.stat.spi.StatisticsImplementor;
|
||||||
import org.hibernate.tuple.entity.EntityMetamodel;
|
import org.hibernate.tuple.entity.EntityMetamodel;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the default load event listeners used by hibernate for loading entities
|
* Defines the default load event listeners used by hibernate for loading entities
|
||||||
|
@ -133,7 +133,7 @@ public class DefaultLoadEventListener implements LoadEventListener {
|
||||||
if ( singleIdAttribute.getMappedType() instanceof EntityMappingType ) {
|
if ( singleIdAttribute.getMappedType() instanceof EntityMappingType ) {
|
||||||
final EntityMappingType dependentIdTargetMapping = (EntityMappingType) singleIdAttribute.getMappedType();
|
final EntityMappingType dependentIdTargetMapping = (EntityMappingType) singleIdAttribute.getMappedType();
|
||||||
final EntityIdentifierMapping dependentIdTargetIdMapping = dependentIdTargetMapping.getIdentifierMapping();
|
final EntityIdentifierMapping dependentIdTargetIdMapping = dependentIdTargetMapping.getIdentifierMapping();
|
||||||
final JavaTypeDescriptor dependentParentIdJtd = dependentIdTargetIdMapping.getMappedType().getMappedJavaTypeDescriptor();
|
final JavaType dependentParentIdJtd = dependentIdTargetIdMapping.getMappedType().getMappedJavaTypeDescriptor();
|
||||||
if ( dependentParentIdJtd.getJavaTypeClass().isInstance( event.getEntityId() ) ) {
|
if ( dependentParentIdJtd.getJavaTypeClass().isInstance( event.getEntityId() ) ) {
|
||||||
// yep that's what we have...
|
// yep that's what we have...
|
||||||
loadByDerivedIdentitySimplePkValue(
|
loadByDerivedIdentitySimplePkValue(
|
||||||
|
|
|
@ -29,7 +29,7 @@ import org.hibernate.property.access.internal.PropertyAccessStrategyMixedImpl;
|
||||||
import org.hibernate.property.access.spi.Getter;
|
import org.hibernate.property.access.spi.Getter;
|
||||||
import org.hibernate.type.BasicType;
|
import org.hibernate.type.BasicType;
|
||||||
import org.hibernate.type.Type;
|
import org.hibernate.type.Type;
|
||||||
import org.hibernate.type.descriptor.java.spi.PrimitiveJavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.spi.PrimitiveJavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility class for various reflection operations.
|
* Utility class for various reflection operations.
|
||||||
|
@ -340,8 +340,8 @@ public final class ReflectHelper {
|
||||||
boolean found = true;
|
boolean found = true;
|
||||||
for ( int j = 0; j < params.length; j++ ) {
|
for ( int j = 0; j < params.length; j++ ) {
|
||||||
final boolean ok = types[j] == null || params[j].isAssignableFrom( types[j].getReturnedClass() ) || (
|
final boolean ok = types[j] == null || params[j].isAssignableFrom( types[j].getReturnedClass() ) || (
|
||||||
types[j] instanceof BasicType<?> && ( (BasicType<?>) types[j] ).getJavaTypeDescriptor() instanceof PrimitiveJavaTypeDescriptor
|
types[j] instanceof BasicType<?> && ( (BasicType<?>) types[j] ).getJavaTypeDescriptor() instanceof PrimitiveJavaType
|
||||||
&& params[j] == ( (PrimitiveJavaTypeDescriptor<?>) ( ( (BasicType<?>) types[j] ).getJavaTypeDescriptor() ) ).getPrimitiveClass()
|
&& params[j] == ( (PrimitiveJavaType<?>) ( ( (BasicType<?>) types[j] ).getJavaTypeDescriptor() ) ).getPrimitiveClass()
|
||||||
);
|
);
|
||||||
if ( !ok ) {
|
if ( !ok ) {
|
||||||
found = false;
|
found = false;
|
||||||
|
|
|
@ -28,13 +28,13 @@ import org.hibernate.jpa.spi.JpaCompliance;
|
||||||
import org.hibernate.persister.entity.EntityPersister;
|
import org.hibernate.persister.entity.EntityPersister;
|
||||||
import org.hibernate.proxy.HibernateProxy;
|
import org.hibernate.proxy.HibernateProxy;
|
||||||
import org.hibernate.proxy.LazyInitializer;
|
import org.hibernate.proxy.LazyInitializer;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
import org.hibernate.type.spi.TypeConfiguration;
|
import org.hibernate.type.spi.TypeConfiguration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
*/
|
*/
|
||||||
public class IdentifierLoadAccessImpl<T> implements IdentifierLoadAccess<T>, JavaTypeDescriptor.CoercionContext {
|
public class IdentifierLoadAccessImpl<T> implements IdentifierLoadAccess<T>, JavaType.CoercionContext {
|
||||||
private final LoadAccessContext context;
|
private final LoadAccessContext context;
|
||||||
private final EntityPersister entityPersister;
|
private final EntityPersister entityPersister;
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,7 @@ import org.hibernate.collection.spi.CollectionSemantics;
|
||||||
import org.hibernate.type.ArrayType;
|
import org.hibernate.type.ArrayType;
|
||||||
import org.hibernate.type.BasicType;
|
import org.hibernate.type.BasicType;
|
||||||
import org.hibernate.type.CollectionType;
|
import org.hibernate.type.CollectionType;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.spi.PrimitiveJavaType;
|
||||||
import org.hibernate.type.descriptor.java.spi.PrimitiveJavaTypeDescriptor;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An array mapping has a primary key consisting of the key columns + index column.
|
* An array mapping has a primary key consisting of the key columns + index column.
|
||||||
|
@ -34,7 +33,7 @@ public class Array extends List {
|
||||||
if ( elementClassName == null ) {
|
if ( elementClassName == null ) {
|
||||||
final org.hibernate.type.Type elementType = getElement().getType();
|
final org.hibernate.type.Type elementType = getElement().getType();
|
||||||
if ( isPrimitiveArray() ) {
|
if ( isPrimitiveArray() ) {
|
||||||
return ( (PrimitiveJavaTypeDescriptor<?>) ( (BasicType<?>) elementType ).getJavaTypeDescriptor() ).getPrimitiveClass();
|
return ( (PrimitiveJavaType<?>) ( (BasicType<?>) elementType ).getJavaTypeDescriptor() ).getPrimitiveClass();
|
||||||
}
|
}
|
||||||
return elementType.getReturnedClass();
|
return elementType.getReturnedClass();
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,8 +46,8 @@ import org.hibernate.type.BasicType;
|
||||||
import org.hibernate.type.ConvertedBasicType;
|
import org.hibernate.type.ConvertedBasicType;
|
||||||
import org.hibernate.type.CustomType;
|
import org.hibernate.type.CustomType;
|
||||||
import org.hibernate.type.Type;
|
import org.hibernate.type.Type;
|
||||||
import org.hibernate.type.descriptor.java.BasicJavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.BasicJavaType;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
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.JdbcTypeDescriptor;
|
||||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators;
|
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptorIndicators;
|
||||||
|
@ -77,7 +77,7 @@ public class BasicValue extends SimpleValue implements JdbcTypeDescriptorIndicat
|
||||||
private String explicitTypeName;
|
private String explicitTypeName;
|
||||||
private Map explicitLocalTypeParams;
|
private Map explicitLocalTypeParams;
|
||||||
|
|
||||||
private Function<TypeConfiguration, BasicJavaTypeDescriptor> explicitJavaTypeAccess;
|
private Function<TypeConfiguration, BasicJavaType> explicitJavaTypeAccess;
|
||||||
private Function<TypeConfiguration, JdbcTypeDescriptor> explicitJdbcTypeAccess;
|
private Function<TypeConfiguration, JdbcTypeDescriptor> 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;
|
||||||
|
@ -148,7 +148,7 @@ public class BasicValue extends SimpleValue implements JdbcTypeDescriptorIndicat
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings({"rawtypes"})
|
@SuppressWarnings({"rawtypes"})
|
||||||
public void setExplicitJavaTypeAccess(Function<TypeConfiguration, BasicJavaTypeDescriptor> explicitJavaTypeAccess) {
|
public void setExplicitJavaTypeAccess(Function<TypeConfiguration, BasicJavaType> explicitJavaTypeAccess) {
|
||||||
this.explicitJavaTypeAccess = explicitJavaTypeAccess;
|
this.explicitJavaTypeAccess = explicitJavaTypeAccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -361,12 +361,12 @@ public class BasicValue extends SimpleValue implements JdbcTypeDescriptorIndicat
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
JavaTypeDescriptor jtd = null;
|
JavaType jtd = null;
|
||||||
|
|
||||||
// determine JTD if we can
|
// determine JTD if we can
|
||||||
|
|
||||||
if ( explicitJavaTypeAccess != null ) {
|
if ( explicitJavaTypeAccess != null ) {
|
||||||
final BasicJavaTypeDescriptor explicitJtd = explicitJavaTypeAccess.apply( typeConfiguration );
|
final BasicJavaType explicitJtd = explicitJavaTypeAccess.apply( typeConfiguration );
|
||||||
if ( explicitJtd != null ) {
|
if ( explicitJtd != null ) {
|
||||||
jtd = explicitJtd;
|
jtd = explicitJtd;
|
||||||
}
|
}
|
||||||
|
@ -382,7 +382,7 @@ public class BasicValue extends SimpleValue implements JdbcTypeDescriptorIndicat
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( jtd == null ) {
|
if ( jtd == null ) {
|
||||||
final JavaTypeDescriptor reflectedJtd = determineReflectedJavaTypeDescriptor();
|
final JavaType reflectedJtd = determineReflectedJavaTypeDescriptor();
|
||||||
if ( reflectedJtd != null ) {
|
if ( reflectedJtd != null ) {
|
||||||
jtd = reflectedJtd;
|
jtd = reflectedJtd;
|
||||||
}
|
}
|
||||||
|
@ -402,7 +402,7 @@ public class BasicValue extends SimpleValue implements JdbcTypeDescriptorIndicat
|
||||||
}
|
}
|
||||||
|
|
||||||
final TypeDefinitionRegistry typeDefinitionRegistry = getBuildingContext().getTypeDefinitionRegistry();
|
final TypeDefinitionRegistry typeDefinitionRegistry = getBuildingContext().getTypeDefinitionRegistry();
|
||||||
final TypeDefinition autoAppliedTypeDef = typeDefinitionRegistry.resolveAutoApplied( (BasicJavaTypeDescriptor<?>) jtd );
|
final TypeDefinition autoAppliedTypeDef = typeDefinitionRegistry.resolveAutoApplied( (BasicJavaType<?>) jtd );
|
||||||
if ( autoAppliedTypeDef != null && ( !jtd.getJavaTypeClass().isEnum() || enumerationStyle == null ) ) {
|
if ( autoAppliedTypeDef != null && ( !jtd.getJavaTypeClass().isEnum() || enumerationStyle == null ) ) {
|
||||||
log.debug( "BasicValue resolution matched auto-applied type-definition" );
|
log.debug( "BasicValue resolution matched auto-applied type-definition" );
|
||||||
return autoAppliedTypeDef.resolve(
|
return autoAppliedTypeDef.resolve(
|
||||||
|
@ -428,7 +428,7 @@ public class BasicValue extends SimpleValue implements JdbcTypeDescriptorIndicat
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private JavaTypeDescriptor determineReflectedJavaTypeDescriptor() {
|
private JavaType determineReflectedJavaTypeDescriptor() {
|
||||||
final java.lang.reflect.Type impliedJavaType;
|
final java.lang.reflect.Type impliedJavaType;
|
||||||
|
|
||||||
if ( resolvedJavaType != null ) {
|
if ( resolvedJavaType != null ) {
|
||||||
|
@ -466,7 +466,7 @@ public class BasicValue extends SimpleValue implements JdbcTypeDescriptorIndicat
|
||||||
String name,
|
String name,
|
||||||
EnumType enumerationStyle,
|
EnumType enumerationStyle,
|
||||||
Function<TypeConfiguration, java.lang.reflect.Type> implicitJavaTypeAccess,
|
Function<TypeConfiguration, java.lang.reflect.Type> implicitJavaTypeAccess,
|
||||||
Function<TypeConfiguration, BasicJavaTypeDescriptor> explicitJtdAccess,
|
Function<TypeConfiguration, BasicJavaType> explicitJtdAccess,
|
||||||
Function<TypeConfiguration, JdbcTypeDescriptor> explicitStdAccess,
|
Function<TypeConfiguration, JdbcTypeDescriptor> explicitStdAccess,
|
||||||
Function<TypeConfiguration, MutabilityPlan> explicitMutabilityPlanAccess,
|
Function<TypeConfiguration, MutabilityPlan> explicitMutabilityPlanAccess,
|
||||||
ConverterDescriptor converterDescriptor,
|
ConverterDescriptor converterDescriptor,
|
||||||
|
@ -514,7 +514,7 @@ public class BasicValue extends SimpleValue implements JdbcTypeDescriptorIndicat
|
||||||
final BasicType basicTypeByName = typeConfiguration.getBasicTypeRegistry().getRegisteredType( name );
|
final BasicType basicTypeByName = typeConfiguration.getBasicTypeRegistry().getRegisteredType( name );
|
||||||
if ( basicTypeByName != null ) {
|
if ( basicTypeByName != null ) {
|
||||||
final BasicValueConverter valueConverter;
|
final BasicValueConverter valueConverter;
|
||||||
final JavaTypeDescriptor<?> domainJtd;
|
final JavaType<?> domainJtd;
|
||||||
if ( converterDescriptor != null ) {
|
if ( converterDescriptor != null ) {
|
||||||
valueConverter = converterDescriptor.createJpaAttributeConverter( converterCreationContext );
|
valueConverter = converterDescriptor.createJpaAttributeConverter( converterCreationContext );
|
||||||
domainJtd = valueConverter.getDomainJavaDescriptor();
|
domainJtd = valueConverter.getDomainJavaDescriptor();
|
||||||
|
@ -762,13 +762,13 @@ public class BasicValue extends SimpleValue implements JdbcTypeDescriptorIndicat
|
||||||
/**
|
/**
|
||||||
* The JavaTypeDescriptor for the value as part of the domain model
|
* The JavaTypeDescriptor for the value as part of the domain model
|
||||||
*/
|
*/
|
||||||
JavaTypeDescriptor<J> getDomainJavaDescriptor();
|
JavaType<J> getDomainJavaDescriptor();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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)
|
||||||
*/
|
*/
|
||||||
JavaTypeDescriptor<?> getRelationalJavaDescriptor();
|
JavaType<?> getRelationalJavaDescriptor();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The JavaTypeDescriptor for the relational value as part of
|
* The JavaTypeDescriptor for the relational value as part of
|
||||||
|
|
|
@ -51,7 +51,7 @@ 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.AttributeConverterJdbcTypeDescriptorAdapter;
|
||||||
import org.hibernate.type.descriptor.converter.AttributeConverterTypeAdapter;
|
import org.hibernate.type.descriptor.converter.AttributeConverterTypeAdapter;
|
||||||
import org.hibernate.type.descriptor.java.BasicJavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.BasicJavaType;
|
||||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||||
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;
|
||||||
|
@ -658,7 +658,7 @@ public abstract class SimpleValue implements KeyValue {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
final BasicJavaTypeDescriptor<?> domainJtd = (BasicJavaTypeDescriptor<?>) jpaAttributeConverter.getDomainJavaTypeDescriptor();
|
final BasicJavaType<?> domainJtd = (BasicJavaType<?>) jpaAttributeConverter.getDomainJavaTypeDescriptor();
|
||||||
|
|
||||||
|
|
||||||
// build the SqlTypeDescriptor adapter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// build the SqlTypeDescriptor adapter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
|
@ -50,7 +50,7 @@ import org.hibernate.sql.results.graph.FetchParent;
|
||||||
import org.hibernate.sql.results.graph.embeddable.EmbeddableValuedFetchable;
|
import org.hibernate.sql.results.graph.embeddable.EmbeddableValuedFetchable;
|
||||||
import org.hibernate.sql.results.graph.embeddable.internal.EmbeddableFetchImpl;
|
import org.hibernate.sql.results.graph.embeddable.internal.EmbeddableFetchImpl;
|
||||||
import org.hibernate.sql.results.graph.embeddable.internal.EmbeddableResultImpl;
|
import org.hibernate.sql.results.graph.embeddable.internal.EmbeddableResultImpl;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base implementation for composite identifier mappings
|
* Base implementation for composite identifier mappings
|
||||||
|
@ -105,7 +105,7 @@ public abstract class AbstractCompositeIdentifierMapping
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getJavaTypeDescriptor() {
|
public JavaType<?> getJavaTypeDescriptor() {
|
||||||
return getEmbeddableTypeDescriptor().getMappedJavaTypeDescriptor();
|
return getEmbeddableTypeDescriptor().getMappedJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,19 +10,18 @@ import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
import org.hibernate.internal.util.collections.CollectionHelper;
|
|
||||||
import org.hibernate.mapping.Component;
|
import org.hibernate.mapping.Component;
|
||||||
import org.hibernate.mapping.Property;
|
import org.hibernate.mapping.Property;
|
||||||
import org.hibernate.metamodel.spi.EmbeddableRepresentationStrategy;
|
import org.hibernate.metamodel.spi.EmbeddableRepresentationStrategy;
|
||||||
import org.hibernate.metamodel.spi.RuntimeModelCreationContext;
|
import org.hibernate.metamodel.spi.RuntimeModelCreationContext;
|
||||||
import org.hibernate.property.access.spi.PropertyAccess;
|
import org.hibernate.property.access.spi.PropertyAccess;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractEmbeddableRepresentationStrategy implements EmbeddableRepresentationStrategy {
|
public abstract class AbstractEmbeddableRepresentationStrategy implements EmbeddableRepresentationStrategy {
|
||||||
private final JavaTypeDescriptor<?> embeddableJavaTypeDescriptor;
|
private final JavaType<?> embeddableJavaTypeDescriptor;
|
||||||
|
|
||||||
private final int propertySpan;
|
private final int propertySpan;
|
||||||
private final PropertyAccess[] propertyAccesses;
|
private final PropertyAccess[] propertyAccesses;
|
||||||
|
@ -32,7 +31,7 @@ public abstract class AbstractEmbeddableRepresentationStrategy implements Embedd
|
||||||
|
|
||||||
public AbstractEmbeddableRepresentationStrategy(
|
public AbstractEmbeddableRepresentationStrategy(
|
||||||
Component bootDescriptor,
|
Component bootDescriptor,
|
||||||
JavaTypeDescriptor<?> embeddableJavaTypeDescriptor,
|
JavaType<?> embeddableJavaTypeDescriptor,
|
||||||
RuntimeModelCreationContext creationContext) {
|
RuntimeModelCreationContext creationContext) {
|
||||||
this.propertySpan = bootDescriptor.getPropertySpan();
|
this.propertySpan = bootDescriptor.getPropertySpan();
|
||||||
this.embeddableJavaTypeDescriptor = embeddableJavaTypeDescriptor;
|
this.embeddableJavaTypeDescriptor = embeddableJavaTypeDescriptor;
|
||||||
|
@ -60,12 +59,12 @@ public abstract class AbstractEmbeddableRepresentationStrategy implements Embedd
|
||||||
|
|
||||||
protected abstract PropertyAccess buildPropertyAccess(Property bootAttributeDescriptor);
|
protected abstract PropertyAccess buildPropertyAccess(Property bootAttributeDescriptor);
|
||||||
|
|
||||||
public JavaTypeDescriptor<?> getEmbeddableJavaTypeDescriptor() {
|
public JavaType<?> getEmbeddableJavaTypeDescriptor() {
|
||||||
return embeddableJavaTypeDescriptor;
|
return embeddableJavaTypeDescriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getMappedJavaTypeDescriptor() {
|
public JavaType<?> getMappedJavaTypeDescriptor() {
|
||||||
return getEmbeddableJavaTypeDescriptor();
|
return getEmbeddableJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ import org.hibernate.engine.spi.SessionFactoryImplementor;
|
||||||
import org.hibernate.mapping.PersistentClass;
|
import org.hibernate.mapping.PersistentClass;
|
||||||
import org.hibernate.metamodel.spi.EntityInstantiator;
|
import org.hibernate.metamodel.spi.EntityInstantiator;
|
||||||
import org.hibernate.tuple.entity.EntityMetamodel;
|
import org.hibernate.tuple.entity.EntityMetamodel;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base support for instantiating entity values as POJO representation
|
* Base support for instantiating entity values as POJO representation
|
||||||
|
@ -29,7 +29,7 @@ public abstract class AbstractEntityInstantiatorPojo extends AbstractPojoInstant
|
||||||
public AbstractEntityInstantiatorPojo(
|
public AbstractEntityInstantiatorPojo(
|
||||||
EntityMetamodel entityMetamodel,
|
EntityMetamodel entityMetamodel,
|
||||||
PersistentClass persistentClass,
|
PersistentClass persistentClass,
|
||||||
JavaTypeDescriptor<?> javaTypeDescriptor) {
|
JavaType<?> javaTypeDescriptor) {
|
||||||
super( javaTypeDescriptor.getJavaTypeClass() );
|
super( javaTypeDescriptor.getJavaTypeClass() );
|
||||||
|
|
||||||
this.entityMetamodel = entityMetamodel;
|
this.entityMetamodel = entityMetamodel;
|
||||||
|
|
|
@ -48,10 +48,9 @@ import org.hibernate.property.access.internal.PropertyAccessMapImpl;
|
||||||
import org.hibernate.property.access.spi.Getter;
|
import org.hibernate.property.access.spi.Getter;
|
||||||
import org.hibernate.tuple.entity.EntityMetamodel;
|
import org.hibernate.tuple.entity.EntityMetamodel;
|
||||||
import org.hibernate.type.AnyType;
|
import org.hibernate.type.AnyType;
|
||||||
import org.hibernate.type.CompositeType;
|
|
||||||
import org.hibernate.type.EmbeddedComponentType;
|
import org.hibernate.type.EmbeddedComponentType;
|
||||||
import org.hibernate.type.EntityType;
|
import org.hibernate.type.EntityType;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
import org.hibernate.type.descriptor.java.spi.JavaTypeDescriptorRegistry;
|
import org.hibernate.type.descriptor.java.spi.JavaTypeDescriptorRegistry;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -223,7 +222,7 @@ public class AttributeFactory {
|
||||||
|
|
||||||
assert type instanceof AnyType;
|
assert type instanceof AnyType;
|
||||||
final AnyType anyType = (AnyType) type;
|
final AnyType anyType = (AnyType) type;
|
||||||
final JavaTypeDescriptor<Object> baseJtd = context.getTypeConfiguration()
|
final JavaType<Object> baseJtd = context.getTypeConfiguration()
|
||||||
.getJavaTypeDescriptorRegistry()
|
.getJavaTypeDescriptorRegistry()
|
||||||
.resolveDescriptor( anyType.getReturnedClass() );
|
.resolveDescriptor( anyType.getReturnedClass() );
|
||||||
return new AnyMappingDomainTypeImpl<>( anyType, baseJtd );
|
return new AnyMappingDomainTypeImpl<>( anyType, baseJtd );
|
||||||
|
@ -239,7 +238,7 @@ public class AttributeFactory {
|
||||||
.resolveStrategy( component, context.getRuntimeModelCreationContext() );
|
.resolveStrategy( component, context.getRuntimeModelCreationContext() );
|
||||||
|
|
||||||
if ( component.isDynamic() ) {
|
if ( component.isDynamic() ) {
|
||||||
final JavaTypeDescriptor javaTypeDescriptor = context.getJavaTypeDescriptorRegistry().getDescriptor( Map.class );
|
final JavaType javaTypeDescriptor = context.getJavaTypeDescriptorRegistry().getDescriptor( Map.class );
|
||||||
|
|
||||||
embeddableType = new EmbeddableTypeImpl<>(
|
embeddableType = new EmbeddableTypeImpl<>(
|
||||||
javaTypeDescriptor,
|
javaTypeDescriptor,
|
||||||
|
@ -260,7 +259,7 @@ public class AttributeFactory {
|
||||||
|
|
||||||
final JavaTypeDescriptorRegistry registry = context.getTypeConfiguration()
|
final JavaTypeDescriptorRegistry registry = context.getTypeConfiguration()
|
||||||
.getJavaTypeDescriptorRegistry();
|
.getJavaTypeDescriptorRegistry();
|
||||||
final JavaTypeDescriptor<Y> javaTypeDescriptor = registry.resolveManagedTypeDescriptor( embeddableClass );
|
final JavaType<Y> javaTypeDescriptor = registry.resolveManagedTypeDescriptor( embeddableClass );
|
||||||
|
|
||||||
embeddableType = new EmbeddableTypeImpl<>(
|
embeddableType = new EmbeddableTypeImpl<>(
|
||||||
javaTypeDescriptor,
|
javaTypeDescriptor,
|
||||||
|
|
|
@ -10,7 +10,7 @@ import java.util.function.Supplier;
|
||||||
|
|
||||||
import org.hibernate.engine.spi.SessionFactoryImplementor;
|
import org.hibernate.engine.spi.SessionFactoryImplementor;
|
||||||
import org.hibernate.metamodel.spi.EmbeddableInstantiator;
|
import org.hibernate.metamodel.spi.EmbeddableInstantiator;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
import static org.hibernate.bytecode.spi.ReflectionOptimizer.InstantiationOptimizer;
|
import static org.hibernate.bytecode.spi.ReflectionOptimizer.InstantiationOptimizer;
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ public class EmbeddableInstantiatorPojoOptimized extends AbstractPojoInstantiato
|
||||||
private final InstantiationOptimizer instantiationOptimizer;
|
private final InstantiationOptimizer instantiationOptimizer;
|
||||||
|
|
||||||
public EmbeddableInstantiatorPojoOptimized(
|
public EmbeddableInstantiatorPojoOptimized(
|
||||||
JavaTypeDescriptor<?> javaTypeDescriptor,
|
JavaType<?> javaTypeDescriptor,
|
||||||
InstantiationOptimizer instantiationOptimizer) {
|
InstantiationOptimizer instantiationOptimizer) {
|
||||||
super( javaTypeDescriptor.getJavaTypeClass() );
|
super( javaTypeDescriptor.getJavaTypeClass() );
|
||||||
this.instantiationOptimizer = instantiationOptimizer;
|
this.instantiationOptimizer = instantiationOptimizer;
|
||||||
|
|
|
@ -17,7 +17,7 @@ import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.internal.util.ReflectHelper;
|
import org.hibernate.internal.util.ReflectHelper;
|
||||||
import org.hibernate.mapping.Component;
|
import org.hibernate.mapping.Component;
|
||||||
import org.hibernate.metamodel.spi.EmbeddableInstantiator;
|
import org.hibernate.metamodel.spi.EmbeddableInstantiator;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Support for instantiating embeddables as POJO representation
|
* Support for instantiating embeddables as POJO representation
|
||||||
|
@ -31,7 +31,7 @@ public class EmbeddableInstantiatorPojoStandard extends AbstractPojoInstantiator
|
||||||
|
|
||||||
public EmbeddableInstantiatorPojoStandard(
|
public EmbeddableInstantiatorPojoStandard(
|
||||||
@SuppressWarnings("unused") Component bootDescriptor,
|
@SuppressWarnings("unused") Component bootDescriptor,
|
||||||
JavaTypeDescriptor<?> javaTypeDescriptor) {
|
JavaType<?> javaTypeDescriptor) {
|
||||||
super( javaTypeDescriptor.getJavaTypeClass() );
|
super( javaTypeDescriptor.getJavaTypeClass() );
|
||||||
|
|
||||||
constructor = resolveConstructor( javaTypeDescriptor.getJavaTypeClass() );
|
constructor = resolveConstructor( javaTypeDescriptor.getJavaTypeClass() );
|
||||||
|
|
|
@ -17,13 +17,13 @@ import org.hibernate.metamodel.spi.EmbeddableRepresentationStrategy;
|
||||||
import org.hibernate.metamodel.spi.RuntimeModelCreationContext;
|
import org.hibernate.metamodel.spi.RuntimeModelCreationContext;
|
||||||
import org.hibernate.property.access.internal.PropertyAccessStrategyMapImpl;
|
import org.hibernate.property.access.internal.PropertyAccessStrategyMapImpl;
|
||||||
import org.hibernate.property.access.spi.PropertyAccess;
|
import org.hibernate.property.access.spi.PropertyAccess;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
*/
|
*/
|
||||||
public class EmbeddableRepresentationStrategyMap implements EmbeddableRepresentationStrategy {
|
public class EmbeddableRepresentationStrategyMap implements EmbeddableRepresentationStrategy {
|
||||||
private final JavaTypeDescriptor<?> mapJtd;
|
private final JavaType<?> mapJtd;
|
||||||
private final EmbeddableInstantiator instantiator;
|
private final EmbeddableInstantiator instantiator;
|
||||||
|
|
||||||
public EmbeddableRepresentationStrategyMap(
|
public EmbeddableRepresentationStrategyMap(
|
||||||
|
@ -44,7 +44,7 @@ public class EmbeddableRepresentationStrategyMap implements EmbeddableRepresenta
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getMappedJavaTypeDescriptor() {
|
public JavaType<?> getMappedJavaTypeDescriptor() {
|
||||||
return mapJtd;
|
return mapJtd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ import org.hibernate.bytecode.spi.ReflectionOptimizer.InstantiationOptimizer;
|
||||||
import org.hibernate.engine.spi.SessionFactoryImplementor;
|
import org.hibernate.engine.spi.SessionFactoryImplementor;
|
||||||
import org.hibernate.mapping.PersistentClass;
|
import org.hibernate.mapping.PersistentClass;
|
||||||
import org.hibernate.tuple.entity.EntityMetamodel;
|
import org.hibernate.tuple.entity.EntityMetamodel;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Support for instantiating entity values as POJO representation using
|
* Support for instantiating entity values as POJO representation using
|
||||||
|
@ -24,7 +24,7 @@ public class EntityInstantiatorPojoOptimized extends AbstractEntityInstantiatorP
|
||||||
public EntityInstantiatorPojoOptimized(
|
public EntityInstantiatorPojoOptimized(
|
||||||
EntityMetamodel entityMetamodel,
|
EntityMetamodel entityMetamodel,
|
||||||
PersistentClass persistentClass,
|
PersistentClass persistentClass,
|
||||||
JavaTypeDescriptor<?> javaTypeDescriptor,
|
JavaType<?> javaTypeDescriptor,
|
||||||
InstantiationOptimizer instantiationOptimizer) {
|
InstantiationOptimizer instantiationOptimizer) {
|
||||||
super( entityMetamodel, persistentClass, javaTypeDescriptor );
|
super( entityMetamodel, persistentClass, javaTypeDescriptor );
|
||||||
this.instantiationOptimizer = instantiationOptimizer;
|
this.instantiationOptimizer = instantiationOptimizer;
|
||||||
|
|
|
@ -20,7 +20,7 @@ import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.internal.util.ReflectHelper;
|
import org.hibernate.internal.util.ReflectHelper;
|
||||||
import org.hibernate.mapping.PersistentClass;
|
import org.hibernate.mapping.PersistentClass;
|
||||||
import org.hibernate.tuple.entity.EntityMetamodel;
|
import org.hibernate.tuple.entity.EntityMetamodel;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Support for instantiating entity values as POJO representation
|
* Support for instantiating entity values as POJO representation
|
||||||
|
@ -37,7 +37,7 @@ public class EntityInstantiatorPojoStandard extends AbstractEntityInstantiatorPo
|
||||||
public EntityInstantiatorPojoStandard(
|
public EntityInstantiatorPojoStandard(
|
||||||
EntityMetamodel entityMetamodel,
|
EntityMetamodel entityMetamodel,
|
||||||
PersistentClass persistentClass,
|
PersistentClass persistentClass,
|
||||||
JavaTypeDescriptor<?> javaTypeDescriptor) {
|
JavaType<?> javaTypeDescriptor) {
|
||||||
super( entityMetamodel, persistentClass, javaTypeDescriptor );
|
super( entityMetamodel, persistentClass, javaTypeDescriptor );
|
||||||
|
|
||||||
this.entityMetamodel = entityMetamodel;
|
this.entityMetamodel = entityMetamodel;
|
||||||
|
|
|
@ -26,7 +26,7 @@ import org.hibernate.property.access.internal.PropertyAccessStrategyMapImpl;
|
||||||
import org.hibernate.property.access.spi.PropertyAccess;
|
import org.hibernate.property.access.spi.PropertyAccess;
|
||||||
import org.hibernate.proxy.ProxyFactory;
|
import org.hibernate.proxy.ProxyFactory;
|
||||||
import org.hibernate.proxy.map.MapProxyFactory;
|
import org.hibernate.proxy.map.MapProxyFactory;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
|
@ -34,7 +34,7 @@ import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
||||||
public class EntityRepresentationStrategyMap implements EntityRepresentationStrategy {
|
public class EntityRepresentationStrategyMap implements EntityRepresentationStrategy {
|
||||||
private static final CoreMessageLogger LOG = CoreLogging.messageLogger( EntityRepresentationStrategyMap.class );
|
private static final CoreMessageLogger LOG = CoreLogging.messageLogger( EntityRepresentationStrategyMap.class );
|
||||||
|
|
||||||
private final JavaTypeDescriptor<Map> mapJtd;
|
private final JavaType<Map> mapJtd;
|
||||||
|
|
||||||
private final ProxyFactory proxyFactory;
|
private final ProxyFactory proxyFactory;
|
||||||
private final EntityInstantiatorDynamicMap instantiator;
|
private final EntityInstantiatorDynamicMap instantiator;
|
||||||
|
@ -120,12 +120,12 @@ public class EntityRepresentationStrategyMap implements EntityRepresentationStra
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getMappedJavaTypeDescriptor() {
|
public JavaType<?> getMappedJavaTypeDescriptor() {
|
||||||
return mapJtd;
|
return mapJtd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getProxyJavaTypeDescriptor() {
|
public JavaType<?> getProxyJavaTypeDescriptor() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ import org.hibernate.proxy.ProxyFactory;
|
||||||
import org.hibernate.proxy.pojo.ProxyFactoryHelper;
|
import org.hibernate.proxy.pojo.ProxyFactoryHelper;
|
||||||
import org.hibernate.tuple.entity.EntityMetamodel;
|
import org.hibernate.tuple.entity.EntityMetamodel;
|
||||||
import org.hibernate.type.CompositeType;
|
import org.hibernate.type.CompositeType;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
import org.hibernate.type.descriptor.java.spi.JavaTypeDescriptorRegistry;
|
import org.hibernate.type.descriptor.java.spi.JavaTypeDescriptorRegistry;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -62,8 +62,8 @@ import org.hibernate.type.descriptor.java.spi.JavaTypeDescriptorRegistry;
|
||||||
public class EntityRepresentationStrategyPojoStandard implements EntityRepresentationStrategy {
|
public class EntityRepresentationStrategyPojoStandard implements EntityRepresentationStrategy {
|
||||||
private static final CoreMessageLogger LOG = CoreLogging.messageLogger( EntityRepresentationStrategyPojoStandard.class );
|
private static final CoreMessageLogger LOG = CoreLogging.messageLogger( EntityRepresentationStrategyPojoStandard.class );
|
||||||
|
|
||||||
private final JavaTypeDescriptor<?> mappedJtd;
|
private final JavaType<?> mappedJtd;
|
||||||
private final JavaTypeDescriptor<?> proxyJtd;
|
private final JavaType<?> proxyJtd;
|
||||||
|
|
||||||
private final boolean isBytecodeEnhanced;
|
private final boolean isBytecodeEnhanced;
|
||||||
private final boolean lifecycleImplementor;
|
private final boolean lifecycleImplementor;
|
||||||
|
@ -422,12 +422,12 @@ public class EntityRepresentationStrategyPojoStandard implements EntityRepresent
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getMappedJavaTypeDescriptor() {
|
public JavaType<?> getMappedJavaTypeDescriptor() {
|
||||||
return mappedJtd;
|
return mappedJtd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getProxyJavaTypeDescriptor() {
|
public JavaType<?> getProxyJavaTypeDescriptor() {
|
||||||
return proxyJtd;
|
return proxyJtd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ package org.hibernate.metamodel.internal;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
@ -26,7 +25,6 @@ import org.hibernate.Internal;
|
||||||
import org.hibernate.MappingException;
|
import org.hibernate.MappingException;
|
||||||
import org.hibernate.internal.EntityManagerMessageLogger;
|
import org.hibernate.internal.EntityManagerMessageLogger;
|
||||||
import org.hibernate.internal.HEMLogging;
|
import org.hibernate.internal.HEMLogging;
|
||||||
import org.hibernate.internal.log.DeprecationLogger;
|
|
||||||
import org.hibernate.internal.util.ReflectHelper;
|
import org.hibernate.internal.util.ReflectHelper;
|
||||||
import org.hibernate.internal.util.collections.CollectionHelper;
|
import org.hibernate.internal.util.collections.CollectionHelper;
|
||||||
import org.hibernate.mapping.Component;
|
import org.hibernate.mapping.Component;
|
||||||
|
@ -52,7 +50,7 @@ import org.hibernate.metamodel.model.domain.internal.MappedSuperclassTypeImpl;
|
||||||
import org.hibernate.metamodel.model.domain.internal.MappingMetamodelImpl;
|
import org.hibernate.metamodel.model.domain.internal.MappingMetamodelImpl;
|
||||||
import org.hibernate.metamodel.spi.EmbeddableRepresentationStrategy;
|
import org.hibernate.metamodel.spi.EmbeddableRepresentationStrategy;
|
||||||
import org.hibernate.metamodel.spi.RuntimeModelCreationContext;
|
import org.hibernate.metamodel.spi.RuntimeModelCreationContext;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
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.spi.TypeConfiguration;
|
import org.hibernate.type.spi.TypeConfiguration;
|
||||||
|
|
||||||
|
@ -428,7 +426,7 @@ public class MetadataContext {
|
||||||
final JavaTypeDescriptorRegistry registry = getTypeConfiguration()
|
final JavaTypeDescriptorRegistry registry = getTypeConfiguration()
|
||||||
.getJavaTypeDescriptorRegistry();
|
.getJavaTypeDescriptorRegistry();
|
||||||
final Class<?> componentClass = identifier.getComponentClass();
|
final Class<?> componentClass = identifier.getComponentClass();
|
||||||
final JavaTypeDescriptor<?> javaTypeDescriptor = registry.resolveManagedTypeDescriptor( componentClass );
|
final JavaType<?> javaTypeDescriptor = registry.resolveManagedTypeDescriptor( componentClass );
|
||||||
|
|
||||||
final EmbeddableRepresentationStrategy representationStrategy = getTypeConfiguration()
|
final EmbeddableRepresentationStrategy representationStrategy = getTypeConfiguration()
|
||||||
.getMetadataBuildingContext()
|
.getMetadataBuildingContext()
|
||||||
|
|
|
@ -8,13 +8,11 @@ package org.hibernate.metamodel.internal;
|
||||||
|
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
|
|
||||||
import org.hibernate.InstantiationException;
|
|
||||||
import org.hibernate.PropertyNotFoundException;
|
import org.hibernate.PropertyNotFoundException;
|
||||||
import org.hibernate.engine.spi.SessionFactoryImplementor;
|
|
||||||
import org.hibernate.internal.CoreLogging;
|
import org.hibernate.internal.CoreLogging;
|
||||||
import org.hibernate.internal.CoreMessageLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.internal.util.ReflectHelper;
|
import org.hibernate.internal.util.ReflectHelper;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
|
@ -25,7 +23,7 @@ public class PojoInstantiatorImpl<J> extends AbstractPojoInstantiator {
|
||||||
private final Constructor constructor;
|
private final Constructor constructor;
|
||||||
|
|
||||||
@SuppressWarnings("WeakerAccess")
|
@SuppressWarnings("WeakerAccess")
|
||||||
public PojoInstantiatorImpl(JavaTypeDescriptor javaTypeDescriptor) {
|
public PojoInstantiatorImpl(JavaType javaTypeDescriptor) {
|
||||||
super( javaTypeDescriptor.getJavaTypeClass() );
|
super( javaTypeDescriptor.getJavaTypeClass() );
|
||||||
|
|
||||||
this.constructor = isAbstract()
|
this.constructor = isAbstract()
|
||||||
|
|
|
@ -62,7 +62,7 @@ import org.hibernate.type.CompositeType;
|
||||||
import org.hibernate.type.EntityType;
|
import org.hibernate.type.EntityType;
|
||||||
import org.hibernate.type.Type;
|
import org.hibernate.type.Type;
|
||||||
import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan;
|
import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
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.spi.TypeConfiguration;
|
import org.hibernate.type.spi.TypeConfiguration;
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ public class EmbeddableMappingType implements ManagedMappingType, SelectableMapp
|
||||||
return mappingType;
|
return mappingType;
|
||||||
}
|
}
|
||||||
|
|
||||||
private final JavaTypeDescriptor<?> embeddableJtd;
|
private final JavaType<?> embeddableJtd;
|
||||||
private final EmbeddableRepresentationStrategy representationStrategy;
|
private final EmbeddableRepresentationStrategy representationStrategy;
|
||||||
|
|
||||||
private final SessionFactoryImplementor sessionFactory;
|
private final SessionFactoryImplementor sessionFactory;
|
||||||
|
@ -526,7 +526,7 @@ public class EmbeddableMappingType implements ManagedMappingType, SelectableMapp
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor getMappedJavaTypeDescriptor() {
|
public JavaType getMappedJavaTypeDescriptor() {
|
||||||
return embeddableJtd;
|
return embeddableJtd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ import org.hibernate.sql.ast.tree.from.TableReferenceJoin;
|
||||||
import org.hibernate.sql.ast.tree.predicate.Predicate;
|
import org.hibernate.sql.ast.tree.predicate.Predicate;
|
||||||
import org.hibernate.sql.results.graph.DomainResultAssembler;
|
import org.hibernate.sql.results.graph.DomainResultAssembler;
|
||||||
import org.hibernate.sql.results.jdbc.spi.RowProcessingState;
|
import org.hibernate.sql.results.jdbc.spi.RowProcessingState;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
import static org.hibernate.bytecode.enhance.spi.LazyPropertyInitializer.UNFETCHED_PROPERTY;
|
import static org.hibernate.bytecode.enhance.spi.LazyPropertyInitializer.UNFETCHED_PROPERTY;
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ public interface EntityMappingType extends ManagedMappingType, EntityValuedModel
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
default JavaTypeDescriptor<?> getJavaTypeDescriptor() {
|
default JavaType<?> getJavaTypeDescriptor() {
|
||||||
return getMappedJavaTypeDescriptor();
|
return getMappedJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -354,7 +354,7 @@ public interface EntityMappingType extends ManagedMappingType, EntityValuedModel
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
default JavaTypeDescriptor getMappedJavaTypeDescriptor() {
|
default JavaType getMappedJavaTypeDescriptor() {
|
||||||
return getEntityPersister().getMappedJavaTypeDescriptor();
|
return getEntityPersister().getMappedJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ import org.hibernate.mapping.IndexedConsumer;
|
||||||
import org.hibernate.query.CastType;
|
import org.hibernate.query.CastType;
|
||||||
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.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -26,7 +26,7 @@ public interface JdbcMapping extends MappingType, JdbcMappingContainer {
|
||||||
* The descriptor for the Java type represented by this
|
* The descriptor for the Java type represented by this
|
||||||
* expressable type
|
* expressable type
|
||||||
*/
|
*/
|
||||||
JavaTypeDescriptor getJavaTypeDescriptor();
|
JavaType getJavaTypeDescriptor();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The descriptor for the SQL type represented by this
|
* The descriptor for the SQL type represented by this
|
||||||
|
@ -51,7 +51,7 @@ public interface JdbcMapping extends MappingType, JdbcMappingContainer {
|
||||||
ValueBinder getJdbcValueBinder();
|
ValueBinder getJdbcValueBinder();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
default JavaTypeDescriptor getMappedJavaTypeDescriptor() {
|
default JavaType getMappedJavaTypeDescriptor() {
|
||||||
return getJavaTypeDescriptor();
|
return getJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,13 +6,12 @@
|
||||||
*/
|
*/
|
||||||
package org.hibernate.metamodel.mapping;
|
package org.hibernate.metamodel.mapping;
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
import org.hibernate.mapping.IndexedConsumer;
|
import org.hibernate.mapping.IndexedConsumer;
|
||||||
import org.hibernate.sql.results.graph.FetchableContainer;
|
import org.hibernate.sql.results.graph.FetchableContainer;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Commonality in regards to the mapping type system for all managed domain
|
* Commonality in regards to the mapping type system for all managed domain
|
||||||
|
@ -22,7 +21,7 @@ import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
||||||
*/
|
*/
|
||||||
public interface ManagedMappingType extends MappingType, FetchableContainer {
|
public interface ManagedMappingType extends MappingType, FetchableContainer {
|
||||||
@Override
|
@Override
|
||||||
default JavaTypeDescriptor<?> getJavaTypeDescriptor() {
|
default JavaType<?> getJavaTypeDescriptor() {
|
||||||
return getMappedJavaTypeDescriptor();
|
return getMappedJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*/
|
*/
|
||||||
package org.hibernate.metamodel.mapping;
|
package org.hibernate.metamodel.mapping;
|
||||||
|
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parts of the ModelPart hierarchy that are type descriptors, as opposed to attributes e.g.
|
* Parts of the ModelPart hierarchy that are type descriptors, as opposed to attributes e.g.
|
||||||
|
@ -14,5 +14,5 @@ import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
*/
|
*/
|
||||||
public interface MappingType {
|
public interface MappingType {
|
||||||
JavaTypeDescriptor<?> getMappedJavaTypeDescriptor();
|
JavaType<?> getMappedJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ import org.hibernate.sql.ast.spi.SqlSelection;
|
||||||
import org.hibernate.sql.ast.tree.from.TableGroup;
|
import org.hibernate.sql.ast.tree.from.TableGroup;
|
||||||
import org.hibernate.sql.results.graph.DomainResult;
|
import org.hibernate.sql.results.graph.DomainResult;
|
||||||
import org.hibernate.sql.results.graph.DomainResultCreationState;
|
import org.hibernate.sql.results.graph.DomainResultCreationState;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes a mapping related to any part of the app's domain model - e.g.
|
* Describes a mapping related to any part of the app's domain model - e.g.
|
||||||
|
@ -32,7 +32,7 @@ import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
||||||
public interface ModelPart extends MappingModelExpressable {
|
public interface ModelPart extends MappingModelExpressable {
|
||||||
MappingType getPartMappingType();
|
MappingType getPartMappingType();
|
||||||
|
|
||||||
JavaTypeDescriptor<?> getJavaTypeDescriptor();
|
JavaType<?> getJavaTypeDescriptor();
|
||||||
|
|
||||||
String getPartName();
|
String getPartName();
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ package org.hibernate.metamodel.mapping;
|
||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypedExpressable;
|
import org.hibernate.type.descriptor.java.JavaTypedExpressable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -28,7 +28,7 @@ public interface ValueMapping extends MappingModelExpressable, JavaTypedExpressa
|
||||||
MappingType getMappedType();
|
MappingType getMappedType();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
default JavaTypeDescriptor<?> getExpressableJavaTypeDescriptor() {
|
default JavaType<?> getExpressableJavaTypeDescriptor() {
|
||||||
return getMappedType().getMappedJavaTypeDescriptor();
|
return getMappedType().getMappedJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ import org.hibernate.metamodel.mapping.AttributeMapping;
|
||||||
import org.hibernate.metamodel.mapping.ForeignKeyDescriptor;
|
import org.hibernate.metamodel.mapping.ForeignKeyDescriptor;
|
||||||
import org.hibernate.metamodel.mapping.ManagedMappingType;
|
import org.hibernate.metamodel.mapping.ManagedMappingType;
|
||||||
import org.hibernate.metamodel.mapping.MappingType;
|
import org.hibernate.metamodel.mapping.MappingType;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
|
@ -42,7 +42,7 @@ public abstract class AbstractAttributeMapping implements AttributeMapping {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getJavaTypeDescriptor() {
|
public JavaType<?> getJavaTypeDescriptor() {
|
||||||
return getMappedType().getMappedJavaTypeDescriptor();
|
return getMappedType().getMappedJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ import org.hibernate.sql.results.graph.FetchParent;
|
||||||
import org.hibernate.sql.results.graph.basic.BasicFetch;
|
import org.hibernate.sql.results.graph.basic.BasicFetch;
|
||||||
import org.hibernate.sql.results.graph.basic.BasicResult;
|
import org.hibernate.sql.results.graph.basic.BasicResult;
|
||||||
import org.hibernate.type.BasicType;
|
import org.hibernate.type.BasicType;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
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.spi.TypeConfiguration;
|
import org.hibernate.type.spi.TypeConfiguration;
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ public abstract class AbstractDiscriminatorMapping implements EntityDiscriminato
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getJavaTypeDescriptor() {
|
public JavaType<?> getJavaTypeDescriptor() {
|
||||||
return getJdbcMapping().getJavaTypeDescriptor();
|
return getJdbcMapping().getJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -283,15 +283,15 @@ public abstract class AbstractDiscriminatorMapping implements EntityDiscriminato
|
||||||
*/
|
*/
|
||||||
private final Function<Object, R> toRelationalConverter;
|
private final Function<Object, R> toRelationalConverter;
|
||||||
|
|
||||||
private final JavaTypeDescriptor<Object> domainJtd;
|
private final JavaType<Object> domainJtd;
|
||||||
private final JavaTypeDescriptor<R> relationalJtd;
|
private final JavaType<R> relationalJtd;
|
||||||
|
|
||||||
public DomainResultConverter(
|
public DomainResultConverter(
|
||||||
Function<R,String> subtypeResolver,
|
Function<R,String> subtypeResolver,
|
||||||
Function<String,Object> entityNameHandler,
|
Function<String,Object> entityNameHandler,
|
||||||
Function<Object,R> toRelationalConverter,
|
Function<Object,R> toRelationalConverter,
|
||||||
JavaTypeDescriptor<Object> domainJtd,
|
JavaType<Object> domainJtd,
|
||||||
JavaTypeDescriptor<R> relationalJtd) {
|
JavaType<R> relationalJtd) {
|
||||||
this.subtypeResolver = subtypeResolver;
|
this.subtypeResolver = subtypeResolver;
|
||||||
this.entityNameHandler = entityNameHandler;
|
this.entityNameHandler = entityNameHandler;
|
||||||
this.toRelationalConverter = toRelationalConverter;
|
this.toRelationalConverter = toRelationalConverter;
|
||||||
|
@ -307,7 +307,7 @@ public abstract class AbstractDiscriminatorMapping implements EntityDiscriminato
|
||||||
final TypeConfiguration typeConfiguration = sessionFactory.getDomainModel().getTypeConfiguration();
|
final TypeConfiguration typeConfiguration = sessionFactory.getDomainModel().getTypeConfiguration();
|
||||||
final JavaTypeDescriptorRegistry jtdRegistry = typeConfiguration.getJavaTypeDescriptorRegistry();
|
final JavaTypeDescriptorRegistry jtdRegistry = typeConfiguration.getJavaTypeDescriptorRegistry();
|
||||||
|
|
||||||
final JavaTypeDescriptor<Object> domainJtd;
|
final JavaType<Object> domainJtd;
|
||||||
final Function<String,Object> entityNameHandler;
|
final Function<String,Object> entityNameHandler;
|
||||||
final Function<Object,Object> toRelationalConverter;
|
final Function<Object,Object> toRelationalConverter;
|
||||||
|
|
||||||
|
@ -384,12 +384,12 @@ public abstract class AbstractDiscriminatorMapping implements EntityDiscriminato
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<Object> getDomainJavaDescriptor() {
|
public JavaType<Object> getDomainJavaDescriptor() {
|
||||||
return domainJtd;
|
return domainJtd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<R> getRelationalJavaDescriptor() {
|
public JavaType<R> getRelationalJavaDescriptor() {
|
||||||
return relationalJtd;
|
return relationalJtd;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ import org.hibernate.sql.results.graph.FetchOptions;
|
||||||
import org.hibernate.sql.results.graph.FetchParent;
|
import org.hibernate.sql.results.graph.FetchParent;
|
||||||
import org.hibernate.sql.results.graph.basic.BasicFetch;
|
import org.hibernate.sql.results.graph.basic.BasicFetch;
|
||||||
import org.hibernate.type.MetaType;
|
import org.hibernate.type.MetaType;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
import static org.hibernate.sql.ast.spi.SqlExpressionResolver.createColumnReferenceKey;
|
import static org.hibernate.sql.ast.spi.SqlExpressionResolver.createColumnReferenceKey;
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ public class AnyDiscriminatorPart implements BasicValuedModelPart, FetchOptions,
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getJavaTypeDescriptor() {
|
public JavaType<?> getJavaTypeDescriptor() {
|
||||||
return jdbcMapping().getMappedJavaTypeDescriptor();
|
return jdbcMapping().getMappedJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ import org.hibernate.sql.results.graph.Fetch;
|
||||||
import org.hibernate.sql.results.graph.FetchOptions;
|
import org.hibernate.sql.results.graph.FetchOptions;
|
||||||
import org.hibernate.sql.results.graph.FetchParent;
|
import org.hibernate.sql.results.graph.FetchParent;
|
||||||
import org.hibernate.sql.results.graph.basic.BasicFetch;
|
import org.hibernate.sql.results.graph.basic.BasicFetch;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Acts as a ModelPart for the key portion of an any-valued mapping
|
* Acts as a ModelPart for the key portion of an any-valued mapping
|
||||||
|
@ -97,7 +97,7 @@ public class AnyKeyPart implements BasicValuedModelPart, FetchOptions {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getJavaTypeDescriptor() {
|
public JavaType<?> getJavaTypeDescriptor() {
|
||||||
return jdbcMapping.getMappedJavaTypeDescriptor();
|
return jdbcMapping.getMappedJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ import org.hibernate.sql.results.graph.FetchParent;
|
||||||
import org.hibernate.sql.results.graph.basic.BasicFetch;
|
import org.hibernate.sql.results.graph.basic.BasicFetch;
|
||||||
import org.hibernate.sql.results.graph.basic.BasicResult;
|
import org.hibernate.sql.results.graph.basic.BasicResult;
|
||||||
import org.hibernate.tuple.ValueGeneration;
|
import org.hibernate.tuple.ValueGeneration;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
|
@ -60,7 +60,7 @@ public class BasicAttributeMapping
|
||||||
private final JdbcMapping jdbcMapping;
|
private final JdbcMapping jdbcMapping;
|
||||||
private final BasicValueConverter<Object, ?> valueConverter;
|
private final BasicValueConverter<Object, ?> valueConverter;
|
||||||
|
|
||||||
private final JavaTypeDescriptor domainTypeDescriptor;
|
private final JavaType domainTypeDescriptor;
|
||||||
|
|
||||||
@SuppressWarnings("WeakerAccess")
|
@SuppressWarnings("WeakerAccess")
|
||||||
public BasicAttributeMapping(
|
public BasicAttributeMapping(
|
||||||
|
@ -162,7 +162,7 @@ public class BasicAttributeMapping
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getJavaTypeDescriptor() {
|
public JavaType<?> getJavaTypeDescriptor() {
|
||||||
return domainTypeDescriptor;
|
return domainTypeDescriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ import org.hibernate.sql.results.graph.FetchParent;
|
||||||
import org.hibernate.sql.results.graph.basic.BasicFetch;
|
import org.hibernate.sql.results.graph.basic.BasicFetch;
|
||||||
import org.hibernate.sql.results.graph.basic.BasicResult;
|
import org.hibernate.sql.results.graph.basic.BasicResult;
|
||||||
import org.hibernate.type.BasicType;
|
import org.hibernate.type.BasicType;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Andrea Boriero
|
* @author Andrea Boriero
|
||||||
|
@ -160,7 +160,7 @@ public class BasicEntityIdentifierMappingImpl implements BasicEntityIdentifierMa
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getJavaTypeDescriptor() {
|
public JavaType<?> getJavaTypeDescriptor() {
|
||||||
return getMappedType().getMappedJavaTypeDescriptor();
|
return getMappedType().getMappedJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ import org.hibernate.sql.results.graph.FetchOptions;
|
||||||
import org.hibernate.sql.results.graph.FetchParent;
|
import org.hibernate.sql.results.graph.FetchParent;
|
||||||
import org.hibernate.sql.results.graph.basic.BasicFetch;
|
import org.hibernate.sql.results.graph.basic.BasicFetch;
|
||||||
import org.hibernate.sql.results.graph.basic.BasicResult;
|
import org.hibernate.sql.results.graph.basic.BasicResult;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Models a basic collection element/value or index/key
|
* Models a basic collection element/value or index/key
|
||||||
|
@ -109,7 +109,7 @@ public class BasicValuedCollectionPart
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getJavaTypeDescriptor() {
|
public JavaType<?> getJavaTypeDescriptor() {
|
||||||
return selectableMapping.getJdbcMapping().getJavaTypeDescriptor();
|
return selectableMapping.getJdbcMapping().getJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ import org.hibernate.sql.results.graph.FetchParent;
|
||||||
import org.hibernate.sql.results.graph.basic.BasicFetch;
|
import org.hibernate.sql.results.graph.basic.BasicFetch;
|
||||||
import org.hibernate.sql.results.graph.basic.BasicResult;
|
import org.hibernate.sql.results.graph.basic.BasicResult;
|
||||||
import org.hibernate.type.BasicType;
|
import org.hibernate.type.BasicType;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
|
@ -103,7 +103,7 @@ public class CollectionIdentifierDescriptorImpl implements CollectionIdentifierD
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getJavaTypeDescriptor() {
|
public JavaType<?> getJavaTypeDescriptor() {
|
||||||
return getMappedType().getMappedJavaTypeDescriptor();
|
return getMappedType().getMappedJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -220,7 +220,7 @@ public class CollectionIdentifierDescriptorImpl implements CollectionIdentifierD
|
||||||
return new BasicResult<>(
|
return new BasicResult<>(
|
||||||
sqlSelection.getValuesArrayPosition(),
|
sqlSelection.getValuesArrayPosition(),
|
||||||
null,
|
null,
|
||||||
(JavaTypeDescriptor<Object>) type.getJavaTypeDescriptor(),
|
(JavaType<Object>) type.getJavaTypeDescriptor(),
|
||||||
collectionPath
|
collectionPath
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ import org.hibernate.sql.results.graph.Fetchable;
|
||||||
import org.hibernate.sql.results.graph.FetchableContainer;
|
import org.hibernate.sql.results.graph.FetchableContainer;
|
||||||
import org.hibernate.sql.results.jdbc.spi.JdbcValuesSourceProcessingOptions;
|
import org.hibernate.sql.results.jdbc.spi.JdbcValuesSourceProcessingOptions;
|
||||||
import org.hibernate.sql.results.jdbc.spi.RowProcessingState;
|
import org.hibernate.sql.results.jdbc.spi.RowProcessingState;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Multi-attribute NaturalIdMapping implementation
|
* Multi-attribute NaturalIdMapping implementation
|
||||||
|
@ -59,7 +59,7 @@ public class CompoundNaturalIdMapping extends AbstractNaturalIdMapping implement
|
||||||
// todo (6.0) : create a composite MappingType for this descriptor's Object[]?
|
// todo (6.0) : create a composite MappingType for this descriptor's Object[]?
|
||||||
|
|
||||||
private final List<SingularAttributeMapping> attributes;
|
private final List<SingularAttributeMapping> attributes;
|
||||||
private final JavaTypeDescriptor<?> jtd;
|
private final JavaType<?> jtd;
|
||||||
|
|
||||||
private List<JdbcMapping> jdbcMappings;
|
private List<JdbcMapping> jdbcMappings;
|
||||||
|
|
||||||
|
@ -257,12 +257,12 @@ public class CompoundNaturalIdMapping extends AbstractNaturalIdMapping implement
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getJavaTypeDescriptor() {
|
public JavaType<?> getJavaTypeDescriptor() {
|
||||||
throw new NotYetImplementedFor6Exception( getClass() );
|
throw new NotYetImplementedFor6Exception( getClass() );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getMappedJavaTypeDescriptor() {
|
public JavaType<?> getMappedJavaTypeDescriptor() {
|
||||||
return getJavaTypeDescriptor();
|
return getJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,7 +276,7 @@ public class CompoundNaturalIdMapping extends AbstractNaturalIdMapping implement
|
||||||
|
|
||||||
final SessionFactoryImplementor sessionFactory = creationState.getSqlAstCreationState().getCreationContext().getSessionFactory();
|
final SessionFactoryImplementor sessionFactory = creationState.getSqlAstCreationState().getCreationContext().getSessionFactory();
|
||||||
|
|
||||||
final JavaTypeDescriptor<Object[]> jtd = sessionFactory
|
final JavaType<Object[]> jtd = sessionFactory
|
||||||
.getTypeConfiguration()
|
.getTypeConfiguration()
|
||||||
.getJavaTypeDescriptorRegistry()
|
.getJavaTypeDescriptorRegistry()
|
||||||
.getDescriptor( Object[].class );
|
.getDescriptor( Object[].class );
|
||||||
|
@ -451,7 +451,7 @@ public class CompoundNaturalIdMapping extends AbstractNaturalIdMapping implement
|
||||||
public static class DomainResultImpl implements DomainResult<Object[]>, FetchParent {
|
public static class DomainResultImpl implements DomainResult<Object[]>, FetchParent {
|
||||||
private final NavigablePath navigablePath;
|
private final NavigablePath navigablePath;
|
||||||
private final CompoundNaturalIdMapping naturalIdMapping;
|
private final CompoundNaturalIdMapping naturalIdMapping;
|
||||||
private final JavaTypeDescriptor<Object[]> arrayJtd;
|
private final JavaType<Object[]> arrayJtd;
|
||||||
|
|
||||||
private final List<Fetch> fetches;
|
private final List<Fetch> fetches;
|
||||||
|
|
||||||
|
@ -460,7 +460,7 @@ public class CompoundNaturalIdMapping extends AbstractNaturalIdMapping implement
|
||||||
public DomainResultImpl(
|
public DomainResultImpl(
|
||||||
NavigablePath navigablePath,
|
NavigablePath navigablePath,
|
||||||
CompoundNaturalIdMapping naturalIdMapping,
|
CompoundNaturalIdMapping naturalIdMapping,
|
||||||
JavaTypeDescriptor<Object[]> arrayJtd,
|
JavaType<Object[]> arrayJtd,
|
||||||
String resultVariable,
|
String resultVariable,
|
||||||
DomainResultCreationState creationState) {
|
DomainResultCreationState creationState) {
|
||||||
this.navigablePath = navigablePath;
|
this.navigablePath = navigablePath;
|
||||||
|
@ -491,7 +491,7 @@ public class CompoundNaturalIdMapping extends AbstractNaturalIdMapping implement
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<Object[]> getResultJavaTypeDescriptor() {
|
public JavaType<Object[]> getResultJavaTypeDescriptor() {
|
||||||
return arrayJtd;
|
return arrayJtd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -537,7 +537,7 @@ public class CompoundNaturalIdMapping extends AbstractNaturalIdMapping implement
|
||||||
private static class AssemblerImpl implements DomainResultAssembler<Object[]> {
|
private static class AssemblerImpl implements DomainResultAssembler<Object[]> {
|
||||||
private final NavigablePath navigablePath;
|
private final NavigablePath navigablePath;
|
||||||
private final CompoundNaturalIdMapping naturalIdMapping;
|
private final CompoundNaturalIdMapping naturalIdMapping;
|
||||||
private final JavaTypeDescriptor<Object[]> jtd;
|
private final JavaType<Object[]> jtd;
|
||||||
|
|
||||||
private final List<DomainResultAssembler<?>> subAssemblers;
|
private final List<DomainResultAssembler<?>> subAssemblers;
|
||||||
|
|
||||||
|
@ -545,7 +545,7 @@ public class CompoundNaturalIdMapping extends AbstractNaturalIdMapping implement
|
||||||
List<Fetch> fetches,
|
List<Fetch> fetches,
|
||||||
NavigablePath navigablePath,
|
NavigablePath navigablePath,
|
||||||
CompoundNaturalIdMapping naturalIdMapping,
|
CompoundNaturalIdMapping naturalIdMapping,
|
||||||
JavaTypeDescriptor<Object[]> jtd,
|
JavaType<Object[]> jtd,
|
||||||
AssemblerCreationState creationState) {
|
AssemblerCreationState creationState) {
|
||||||
this.navigablePath = navigablePath;
|
this.navigablePath = navigablePath;
|
||||||
this.naturalIdMapping = naturalIdMapping;
|
this.naturalIdMapping = naturalIdMapping;
|
||||||
|
@ -575,7 +575,7 @@ public class CompoundNaturalIdMapping extends AbstractNaturalIdMapping implement
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<Object[]> getAssembledJavaTypeDescriptor() {
|
public JavaType<Object[]> getAssembledJavaTypeDescriptor() {
|
||||||
return jtd;
|
return jtd;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ import org.hibernate.sql.results.graph.Fetch;
|
||||||
import org.hibernate.sql.results.graph.FetchParent;
|
import org.hibernate.sql.results.graph.FetchParent;
|
||||||
import org.hibernate.sql.results.graph.Fetchable;
|
import org.hibernate.sql.results.graph.Fetchable;
|
||||||
import org.hibernate.type.AnyType;
|
import org.hibernate.type.AnyType;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
import org.hibernate.type.descriptor.java.MutabilityPlan;
|
import org.hibernate.type.descriptor.java.MutabilityPlan;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -58,7 +58,7 @@ public class DiscriminatedAssociationAttributeMapping
|
||||||
|
|
||||||
public DiscriminatedAssociationAttributeMapping(
|
public DiscriminatedAssociationAttributeMapping(
|
||||||
NavigableRole attributeRole,
|
NavigableRole attributeRole,
|
||||||
JavaTypeDescriptor<?> baseAssociationJtd,
|
JavaType<?> baseAssociationJtd,
|
||||||
ManagedMappingType declaringType,
|
ManagedMappingType declaringType,
|
||||||
int stateArrayPosition,
|
int stateArrayPosition,
|
||||||
StateArrayContributorMetadataAccess attributeMetadataAccess,
|
StateArrayContributorMetadataAccess attributeMetadataAccess,
|
||||||
|
|
|
@ -47,7 +47,7 @@ import org.hibernate.sql.results.jdbc.spi.RowProcessingState;
|
||||||
import org.hibernate.type.AnyType;
|
import org.hibernate.type.AnyType;
|
||||||
import org.hibernate.type.BasicType;
|
import org.hibernate.type.BasicType;
|
||||||
import org.hibernate.type.MetaType;
|
import org.hibernate.type.MetaType;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the "type" of an any-valued mapping
|
* Represents the "type" of an any-valued mapping
|
||||||
|
@ -58,7 +58,7 @@ public class DiscriminatedAssociationMapping implements MappingType, FetchOption
|
||||||
|
|
||||||
public static DiscriminatedAssociationMapping from(
|
public static DiscriminatedAssociationMapping from(
|
||||||
NavigableRole containerRole,
|
NavigableRole containerRole,
|
||||||
JavaTypeDescriptor<?> baseAssociationJtd,
|
JavaType<?> baseAssociationJtd,
|
||||||
DiscriminatedAssociationModelPart declaringModelPart,
|
DiscriminatedAssociationModelPart declaringModelPart,
|
||||||
AnyType anyType,
|
AnyType anyType,
|
||||||
Any bootValueMapping,
|
Any bootValueMapping,
|
||||||
|
@ -119,7 +119,7 @@ public class DiscriminatedAssociationMapping implements MappingType, FetchOption
|
||||||
private final AnyDiscriminatorPart discriminatorPart;
|
private final AnyDiscriminatorPart discriminatorPart;
|
||||||
private final BasicValuedModelPart keyPart;
|
private final BasicValuedModelPart keyPart;
|
||||||
|
|
||||||
private final JavaTypeDescriptor<?> baseAssociationJtd;
|
private final JavaType<?> baseAssociationJtd;
|
||||||
|
|
||||||
private final FetchTiming fetchTiming;
|
private final FetchTiming fetchTiming;
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ public class DiscriminatedAssociationMapping implements MappingType, FetchOption
|
||||||
DiscriminatedAssociationModelPart modelPart,
|
DiscriminatedAssociationModelPart modelPart,
|
||||||
AnyDiscriminatorPart discriminatorPart,
|
AnyDiscriminatorPart discriminatorPart,
|
||||||
BasicValuedModelPart keyPart,
|
BasicValuedModelPart keyPart,
|
||||||
JavaTypeDescriptor<?> baseAssociationJtd,
|
JavaType<?> baseAssociationJtd,
|
||||||
FetchTiming fetchTiming,
|
FetchTiming fetchTiming,
|
||||||
Map<Object,String> discriminatorValueMappings,
|
Map<Object,String> discriminatorValueMappings,
|
||||||
SessionFactoryImplementor sessionFactory) {
|
SessionFactoryImplementor sessionFactory) {
|
||||||
|
@ -289,12 +289,12 @@ public class DiscriminatedAssociationMapping implements MappingType, FetchOption
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public JavaTypeDescriptor<?> getJavaTypeDescriptor() {
|
public JavaType<?> getJavaTypeDescriptor() {
|
||||||
return baseAssociationJtd;
|
return baseAssociationJtd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getMappedJavaTypeDescriptor() {
|
public JavaType<?> getMappedJavaTypeDescriptor() {
|
||||||
return baseAssociationJtd;
|
return baseAssociationJtd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -342,7 +342,7 @@ public class DiscriminatedAssociationMapping implements MappingType, FetchOption
|
||||||
private final NavigablePath navigablePath;
|
private final NavigablePath navigablePath;
|
||||||
|
|
||||||
private final DiscriminatedAssociationModelPart graphedPart;
|
private final DiscriminatedAssociationModelPart graphedPart;
|
||||||
private final JavaTypeDescriptor<?> baseAssociationJtd;
|
private final JavaType<?> baseAssociationJtd;
|
||||||
|
|
||||||
private Fetch discriminatorValueFetch;
|
private Fetch discriminatorValueFetch;
|
||||||
private Fetch keyValueFetch;
|
private Fetch keyValueFetch;
|
||||||
|
@ -350,7 +350,7 @@ public class DiscriminatedAssociationMapping implements MappingType, FetchOption
|
||||||
public AnyValuedResultGraphNode(
|
public AnyValuedResultGraphNode(
|
||||||
NavigablePath navigablePath,
|
NavigablePath navigablePath,
|
||||||
DiscriminatedAssociationModelPart graphedPart,
|
DiscriminatedAssociationModelPart graphedPart,
|
||||||
JavaTypeDescriptor<?> baseAssociationJtd) {
|
JavaType<?> baseAssociationJtd) {
|
||||||
this.navigablePath = navigablePath;
|
this.navigablePath = navigablePath;
|
||||||
this.graphedPart = graphedPart;
|
this.graphedPart = graphedPart;
|
||||||
this.baseAssociationJtd = baseAssociationJtd;
|
this.baseAssociationJtd = baseAssociationJtd;
|
||||||
|
@ -372,7 +372,7 @@ public class DiscriminatedAssociationMapping implements MappingType, FetchOption
|
||||||
return keyValueFetch;
|
return keyValueFetch;
|
||||||
}
|
}
|
||||||
|
|
||||||
public JavaTypeDescriptor<?> getBaseAssociationJtd() {
|
public JavaType<?> getBaseAssociationJtd() {
|
||||||
return baseAssociationJtd;
|
return baseAssociationJtd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -382,7 +382,7 @@ public class DiscriminatedAssociationMapping implements MappingType, FetchOption
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getResultJavaTypeDescriptor() {
|
public JavaType<?> getResultJavaTypeDescriptor() {
|
||||||
return baseAssociationJtd;
|
return baseAssociationJtd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -428,7 +428,7 @@ public class DiscriminatedAssociationMapping implements MappingType, FetchOption
|
||||||
|
|
||||||
public AnyValuedResult(
|
public AnyValuedResult(
|
||||||
NavigablePath navigablePath,
|
NavigablePath navigablePath,
|
||||||
JavaTypeDescriptor<?> baseAssociationJtd,
|
JavaType<?> baseAssociationJtd,
|
||||||
DiscriminatedAssociationModelPart fetchedPart,
|
DiscriminatedAssociationModelPart fetchedPart,
|
||||||
String resultVariable) {
|
String resultVariable) {
|
||||||
super( navigablePath, fetchedPart, baseAssociationJtd );
|
super( navigablePath, fetchedPart, baseAssociationJtd );
|
||||||
|
@ -458,7 +458,7 @@ public class DiscriminatedAssociationMapping implements MappingType, FetchOption
|
||||||
|
|
||||||
public AnyValuedFetch(
|
public AnyValuedFetch(
|
||||||
NavigablePath navigablePath,
|
NavigablePath navigablePath,
|
||||||
JavaTypeDescriptor<?> baseAssociationJtd,
|
JavaType<?> baseAssociationJtd,
|
||||||
DiscriminatedAssociationModelPart fetchedPart,
|
DiscriminatedAssociationModelPart fetchedPart,
|
||||||
FetchTiming fetchTiming,
|
FetchTiming fetchTiming,
|
||||||
FetchParent fetchParent,
|
FetchParent fetchParent,
|
||||||
|
@ -563,9 +563,9 @@ public class DiscriminatedAssociationMapping implements MappingType, FetchOption
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<T> getAssembledJavaTypeDescriptor() {
|
public JavaType<T> getAssembledJavaTypeDescriptor() {
|
||||||
//noinspection unchecked
|
//noinspection unchecked
|
||||||
return (JavaTypeDescriptor<T>) fetchedPart.getJavaTypeDescriptor();
|
return (JavaType<T>) fetchedPart.getJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -29,7 +29,7 @@ import org.hibernate.sql.results.graph.Fetch;
|
||||||
import org.hibernate.sql.results.graph.FetchOptions;
|
import org.hibernate.sql.results.graph.FetchOptions;
|
||||||
import org.hibernate.sql.results.graph.FetchParent;
|
import org.hibernate.sql.results.graph.FetchParent;
|
||||||
import org.hibernate.type.AnyType;
|
import org.hibernate.type.AnyType;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
|
@ -44,7 +44,7 @@ public class DiscriminatedCollectionPart implements DiscriminatedAssociationMode
|
||||||
public DiscriminatedCollectionPart(
|
public DiscriminatedCollectionPart(
|
||||||
Nature nature,
|
Nature nature,
|
||||||
CollectionPersister collectionDescriptor,
|
CollectionPersister collectionDescriptor,
|
||||||
JavaTypeDescriptor<Object> baseAssociationJtd,
|
JavaType<Object> baseAssociationJtd,
|
||||||
Any bootValueMapping,
|
Any bootValueMapping,
|
||||||
AnyType anyType,
|
AnyType anyType,
|
||||||
MappingModelCreationProcess creationProcess) {
|
MappingModelCreationProcess creationProcess) {
|
||||||
|
@ -140,7 +140,7 @@ public class DiscriminatedCollectionPart implements DiscriminatedAssociationMode
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getJavaTypeDescriptor() {
|
public JavaType<?> getJavaTypeDescriptor() {
|
||||||
return discriminatorMapping.getJavaTypeDescriptor();
|
return discriminatorMapping.getJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ import org.hibernate.sql.results.graph.FetchParent;
|
||||||
import org.hibernate.sql.results.graph.embeddable.EmbeddableValuedFetchable;
|
import org.hibernate.sql.results.graph.embeddable.EmbeddableValuedFetchable;
|
||||||
import org.hibernate.sql.results.graph.embeddable.internal.EmbeddableFetchImpl;
|
import org.hibernate.sql.results.graph.embeddable.internal.EmbeddableFetchImpl;
|
||||||
import org.hibernate.sql.results.graph.embeddable.internal.EmbeddableResultImpl;
|
import org.hibernate.sql.results.graph.embeddable.internal.EmbeddableResultImpl;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
|
@ -251,7 +251,7 @@ public class EmbeddedCollectionPart implements CollectionPart, EmbeddableValuedF
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getJavaTypeDescriptor() {
|
public JavaType<?> getJavaTypeDescriptor() {
|
||||||
return getEmbeddableTypeDescriptor().getJavaTypeDescriptor();
|
return getEmbeddableTypeDescriptor().getJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ import org.hibernate.sql.ast.tree.predicate.Predicate;
|
||||||
import org.hibernate.sql.results.graph.DomainResult;
|
import org.hibernate.sql.results.graph.DomainResult;
|
||||||
import org.hibernate.sql.results.graph.DomainResultCreationState;
|
import org.hibernate.sql.results.graph.DomainResultCreationState;
|
||||||
import org.hibernate.sql.results.graph.embeddable.internal.EmbeddableForeignKeyResultImpl;
|
import org.hibernate.sql.results.graph.embeddable.internal.EmbeddableForeignKeyResultImpl;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Andrea Boriero
|
* @author Andrea Boriero
|
||||||
|
@ -479,7 +479,7 @@ public class EmbeddedForeignKeyDescriptor implements ForeignKeyDescriptor {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getJavaTypeDescriptor() {
|
public JavaType<?> getJavaTypeDescriptor() {
|
||||||
return targetSide.getModelPart().getJavaTypeDescriptor();
|
return targetSide.getModelPart().getJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,14 +34,13 @@ import org.hibernate.sql.ast.tree.from.TableGroup;
|
||||||
import org.hibernate.sql.ast.tree.from.TableGroupJoin;
|
import org.hibernate.sql.ast.tree.from.TableGroupJoin;
|
||||||
import org.hibernate.sql.results.graph.DomainResult;
|
import org.hibernate.sql.results.graph.DomainResult;
|
||||||
import org.hibernate.sql.results.graph.DomainResultCreationState;
|
import org.hibernate.sql.results.graph.DomainResultCreationState;
|
||||||
import org.hibernate.sql.results.graph.Fetch;
|
|
||||||
import org.hibernate.sql.results.graph.FetchOptions;
|
import org.hibernate.sql.results.graph.FetchOptions;
|
||||||
import org.hibernate.sql.results.graph.FetchParent;
|
import org.hibernate.sql.results.graph.FetchParent;
|
||||||
import org.hibernate.sql.results.graph.collection.internal.EntityCollectionPartTableGroup;
|
import org.hibernate.sql.results.graph.collection.internal.EntityCollectionPartTableGroup;
|
||||||
import org.hibernate.sql.results.graph.entity.EntityFetch;
|
import org.hibernate.sql.results.graph.entity.EntityFetch;
|
||||||
import org.hibernate.sql.results.graph.entity.EntityValuedFetchable;
|
import org.hibernate.sql.results.graph.entity.EntityValuedFetchable;
|
||||||
import org.hibernate.sql.results.graph.entity.internal.EntityFetchJoinedImpl;
|
import org.hibernate.sql.results.graph.entity.internal.EntityFetchJoinedImpl;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
|
@ -115,7 +114,7 @@ public class EntityCollectionPart
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getJavaTypeDescriptor() {
|
public JavaType<?> getJavaTypeDescriptor() {
|
||||||
return getEntityMappingType().getJavaTypeDescriptor();
|
return getEntityMappingType().getJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ import org.hibernate.sql.results.graph.DomainResult;
|
||||||
import org.hibernate.sql.results.graph.DomainResultCreationState;
|
import org.hibernate.sql.results.graph.DomainResultCreationState;
|
||||||
import org.hibernate.sql.results.graph.basic.BasicResult;
|
import org.hibernate.sql.results.graph.basic.BasicResult;
|
||||||
import org.hibernate.type.BasicType;
|
import org.hibernate.type.BasicType;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Nathan Xu
|
* @author Nathan Xu
|
||||||
|
@ -57,7 +57,7 @@ public class EntityRowIdMappingImpl implements EntityRowIdMapping, SelectableMap
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getJavaTypeDescriptor() {
|
public JavaType<?> getJavaTypeDescriptor() {
|
||||||
return rowIdType.getJavaTypeDescriptor();
|
return rowIdType.getJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ import org.hibernate.sql.results.graph.FetchParent;
|
||||||
import org.hibernate.sql.results.graph.basic.BasicFetch;
|
import org.hibernate.sql.results.graph.basic.BasicFetch;
|
||||||
import org.hibernate.sql.results.graph.basic.BasicResult;
|
import org.hibernate.sql.results.graph.basic.BasicResult;
|
||||||
import org.hibernate.type.BasicType;
|
import org.hibernate.type.BasicType;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
|
@ -106,7 +106,7 @@ public class EntityVersionMappingImpl implements EntityVersionMapping, FetchOpti
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getJavaTypeDescriptor() {
|
public JavaType<?> getJavaTypeDescriptor() {
|
||||||
return versionBasicType.getJavaTypeDescriptor();
|
return versionBasicType.getJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@ import org.hibernate.type.EntityType;
|
||||||
import org.hibernate.type.ForeignKeyDirection;
|
import org.hibernate.type.ForeignKeyDirection;
|
||||||
import org.hibernate.type.Type;
|
import org.hibernate.type.Type;
|
||||||
import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan;
|
import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
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.java.spi.JavaTypeDescriptorRegistry;
|
import org.hibernate.type.descriptor.java.spi.JavaTypeDescriptorRegistry;
|
||||||
import org.hibernate.type.spi.TypeConfiguration;
|
import org.hibernate.type.spi.TypeConfiguration;
|
||||||
|
@ -1422,7 +1422,7 @@ public class MappingModelCreationHelper {
|
||||||
final SessionFactoryImplementor sessionFactory = creationProcess.getCreationContext().getSessionFactory();
|
final SessionFactoryImplementor sessionFactory = creationProcess.getCreationContext().getSessionFactory();
|
||||||
final TypeConfiguration typeConfiguration = sessionFactory.getTypeConfiguration();
|
final TypeConfiguration typeConfiguration = sessionFactory.getTypeConfiguration();
|
||||||
final JavaTypeDescriptorRegistry jtdRegistry = typeConfiguration.getJavaTypeDescriptorRegistry();
|
final JavaTypeDescriptorRegistry jtdRegistry = typeConfiguration.getJavaTypeDescriptorRegistry();
|
||||||
final JavaTypeDescriptor<Object> baseJtd = jtdRegistry.getDescriptor(Object.class);
|
final JavaType<Object> baseJtd = jtdRegistry.getDescriptor(Object.class);
|
||||||
|
|
||||||
return new DiscriminatedCollectionPart(
|
return new DiscriminatedCollectionPart(
|
||||||
CollectionPart.Nature.ELEMENT,
|
CollectionPart.Nature.ELEMENT,
|
||||||
|
@ -1478,12 +1478,12 @@ public class MappingModelCreationHelper {
|
||||||
|
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
private static class CollectionMappingTypeImpl implements CollectionMappingType {
|
private static class CollectionMappingTypeImpl implements CollectionMappingType {
|
||||||
private final JavaTypeDescriptor collectionJtd;
|
private final JavaType collectionJtd;
|
||||||
private final CollectionSemantics semantics;
|
private final CollectionSemantics semantics;
|
||||||
|
|
||||||
@SuppressWarnings("WeakerAccess")
|
@SuppressWarnings("WeakerAccess")
|
||||||
public CollectionMappingTypeImpl(
|
public CollectionMappingTypeImpl(
|
||||||
JavaTypeDescriptor collectionJtd,
|
JavaType collectionJtd,
|
||||||
CollectionSemantics semantics) {
|
CollectionSemantics semantics) {
|
||||||
this.collectionJtd = collectionJtd;
|
this.collectionJtd = collectionJtd;
|
||||||
this.semantics = semantics;
|
this.semantics = semantics;
|
||||||
|
@ -1495,7 +1495,7 @@ public class MappingModelCreationHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor getMappedJavaTypeDescriptor() {
|
public JavaType getMappedJavaTypeDescriptor() {
|
||||||
return collectionJtd;
|
return collectionJtd;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ import org.hibernate.sql.results.graph.Fetch;
|
||||||
import org.hibernate.sql.results.graph.FetchOptions;
|
import org.hibernate.sql.results.graph.FetchOptions;
|
||||||
import org.hibernate.sql.results.graph.FetchParent;
|
import org.hibernate.sql.results.graph.FetchParent;
|
||||||
import org.hibernate.sql.results.graph.basic.BasicResult;
|
import org.hibernate.sql.results.graph.basic.BasicResult;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
|
@ -356,7 +356,7 @@ public class SimpleForeignKeyDescriptor implements ForeignKeyDescriptor, BasicVa
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getJavaTypeDescriptor() {
|
public JavaType<?> getJavaTypeDescriptor() {
|
||||||
return targetSide.getModelPart().getJdbcMapping().getJavaTypeDescriptor();
|
return targetSide.getModelPart().getJdbcMapping().getJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,13 +32,13 @@ import org.hibernate.sql.ast.spi.SqlSelection;
|
||||||
import org.hibernate.sql.ast.tree.from.TableGroup;
|
import org.hibernate.sql.ast.tree.from.TableGroup;
|
||||||
import org.hibernate.sql.results.graph.DomainResult;
|
import org.hibernate.sql.results.graph.DomainResult;
|
||||||
import org.hibernate.sql.results.graph.DomainResultCreationState;
|
import org.hibernate.sql.results.graph.DomainResultCreationState;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
import org.hibernate.type.spi.TypeConfiguration;
|
import org.hibernate.type.spi.TypeConfiguration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Single-attribute NaturalIdMapping implementation
|
* Single-attribute NaturalIdMapping implementation
|
||||||
*/
|
*/
|
||||||
public class SimpleNaturalIdMapping extends AbstractNaturalIdMapping implements JavaTypeDescriptor.CoercionContext {
|
public class SimpleNaturalIdMapping extends AbstractNaturalIdMapping implements JavaType.CoercionContext {
|
||||||
private final SingularAttributeMapping attribute;
|
private final SingularAttributeMapping attribute;
|
||||||
private final TypeConfiguration typeConfiguration;
|
private final TypeConfiguration typeConfiguration;
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ public class SimpleNaturalIdMapping extends AbstractNaturalIdMapping implements
|
||||||
@Override
|
@Override
|
||||||
public int calculateHashCode(Object value, SharedSessionContractImplementor session) {
|
public int calculateHashCode(Object value, SharedSessionContractImplementor session) {
|
||||||
//noinspection unchecked
|
//noinspection unchecked
|
||||||
return value == null ? 0 : ( (JavaTypeDescriptor<Object>) getJavaTypeDescriptor() ).extractHashCode( value );
|
return value == null ? 0 : ( (JavaType<Object>) getJavaTypeDescriptor() ).extractHashCode( value );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -181,7 +181,7 @@ public class SimpleNaturalIdMapping extends AbstractNaturalIdMapping implements
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<?> getJavaTypeDescriptor() {
|
public JavaType<?> getJavaTypeDescriptor() {
|
||||||
return attribute.getJavaTypeDescriptor();
|
return attribute.getJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ import org.hibernate.metamodel.model.convert.internal.JpaAttributeConverterImpl;
|
||||||
import org.hibernate.metamodel.model.convert.spi.BasicValueConverter;
|
import org.hibernate.metamodel.model.convert.spi.BasicValueConverter;
|
||||||
import org.hibernate.resource.beans.spi.ManagedBean;
|
import org.hibernate.resource.beans.spi.ManagedBean;
|
||||||
import org.hibernate.resource.beans.spi.ManagedBeanRegistry;
|
import org.hibernate.resource.beans.spi.ManagedBeanRegistry;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
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.spi.TypeConfiguration;
|
import org.hibernate.type.spi.TypeConfiguration;
|
||||||
|
|
||||||
|
@ -25,8 +25,8 @@ import org.hibernate.type.spi.TypeConfiguration;
|
||||||
*/
|
*/
|
||||||
public class Converters {
|
public class Converters {
|
||||||
public static <O,R> BasicValueConverter<O,R> jpaAttributeConverter(
|
public static <O,R> BasicValueConverter<O,R> jpaAttributeConverter(
|
||||||
JavaTypeDescriptor<R> relationalJtd,
|
JavaType<R> relationalJtd,
|
||||||
JavaTypeDescriptor<O> domainJtd,
|
JavaType<O> domainJtd,
|
||||||
Class<? extends AttributeConverter<O,R>> converterClass,
|
Class<? extends AttributeConverter<O,R>> converterClass,
|
||||||
SessionFactory factory) {
|
SessionFactory factory) {
|
||||||
final SessionFactoryImplementor sfi = (SessionFactoryImplementor) factory;
|
final SessionFactoryImplementor sfi = (SessionFactoryImplementor) factory;
|
||||||
|
@ -36,7 +36,7 @@ public class Converters {
|
||||||
|
|
||||||
final TypeConfiguration typeConfiguration = sfi.getTypeConfiguration();
|
final TypeConfiguration typeConfiguration = sfi.getTypeConfiguration();
|
||||||
final JavaTypeDescriptorRegistry jtdRegistry = typeConfiguration.getJavaTypeDescriptorRegistry();
|
final JavaTypeDescriptorRegistry jtdRegistry = typeConfiguration.getJavaTypeDescriptorRegistry();
|
||||||
final JavaTypeDescriptor<? extends AttributeConverter<O, R>> converterJtd = jtdRegistry.getDescriptor( converterClass );
|
final JavaType<? extends AttributeConverter<O, R>> converterJtd = jtdRegistry.getDescriptor( converterClass );
|
||||||
|
|
||||||
return new JpaAttributeConverterImpl<>( converterBean, converterJtd, domainJtd, relationalJtd );
|
return new JpaAttributeConverterImpl<>( converterBean, converterJtd, domainJtd, relationalJtd );
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,13 +8,11 @@ package org.hibernate.metamodel.model.convert.internal;
|
||||||
|
|
||||||
import jakarta.persistence.AttributeConverter;
|
import jakarta.persistence.AttributeConverter;
|
||||||
|
|
||||||
import org.hibernate.annotations.Immutable;
|
|
||||||
import org.hibernate.boot.model.convert.spi.JpaAttributeConverterCreationContext;
|
import org.hibernate.boot.model.convert.spi.JpaAttributeConverterCreationContext;
|
||||||
import org.hibernate.metamodel.model.convert.spi.JpaAttributeConverter;
|
import org.hibernate.metamodel.model.convert.spi.JpaAttributeConverter;
|
||||||
import org.hibernate.resource.beans.spi.ManagedBean;
|
import org.hibernate.resource.beans.spi.ManagedBean;
|
||||||
import org.hibernate.type.descriptor.converter.AttributeConverterMutabilityPlanImpl;
|
import org.hibernate.type.descriptor.converter.AttributeConverterMutabilityPlanImpl;
|
||||||
import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
|
||||||
import org.hibernate.type.descriptor.java.MutabilityPlan;
|
import org.hibernate.type.descriptor.java.MutabilityPlan;
|
||||||
import org.hibernate.type.descriptor.java.spi.JavaTypeDescriptorRegistry;
|
import org.hibernate.type.descriptor.java.spi.JavaTypeDescriptorRegistry;
|
||||||
import org.hibernate.type.descriptor.java.spi.RegistryHelper;
|
import org.hibernate.type.descriptor.java.spi.RegistryHelper;
|
||||||
|
@ -26,15 +24,15 @@ import org.hibernate.type.descriptor.java.spi.RegistryHelper;
|
||||||
*/
|
*/
|
||||||
public class JpaAttributeConverterImpl<O,R> implements JpaAttributeConverter<O,R> {
|
public class JpaAttributeConverterImpl<O,R> implements JpaAttributeConverter<O,R> {
|
||||||
private final ManagedBean<? extends AttributeConverter<O,R>> attributeConverterBean;
|
private final ManagedBean<? extends AttributeConverter<O,R>> attributeConverterBean;
|
||||||
private final JavaTypeDescriptor<? extends AttributeConverter<O, R>> converterJtd;
|
private final JavaType<? extends AttributeConverter<O, R>> converterJtd;
|
||||||
private final JavaTypeDescriptor<O> domainJtd;
|
private final JavaType<O> domainJtd;
|
||||||
private final JavaTypeDescriptor<R> jdbcJtd;
|
private final JavaType<R> jdbcJtd;
|
||||||
|
|
||||||
public JpaAttributeConverterImpl(
|
public JpaAttributeConverterImpl(
|
||||||
ManagedBean<? extends AttributeConverter<O, R>> attributeConverterBean,
|
ManagedBean<? extends AttributeConverter<O, R>> attributeConverterBean,
|
||||||
JavaTypeDescriptor<? extends AttributeConverter<O,R>> converterJtd,
|
JavaType<? extends AttributeConverter<O,R>> converterJtd,
|
||||||
JavaTypeDescriptor<O> domainJtd,
|
JavaType<O> domainJtd,
|
||||||
JavaTypeDescriptor<R> jdbcJtd) {
|
JavaType<R> jdbcJtd) {
|
||||||
this.attributeConverterBean = attributeConverterBean;
|
this.attributeConverterBean = attributeConverterBean;
|
||||||
this.converterJtd = converterJtd;
|
this.converterJtd = converterJtd;
|
||||||
this.domainJtd = domainJtd;
|
this.domainJtd = domainJtd;
|
||||||
|
@ -43,7 +41,7 @@ public class JpaAttributeConverterImpl<O,R> implements JpaAttributeConverter<O,R
|
||||||
|
|
||||||
public JpaAttributeConverterImpl(
|
public JpaAttributeConverterImpl(
|
||||||
ManagedBean<? extends AttributeConverter<O,R>> attributeConverterBean,
|
ManagedBean<? extends AttributeConverter<O,R>> attributeConverterBean,
|
||||||
JavaTypeDescriptor<? extends AttributeConverter<O,R>> converterJtd,
|
JavaType<? extends AttributeConverter<O,R>> converterJtd,
|
||||||
Class<O> domainJavaType,
|
Class<O> domainJavaType,
|
||||||
Class<R> jdbcJavaType,
|
Class<R> jdbcJavaType,
|
||||||
JpaAttributeConverterCreationContext context) {
|
JpaAttributeConverterCreationContext context) {
|
||||||
|
@ -54,7 +52,7 @@ public class JpaAttributeConverterImpl<O,R> implements JpaAttributeConverter<O,R
|
||||||
|
|
||||||
jdbcJtd = jtdRegistry.getDescriptor( jdbcJavaType );
|
jdbcJtd = jtdRegistry.getDescriptor( jdbcJavaType );
|
||||||
//noinspection unchecked
|
//noinspection unchecked
|
||||||
domainJtd = (JavaTypeDescriptor<O>) jtdRegistry.resolveDescriptor(
|
domainJtd = (JavaType<O>) jtdRegistry.resolveDescriptor(
|
||||||
domainJavaType,
|
domainJavaType,
|
||||||
() -> RegistryHelper.INSTANCE.createTypeDescriptor(
|
() -> RegistryHelper.INSTANCE.createTypeDescriptor(
|
||||||
domainJavaType,
|
domainJavaType,
|
||||||
|
@ -92,27 +90,27 @@ public class JpaAttributeConverterImpl<O,R> implements JpaAttributeConverter<O,R
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<? extends AttributeConverter<O, R>> getConverterJavaTypeDescriptor() {
|
public JavaType<? extends AttributeConverter<O, R>> getConverterJavaTypeDescriptor() {
|
||||||
return converterJtd;
|
return converterJtd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<O> getDomainJavaDescriptor() {
|
public JavaType<O> getDomainJavaDescriptor() {
|
||||||
return getDomainJavaTypeDescriptor();
|
return getDomainJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<R> getRelationalJavaDescriptor() {
|
public JavaType<R> getRelationalJavaDescriptor() {
|
||||||
return getRelationalJavaTypeDescriptor();
|
return getRelationalJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<O> getDomainJavaTypeDescriptor() {
|
public JavaType<O> getDomainJavaTypeDescriptor() {
|
||||||
return domainJtd;
|
return domainJtd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<R> getRelationalJavaTypeDescriptor() {
|
public JavaType<R> getRelationalJavaTypeDescriptor() {
|
||||||
return jdbcJtd;
|
return jdbcJtd;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ import org.hibernate.metamodel.model.convert.spi.EnumValueConverter;
|
||||||
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.EnumJavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.EnumJavaTypeDescriptor;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -30,7 +30,7 @@ import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||||
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 JdbcTypeDescriptor jdbcTypeDescriptor;
|
||||||
private final JavaTypeDescriptor<String> relationalTypeDescriptor;
|
private final JavaType<String> relationalTypeDescriptor;
|
||||||
|
|
||||||
private transient ValueExtractor<String> valueExtractor;
|
private transient ValueExtractor<String> valueExtractor;
|
||||||
private transient ValueBinder<String> valueBinder;
|
private transient ValueBinder<String> valueBinder;
|
||||||
|
@ -38,7 +38,7 @@ public class NamedEnumValueConverter<E extends Enum<E>> implements EnumValueConv
|
||||||
public NamedEnumValueConverter(
|
public NamedEnumValueConverter(
|
||||||
EnumJavaTypeDescriptor<E> domainTypeDescriptor,
|
EnumJavaTypeDescriptor<E> domainTypeDescriptor,
|
||||||
JdbcTypeDescriptor jdbcTypeDescriptor,
|
JdbcTypeDescriptor jdbcTypeDescriptor,
|
||||||
JavaTypeDescriptor<String> relationalTypeDescriptor) {
|
JavaType<String> relationalTypeDescriptor) {
|
||||||
this.domainTypeDescriptor = domainTypeDescriptor;
|
this.domainTypeDescriptor = domainTypeDescriptor;
|
||||||
this.jdbcTypeDescriptor = jdbcTypeDescriptor;
|
this.jdbcTypeDescriptor = jdbcTypeDescriptor;
|
||||||
this.relationalTypeDescriptor = relationalTypeDescriptor;
|
this.relationalTypeDescriptor = relationalTypeDescriptor;
|
||||||
|
@ -53,7 +53,7 @@ public class NamedEnumValueConverter<E extends Enum<E>> implements EnumValueConv
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<String> getRelationalJavaDescriptor() {
|
public JavaType<String> getRelationalJavaDescriptor() {
|
||||||
return relationalTypeDescriptor;
|
return relationalTypeDescriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ import org.hibernate.metamodel.model.convert.spi.EnumValueConverter;
|
||||||
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.EnumJavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.EnumJavaTypeDescriptor;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
import org.hibernate.type.descriptor.jdbc.JdbcTypeDescriptor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -31,7 +31,7 @@ public class OrdinalEnumValueConverter<E extends Enum<E>> implements EnumValueCo
|
||||||
|
|
||||||
private final EnumJavaTypeDescriptor<E> enumJavaDescriptor;
|
private final EnumJavaTypeDescriptor<E> enumJavaDescriptor;
|
||||||
private final JdbcTypeDescriptor jdbcTypeDescriptor;
|
private final JdbcTypeDescriptor jdbcTypeDescriptor;
|
||||||
private final JavaTypeDescriptor<Integer> relationalJavaDescriptor;
|
private final JavaType<Integer> relationalJavaDescriptor;
|
||||||
|
|
||||||
private transient ValueExtractor<Integer> valueExtractor;
|
private transient ValueExtractor<Integer> valueExtractor;
|
||||||
private transient ValueBinder<Integer> valueBinder;
|
private transient ValueBinder<Integer> valueBinder;
|
||||||
|
@ -39,7 +39,7 @@ public class OrdinalEnumValueConverter<E extends Enum<E>> implements EnumValueCo
|
||||||
public OrdinalEnumValueConverter(
|
public OrdinalEnumValueConverter(
|
||||||
EnumJavaTypeDescriptor<E> enumJavaDescriptor,
|
EnumJavaTypeDescriptor<E> enumJavaDescriptor,
|
||||||
JdbcTypeDescriptor jdbcTypeDescriptor,
|
JdbcTypeDescriptor jdbcTypeDescriptor,
|
||||||
JavaTypeDescriptor<Integer> relationalJavaDescriptor) {
|
JavaType<Integer> relationalJavaDescriptor) {
|
||||||
this.enumJavaDescriptor = enumJavaDescriptor;
|
this.enumJavaDescriptor = enumJavaDescriptor;
|
||||||
this.jdbcTypeDescriptor = jdbcTypeDescriptor;
|
this.jdbcTypeDescriptor = jdbcTypeDescriptor;
|
||||||
this.relationalJavaDescriptor = relationalJavaDescriptor;
|
this.relationalJavaDescriptor = relationalJavaDescriptor;
|
||||||
|
@ -72,7 +72,7 @@ public class OrdinalEnumValueConverter<E extends Enum<E>> implements EnumValueCo
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<Integer> getRelationalJavaDescriptor() {
|
public JavaType<Integer> getRelationalJavaDescriptor() {
|
||||||
return relationalJavaDescriptor;
|
return relationalJavaDescriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
package org.hibernate.metamodel.model.convert.spi;
|
package org.hibernate.metamodel.model.convert.spi;
|
||||||
|
|
||||||
import org.hibernate.Incubating;
|
import org.hibernate.Incubating;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Support for basic-value conversions.
|
* Support for basic-value conversions.
|
||||||
|
@ -40,10 +40,10 @@ public interface BasicValueConverter<D,R> {
|
||||||
/**
|
/**
|
||||||
* Descriptor for the Java type for the domain portion of this converter
|
* Descriptor for the Java type for the domain portion of this converter
|
||||||
*/
|
*/
|
||||||
JavaTypeDescriptor<D> getDomainJavaDescriptor();
|
JavaType<D> getDomainJavaDescriptor();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Descriptor for the Java type for the relational portion of this converter
|
* Descriptor for the Java type for the relational portion of this converter
|
||||||
*/
|
*/
|
||||||
JavaTypeDescriptor<R> getRelationalJavaDescriptor();
|
JavaType<R> getRelationalJavaDescriptor();
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ package org.hibernate.metamodel.model.convert.spi;
|
||||||
import jakarta.persistence.AttributeConverter;
|
import jakarta.persistence.AttributeConverter;
|
||||||
|
|
||||||
import org.hibernate.resource.beans.spi.ManagedBean;
|
import org.hibernate.resource.beans.spi.ManagedBean;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BasicValueConverter extension for AttributeConverter-specific support
|
* BasicValueConverter extension for AttributeConverter-specific support
|
||||||
|
@ -17,10 +17,10 @@ import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
*/
|
*/
|
||||||
public interface JpaAttributeConverter<O,R> extends BasicValueConverter<O,R> {
|
public interface JpaAttributeConverter<O,R> extends BasicValueConverter<O,R> {
|
||||||
JavaTypeDescriptor<? extends AttributeConverter<O,R>> getConverterJavaTypeDescriptor();
|
JavaType<? extends AttributeConverter<O,R>> getConverterJavaTypeDescriptor();
|
||||||
|
|
||||||
ManagedBean<? extends AttributeConverter<O,R>> getConverterBean();
|
ManagedBean<? extends AttributeConverter<O,R>> getConverterBean();
|
||||||
|
|
||||||
JavaTypeDescriptor<O> getDomainJavaTypeDescriptor();
|
JavaType<O> getDomainJavaTypeDescriptor();
|
||||||
JavaTypeDescriptor<R> getRelationalJavaTypeDescriptor();
|
JavaType<R> getRelationalJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,21 +8,21 @@ package org.hibernate.metamodel.model.convert.spi;
|
||||||
|
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
*/
|
*/
|
||||||
public class SimpleBasicValueConverter<D,R> implements BasicValueConverter<D,R> {
|
public class SimpleBasicValueConverter<D,R> implements BasicValueConverter<D,R> {
|
||||||
private final JavaTypeDescriptor<D> domainJtd;
|
private final JavaType<D> domainJtd;
|
||||||
private final JavaTypeDescriptor<R> relationalJtd;
|
private final JavaType<R> relationalJtd;
|
||||||
|
|
||||||
private final Function<R,D> toDomainHandler;
|
private final Function<R,D> toDomainHandler;
|
||||||
private final Function<D,R> toRelationalHandler;
|
private final Function<D,R> toRelationalHandler;
|
||||||
|
|
||||||
public SimpleBasicValueConverter(
|
public SimpleBasicValueConverter(
|
||||||
JavaTypeDescriptor<D> domainJtd,
|
JavaType<D> domainJtd,
|
||||||
JavaTypeDescriptor<R> relationalJtd,
|
JavaType<R> relationalJtd,
|
||||||
Function<R,D> toDomainHandler,
|
Function<R,D> toDomainHandler,
|
||||||
Function<D,R> toRelationalHandler) {
|
Function<D,R> toRelationalHandler) {
|
||||||
this.domainJtd = domainJtd;
|
this.domainJtd = domainJtd;
|
||||||
|
@ -42,12 +42,12 @@ public class SimpleBasicValueConverter<D,R> implements BasicValueConverter<D,R>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<D> getDomainJavaDescriptor() {
|
public JavaType<D> getDomainJavaDescriptor() {
|
||||||
return domainJtd;
|
return domainJtd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<R> getRelationalJavaDescriptor() {
|
public JavaType<R> getRelationalJavaDescriptor() {
|
||||||
return relationalJtd;
|
return relationalJtd;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,17 +6,17 @@
|
||||||
*/
|
*/
|
||||||
package org.hibernate.metamodel.model.domain;
|
package org.hibernate.metamodel.model.domain;
|
||||||
|
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractDomainType<J> implements SimpleDomainType<J> {
|
public abstract class AbstractDomainType<J> implements SimpleDomainType<J> {
|
||||||
private final JpaMetamodel domainMetamodel;
|
private final JpaMetamodel domainMetamodel;
|
||||||
private final JavaTypeDescriptor<J> javaTypeDescriptor;
|
private final JavaType<J> javaTypeDescriptor;
|
||||||
|
|
||||||
@SuppressWarnings("WeakerAccess")
|
@SuppressWarnings("WeakerAccess")
|
||||||
public AbstractDomainType(JavaTypeDescriptor<J> javaTypeDescriptor, JpaMetamodel domainMetamodel) {
|
public AbstractDomainType(JavaType<J> javaTypeDescriptor, JpaMetamodel domainMetamodel) {
|
||||||
this.javaTypeDescriptor = javaTypeDescriptor;
|
this.javaTypeDescriptor = javaTypeDescriptor;
|
||||||
this.domainMetamodel = domainMetamodel;
|
this.domainMetamodel = domainMetamodel;
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ public abstract class AbstractDomainType<J> implements SimpleDomainType<J> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JavaTypeDescriptor<J> getExpressableJavaTypeDescriptor() {
|
public JavaType<J> getExpressableJavaTypeDescriptor() {
|
||||||
return javaTypeDescriptor;
|
return javaTypeDescriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,12 +16,11 @@ import jakarta.persistence.metamodel.IdentifiableType;
|
||||||
import jakarta.persistence.metamodel.SingularAttribute;
|
import jakarta.persistence.metamodel.SingularAttribute;
|
||||||
|
|
||||||
import org.hibernate.metamodel.mapping.EntityIdentifierMapping;
|
import org.hibernate.metamodel.mapping.EntityIdentifierMapping;
|
||||||
import org.hibernate.metamodel.model.domain.internal.AttributeContainer;
|
|
||||||
import org.hibernate.metamodel.model.domain.internal.BasicSqmPathSource;
|
import org.hibernate.metamodel.model.domain.internal.BasicSqmPathSource;
|
||||||
import org.hibernate.metamodel.model.domain.internal.EmbeddedSqmPathSource;
|
import org.hibernate.metamodel.model.domain.internal.EmbeddedSqmPathSource;
|
||||||
import org.hibernate.metamodel.model.domain.internal.NonAggregatedCompositeSqmPathSource;
|
import org.hibernate.metamodel.model.domain.internal.NonAggregatedCompositeSqmPathSource;
|
||||||
import org.hibernate.query.sqm.SqmPathSource;
|
import org.hibernate.query.sqm.SqmPathSource;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
|
@ -55,7 +54,7 @@ public abstract class AbstractIdentifiableType<J>
|
||||||
|
|
||||||
public AbstractIdentifiableType(
|
public AbstractIdentifiableType(
|
||||||
String typeName,
|
String typeName,
|
||||||
JavaTypeDescriptor<J> javaTypeDescriptor,
|
JavaType<J> javaTypeDescriptor,
|
||||||
IdentifiableDomainType<? super J> superType,
|
IdentifiableDomainType<? super J> superType,
|
||||||
boolean hasIdClass,
|
boolean hasIdClass,
|
||||||
boolean hasIdentifierProperty,
|
boolean hasIdentifierProperty,
|
||||||
|
|
|
@ -33,7 +33,7 @@ import org.hibernate.internal.util.collections.CollectionHelper;
|
||||||
import org.hibernate.metamodel.RepresentationMode;
|
import org.hibernate.metamodel.RepresentationMode;
|
||||||
import org.hibernate.metamodel.model.domain.internal.AttributeContainer;
|
import org.hibernate.metamodel.model.domain.internal.AttributeContainer;
|
||||||
import org.hibernate.metamodel.model.domain.internal.DomainModelHelper;
|
import org.hibernate.metamodel.model.domain.internal.DomainModelHelper;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Commonality for Hibernate's implementations of the JPA {@link ManagedType}
|
* Commonality for Hibernate's implementations of the JPA {@link ManagedType}
|
||||||
|
@ -55,7 +55,7 @@ public abstract class AbstractManagedType<J>
|
||||||
|
|
||||||
protected AbstractManagedType(
|
protected AbstractManagedType(
|
||||||
String hibernateTypeName,
|
String hibernateTypeName,
|
||||||
JavaTypeDescriptor<J> javaTypeDescriptor,
|
JavaType<J> javaTypeDescriptor,
|
||||||
ManagedDomainType<? super J> superType,
|
ManagedDomainType<? super J> superType,
|
||||||
JpaMetamodel domainMetamodel) {
|
JpaMetamodel domainMetamodel) {
|
||||||
super( javaTypeDescriptor, domainMetamodel );
|
super( javaTypeDescriptor, domainMetamodel );
|
||||||
|
|
|
@ -8,7 +8,7 @@ package org.hibernate.metamodel.model.domain;
|
||||||
|
|
||||||
import org.hibernate.Incubating;
|
import org.hibernate.Incubating;
|
||||||
import org.hibernate.query.Query;
|
import org.hibernate.query.Query;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specialization of DomainType for types that can be used as {@link Query} parameter bind values.
|
* Specialization of DomainType for types that can be used as {@link Query} parameter bind values.
|
||||||
|
@ -17,5 +17,5 @@ import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
||||||
*/
|
*/
|
||||||
@Incubating
|
@Incubating
|
||||||
public interface AllowableParameterType<J> extends SimpleDomainType<J> {
|
public interface AllowableParameterType<J> extends SimpleDomainType<J> {
|
||||||
JavaTypeDescriptor<J> getExpressableJavaTypeDescriptor();
|
JavaType<J> getExpressableJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,14 +7,14 @@
|
||||||
package org.hibernate.metamodel.model.domain;
|
package org.hibernate.metamodel.model.domain;
|
||||||
|
|
||||||
import org.hibernate.query.sqm.SqmExpressable;
|
import org.hibernate.query.sqm.SqmExpressable;
|
||||||
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
|
import org.hibernate.type.descriptor.java.JavaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes any type that occurs in the application's domain model.
|
* Describes any type that occurs in the application's domain model.
|
||||||
*
|
*
|
||||||
* The base for Hibernate's extension of the JPA type system.
|
* The base for Hibernate's extension of the JPA type system.
|
||||||
*
|
*
|
||||||
* Encapsulates a {@link JavaTypeDescriptor} describing the more rudimentary
|
* Encapsulates a {@link JavaType} describing the more rudimentary
|
||||||
* aspects of the Java type. The DomainType is a higher-level construct
|
* aspects of the Java type. The DomainType is a higher-level construct
|
||||||
* incorporating information such as bean properties, constructors, etc
|
* incorporating information such as bean properties, constructors, etc
|
||||||
*
|
*
|
||||||
|
@ -44,5 +44,5 @@ public interface DomainType<J> extends SqmExpressable<J> {
|
||||||
*
|
*
|
||||||
* @see #getTypeName
|
* @see #getTypeName
|
||||||
*/
|
*/
|
||||||
JavaTypeDescriptor<J> getExpressableJavaTypeDescriptor();
|
JavaType<J> getExpressableJavaTypeDescriptor();
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue