Package org.hibernate.type
Class YesNoConverter
- java.lang.Object
-
- org.hibernate.type.YesNoConverter
-
- All Implemented Interfaces:
jakarta.persistence.AttributeConverter<Boolean,Character>
,BasicValueConverter<Boolean,Character>
public class YesNoConverter extends Object implements jakarta.persistence.AttributeConverter<Boolean,Character>, BasicValueConverter<Boolean,Character>
Handles conversion to/from Boolean as `Y` or `N`
-
-
Field Summary
Fields Modifier and Type Field Description static YesNoConverter
INSTANCE
Singleton access
-
Constructor Summary
Constructors Constructor Description YesNoConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Character
convertToDatabaseColumn(Boolean attribute)
Boolean
convertToEntityAttribute(Character dbData)
JavaType<Boolean>
getDomainJavaType()
Descriptor for the Java type for the domain portion of this converterJavaType<Character>
getRelationalJavaType()
Descriptor for the Java type for the relational portion of this converterBoolean
toDomainValue(Character relationalForm)
Convert the relational form just retrieved from JDBC ResultSet into the domain form.Character
toRelationalValue(Boolean domainForm)
Convert the domain form into the relational form in preparation for storage into JDBC
-
-
-
Field Detail
-
INSTANCE
public static final YesNoConverter INSTANCE
Singleton access
-
-
Method Detail
-
toDomainValue
public Boolean toDomainValue(Character relationalForm)
Description copied from interface:BasicValueConverter
Convert the relational form just retrieved from JDBC ResultSet into the domain form.- Specified by:
toDomainValue
in interfaceBasicValueConverter<Boolean,Character>
-
toRelationalValue
public Character toRelationalValue(Boolean domainForm)
Description copied from interface:BasicValueConverter
Convert the domain form into the relational form in preparation for storage into JDBC- Specified by:
toRelationalValue
in interfaceBasicValueConverter<Boolean,Character>
-
getDomainJavaType
public JavaType<Boolean> getDomainJavaType()
Description copied from interface:BasicValueConverter
Descriptor for the Java type for the domain portion of this converter- Specified by:
getDomainJavaType
in interfaceBasicValueConverter<Boolean,Character>
-
getRelationalJavaType
public JavaType<Character> getRelationalJavaType()
Description copied from interface:BasicValueConverter
Descriptor for the Java type for the relational portion of this converter- Specified by:
getRelationalJavaType
in interfaceBasicValueConverter<Boolean,Character>
-
-