Package org.hibernate.metamodel.mapping
Class DiscriminatorConverter<O,R>
- java.lang.Object
-
- org.hibernate.metamodel.mapping.DiscriminatorConverter<O,R>
-
- Type Parameters:
O- The domain type - either- the entity Class for unnamed entities
- the entity name for named entities
R- The Java type of the relational form of the discriminator
- All Implemented Interfaces:
BasicValueConverter<O,R>
public class DiscriminatorConverter<O,R> extends Object implements BasicValueConverter<O,R>
Conversion of discriminator values between the entity name/Class domain form and its generally CHARACTER or INTEGER based relational form
-
-
Constructor Summary
Constructors Constructor Description DiscriminatorConverter(NavigableRole discriminatorRole, JavaType<O> domainJavaType, JavaType<R> relationalJavaType, List<DiscriminatorValueDetails> valueMappings)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidforEachValueDetail(Consumer<DiscriminatorValueDetails> consumer)<X> XfromValueDetails(Function<DiscriminatorValueDetails,X> handler)static <O,R>
DiscriminatorConverter<O,R>fromValueMappings(NavigableRole role, JavaType<O> domainJavaType, BasicType<R> underlyingJdbcMapping, Map<Object,String> valueMappings, SessionFactoryImplementor sessionFactory)DiscriminatorValueDetailsgetDetailsForDiscriminatorValue(Object value)DiscriminatorValueDetailsgetDetailsForEntityName(String entityName)DiscriminatorValueDetailsgetDetailsForRelationalForm(R relationalForm)JavaType<O>getDomainJavaType()Descriptor for the Java type for the domain portion of this converterNavigableRolegetNavigableRole()JavaType<R>getRelationalJavaType()Descriptor for the Java type for the relational portion of this converterOtoDomainValue(R relationalForm)Convert the relational form just retrieved from JDBC ResultSet into the domain form.RtoRelationalValue(O domainForm)Convert the domain form into the relational form in preparation for storage into JDBCStringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.hibernate.type.descriptor.converter.spi.BasicValueConverter
getCheckCondition, getSpecializedTypeDeclaration
-
-
-
-
Constructor Detail
-
DiscriminatorConverter
public DiscriminatorConverter(NavigableRole discriminatorRole, JavaType<O> domainJavaType, JavaType<R> relationalJavaType, List<DiscriminatorValueDetails> valueMappings)
-
-
Method Detail
-
fromValueMappings
public static <O,R> DiscriminatorConverter<O,R> fromValueMappings(NavigableRole role, JavaType<O> domainJavaType, BasicType<R> underlyingJdbcMapping, Map<Object,String> valueMappings, SessionFactoryImplementor sessionFactory)
-
getNavigableRole
public NavigableRole getNavigableRole()
-
getDomainJavaType
public JavaType<O> getDomainJavaType()
Description copied from interface:BasicValueConverterDescriptor for the Java type for the domain portion of this converter- Specified by:
getDomainJavaTypein interfaceBasicValueConverter<O,R>
-
getRelationalJavaType
public JavaType<R> getRelationalJavaType()
Description copied from interface:BasicValueConverterDescriptor for the Java type for the relational portion of this converter- Specified by:
getRelationalJavaTypein interfaceBasicValueConverter<O,R>
-
getDetailsForRelationalForm
public DiscriminatorValueDetails getDetailsForRelationalForm(R relationalForm)
-
toDomainValue
public O toDomainValue(R relationalForm)
Description copied from interface:BasicValueConverterConvert the relational form just retrieved from JDBC ResultSet into the domain form.- Specified by:
toDomainValuein interfaceBasicValueConverter<O,R>
-
getDetailsForEntityName
public DiscriminatorValueDetails getDetailsForEntityName(String entityName)
-
getDetailsForDiscriminatorValue
public DiscriminatorValueDetails getDetailsForDiscriminatorValue(Object value)
-
toRelationalValue
public R toRelationalValue(O domainForm)
Description copied from interface:BasicValueConverterConvert the domain form into the relational form in preparation for storage into JDBC- Specified by:
toRelationalValuein interfaceBasicValueConverter<O,R>
-
forEachValueDetail
public void forEachValueDetail(Consumer<DiscriminatorValueDetails> consumer)
-
fromValueDetails
public <X> X fromValueDetails(Function<DiscriminatorValueDetails,X> handler)
-
-