Class Boolean01Converter

java.lang.Object
org.kuali.rice.krad.data.jpa.converters.Boolean01Converter
All Implemented Interfaces:
javax.persistence.AttributeConverter<Boolean,BigInteger>

public class Boolean01Converter extends Object implements javax.persistence.AttributeConverter<Boolean,BigInteger>
Converts values of 0 or 1 to and from false or true.

The conversion treats the values as follows: 1 is true and 0 is false.

Author:
Kuali Rice Team (rice.collab@kuali.org)
  • Constructor Details

    • Boolean01Converter

      public Boolean01Converter()
  • Method Details

    • convertToDatabaseColumn

      public BigInteger convertToDatabaseColumn(Boolean objectValue)
      This implementation will convert from a false or true value to a 0 or 1 value.
      Specified by:
      convertToDatabaseColumn in interface javax.persistence.AttributeConverter<Boolean,BigInteger>
    • convertToEntityAttribute

      public Boolean convertToEntityAttribute(BigInteger dataValue)
      This implementation will convert from a false or true value to a 0 or 1 value.
      Specified by:
      convertToEntityAttribute in interface javax.persistence.AttributeConverter<Boolean,BigInteger>