public interface LogicalType<T>
| Modifier and Type | Method and Description |
|---|---|
int |
getDefaultJdbcWriteType()
Returns the default JDBC type to use when writing values to the database.
|
com.google.common.collect.ImmutableSet<Integer> |
getJdbcReadTypes()
Returns the set of JDBC types that can be translated into this logical type.
|
String |
getName()
Returns a descriptive name for this logical type.
|
com.google.common.collect.ImmutableSet<Class<?>> |
getTypes()
Returns the Java types that are handled by this logical type.
|
boolean |
isAllowedAsPrimaryKey()
Returns a boolean specifying if this type can be used as a primary key value.
|
T |
parse(String input)
Attempts to parse a string into a value of this logical type.
|
T |
parseDefault(String input)
Same as
parse(String), but adds any necessary validation when the value is being
used as a default value for a column. |
T |
pullFromDatabase(EntityManager manager,
ResultSet res,
Class<T> type,
int columnIndex)
Reads a value from a JDBC result set.
|
T |
pullFromDatabase(EntityManager manager,
ResultSet res,
Class<T> type,
String columnName)
Reads a value from a JDBC result set.
|
void |
putToDatabase(EntityManager manager,
PreparedStatement stmt,
int index,
T value,
int jdbcType)
Sets a value in a JDBC statement.
|
boolean |
shouldCache(Class<?> type)
Deprecated.
since 0.25. Entities and values now no longer cached.
|
boolean |
shouldStore(Class<?> type)
Returns whether the type may be put inside the entities value store.
|
Object |
validate(Object value)
Verifies that a value can be stored in the database.
|
boolean |
valueEquals(Object val1,
Object val2) |
String |
valueToString(T value) |
String getName()
com.google.common.collect.ImmutableSet<Class<?>> getTypes()
com.google.common.collect.ImmutableSet<Integer> getJdbcReadTypes()
int getDefaultJdbcWriteType()
SchemaProperties.boolean isAllowedAsPrimaryKey()
T parse(String input) throws IllegalArgumentException
IllegalArgumentExceptionT parseDefault(String input) throws IllegalArgumentException
parse(String), but adds any necessary validation when the value is being
used as a default value for a column.IllegalArgumentExceptionObject validate(Object value) throws IllegalArgumentException
IllegalArgumentExceptionvoid putToDatabase(EntityManager manager, PreparedStatement stmt, int index, T value, int jdbcType) throws SQLException
SQLExceptionT pullFromDatabase(EntityManager manager, ResultSet res, Class<T> type, String columnName) throws SQLException
SQLExceptionT pullFromDatabase(EntityManager manager, ResultSet res, Class<T> type, int columnIndex) throws SQLException
SQLExceptionboolean shouldCache(Class<?> type)
boolean shouldStore(Class<?> type)
Copyright © 2007–2018. All rights reserved.