public class BooleanBitType extends Object implements Convertible<Boolean,Integer>
Java Boolean
to JDBC BIT
. This conversion has default usage.
The pattern
format is: true|false, where the values can be any string value.
@Converter(converter = BooleanBitType.class,pattern = "1|0")
Constructor and Description |
---|
BooleanBitType(String pattern) |
Modifier and Type | Method and Description |
---|---|
ColumnType |
getColumnType() |
Class<Boolean> |
getType() |
Boolean |
toAttribute(Integer jdbc)
Convert the jdbc value to attribute format or type
|
Integer |
toJdbc(Boolean attribute)
Convert attribute to jdbc format or type
|
String |
toString() |
public BooleanBitType(String pattern)
public Integer toJdbc(Boolean attribute)
Convertible
toJdbc
in interface Convertible<Boolean,Integer>
attribute
- the value of to be convertedpublic Boolean toAttribute(Integer jdbc)
Convertible
toAttribute
in interface Convertible<Boolean,Integer>
jdbc
- the value stored at databasepublic Class<Boolean> getType()
getType
in interface Convertible<Boolean,Integer>
public ColumnType getColumnType()
getColumnType
in interface Convertible<Boolean,Integer>
Copyright © 2012–2020 jkniv, copyleft code. All rights reserved.