public interface PersistenceStore
PersistenceStore
The persistence store allows access to the persistent
storage mechanism within the application.
PersistenceStore instances ARE NOT
thread safe. The best practices approach for using
the persistence store is to use
PersistenceStoreContainer.getStoreForThread()
any time the store is to be accessed.
| Modifier and Type | Field and Description |
|---|---|
static int |
LOCK_NO_LOCK
No lock at all aka the object is read only changes WILL NOT be persisted
at checkPoints or commits.
|
static int |
LOCK_PESSIMISTIC
changes to the object will be written to the database.
|
static int |
LOCK_READ
changes to the object will be written to the database, in this case the lock
will be automatically upgraded to the write lock on transaction
|
static final int LOCK_NO_LOCK
static final int LOCK_READ
static final int LOCK_PESSIMISTIC
void addEventListener(PersistenceStoreEventListener listener)
void close()
void deletePersistent(Object obj) throws LockFailedException
LockFailedExceptionvoid deleteAll(Object query) throws LockFailedException
LockFailedExceptionCollection getCollectionByQuery(Object query)
Collection getCollectionByQuery(Object query, int lockLevel)
Object getObjectByIdentity(Object object) throws LockFailedException
LockFailedExceptionObject getObjectByIdentity(Object object, int lockLevel) throws LockFailedException
LockFailedExceptionint getCount(Object query)
boolean isClosed()
isClosed
indicates whether or not this PersistenceStore
instance has been closed. A closed store will generally
throw exceptions when any operation is performed upon it.
Transaction getTransaction()
getTransaction
Returns the current Transaction for thsis
PersistenceStore instance. The transaction
will always be the same for the lifetime of the
PersistenceStore instance.
Transaction for this
PersistenceStorevoid invalidate(Object obj) throws LockFailedException
LockFailedExceptionvoid invalidateAll()
throws LockFailedException
LockFailedExceptionvoid invalidateExtent(Class clazz) throws LockFailedException
LockFailedExceptionvoid invalidateByQuery(Object query) throws LockFailedException
LockFailedExceptionvoid lockForWrite(Object obj) throws LockFailedException
LockFailedExceptionvoid makePersistent(Object obj) throws LockFailedException
LockFailedExceptionFilter newFilter()
Collection getExtent(Class clazz)
Collection getExtent(Class clazz, int lockLevel)
Copyright © 1999–2016 The Apache Software Foundation. All rights reserved.