T
- Java type for this mappingpublic interface ResultSetMapping<T>
Modifier and Type | Method and Description |
---|---|
Class<T> |
getJavaClass()
Returns the Java Class to use for this type mapping.
|
String |
getResultSetMethodName(Dbms dbms)
Returns the name of the ResultSet method to be used when getting data
from a database.
|
default boolean |
isMustUseSupportMethod()
Returns if this type must use a support method to read from the ResulSet
rather than just calling a ResultSet method directly (for example, there is no
rs.getUuid() method). |
T |
parse(long input)
Parses the given input
long and returns an object of type T that
corresponds to the given long. |
T |
parse(String input)
Parses the given input
String and returns an object of type T
that corresponds to the given String . |
static <T> T |
unableToMap(Class<?> from,
Class<T> to) |
static <T> T |
unableToMapLong(Class<T> clazz) |
static <T> T |
unableToMapString(Class<T> clazz) |
Class<T> getJavaClass()
String getResultSetMethodName(Dbms dbms)
Integer
is used,
then this method will return "Int" because an Integer
can be read
from a ResultSet
with the method
ResultSet.getInt(int)
. In some (rare) cases, the
response might be different for different Dbms:es, so this is why the
dmbs parameter needs to be provided.dbms
- to useT parse(String input)
String
and returns an object of type T
that corresponds to the given String
. This function is needed to
be able to reconstruct Entity fields from JSON strings or change data
logs for example.input
- the input String
Object
of type T that corresponds to the given
String
T parse(long input)
long
and returns an object of type T that
corresponds to the given long. This function is needed to be able to
reconstruct Entity fields that are auto increments in SQL tables.
Typically, this method is only implemented for classes implementing the
Number
interface.input
- the input long
Object
of type T that corresponds to the given
String
static <T> T unableToMapString(Class<T> clazz)
static <T> T unableToMapLong(Class<T> clazz)
default boolean isMustUseSupportMethod()
rs.getUuid()
method).Copyright © 2016 Speedment, Inc.. All rights reserved.