Holger's
Java API

com.antelmann.imagedb
Interface ImageDB

All Known Implementing Classes:
SQLImageDB

public interface ImageDB

an interface for an image database

Author:
Holger Antelmann

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 ImageHolder from the database; optional operation.
 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... fields)
          loads the specified fields from the database into the given ImageHolder and returns the same.
 void store(ImageHolder ih, ImageHolder.Field... fields)
          updates the specified ImageHolder fields in the database based on the given object; the entry must exist before calling this method.
 

Method Detail

insert

ImageHolder insert(ImageHolder ih)
                   throws DatabaseException
inserts the image holder information to the database. The id of the given ImageHolder is completely ignored. The id of the returned ImageHolder may be different and corresponds to the entry actually residing in the database after the call. The returned object may, however, be the same as the one passed in. All fields of the given ImageHolder will be set to be retrieved.

Returns:
the object (with its id) as it then resides in the database
Throws:
DatabaseException
See Also:
ImageHolder.isRetrieved(ImageHolder.Field)

store

void store(ImageHolder ih,
           ImageHolder.Field... fields)
           throws DatabaseException
updates the specified ImageHolder fields in the database based on the given object; the entry must exist before calling this method. If no field is specified, all fields will be retrieved. All specified fields will be set to be retrieved, all others will be false (as they may differ hereafter).

Throws:
DatabaseException
See Also:
ImageHolder.isRetrieved(ImageHolder.Field)

retrieve

ImageHolder retrieve(ImageHolder ih,
                     ImageHolder.Field... fields)
                     throws DatabaseException
loads the specified fields from the database into the given ImageHolder and returns the same. If no field is specified, all fields will be retrieved. All specified fields will be marked as retrieved.

Throws:
DatabaseException
See Also:
ImageHolder.isRetrieved(ImageHolder.Field)

contains

boolean contains(ImageHolder ih)
                 throws DatabaseException
determines whether an ImageHolder with the id of the given ImageHolder resides in the database

Throws:
DatabaseException

numberOfImageHolders

int numberOfImageHolders()
                         throws DatabaseException
returns the total number of ImageHolder objects in the database

Throws:
DatabaseException

getImageHolders

Collection<ImageHolder> getImageHolders(Filter<ImageHolder> filter,
                                        ImageHolder.Field... fields)
                                        throws DatabaseException
retrieves a collection of ImageHolder objects; note that the returned ImageHolder objects may not contain more than the ID, initially. To determine, which fields have been retrieved from the database, use isRetrieved(ImageHolder.Field) on the ImageHolder object.

Parameters:
filter - 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
Throws:
DatabaseException
See Also:
ImageHolder.isRetrieved(ImageHolder.Field), retrieve(ImageHolder, ImageHolder.Field...)

delete

boolean delete(ImageHolder ih)
               throws DatabaseException,
                      UnsupportedOperationException
deletes the given ImageHolder from the database; optional operation.

Returns:
true only if the ImageHolder existed before and is now deleted
Throws:
DatabaseException
UnsupportedOperationException


(c) 2001-2006 Holger Antelmann - all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads