Package io.ebeaninternal.server.type
Class ScalarTypeCharArray
- java.lang.Object
-
- io.ebeaninternal.server.type.ScalarTypeBase<T>
-
- io.ebeaninternal.server.type.ScalarTypeBaseVarchar<char[]>
-
- io.ebeaninternal.server.type.ScalarTypeCharArray
-
- All Implemented Interfaces:
StringFormatter
,StringParser
,ScalarDataReader<char[]>
,ScalarType<char[]>
public class ScalarTypeCharArray extends ScalarTypeBaseVarchar<char[]>
ScalarType for char[].
-
-
Constructor Summary
Constructors Constructor Description ScalarTypeCharArray()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bind(DataBind b, char[] value)
Convert (if necessary) and bind the value to the preparedStatement.char[]
convertFromDbString(String dbValue)
Convert from DB string value to the target type.String
convertToDbString(char[] beanValue)
Convert to DB string from the target type.String
formatValue(char[] t)
Format the target type to a string.char[]
jsonRead(com.fasterxml.jackson.core.JsonParser parser)
Read the value from JsonParser.void
jsonWrite(com.fasterxml.jackson.core.JsonGenerator ctx, String name, char[] value)
char[]
parse(String value)
Parse from a formatted string value.char[]
read(DataReader dataReader)
Read the value from the resultSet and convert if necessary to the logical bean property value.char[]
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, jsonWrite, readData, writeData
-
Methods inherited from class io.ebeaninternal.server.type.ScalarTypeBase
asVersion, getJdbcType, getLength, getType, isBinaryType, isDirty, isJdbcNative, isMutable, loadIgnore
-
-
-
-
Constructor Detail
-
ScalarTypeCharArray
public ScalarTypeCharArray()
-
-
Method Detail
-
convertFromDbString
public char[] convertFromDbString(String dbValue)
Description copied from class:ScalarTypeBaseVarchar
Convert from DB string value to the target type.- Specified by:
convertFromDbString
in classScalarTypeBaseVarchar<char[]>
-
convertToDbString
public String convertToDbString(char[] beanValue)
Description copied from class:ScalarTypeBaseVarchar
Convert to DB string from the target type.- Specified by:
convertToDbString
in classScalarTypeBaseVarchar<char[]>
-
bind
public void bind(DataBind b, char[] 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<char[]>
- Overrides:
bind
in classScalarTypeBaseVarchar<char[]>
- Throws:
SQLException
-
read
public char[] 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<char[]>
- Specified by:
read
in interfaceScalarType<char[]>
- Overrides:
read
in classScalarTypeBaseVarchar<char[]>
- 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<char[]>
- Overrides:
toJdbcType
in classScalarTypeBaseVarchar<char[]>
-
toBeanType
public char[] 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<char[]>
- Overrides:
toBeanType
in classScalarTypeBaseVarchar<char[]>
-
formatValue
public String formatValue(char[] t)
Description copied from class:ScalarTypeBaseVarchar
Format the target type to a string.- Specified by:
formatValue
in interfaceScalarType<char[]>
- Specified by:
formatValue
in classScalarTypeBaseVarchar<char[]>
-
parse
public char[] parse(String value)
Description copied from class:ScalarTypeBaseVarchar
Parse from a formatted string value.- Specified by:
parse
in interfaceScalarType<char[]>
- Specified by:
parse
in interfaceStringParser
- Specified by:
parse
in classScalarTypeBaseVarchar<char[]>
-
jsonRead
public char[] jsonRead(com.fasterxml.jackson.core.JsonParser parser) throws IOException
Description copied from interface:ScalarType
Read the value from JsonParser.- Specified by:
jsonRead
in interfaceScalarType<char[]>
- Overrides:
jsonRead
in classScalarTypeBaseVarchar<char[]>
- Throws:
IOException
-
jsonWrite
public void jsonWrite(com.fasterxml.jackson.core.JsonGenerator ctx, String name, char[] value) throws IOException
- Throws:
IOException
-
-