public class BooleanConverter extends Object implements AttributeConverter<Boolean,Integer>
1
is true
and 0
is false
.Constructor and Description |
---|
BooleanConverter() |
Modifier and Type | Method and Description |
---|---|
Integer |
convertToDatabaseColumn(Boolean value)
Converts
true to 1 , false to 0 , and null to null . |
Boolean |
convertToEntityAttribute(Integer value)
Converts
1 to true , 0 to false , and null to null . |
public Integer convertToDatabaseColumn(Boolean value)
true
to 1
, false
to 0
, and null
to null
.convertToDatabaseColumn
in interface AttributeConverter<Boolean,Integer>
value
- the value to be convertedInteger
representation of a Boolean
valuepublic Boolean convertToEntityAttribute(Integer value)
1
to true
, 0
to false
, and null
to null
.convertToEntityAttribute
in interface AttributeConverter<Boolean,Integer>
value
- the value to be convertedBoolean
representation of an Integer
valueCopyright © 2015 Joseph Hendrix