Package org.hibernate.type
Class NumericBooleanConverter
- java.lang.Object
-
- org.hibernate.type.NumericBooleanConverter
-
- All Implemented Interfaces:
jakarta.persistence.AttributeConverter<Boolean,Integer>
,BasicValueConverter<Boolean,Integer>
public class NumericBooleanConverter extends Object implements jakarta.persistence.AttributeConverter<Boolean,Integer>, BasicValueConverter<Boolean,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)
String
getCheckCondition(String columnName, JdbcType jdbcType, Dialect dialect)
The check constraint that should be added to the column definition in generated DDL.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-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.type.descriptor.converter.spi.BasicValueConverter
getSpecializedTypeDeclaration
-
-
-
-
Field Detail
-
INSTANCE
public static final NumericBooleanConverter INSTANCE
Singleton access
-
-
Method Detail
-
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>
-
getCheckCondition
public String getCheckCondition(String columnName, JdbcType jdbcType, Dialect dialect)
Description copied from interface:BasicValueConverter
The check constraint that should be added to the column definition in generated DDL.- Specified by:
getCheckCondition
in interfaceBasicValueConverter<Boolean,Integer>
- Parameters:
columnName
- the name of the columnjdbcType
- theJdbcType
of the mapped columndialect
- the SQLDialect
- Returns:
- a check constraint condition or null
-
-