Package com.jk.data.dataaccess.orm.util
Class JKBooleanConverter
java.lang.Object
com.jk.data.dataaccess.orm.util.JKBooleanConverter
- Direct Known Subclasses:
 JKBooleanYesNoConvertor,JKBooleanYNConvertor
public class JKBooleanConverter
extends Object
implements jakarta.persistence.AttributeConverter<Boolean,String> 
This class is used to convert boolean values (
true and false)
 into a custom string representation.- Version:
 - 1.0
 - Author:
 - Dr. Jalal H. Kiswani
 
- 
Constructor Summary
ConstructorsConstructorDescriptionThis method constructs a newJKBooleanConverter.JKBooleanConverter(String trueString, String falseString) This method constructs a newJKBooleanConverterwith the specified true and false strings. - 
Method Summary
Modifier and TypeMethodDescriptionconvertToDatabaseColumn(Boolean value) Converts the value stored in the entity attribute into the data representation to be stored in the database.convertToEntityAttribute(String value) Converts the data stored in the database column into the value to be stored in the entity attribute. 
- 
Constructor Details
- 
JKBooleanConverter
public JKBooleanConverter()This method constructs a newJKBooleanConverter.This constructs represents the
trueboolean value with the"1"string, and thefalseboolean value with the"0"string. - 
JKBooleanConverter
This method constructs a newJKBooleanConverterwith the specified true and false strings.- Parameters:
 trueString- Specifies the string representation of thetrueboolean value.falseString- Specifies the string representation of thefalseboolean value.
 
 - 
 - 
Method Details
- 
convertToDatabaseColumn
Converts the value stored in the entity attribute into the data representation to be stored in the database. - 
convertToEntityAttribute
Converts the data stored in the database column into the value to be stored in the entity attribute. Note that it is the responsibility of the converter writer to specify the correctdbDatatype for the corresponding column for use by the JDBC driver: i.e., persistence providers are not expected to do such type conversion. 
 -