Package io.ebeaninternal.server.type
Class ScalarTypeUUIDBinary
- java.lang.Object
-
- io.ebeaninternal.server.type.ScalarTypeBase<UUID>
-
- io.ebeaninternal.server.type.ScalarTypeUUIDBase
-
- io.ebeaninternal.server.type.ScalarTypeUUIDBinary
-
- All Implemented Interfaces:
StringFormatter
,StringParser
,ScalarDataReader<UUID>
,ScalarType<UUID>
,ScalarTypeLogicalType
public class ScalarTypeUUIDBinary extends ScalarTypeUUIDBase
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bind(DataBind b, UUID value)
Convert (if necessary) and bind the value to the preparedStatement.static UUID
convertFromBytes(byte[] bytes, boolean optimized)
Convert from byte[] to UUID.static byte[]
convertToBytes(Object value, boolean optimized)
Convert from UUID to byte[].int
getLength()
Just return 0.UUID
read(DataReader dataReader)
Read the value from the resultSet and convert if necessary to the logical bean property value.UUID
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.ScalarTypeUUIDBase
convertFromMillis, formatValue, getDocType, getLogicalType, isDateTimeCapable, isDirty, isMutable, jsonRead, jsonWrite, parse, readData, writeData
-
Methods inherited from class io.ebeaninternal.server.type.ScalarTypeBase
asVersion, format, getJdbcType, getType, isBinaryType, isJdbcNative, loadIgnore
-
-
-
-
Method Detail
-
getLength
public int getLength()
Description copied from class:ScalarTypeBase
Just return 0.- Specified by:
getLength
in interfaceScalarType<UUID>
- Overrides:
getLength
in classScalarTypeBase<UUID>
-
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<UUID>
- Overrides:
toJdbcType
in classScalarTypeUUIDBase
-
toBeanType
public UUID 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<UUID>
- Overrides:
toBeanType
in classScalarTypeUUIDBase
-
bind
public void bind(DataBind b, UUID 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.
- Throws:
SQLException
-
read
public UUID 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.- Throws:
SQLException
-
convertFromBytes
public static UUID convertFromBytes(byte[] bytes, boolean optimized)
Convert from byte[] to UUID.
-
convertToBytes
public static byte[] convertToBytes(Object value, boolean optimized)
Convert from UUID to byte[].
-
-