Package net.ontopia.persistence.proxy
Interface StorageAccessIF
-
- All Known Implementing Classes:
RDBMSAccess
public interface StorageAccessIF
INTERNAL: Interface that encapsulates the access to the actual data repository.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
abort()
INTERNAL: Aborts all changes performed in the transaction.void
close()
INTERNAL: Closes the storage access, which allows it to free its resources.void
commit()
INTERNAL: Commits the changes performed in the transaction.void
createObject(ObjectAccessIF oaccess, Object object)
INTERNAL: Called by the transaction when it requests the new object to be created in the data repository.QueryIF
createQuery(String name, ObjectAccessIF oaccess, AccessRegistrarIF registrar)
INTERNAL: Creates a query instance for the given transaction.QueryIF
createQuery(JDOQuery jdoquery, ObjectAccessIF oaccess, AccessRegistrarIF registrar, boolean lookup_identities)
INTERNAL: Build a QueryIF from the specified JDO query instance.void
deleteObject(ObjectAccessIF oaccess, Object object)
INTERNAL: Called by the transaction when it requests the object to be deleted in the data repository.void
flush()
INTERNAL: Called when the transaction requires the transaction changes to be stored by the storage access (i.e.IdentityIF
generateIdentity(Class<?> type)
INTERNAL: Called by the application when it requests a new object identity for a given object type.String
getId()
INTERNAL: Gets the storage access id.String
getProperty(String property)
INTERNAL: Gets the value of the specified property.StorageIF
getStorage()
INTERNAL: Returns the storage definition that the access uses.boolean
isReadOnly()
INTERNAL: Returns true if the storage access is read-only.Object
loadField(AccessRegistrarIF registrar, IdentityIF identity, int field)
INTERNAL: Requests the loading of the specified field for the given object identity.Object
loadFieldMultiple(AccessRegistrarIF registrar, Collection<IdentityIF> identities, IdentityIF current, Class<?> type, int field)
INTERNAL: Requests the loading of the specified field for all the given object identities.boolean
loadObject(AccessRegistrarIF registrar, IdentityIF identity)
INTERNAL: Check for the existence of the object identity in the data repository.void
storeDirty(ObjectAccessIF oaccess, Object object)
INTERNAL: Stores object fields that are dirty in the database.boolean
validate()
INTERNAL: Returns true if the storage access is valid.
-
-
-
Method Detail
-
getId
String getId()
INTERNAL: Gets the storage access id. This id is unique for a given StorageIF instance.
-
getStorage
StorageIF getStorage()
INTERNAL: Returns the storage definition that the access uses.
-
isReadOnly
boolean isReadOnly()
INTERNAL: Returns true if the storage access is read-only.
-
getProperty
String getProperty(String property)
INTERNAL: Gets the value of the specified property.
-
validate
boolean validate()
INTERNAL: Returns true if the storage access is valid.
-
commit
void commit()
INTERNAL: Commits the changes performed in the transaction.
-
abort
void abort()
INTERNAL: Aborts all changes performed in the transaction.
-
close
void close()
INTERNAL: Closes the storage access, which allows it to free its resources.
-
flush
void flush()
INTERNAL: Called when the transaction requires the transaction changes to be stored by the storage access (i.e. written to the database).This method exists mainly to allow storage access implementations to optimize its communication with data repositories. An example of this is writing transaction changes in batches to improve performance.
Note that the transaction will always call this method at the end of its store method. It will do this so that it is sure that the changes will be visible inside the data repository.
-
loadObject
boolean loadObject(AccessRegistrarIF registrar, IdentityIF identity)
INTERNAL: Check for the existence of the object identity in the data repository. An exception will be thrown if the object does not exist. If it exists the access registrar will be notified.- Returns:
- true if object was found in the data store, false otherwise.
-
loadField
Object loadField(AccessRegistrarIF registrar, IdentityIF identity, int field) throws IdentityNotFoundException
INTERNAL: Requests the loading of the specified field for the given object identity. An exception will be thrown if the object does not exist. If it exists the access registrar will be notified.- Returns:
- The value loaded for the specific field. Note that if the field is a reference field the identity will be returned, not the actual object. This is because the storage system does not deal with persistent object instances directly.
- Throws:
IdentityNotFoundException
- if the identity was not found.
-
loadFieldMultiple
Object loadFieldMultiple(AccessRegistrarIF registrar, Collection<IdentityIF> identities, IdentityIF current, Class<?> type, int field) throws IdentityNotFoundException
INTERNAL: Requests the loading of the specified field for all the given object identities. An exception will be thrown if the current object does not exist. If it exists the access registrar will be notified.- Returns:
- The value loaded for the specific field. Note that if the field is a reference field the identity will be returned, not the actual object. This is because the storage system does not deal with persistent object instances directly.
- Throws:
IdentityNotFoundException
- if the identity was not found.
-
createObject
void createObject(ObjectAccessIF oaccess, Object object)
INTERNAL: Called by the transaction when it requests the new object to be created in the data repository. The ObjectAccessIF object is used to access information about the object as needed.
-
deleteObject
void deleteObject(ObjectAccessIF oaccess, Object object)
INTERNAL: Called by the transaction when it requests the object to be deleted in the data repository.
-
storeDirty
void storeDirty(ObjectAccessIF oaccess, Object object)
INTERNAL: Stores object fields that are dirty in the database.
-
generateIdentity
IdentityIF generateIdentity(Class<?> type)
INTERNAL: Called by the application when it requests a new object identity for a given object type.
-
createQuery
QueryIF createQuery(String name, ObjectAccessIF oaccess, AccessRegistrarIF registrar)
INTERNAL: Creates a query instance for the given transaction.
-
createQuery
QueryIF createQuery(JDOQuery jdoquery, ObjectAccessIF oaccess, AccessRegistrarIF registrar, boolean lookup_identities)
INTERNAL: Build a QueryIF from the specified JDO query instance.
-
-