|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.imagedb.SQLImageDB
public class SQLImageDB
a JDBC implementation of an ImageDB
| Field Summary | |
|---|---|
protected String |
attrImageField
foreign key field to idField in imageTableName |
protected String |
attrKeyField
string field |
protected String |
attrTableName
containing image attributes as properties |
protected String |
attrValueField
string field |
protected String |
descriptionField
longvarchar field |
protected String |
idField
number |
protected String |
imageField
blob field |
protected String |
imageTableName
|
protected String |
thumbnailField
blob field |
protected String |
timeField
timestamp field |
protected String |
titleField
string field |
protected String |
typeField
string field |
protected String |
urlField
string field |
| Constructor Summary | |
|---|---|
SQLImageDB(Connection con)
uses empty properties, which results in the use of defaults |
|
SQLImageDB(Connection con,
Properties props)
|
|
| Method Summary | |
|---|---|
boolean |
contains(ImageHolder ih)
determines whether an ImageHolder with the id of the given ImageHolder resides in the database |
boolean |
delete(ImageHolder ih)
deletes the given entry from the database completely |
protected int |
generateNewID()
takes the maximum existing id and adds one |
Connection |
getConnection()
|
Collection<ImageHolder> |
getImageHolders(Filter<ImageHolder> filter,
ImageHolder.Field... fields)
retrieves a collection of ImageHolder objects; note that the returned ImageHolder objects may not contain more than the ID, initially. |
ImageHolder |
insert(ImageHolder ih)
inserts the image holder information to the database. |
int |
numberOfImageHolders()
returns the total number of ImageHolder objects in the database |
ImageHolder |
retrieve(ImageHolder ih,
ImageHolder.Field... field)
loads the specified fields from the database into the given ImageHolder and returns the same. |
void |
store(ImageHolder ih,
ImageHolder.Field... field)
updates the specified ImageHolder fields in the database based on the given object; the entry must exist before calling this method. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected String imageTableName
protected String idField
protected String timeField
protected String imageField
protected String thumbnailField
protected String descriptionField
protected String urlField
protected String typeField
protected String titleField
protected String attrTableName
protected String attrImageField
protected String attrKeyField
protected String attrValueField
| Constructor Detail |
|---|
public SQLImageDB(Connection con)
public SQLImageDB(Connection con,
Properties props)
| Method Detail |
|---|
protected int generateNewID()
throws SQLException
SQLExceptionpublic Connection getConnection()
public boolean contains(ImageHolder ih)
throws DatabaseException
ImageDB
contains in interface ImageDBDatabaseException
public ImageHolder insert(ImageHolder ih)
throws DatabaseException
ImageDB
insert in interface ImageDBDatabaseExceptionImageHolder.isRetrieved(ImageHolder.Field)
public void store(ImageHolder ih,
ImageHolder.Field... field)
throws DatabaseException
ImageDB
store in interface ImageDBDatabaseExceptionImageHolder.isRetrieved(ImageHolder.Field)
public boolean delete(ImageHolder ih)
throws DatabaseException
delete in interface ImageDBDatabaseException
public int numberOfImageHolders()
throws DatabaseException
ImageDB
numberOfImageHolders in interface ImageDBDatabaseException
public ImageHolder retrieve(ImageHolder ih,
ImageHolder.Field... field)
throws DatabaseException
ImageDB
retrieve in interface ImageDBDatabaseExceptionImageHolder.isRetrieved(ImageHolder.Field)
public Collection<ImageHolder> getImageHolders(Filter<ImageHolder> filter,
ImageHolder.Field... fields)
throws DatabaseException
ImageDBisRetrieved(ImageHolder.Field) on the ImageHolder object.
getImageHolders in interface ImageDBfilter - limits the returned collection to those ImageHolders that are accepted by the
filter; null is allowed (then, all ImageHolder objects are returned)fields - defines what fields are pre-initialized, before the filter may see it
- other than the id; if no fields are given, no other fields are loaded
(this semantic is different from retrieve
DatabaseExceptionImageHolder.isRetrieved(ImageHolder.Field),
ImageDB.retrieve(ImageHolder, ImageHolder.Field...)
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||