Package | Description |
---|---|
org.sormula |
Fundamental classes.
|
org.sormula.cache |
Fundamental classes used to implement caching that is specified by
Cached.type() . |
org.sormula.cache.readonly |
Implementation of
ReadOnlyCache . |
org.sormula.cache.readwrite |
Implementation of
ReadWriteCache . |
org.sormula.cache.writable |
The abstract
WritableCache and supporting classes that are
used for implementing a cache that writes rows to the database. |
Modifier and Type | Method and Description |
---|---|
protected Cache<R> |
Table.initCache()
Initialize cache for this table.
|
Modifier and Type | Class and Description |
---|---|
class |
DuplicateCacheException
Indicates that a duplicate set of primary key(s) already exists in the cache.
|
class |
IllegalCacheOperationException
Invalid use of method by invoking methods in a manner that violates the cache contract.
|
class |
IllegalCacheStateException
Invalid cache state caused by cache activity outside of a transaction or failure to
commit or rollback transaction.
|
Modifier and Type | Method and Description |
---|---|
void |
Cache.begin(Transaction transaction)
Notification of database transaction start.
|
void |
AbstractCache.begin(Transaction transaction)
Indicates start of database transaction.
|
protected void |
AbstractCache.check()
Verifies that cache is ready.
|
void |
Cache.close(SqlOperation<R> sqlOperation)
Notification that a
SqlOperation for the cached table is about to close. |
void |
Cache.commit(Transaction transaction)
Notification of database transaction normal end.
|
void |
AbstractCache.commit(Transaction transaction)
Indicates database transaction commit.
|
boolean |
Cache.contains(java.lang.Object[] primaryKeys)
Tests if cache contains a row with the primary key(s).
|
boolean |
AbstractCache.contains(java.lang.Object[] primaryKeys)
Tests if row is in cache.
|
abstract UncommittedRow<R> |
UncommittedRow.delete(R row)
Performs a delete of new row on existing uncommitted row.
|
boolean |
Cache.delete(R row)
Performs an equivalent to SQL delete on cache for row.
|
abstract UncommittedRow<R> |
UncommittedRow.deleted(R row)
Notifies cache that row has been deleted from database.
|
void |
Cache.deleted(R row)
Indicates that a row was deleted from database.
|
void |
Cache.evict(R row)
Removes row from cache.
|
void |
AbstractCache.evict(R row)
Removes row from the cache.
|
void |
Cache.evictAll()
Removes all rows from cache.
|
void |
AbstractCache.evictAll()
Removes all rows from the cache.
|
void |
Cache.execute(SqlOperation<R> sqlOperation)
Notification that a
SqlOperation for the cached table is about to execute. |
java.lang.Object[] |
AbstractCache.getPrimaryKeyValues(R row)
Gets the primary key values from a row as Object array.
|
protected void |
AbstractCache.initCommittedCache()
Initializes committed map with initial capacity of
Cached.size() . |
protected void |
AbstractCache.initUncommittedCache()
Initializes uncommitted map with initial capacity of 1/2 of
Cached.size() . |
abstract UncommittedRow<R> |
UncommittedRow.insert(R row)
Performs an insert of new row on existing uncommitted row.
|
boolean |
Cache.insert(R row)
Performs an equivalent to SQL insert on cache for row.
|
abstract UncommittedRow<R> |
UncommittedRow.inserted(R row)
Notifies cache that row has been inserted into database.
|
void |
Cache.inserted(R row)
Indicates that a row was inserted into database.
|
void |
Cache.rollback(Transaction transaction)
Notification of database transaction abnormal end.
|
void |
AbstractCache.rollback(Transaction transaction)
Indicates database transaction rollback.
|
abstract UncommittedRow<R> |
UncommittedRow.save(R row)
Performs a save of new row on existing uncommitted row.
|
boolean |
Cache.save(R row)
Performs an equivalent to save operation on cache for row.
|
abstract UncommittedRow<R> |
UncommittedRow.saved(R row)
Notifies cache that row has been saved in database.
|
void |
Cache.saved(R row)
Indicates that a row was saved in database.
|
abstract R |
UncommittedRow.select()
Performs a primary key select on the uncommitted row.
|
R |
Cache.select(java.lang.Object[] primaryKeys)
Performs an equivalent to SQL select on cache for a row with primary key(s).
|
abstract R |
UncommittedRow.selected(R row)
Notifies cache that row has been selected from database.
|
R |
Cache.selected(R row)
Indicates row was selected from database.
|
abstract UncommittedRow<R> |
UncommittedRow.update(R row)
Performs an update of new row on existing uncommitted row.
|
boolean |
Cache.update(R row)
Performs an equivalent to SQL update on cache for row.
|
abstract void |
UncommittedRow.updateCommitted(Cache<R> cache)
Put this uncommitted row in committed map of cache.
|
abstract UncommittedRow<R> |
UncommittedRow.updated(R row)
Notifies cache that row has been updated in database.
|
void |
Cache.updated(R row)
Indicates that a row was updated in database.
|
void |
Cache.write()
Writes uncommitted changes to database.
|
Constructor and Description |
---|
AbstractCache(Table<R> table,
Cached cachedAnnotation)
Constructs for a table and annotation.
|
Modifier and Type | Method and Description |
---|---|
void |
ReadOnlyCache.close(SqlOperation<R> sqlOperation)
Does nothing.
|
UncommittedRow<R> |
UncommittedReadOnlyRow.delete(R row)
Throws
IllegalCacheOperationException since this method should not be used
for ReadOnlyCache . |
boolean |
ReadOnlyCache.delete(R row)
Returns false since read only cache never writes to database and is never authority
for row.
|
UncommittedRow<R> |
UncommittedUpdate.deleted(R row) |
UncommittedRow<R> |
UncommittedSelect.deleted(R row) |
UncommittedRow<R> |
UncommittedInsert.deleted(R row) |
UncommittedRow<R> |
UncommittedDelete.deleted(R row) |
void |
ReadOnlyCache.deleted(R row)
Indicates that a row was deleted from database.
|
void |
ReadOnlyCache.execute(SqlOperation<R> sqlOperation)
Prepares cache for use.
|
UncommittedRow<R> |
UncommittedReadOnlyRow.insert(R row)
Throws
IllegalCacheOperationException since this method should not be used
for ReadOnlyCache . |
boolean |
ReadOnlyCache.insert(R row)
Returns false since read only cache never writes to database and is never authority
for row.
|
UncommittedRow<R> |
UncommittedUpdate.inserted(R row) |
UncommittedRow<R> |
UncommittedSelect.inserted(R row) |
UncommittedRow<R> |
UncommittedInsert.inserted(R row) |
UncommittedRow<R> |
UncommittedDelete.inserted(R row) |
void |
ReadOnlyCache.inserted(R row)
Indicates that a row was inserted into database.
|
UncommittedRow<R> |
UncommittedReadOnlyRow.save(R row)
Throws
IllegalCacheOperationException since this method should not be used
for ReadOnlyCache . |
boolean |
ReadOnlyCache.save(R row)
Returns false since read only cache never writes to database and is never authority
for row.
|
UncommittedRow<R> |
UncommittedUpdate.saved(R row) |
UncommittedRow<R> |
UncommittedSelect.saved(R row) |
UncommittedRow<R> |
UncommittedInsert.saved(R row) |
UncommittedRow<R> |
UncommittedDelete.saved(R row) |
void |
ReadOnlyCache.saved(R row)
Indicates that a row was saved in database.
|
R |
UncommittedUpdate.select() |
R |
UncommittedSelect.select() |
R |
UncommittedInsert.select() |
R |
UncommittedDelete.select() |
R |
ReadOnlyCache.select(java.lang.Object[] primaryKeys)
Performs an equivalent to SQL select on cache for a row with primary key(s).
|
R |
UncommittedUpdate.selected(R row) |
R |
UncommittedSelect.selected(R row) |
R |
UncommittedInsert.selected(R row) |
R |
UncommittedDelete.selected(R row) |
R |
ReadOnlyCache.selected(R row)
Indicates row was selected from database.
|
UncommittedRow<R> |
UncommittedReadOnlyRow.update(R row)
Throws
IllegalCacheOperationException since this method should not be used
for ReadOnlyCache . |
boolean |
ReadOnlyCache.update(R row)
Returns false since read only cache never writes to database and is never authority
for row.
|
void |
UncommittedUpdate.updateCommitted(Cache<R> cache) |
void |
UncommittedSelect.updateCommitted(Cache<R> cache) |
void |
UncommittedInsert.updateCommitted(Cache<R> cache) |
void |
UncommittedDelete.updateCommitted(Cache<R> cache) |
UncommittedRow<R> |
UncommittedUpdate.updated(R row) |
UncommittedRow<R> |
UncommittedSelect.updated(R row) |
UncommittedRow<R> |
UncommittedInsert.updated(R row) |
UncommittedRow<R> |
UncommittedDelete.updated(R row) |
void |
ReadOnlyCache.updated(R row)
Indicates that a row was updated in database.
|
void |
ReadOnlyCache.write()
Does nothing.
|
Constructor and Description |
---|
ReadOnlyCache(Table<R> table,
Cached cachedAnnotation)
Constructs for a table and cache annotation.
|
Modifier and Type | Method and Description |
---|---|
void |
ReadWriteCache.close(SqlOperation<R> sqlOperation)
Notification that a
SqlOperation for the cached table is about to close. |
UncommittedRow<R> |
UncommittedUpdate.delete(R row) |
UncommittedRow<R> |
UncommittedSelect.delete(R row) |
UncommittedRow<R> |
UncommittedSave.delete(R row) |
UncommittedRow<R> |
UncommittedInsert.delete(R row) |
UncommittedRow<R> |
UncommittedDelete.delete(R row) |
boolean |
ReadWriteCache.delete(R row)
Performs an equivalent to SQL delete on cache for row.
|
void |
ReadWriteCache.deleted(R row)
Throws IllegalCacheOperationException since writable
ReadWriteCache should never be
notified of a delete since ReadWriteCache will be deleting from the database. |
void |
ReadWriteCache.execute(SqlOperation<R> sqlOperation)
Prepares cache for use.
|
UncommittedRow<R> |
UncommittedUpdate.insert(R row) |
UncommittedRow<R> |
UncommittedSelect.insert(R row) |
UncommittedRow<R> |
UncommittedSave.insert(R row) |
UncommittedRow<R> |
UncommittedInsert.insert(R row) |
UncommittedRow<R> |
UncommittedDelete.insert(R row) |
boolean |
ReadWriteCache.insert(R row)
Performs an equivalent to SQL insert on cache for row.
|
void |
ReadWriteCache.inserted(R row)
If table does not have an identity column, then throws IllegalCacheOperationException
since writable
ReadWriteCache should never be notified of an insert of non identity
row since ReadWriteCache will be inserting the database. |
UncommittedRow<R> |
UncommittedUpdate.save(R row) |
UncommittedRow<R> |
UncommittedSelect.save(R row) |
UncommittedRow<R> |
UncommittedSave.save(R row) |
UncommittedRow<R> |
UncommittedInsert.save(R row) |
UncommittedRow<R> |
UncommittedDelete.save(R row) |
boolean |
ReadWriteCache.save(R row)
Performs an equivalent to save operation on cache for row.
|
void |
ReadWriteCache.saved(R row)
Throws IllegalCacheOperationException since writable
ReadWriteCache should never be
notified of an save since ReadWriteCache will be saving to the database. |
R |
UncommittedUpdate.select() |
R |
UncommittedSelect.select() |
R |
UncommittedSave.select() |
R |
UncommittedInsert.select() |
R |
UncommittedDelete.select() |
R |
ReadWriteCache.select(java.lang.Object[] primaryKeys)
Performs an equivalent to SQL select on cache for a row with primary key(s).
|
R |
UncommittedUpdate.selected(R row) |
R |
UncommittedSelect.selected(R row) |
R |
UncommittedSave.selected(R row) |
R |
UncommittedInsert.selected(R row) |
R |
UncommittedDelete.selected(R row) |
R |
ReadWriteCache.selected(R row)
Indicates row was selected from database.
|
UncommittedRow<R> |
UncommittedUpdate.update(R row) |
UncommittedRow<R> |
UncommittedSelect.update(R row) |
UncommittedRow<R> |
UncommittedSave.update(R row) |
UncommittedRow<R> |
UncommittedInsert.update(R row) |
UncommittedRow<R> |
UncommittedDelete.update(R row) |
boolean |
ReadWriteCache.update(R row)
Performs an equivalent to SQL update on cache for row.
|
void |
UncommittedUpdate.updateCommitted(Cache<R> cache) |
void |
UncommittedSelect.updateCommitted(Cache<R> cache) |
void |
UncommittedSave.updateCommitted(Cache<R> cache) |
void |
UncommittedInsert.updateCommitted(Cache<R> cache) |
void |
UncommittedDelete.updateCommitted(Cache<R> cache) |
void |
ReadWriteCache.updated(R row)
Throws IllegalCacheOperationException since writable
ReadWriteCache should never be
notified of an update since ReadWriteCache will be updating the database. |
void |
UncommittedUpdate.write(WriteOperations<R> writeOperations) |
void |
UncommittedSelect.write(WriteOperations<R> writeOperations) |
void |
UncommittedSave.write(WriteOperations<R> writeOperations) |
void |
UncommittedInsert.write(WriteOperations<R> writeOperations) |
void |
UncommittedDelete.write(WriteOperations<R> writeOperations) |
Constructor and Description |
---|
ReadWriteCache(Table<R> table,
Cached cachedAnnotation)
Constructs for a table and cache annotation.
|
Modifier and Type | Class and Description |
---|---|
class |
CacheWriteException
Thrown when cache has error writing to the database.
|
Modifier and Type | Method and Description |
---|---|
void |
WriteOperations.close()
Closes write operations.
|
void |
WritableCache.commit(Transaction transaction)
Writes any uncommitted rows to database with
Object.wait() and then commits them
by invoking AbstractCache.commit(Transaction) . |
void |
WriteOperations.delete(R row)
Deletes row from database using primary key(s) with
Cached.delete() . |
UncommittedRow<R> |
UncommittedWritableRow.deleted(R row)
Throws
IllegalCacheOperationException since this method should not be used. |
void |
WriteOperations.insert(R row)
Inserts row into database with
Cached.insert() . |
UncommittedRow<R> |
UncommittedWritableRow.inserted(R row)
Throws
IllegalCacheOperationException since this method should not be used. |
void |
WriteOperations.open()
Creates new instances of write operations and initializes them to be used by
WriteOperations.insert(Object) ,
WriteOperations.update(Object) , WriteOperations.delete(Object) , and WriteOperations.save(Object) . |
void |
WriteOperations.save(R row)
Saves row into database using primary key(s) with
Cached.save() . |
UncommittedRow<R> |
UncommittedWritableRow.saved(R row)
Throws
IllegalCacheOperationException since this method should not be used. |
void |
WriteOperations.update(R row)
Updates row in database using primary key(s) with
Cached.update() . |
UncommittedRow<R> |
UncommittedWritableRow.updated(R row)
Throws
IllegalCacheOperationException since this method should not be used. |
void |
WritableCache.write()
Writes uncommitted rows to database by invoking
UncommittedWritableRow.write(WriteOperations)
on all rows in AbstractCache.getUncommittedCache() . |
abstract void |
UncommittedWritableRow.write(WriteOperations<R> writeOperations)
Writes row to database.
|
Constructor and Description |
---|
WritableCache(Table<R> table,
Cached cachedAnnotation)
Constructs for a table and annotation.
|
WriteOperations(WritableCache<R> writableCache)
Constructs for a cache.
|