Package io.ebeaninternal.server.type
Class ScalarTypeChar
- java.lang.Object
-
- io.ebeaninternal.server.type.ScalarTypeBase<T>
-
- io.ebeaninternal.server.type.ScalarTypeBaseVarchar<Character>
-
- io.ebeaninternal.server.type.ScalarTypeChar
-
- All Implemented Interfaces:
StringFormatter
,StringParser
,ScalarDataReader<Character>
,ScalarType<Character>
public class ScalarTypeChar extends ScalarTypeBaseVarchar<Character>
ScalarType for char.
-
-
Constructor Summary
Constructors Constructor Description ScalarTypeChar()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bind(DataBind b, Character value)
Convert (if necessary) and bind the value to the preparedStatement.Character
convertFromDbString(String dbValue)
Convert from DB string value to the target type.String
convertToDbString(Character beanValue)
Convert to DB string from the target type.String
formatValue(Character t)
Format the target type to a string.Character
parse(String value)
Parse from a formatted string value.Character
read(DataReader dataReader)
Read the value from the resultSet and convert if necessary to the logical bean property value.Character
toBeanType(Object value)
Convert the value as necessary to the logical Bean type.Object
toJdbcType(Object value)
Convert the value as necessary to the JDBC type.-
Methods inherited from class io.ebeaninternal.server.type.ScalarTypeBaseVarchar
convertFromMillis, format, getDocType, isDateTimeCapable, jsonRead, jsonWrite, readData, writeData
-
Methods inherited from class io.ebeaninternal.server.type.ScalarTypeBase
asVersion, getJdbcType, getLength, getType, isBinaryType, isDirty, isJdbcNative, isMutable, loadIgnore
-
-
-
-
Constructor Detail
-
ScalarTypeChar
public ScalarTypeChar()
-
-
Method Detail
-
convertFromDbString
public Character convertFromDbString(String dbValue)
Description copied from class:ScalarTypeBaseVarchar
Convert from DB string value to the target type.- Specified by:
convertFromDbString
in classScalarTypeBaseVarchar<Character>
-
convertToDbString
public String convertToDbString(Character beanValue)
Description copied from class:ScalarTypeBaseVarchar
Convert to DB string from the target type.- Specified by:
convertToDbString
in classScalarTypeBaseVarchar<Character>
-
bind
public void bind(DataBind b, Character value) throws SQLException
Description copied from interface:ScalarType
Convert (if necessary) and bind the value to the preparedStatement.value may need to be converted from the logical bean property type to the JDBC type.
- Specified by:
bind
in interfaceScalarType<Character>
- Overrides:
bind
in classScalarTypeBaseVarchar<Character>
- Throws:
SQLException
-
read
public Character read(DataReader dataReader) throws SQLException
Description copied from interface:ScalarType
Read the value from the resultSet and convert if necessary to the logical bean property value.- Specified by:
read
in interfaceScalarDataReader<Character>
- Specified by:
read
in interfaceScalarType<Character>
- Overrides:
read
in classScalarTypeBaseVarchar<Character>
- Throws:
SQLException
-
toJdbcType
public Object toJdbcType(Object value)
Description copied from interface:ScalarType
Convert the value as necessary to the JDBC type.Note that this should also match the type as per the getJdbcType() method.
This is typically used when the matching type is used in a where clause and we use this to ensure it is an appropriate jdbc type.
- Specified by:
toJdbcType
in interfaceScalarType<Character>
- Overrides:
toJdbcType
in classScalarTypeBaseVarchar<Character>
-
toBeanType
public Character toBeanType(Object value)
Description copied from interface:ScalarType
Convert the value as necessary to the logical Bean type.The type as per the bean property.
This is used to automatically convert id values (typically from a string to a int, long or UUID).
- Specified by:
toBeanType
in interfaceScalarType<Character>
- Overrides:
toBeanType
in classScalarTypeBaseVarchar<Character>
-
formatValue
public String formatValue(Character t)
Description copied from class:ScalarTypeBaseVarchar
Format the target type to a string.- Specified by:
formatValue
in interfaceScalarType<Character>
- Specified by:
formatValue
in classScalarTypeBaseVarchar<Character>
-
parse
public Character parse(String value)
Description copied from class:ScalarTypeBaseVarchar
Parse from a formatted string value.- Specified by:
parse
in interfaceScalarType<Character>
- Specified by:
parse
in interfaceStringParser
- Specified by:
parse
in classScalarTypeBaseVarchar<Character>
-
-