|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.db.AbstractDBClassStore<T>
public abstract class AbstractDBClassStore<T extends DBEntry>
provides basic implementation of methods that can be implemented based on other methods of the interface - though these implementations may be very inefficient
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.antelmann.db.DBClassStore |
|---|
DBClassStore.DBMethod |
| Constructor Summary | |
|---|---|
AbstractDBClassStore(Database<?> db,
Class<T> type)
|
|
| Method Summary | |
|---|---|
boolean |
containsID(Object id)
determines whether the given ID is present in this store. |
int |
deleteEntries(Filter<? super T> filter)
deletes all DBEntry objects that match the given filter; if the filter is null, all resources are deleted. |
DBEnumeration<Stub<T>> |
fetchStubs(Filter<? super Stub<?>> filter)
allows to access objects from this store w/o having to instantiate the entire original objects, but instead use Stubs to be able to display the list properly for selection. |
Database<?> |
getDatabase()
provides access to the database instance that also coordinates the transaction management. |
T |
getEntry(Object id)
returns the DBEntry based on its ID. |
Class<T> |
getEntryClass()
returns the runtime class type this store represents |
Stub<T> |
getStub(Object id)
returns a Stub representing the resource for the given ID or null. |
int |
size(Filter<? super T> filter)
returns the total number of T elements in this store based on the given filter (which may be null) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.antelmann.db.DBClassStore |
|---|
deleteEntry, fetch, generateNewID, insert, insertAsNew, update |
| Constructor Detail |
|---|
public AbstractDBClassStore(Database<?> db,
Class<T> type)
| Method Detail |
|---|
public Database<?> getDatabase()
DBClassStore
getDatabase in interface DBClassStore<T extends DBEntry>public Class<T> getEntryClass()
DBClassStore
getEntryClass in interface DBClassStore<T extends DBEntry>
public boolean containsID(Object id)
throws DatabaseException
DBClassStore
containsID in interface DBClassStore<T extends DBEntry>DatabaseException
public int deleteEntries(Filter<? super T> filter)
throws DatabaseException
DBClassStoreDBClassStore.deleteEntry(Object)
is called for each entry passing the filter (although stores may choose to do so)!
Consequently, if a store's implementation does not call DBClassStore.deleteEntry(Object)
on each instance, calling this method may result in changes that are hard to monitor
for versioning purposes.
deleteEntries in interface DBClassStore<T extends DBEntry>DatabaseExceptionDBClassStore.deleteEntry(Object)
public T getEntry(Object id)
throws DatabaseException
DBClassStore
getEntry in interface DBClassStore<T extends DBEntry>id - the ID that is retrieved from Resource.getID()
DatabaseExceptionDBEntry.getID()
public DBEnumeration<Stub<T>> fetchStubs(Filter<? super Stub<?>> filter)
throws DatabaseException
DBClassStorefetch(Filter) .
fetchStubs in interface DBClassStore<T extends DBEntry>DatabaseException
public Stub<T> getStub(Object id)
throws DatabaseException
DBClassStore
getStub in interface DBClassStore<T extends DBEntry>DatabaseException
public int size(Filter<? super T> filter)
throws DatabaseException
DBClassStore
size in interface DBClassStore<T extends DBEntry>filter - if non-null, only those elements will be counted that are applicable to the filter
DatabaseException
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||