Package net.ontopia.persistence.proxy
Interface TransactionIF
-
- All Known Implementing Classes:
AbstractTransaction,ROTransaction,RWTransaction
public interface TransactionIFINTERNAL: Interface that manages object transactions using the proxy framework.This class is similar to the JDO PersistenceManager, StateManager and Transaction interfaces.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PersistentIF_getObject(IdentityIF identity)EXPERIMENTAL: ...voidabort()INTERNAL: Aborts the changes performed in the transaction.voidassignIdentity(PersistentIF object)voidbegin()INTERNAL: Begins a new transaction.voidclose()INTERNAL: Releases all resources used by the transaction.voidcommit()INTERNAL: Commits the changes performed in the transaction.voidcreate(PersistentIF object)INTERNAL: Registers the object with the transaction and marks it for creation in the data repository.QueryIFcreateQuery(JDOQuery jdoquery, boolean resolve_identities)INTERNAL: Build a QueryIF from the specified JDO query instance.voiddelete(PersistentIF identity)INTERNAL: Unregisters the object with the transaction and marks it for deletion in the data repository.ObjectexecuteQuery(String name, Object[] params)INTERNAL: Executes the named query.voidflush()INTERNAL: Stores all pending changes in the data repository.AccessRegistrarIFgetAccessRegistrar()INTERNAL: Gets the access registrar used by the transaction.StringgetId()INTERNAL: Gets the transaction id.PersistentIFgetObject(IdentityIF identity)INTERNAL: Gets the object instance with the given identity.PersistentIFgetObject(IdentityIF identity, boolean acceptDeleted)INTERNAL: Gets the object instance with the given identity.ObjectAccessIFgetObjectAccess()INTERNAL: Gets the object access used by the transaction.StorageAccessIFgetStorageAccess()INTERNAL: Gets the storage access used by the transaction.booleanisActive()INTERNAL: Returns true the transaction is active.booleanisClean()INTERNAL: Returns true the transaction is clean, i.e.booleanisFieldLoaded(IdentityIF identity, int field)EXPERIMENTAL:booleanisObjectClean(IdentityIF identity)booleanisObjectLoaded(IdentityIF identity)EXPERIMENTAL:booleanisReadOnly()INTERNAL: Returns true if this is a read-only transaction.<F> FloadField(IdentityIF object, int field)INTERNAL: Called by PersistentIFs when the value of the specified field is requested.voidobjectCreated(PersistentIF object)voidobjectDeleted(PersistentIF object)voidobjectDirty(PersistentIF object)INTERNAL: Called by PersistentIFs when the object's data has changed.voidobjectRead(IdentityIF identity)voidprefetch(Class<?> type, int[] fields, boolean[] traverse, Collection<IdentityIF> identities)voidprefetch(Class<?> type, int field, boolean traverse, Collection<IdentityIF> identities)booleanvalidate()INTERNAL: Returns true if the transaction is valid.
-
-
-
Method Detail
-
getId
String getId()
INTERNAL: Gets the transaction id. This id is unique for a given StorageIF instance.
-
getStorageAccess
StorageAccessIF getStorageAccess()
INTERNAL: Gets the storage access used by the transaction.
-
getObjectAccess
ObjectAccessIF getObjectAccess()
INTERNAL: Gets the object access used by the transaction.
-
getAccessRegistrar
AccessRegistrarIF getAccessRegistrar()
INTERNAL: Gets the access registrar used by the transaction.
-
isReadOnly
boolean isReadOnly()
INTERNAL: Returns true if this is a read-only transaction.
-
isActive
boolean isActive()
INTERNAL: Returns true the transaction is active.
-
isClean
boolean isClean()
INTERNAL: Returns true the transaction is clean, i.e. no changes have been made.
-
validate
boolean validate()
INTERNAL: Returns true if the transaction is valid.
-
begin
void begin()
INTERNAL: Begins a new transaction.
-
commit
void commit()
INTERNAL: Commits the changes performed in the transaction.
-
abort
void abort()
INTERNAL: Aborts the changes performed in the transaction.
-
close
void close()
INTERNAL: Releases all resources used by the transaction.
-
flush
void flush()
INTERNAL: Stores all pending changes in the data repository. Note that the transaction is not commited.
-
getObject
PersistentIF getObject(IdentityIF identity)
INTERNAL: Gets the object instance with the given identity. If the identity is known not to exist in the data repository an exception will be thrown. Deleted objects will not be returned from this method.
-
getObject
PersistentIF getObject(IdentityIF identity, boolean acceptDeleted)
INTERNAL: Gets the object instance with the given identity. If the identity is known not to exist in the data repository an exception will be thrown. Known and still existing object instances of deleted objects will be returned from this method if the acceptDeleted flag is true.
-
_getObject
PersistentIF _getObject(IdentityIF identity)
EXPERIMENTAL: ...
-
assignIdentity
void assignIdentity(PersistentIF object)
-
create
void create(PersistentIF object)
INTERNAL: Registers the object with the transaction and marks it for creation in the data repository.
-
delete
void delete(PersistentIF identity)
INTERNAL: Unregisters the object with the transaction and marks it for deletion in the data repository.
-
objectDirty
void objectDirty(PersistentIF object)
INTERNAL: Called by PersistentIFs when the object's data has changed.
-
objectRead
void objectRead(IdentityIF identity)
-
objectCreated
void objectCreated(PersistentIF object)
-
objectDeleted
void objectDeleted(PersistentIF object)
-
loadField
<F> F loadField(IdentityIF object, int field) throws IdentityNotFoundException
INTERNAL: Called by PersistentIFs when the value of the specified field is requested. Note that the persistent object will be notified through the _p_setValue method, so there is usually no need to use the return value to set the instance member.- Returns:
- the field value that was loaded.
- Throws:
IdentityNotFoundException- if the identity was not found.
-
isObjectLoaded
boolean isObjectLoaded(IdentityIF identity)
EXPERIMENTAL:
-
isFieldLoaded
boolean isFieldLoaded(IdentityIF identity, int field)
EXPERIMENTAL:
-
isObjectClean
boolean isObjectClean(IdentityIF identity)
-
prefetch
void prefetch(Class<?> type, int field, boolean traverse, Collection<IdentityIF> identities)
-
prefetch
void prefetch(Class<?> type, int[] fields, boolean[] traverse, Collection<IdentityIF> identities)
-
executeQuery
Object executeQuery(String name, Object[] params)
INTERNAL: Executes the named query. The parameters given in the params parameter are used during the execution of the query.
-
-