|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface LogicalType<T>
Defines a logical type which can translate between one or more Java types and one or more JDBC types. This should be independent of the underlying database dialect.
| Method Summary | |
|---|---|
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)
|
| Method Detail |
|---|
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
IllegalArgumentException
T 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.
IllegalArgumentException
Object validate(Object value)
throws IllegalArgumentException
IllegalArgumentException
void putToDatabase(EntityManager manager,
PreparedStatement stmt,
int index,
T value,
int jdbcType)
throws SQLException
SQLException
T pullFromDatabase(EntityManager manager,
ResultSet res,
Class<T> type,
String columnName)
throws SQLException
SQLException
T pullFromDatabase(EntityManager manager,
ResultSet res,
Class<T> type,
int columnIndex)
throws SQLException
SQLExceptionboolean shouldCache(Class<?> type)
boolean shouldStore(Class<?> type)
boolean valueEquals(Object val1,
Object val2)
String valueToString(T value)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||