|
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.image.ImageURLEntryMapper<T>
public class ImageURLEntryMapper<T extends ImageURLEntry>
an abstract base implementation of a mapper to be used with an ImageHolderSQLStore.
This implementation disregards the actual original image completely and
simply relies on ImageURLEntry.retrieveImage() to do its job.
Also, if the image is ever altered by ImageURLEntry.setImageReference(Image),
this change is ignored when saving the image, unless subclasses take care of it.
ImageURLEntrySQLStore| Nested Class Summary | |
|---|---|
static class |
ImageURLEntryMapper.ColumnKey
provide keys for accessing the column names via MappingInfo interface |
| Nested classes/interfaces inherited from interface com.antelmann.util.Converter |
|---|
Converter.Adapter<T1,T2> |
| Field Summary | |
|---|---|
protected String |
altitudeColumn
number field; null by default |
protected String |
descriptionColumn
longvarchar field |
protected String |
latitudeColumn
number field |
protected String |
longitudeColumn
number field |
protected String |
thumbnailColumn
blob field |
protected String |
timeColumn
timestamp field |
protected String |
urlColumn
string field |
| Fields inherited from class com.antelmann.sql.BaseRowMapper |
|---|
db, helper |
| Constructor Summary | |
|---|---|
ImageURLEntryMapper(Database<Connection> db,
String tableName,
String idColumn,
String displayColumn,
Class<T> type)
uses BaseRowMapper.getNextIntID() as id-factory |
|
ImageURLEntryMapper(Database<Connection> db,
String tableName,
String idColumn,
String displayColumn,
IDFactory idFactory,
Class<T> type)
|
|
| Method Summary | |
|---|---|
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. |
String |
getMappingForTopic(Object topic)
If the topic does not exist but is a String that is an existing column, it is returned as such. |
T |
instantiate(RowItem row)
instantiates the DBEntry based on the properties in the given row. |
protected T |
makeNewInstance(Object id)
creates the instance based on the type through reflection; uses a constructor that solely takes an Object as the id |
protected InputStream |
storeThumbnail(Image image)
simply uses a jpg serialized ByteArrayInputStream |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected String timeColumn
protected String thumbnailColumn
protected String descriptionColumn
protected String urlColumn
protected String latitudeColumn
protected String longitudeColumn
protected String altitudeColumn
| Constructor Detail |
|---|
public ImageURLEntryMapper(Database<Connection> db,
String tableName,
String idColumn,
String displayColumn,
IDFactory idFactory,
Class<T> type)
throws DatabaseException
displayColumn - represents the title of the image entry; see ImageURLEntry.getTitle()
DatabaseException
public ImageURLEntryMapper(Database<Connection> db,
String tableName,
String idColumn,
String displayColumn,
Class<T> type)
throws DatabaseException
BaseRowMapper.getNextIntID() as id-factory
DatabaseException| Method Detail |
|---|
public String getMappingForTopic(Object topic)
BaseRowMapper
getMappingForTopic in interface MappingInfogetMappingForTopic in class BaseRowMapper<T extends ImageURLEntry>BaseRowMapper.setTopic(Object, String)
protected Map<String,Object> generateRowProperties(T entry)
throws WrongDataException
BaseRowMapper
generateRowProperties in class BaseRowMapper<T extends ImageURLEntry>WrongDataException
protected InputStream storeThumbnail(Image image)
throws IOException
IOException
protected T makeNewInstance(Object id)
throws Exception
Exception
public T instantiate(RowItem row)
throws Exception
ObjectRowMapperObjectRowMapper.getRestrictMappedColumns().
Exception
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||