|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.sql.BaseRowMapper<T>
com.antelmann.sql.MappedEntryMapper<T>
public class MappedEntryMapper<T extends DBEntry>
a special mapper that completely automates the mapping with
specially annotated DBEntry classes via reflection.
MappedEntry,
MappedColumn| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.antelmann.util.Converter |
|---|
Converter.Adapter<T1,T2> |
| Field Summary |
|---|
| Fields inherited from class com.antelmann.sql.BaseRowMapper |
|---|
db, helper |
| Constructor Summary | |
|---|---|
MappedEntryMapper(Database<Connection> db,
Class<T> type)
|
|
MappedEntryMapper(Database<Connection> db,
Class<T> type,
IDFactory factory)
|
|
| Method Summary | ||
|---|---|---|
protected Object |
convertToJava(Object obj,
Member member)
supports Stub members |
|
protected Object |
convertToSQL(Object obj,
int sqlType,
int precision)
supports Stub members |
|
static
|
createStore(Database<Connection> db,
Class<T> type)
convenience method to easily create a store with no factory |
|
static
|
createStore(Database<Connection> db,
Class<T> type,
boolean useNextIntForID)
convenience method to easily create a store and use BaseRowMapper.getNextIntID() to implement BaseRowMapper.generateNewID() |
|
static
|
createStore(Database<Connection> db,
Class<T> type,
boolean useNextIntForID,
boolean fastDelete)
convenience method to easily create a store and use BaseRowMapper.getNextIntID() to implement BaseRowMapper.generateNewID() |
|
static
|
createStore(Database<Connection> db,
Class<T> type,
IDFactory factory,
boolean enableFastDelete)
convenience method to easily create a store |
|
protected Map<String,Object> |
generateRowProperties(T entry)
generates a map that contains all columns mapped to their values, so that the map can be used to store the object into a row. |
|
static String |
getColumn(AccessibleObject ao)
|
|
static HashSet<String> |
getColumns(Class<?> type)
|
|
static String |
getDisplayColumnName(Class<?> type)
|
|
static String |
getIdColumnName(Class<?> type)
|
|
static String |
getQuery(Class<?> type)
|
|
static String |
getTableName(Class<?> type)
returns either the name of the specified table or the simple name of the type if the table was not specified |
|
T |
instantiate(RowItem row)
instantiates the DBEntry based on the properties in the given row. |
|
void |
setIDFactory(IDFactory idFactory,
Class<T> type)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MappedEntryMapper(Database<Connection> db,
Class<T> type)
throws DatabaseException,
IllegalArgumentException
DatabaseException
IllegalArgumentException
public MappedEntryMapper(Database<Connection> db,
Class<T> type,
IDFactory factory)
throws DatabaseException,
IllegalArgumentException
DatabaseException
IllegalArgumentException| Method Detail |
|---|
public static <T extends DBEntry> JDBCRowStore<T> createStore(Database<Connection> db,
Class<T> type)
throws DatabaseException,
NullPointerException,
IllegalArgumentException
DatabaseException
NullPointerException
IllegalArgumentException
public static <T extends DBEntry> JDBCRowStore<T> createStore(Database<Connection> db,
Class<T> type,
boolean useNextIntForID)
throws DatabaseException,
IllegalArgumentException
BaseRowMapper.getNextIntID() to implement BaseRowMapper.generateNewID()
DatabaseException
IllegalArgumentException
public static <T extends DBEntry> JDBCRowStore<T> createStore(Database<Connection> db,
Class<T> type,
boolean useNextIntForID,
boolean fastDelete)
throws DatabaseException,
IllegalArgumentException
BaseRowMapper.getNextIntID() to implement BaseRowMapper.generateNewID()
DatabaseException
IllegalArgumentException
public static <T extends DBEntry> JDBCRowStore<T> createStore(Database<Connection> db,
Class<T> type,
IDFactory factory,
boolean enableFastDelete)
throws DatabaseException,
IllegalArgumentException
DatabaseException
IllegalArgumentException
public static String getTableName(Class<?> type)
throws NullPointerException
NullPointerException
public static String getIdColumnName(Class<?> type)
throws NullPointerException
NullPointerException
public static String getDisplayColumnName(Class<?> type)
throws NullPointerException
NullPointerException
public static String getQuery(Class<?> type)
throws NullPointerException
NullPointerExceptionpublic static String getColumn(AccessibleObject ao)
public static HashSet<String> getColumns(Class<?> type)
public void setIDFactory(IDFactory idFactory,
Class<T> type)
setIDFactory in class BaseRowMapper<T extends DBEntry>
protected Map<String,Object> generateRowProperties(T entry)
throws WrongDataException
BaseRowMapper
generateRowProperties in class BaseRowMapper<T extends DBEntry>WrongDataException
public T instantiate(RowItem row)
throws Exception
ObjectRowMapperObjectRowMapper.getRestrictMappedColumns().
Exception
protected Object convertToJava(Object obj,
Member member)
protected Object convertToSQL(Object obj,
int sqlType,
int precision)
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||