Package org.hibernate.metamodel.mapping
Class MappedDiscriminatorConverter<O,R>
- java.lang.Object
-
- org.hibernate.metamodel.mapping.DiscriminatorConverter<O,R>
-
- org.hibernate.metamodel.mapping.MappedDiscriminatorConverter<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 MappedDiscriminatorConverter<O,R> extends DiscriminatorConverter<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 MappedDiscriminatorConverter(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 void
forEachValueDetail(Consumer<DiscriminatorValueDetails> consumer)
<X> X
fromValueDetails(Function<DiscriminatorValueDetails,X> handler)
static <O,R>
MappedDiscriminatorConverter<O,R>fromValueMappings(NavigableRole role, JavaType<O> domainJavaType, BasicType<R> underlyingJdbcMapping, Map<Object,String> valueMappings, MappingMetamodelImplementor mappingMetamodel)
DiscriminatorValueDetails
getDetailsForDiscriminatorValue(Object value)
DiscriminatorValueDetails
getDetailsForEntityName(String entityName)
DiscriminatorValueDetails
getDetailsForRelationalForm(R relationalForm)
-
Methods inherited from class org.hibernate.metamodel.mapping.DiscriminatorConverter
getDomainJavaType, getNavigableRole, getRelationalJavaType, toDomainValue, toRelationalValue, toString
-
-
-
-
Constructor Detail
-
MappedDiscriminatorConverter
public MappedDiscriminatorConverter(NavigableRole discriminatorRole, JavaType<O> domainJavaType, JavaType<R> relationalJavaType, List<DiscriminatorValueDetails> valueMappings)
-
-
Method Detail
-
fromValueMappings
public static <O,R> MappedDiscriminatorConverter<O,R> fromValueMappings(NavigableRole role, JavaType<O> domainJavaType, BasicType<R> underlyingJdbcMapping, Map<Object,String> valueMappings, MappingMetamodelImplementor mappingMetamodel)
-
getDetailsForRelationalForm
public DiscriminatorValueDetails getDetailsForRelationalForm(R relationalForm)
- Overrides:
getDetailsForRelationalForm
in classDiscriminatorConverter<O,R>
-
getDetailsForEntityName
public DiscriminatorValueDetails getDetailsForEntityName(String entityName)
- Specified by:
getDetailsForEntityName
in classDiscriminatorConverter<O,R>
-
getDetailsForDiscriminatorValue
public DiscriminatorValueDetails getDetailsForDiscriminatorValue(Object value)
- Specified by:
getDetailsForDiscriminatorValue
in classDiscriminatorConverter<O,R>
-
forEachValueDetail
public void forEachValueDetail(Consumer<DiscriminatorValueDetails> consumer)
- Specified by:
forEachValueDetail
in classDiscriminatorConverter<O,R>
-
fromValueDetails
public <X> X fromValueDetails(Function<DiscriminatorValueDetails,X> handler)
- Specified by:
fromValueDetails
in classDiscriminatorConverter<O,R>
-
-