|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface implemented by objects that manage a collection of records.
Method Summary | |
void |
delete(java.lang.Object key)
This is equivalent to delete(null, key) |
void |
delete(java.lang.String type,
java.lang.Object key)
Delete a record given its primary lookup key. |
void |
insert(Record rec)
Adds a new record to the managed pool. |
java.util.List |
select(RecordFilter filter)
This is equivalent to select(null, filter) |
java.util.List |
select(java.lang.String type,
RecordFilter filter)
Fetches a list of records matching filter. |
void |
update(Record rec)
Replaces an existing version of a record with a new updated version. |
void |
wipeCache()
If this data source is backed by some external mechanism, like an RDBMS, wipes the in-memory cache, if one is being maintained. |
Methods inherited from interface com.niggle.data.DataSource |
close, get, get, getName, getRecords, init, keys, keys |
Methods inherited from interface com.niggle.data.DataChangeNotifier |
addDataListener, removeDataListener |
Method Detail |
public void insert(Record rec) throws java.io.IOException
rec
- the record to addDuplicateRecordException
- if another record already exists
with same primary key as 'rec'.java.io.IOException
- if the record cannot be
initialized (i.e. has missing fields or invalid
field values, etc.), or in case of a low-level error.public void update(Record rec) throws java.io.IOException
Not all underlying storage mediums will be able to support these semantics. Check your implementation carefully.
rec
- the new updated record.ModifiedRecordException
- thrown if the record was modified
by another process since rec was requested from a data source.java.io.IOException
- thrown in case of any other database or
communication error.public void delete(java.lang.Object key) throws java.io.IOException
public void delete(java.lang.String type, java.lang.Object key) throws java.io.IOException
type
- the record type we want to delete
If this is null, we delete indistinctly with no sanity check.key
- the key to the object to delete.MissingRecordException
- thrown if the record to be
deleted could not be found.DataException
- thrown if the key maps to more than
one record.java.io.IOException
- thrown in case of any other database or
communication error.public java.util.List select(RecordFilter filter) throws java.io.IOException
public java.util.List select(java.lang.String type, RecordFilter filter) throws java.io.IOException
the
- type of record we are interested in, possibly nullfilter
- the record filter, or null.public void wipeCache() throws java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |