Package io.ebeaninternal.server.type
Class ScalarTypeEnumStandard.OrdinalEnum
- java.lang.Object
-
- io.ebeaninternal.server.type.ScalarTypeBase
-
- io.ebeaninternal.server.type.ScalarTypeEnumStandard.EnumBase
-
- io.ebeaninternal.server.type.ScalarTypeEnumStandard.OrdinalEnum
-
- All Implemented Interfaces:
StringFormatter
,StringParser
,ScalarDataReader
,ScalarType
,ScalarTypeEnum
- Enclosing class:
- ScalarTypeEnumStandard
public static class ScalarTypeEnumStandard.OrdinalEnum extends ScalarTypeEnumStandard.EnumBase implements ScalarTypeEnum
-
-
Constructor Summary
Constructors Constructor Description OrdinalEnum(Class enumType)
Create a ScalarTypeEnum.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bind(DataBind b, Object value)
Convert (if necessary) and bind the value to the preparedStatement.Set<String>
getDbCheckConstraintValues()
Return the IN values for DB constraint construction.boolean
isCompatible(javax.persistence.EnumType enumType)
Return true if the scalar type is compatible with the specified enum type.Object
read(DataReader dataReader)
Read the value from the resultSet and convert if necessary to the logical bean property value.Object
toBeanType(Object dbValue)
Convert the db value to the Enum value.Object
toJdbcType(Object beanValue)
Convert the Enum value to the db value.-
Methods inherited from class io.ebeaninternal.server.type.ScalarTypeEnumStandard.EnumBase
convertFromMillis, format, formatValue, getDocType, isDateTimeCapable, jsonRead, jsonWrite, parse, readData, writeData
-
Methods inherited from class io.ebeaninternal.server.type.ScalarTypeBase
asVersion, getJdbcType, getLength, getType, isBinaryType, isDirty, isJdbcNative, isMutable, loadIgnore
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.ebeaninternal.server.type.ScalarType
asVersion, convertFromMillis, format, formatValue, getDocType, getJdbcType, getLength, getType, isBinaryType, isDateTimeCapable, isDirty, isJdbcNative, isMutable, jsonRead, jsonWrite, loadIgnore, parse, readData, writeData
-
Methods inherited from interface io.ebeaninternal.server.type.ScalarTypeEnum
isOverrideBy
-
-
-
-
Constructor Detail
-
OrdinalEnum
public OrdinalEnum(Class enumType)
Create a ScalarTypeEnum.
-
-
Method Detail
-
isCompatible
public boolean isCompatible(javax.persistence.EnumType enumType)
Description copied from interface:ScalarTypeEnum
Return true if the scalar type is compatible with the specified enum type.- Specified by:
isCompatible
in interfaceScalarTypeEnum
-
getDbCheckConstraintValues
public Set<String> getDbCheckConstraintValues()
Return the IN values for DB constraint construction.- Specified by:
getDbCheckConstraintValues
in interfaceScalarTypeEnum
-
bind
public void bind(DataBind b, Object 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
- Throws:
SQLException
-
read
public Object 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
- Specified by:
read
in interfaceScalarType
- Throws:
SQLException
-
toJdbcType
public Object toJdbcType(Object beanValue)
Convert the Enum value to the db value.- Specified by:
toJdbcType
in interfaceScalarType
-
toBeanType
public Object toBeanType(Object dbValue)
Convert the db value to the Enum value.- Specified by:
toBeanType
in interfaceScalarType
-
-