Package org.hibernate.type
Class NumericBooleanConverter
- java.lang.Object
-
- org.hibernate.type.NumericBooleanConverter
-
- All Implemented Interfaces:
AttributeConverter<Boolean,Integer>
,BasicValueConverter<Boolean,Integer>
,StandardBooleanConverter<Integer>
,StandardConverter<Boolean,Integer>
public class NumericBooleanConverter extends Object implements StandardBooleanConverter<Integer>
Handles conversion to/fromBoolean
as0
(false) or1
(true)
-
-
Field Summary
Fields Modifier and Type Field Description static NumericBooleanConverter
INSTANCE
Singleton access
-
Constructor Summary
Constructors Constructor Description NumericBooleanConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Integer
convertToDatabaseColumn(Boolean attribute)
Boolean
convertToEntityAttribute(Integer dbData)
JavaType<Boolean>
getDomainJavaType()
Descriptor for the Java type for the domain portion of this converterJavaType<Integer>
getRelationalJavaType()
Descriptor for the Java type for the relational portion of this converterBoolean
toDomainValue(Integer relationalForm)
Convert the relational form just retrieved from JDBC ResultSet into the domain form.Integer
toRelationalValue(Boolean domainForm)
Convert the domain form into the relational form in preparation for storage into JDBC
-
-
-
Field Detail
-
INSTANCE
public static final NumericBooleanConverter INSTANCE
Singleton access
-
-
Method Detail
-
convertToDatabaseColumn
public Integer convertToDatabaseColumn(Boolean attribute)
- Specified by:
convertToDatabaseColumn
in interfaceAttributeConverter<Boolean,Integer>
-
convertToEntityAttribute
public Boolean convertToEntityAttribute(Integer dbData)
- Specified by:
convertToEntityAttribute
in interfaceAttributeConverter<Boolean,Integer>
-
toDomainValue
public Boolean toDomainValue(Integer 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,Integer>
-
toRelationalValue
public Integer 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,Integer>
-
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,Integer>
-
getRelationalJavaType
public JavaType<Integer> getRelationalJavaType()
Description copied from interface:BasicValueConverter
Descriptor for the Java type for the relational portion of this converter- Specified by:
getRelationalJavaType
in interfaceBasicValueConverter<Boolean,Integer>
-
-