Package org.hibernate.type
Class YesNoConverter
- java.lang.Object
-
- org.hibernate.type.YesNoConverter
-
- All Implemented Interfaces:
AttributeConverter<Boolean,Character>,BasicValueConverter<Boolean,Character>
public class YesNoConverter extends Object implements AttributeConverter<Boolean,Character>, BasicValueConverter<Boolean,Character>
Handles conversion to/from Boolean as `Y` or `N`
-
-
Field Summary
Fields Modifier and Type Field Description static YesNoConverterINSTANCESingleton access
-
Constructor Summary
Constructors Constructor Description YesNoConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CharacterconvertToDatabaseColumn(Boolean attribute)BooleanconvertToEntityAttribute(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 converterBooleantoDomainValue(Character relationalForm)Convert the relational form just retrieved from JDBC ResultSet into the domain form.CharactertoRelationalValue(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
-
convertToDatabaseColumn
public Character convertToDatabaseColumn(Boolean attribute)
- Specified by:
convertToDatabaseColumnin interfaceAttributeConverter<Boolean,Character>
-
convertToEntityAttribute
public Boolean convertToEntityAttribute(Character dbData)
- Specified by:
convertToEntityAttributein interfaceAttributeConverter<Boolean,Character>
-
toDomainValue
public Boolean toDomainValue(Character relationalForm)
Description copied from interface:BasicValueConverterConvert the relational form just retrieved from JDBC ResultSet into the domain form.- Specified by:
toDomainValuein interfaceBasicValueConverter<Boolean,Character>
-
toRelationalValue
public Character toRelationalValue(Boolean domainForm)
Description copied from interface:BasicValueConverterConvert the domain form into the relational form in preparation for storage into JDBC- Specified by:
toRelationalValuein interfaceBasicValueConverter<Boolean,Character>
-
getDomainJavaType
public JavaType<Boolean> getDomainJavaType()
Description copied from interface:BasicValueConverterDescriptor for the Java type for the domain portion of this converter- Specified by:
getDomainJavaTypein interfaceBasicValueConverter<Boolean,Character>
-
getRelationalJavaType
public JavaType<Character> getRelationalJavaType()
Description copied from interface:BasicValueConverterDescriptor for the Java type for the relational portion of this converter- Specified by:
getRelationalJavaTypein interfaceBasicValueConverter<Boolean,Character>
-
-