Package io.ebeaninternal.server.type
Class ScalarTypeJsonList.Varchar
- java.lang.Object
-
- io.ebeaninternal.server.type.ScalarTypeBase<T>
-
- io.ebeaninternal.server.type.ScalarTypeJsonList.Varchar
-
- All Implemented Interfaces:
StringFormatter
,StringParser
,ScalarDataReader<List>
,ScalarType<List>
,ScalarTypeArray
- Enclosing class:
- ScalarTypeJsonList
public static class ScalarTypeJsonList.Varchar extends ScalarTypeBase<T>
List mapped to DB VARCHAR.
-
-
Constructor Summary
Constructors Constructor Description Varchar(DocPropertyType docType, boolean nullable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
convertFromMillis(long dateTime)
Convert the systemTimeMillis into the appropriate java object.String
getDbColumnDefn()
Return the logical db column definition based on the element document type.DocPropertyType
getDocType()
Return the type this maps to for JSON document stores.boolean
isDateTimeCapable()
Return true if the type can accept long systemTimeMillis input.boolean
isDirty(Object value)
Return true if the value should be considered dirty (and included in an update).boolean
isMutable()
Consider as a mutable type.T
readData(DataInput dataInput)
Read the value from binary input.T
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.void
writeData(DataOutput dataOutput, T value)
Write the value to binary output.-
Methods inherited from class io.ebeaninternal.server.type.ScalarTypeBase
asVersion, format, getJdbcType, getLength, getType, isBinaryType, isJdbcNative, loadIgnore
-
-
-
-
Constructor Detail
-
Varchar
public Varchar(DocPropertyType docType, boolean nullable)
-
-
Method Detail
-
getDbColumnDefn
public String getDbColumnDefn()
Return the logical db column definition based on the element document type.- Specified by:
getDbColumnDefn
in interfaceScalarTypeArray
-
isMutable
public boolean isMutable()
Consider as a mutable type. Use the isDirty() method to check for dirty state.- Specified by:
isMutable
in interfaceScalarType<T>
- Overrides:
isMutable
in classScalarTypeBase<T>
-
isDirty
public boolean isDirty(Object value)
Return true if the value should be considered dirty (and included in an update).- Specified by:
isDirty
in interfaceScalarType<T>
- Overrides:
isDirty
in classScalarTypeBase<T>
-
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<T>
-
toBeanType
public T 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<T>
-
getDocType
public DocPropertyType getDocType()
Description copied from interface:ScalarType
Return the type this maps to for JSON document stores.- Specified by:
getDocType
in interfaceScalarType<T>
-
isDateTimeCapable
public boolean isDateTimeCapable()
Description copied from interface:ScalarType
Return true if the type can accept long systemTimeMillis input.This is used to determine if is is sensible to use the
ScalarType.convertFromMillis(long)
method.This includes the Date, Calendar, sql Date, Time, Timestamp, JODA types as well as Long, BigDecimal and String (although it generally is not expected to parse systemTimeMillis to a String or BigDecimal).
- Specified by:
isDateTimeCapable
in interfaceScalarType<T>
-
convertFromMillis
public T convertFromMillis(long dateTime)
Description copied from interface:ScalarType
Convert the systemTimeMillis into the appropriate java object.For non dateTime types this will throw an exception.
- Specified by:
convertFromMillis
in interfaceScalarType<T>
-
readData
public T readData(DataInput dataInput) throws IOException
Description copied from interface:ScalarType
Read the value from binary input.- Specified by:
readData
in interfaceScalarType<T>
- Throws:
IOException
-
writeData
public void writeData(DataOutput dataOutput, T value) throws IOException
Description copied from interface:ScalarType
Write the value to binary output.- Specified by:
writeData
in interfaceScalarType<T>
- Throws:
IOException
-
-