|
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>
public abstract class BaseRowMapper<T extends Resource>
serves as a base class for implementations of ObjectRowMapper. The methods left to be implemented directly depend on the class to be mapped:
SimpleEntityFilter| Field Summary | |
|---|---|
protected ConnectionHelper |
helper
|
protected String |
idColumn
|
protected String |
tableName
|
| Constructor Summary | |
|---|---|
BaseRowMapper(Connection con,
String tableName,
String idColumn)
|
|
| Method Summary | |
|---|---|
protected abstract 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. |
String |
getIDColumnName()
|
ResultSet |
getResultSet(Filter<T> filter)
constructs the ResultSet that corresponds closesd to the filter; note that the filter may be null, in which case the select statement should return all rows. |
ResultSet |
getResultSet(SimpleEntityFilter<? extends Entity> filter)
|
String |
getTableName()
generates a (blank) RowItem that tells the caller in what table to look for what value in what field to find the object. |
RowItem |
mapToRow(T entry)
uses the abstract generateRowProperties(T) method to generate the RowItem |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.antelmann.sql.ObjectRowMapper |
|---|
generateNewID, instanciate |
| Field Detail |
|---|
protected ConnectionHelper helper
protected String tableName
protected String idColumn
| Constructor Detail |
|---|
public BaseRowMapper(Connection con,
String tableName,
String idColumn)
| Method Detail |
|---|
public String getTableName()
ObjectRowMapper
getTableName in interface ObjectRowMapper<T extends Resource>public String getIDColumnName()
getIDColumnName in interface ObjectRowMapper<T extends Resource>protected abstract Map<String,Object> generateRowProperties(T entry)
public RowItem mapToRow(T entry)
generateRowProperties(T) method to generate the RowItem
mapToRow in interface ObjectRowMapper<T extends Resource>
public ResultSet getResultSet(SimpleEntityFilter<? extends Entity> filter)
throws SQLException
SQLException
public ResultSet getResultSet(Filter<T> filter)
throws SQLException
ObjectRowMapper
getResultSet in interface ObjectRowMapper<T extends Resource>SQLException
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||