org.datanucleus.store
Interface StorePersistenceHandler2

All Known Implementing Classes:
AbstractPersistenceHandler2

public interface StorePersistenceHandler2

Interface defining persistence operations of a StoreManager. This performs the low level communication with the actual datastore.


Method Summary
 void batchEnd(ExecutionContext ectx)
          Signal that a batch of operations are ending for the specified ExecutionContext.
 void batchStart(ExecutionContext ectx)
          Signal that a batch of operations are starting for the specified ExecutionContext.
 void close()
          Method to close the persistence handler, and release any resources.
 void deleteObject(ObjectProvider op)
          Deletes a persistent object from the datastore.
 void fetchObject(ObjectProvider op, int[] fieldNumbers)
          Fetches a persistent object from the database.
 java.lang.Object findObject(ExecutionContext ectx, java.lang.Object id)
          Method to find a persistable object with the specified id from the datastore, if the StoreManager supports this operation (optional).
 java.lang.Object[] findObjects(ExecutionContext ectx, java.lang.Object[] ids)
          Method to find an array of objects with the specified identities from the datastore.
 void insertObject(ObjectProvider op)
          Inserts a persistent object into the database.
 void locateObject(ObjectProvider op)
          Locates this object in the datastore.
 void locateObjects(ObjectProvider[] ops)
          Locates object(s) in the datastore.
 void updateObject(ObjectProvider op, int[] fieldNumbers)
          Updates a persistent object in the datastore.
 

Method Detail

close

void close()
Method to close the persistence handler, and release any resources.


batchStart

void batchStart(ExecutionContext ectx)
Signal that a batch of operations are starting for the specified ExecutionContext. This is usually a batch persist, or batch delete.

Parameters:
ectx - The ExecutionContext

batchEnd

void batchEnd(ExecutionContext ectx)
Signal that a batch of operations are ending for the specified ExecutionContext. This is usually a batch persist, or batch delete.

Parameters:
ectx - The ExecutionContext

insertObject

void insertObject(ObjectProvider op)
Inserts a persistent object into the database.

Parameters:
op - The ObjectProvider of the object to be inserted.
Throws:
NucleusDataStoreException - when an error occurs in the datastore communication

updateObject

void updateObject(ObjectProvider op,
                  int[] fieldNumbers)
Updates a persistent object in the datastore.

Parameters:
op - The ObjectProvider of the object to be updated.
fieldNumbers - The numbers of the fields to be updated.
Throws:
NucleusDataStoreException - when an error occurs in the datastore communication

deleteObject

void deleteObject(ObjectProvider op)
Deletes a persistent object from the datastore.

Parameters:
op - The ObjectProvider of the object to be deleted.
Throws:
NucleusDataStoreException - when an error occurs in the datastore communication

fetchObject

void fetchObject(ObjectProvider op,
                 int[] fieldNumbers)
Fetches a persistent object from the database.

Parameters:
op - The ObjectProvider of the object to be fetched.
fieldNumbers - The numbers of the fields to be fetched.
Throws:
NucleusObjectNotFoundException - if the object doesn't exist
NucleusDataStoreException - when an error occurs in the datastore communication

locateObject

void locateObject(ObjectProvider op)
Locates this object in the datastore.

Parameters:
op - The ObjectProvider for the object to be found
Throws:
NucleusObjectNotFoundException - if the object doesn't exist
NucleusDataStoreException - when an error occurs in the datastore communication

locateObjects

void locateObjects(ObjectProvider[] ops)
Locates object(s) in the datastore.

Parameters:
ops - ObjectProvider(s) for the object(s) to be found
Throws:
NucleusObjectNotFoundException - if an object doesn't exist
NucleusDataStoreException - when an error occurs in the datastore communication

findObject

java.lang.Object findObject(ExecutionContext ectx,
                            java.lang.Object id)
Method to find a persistable object with the specified id from the datastore, if the StoreManager supports this operation (optional). This allows for datastores that perform the instantiation of objects directly (such as ODBMS). With other types of datastores (e.g RDBMS) this method returns null.

Parameters:
ectx - The ExecutionContext
id - the id of the object in question.
Returns:
a persistable object with a valid object state (for example: hollow) or null, indicating that the implementation leaves the instantiation work to DataNucleus.
Throws:
NucleusObjectNotFoundException - if this route is supported yet the object doesn't exist
NucleusDataStoreException - when an error occurs in the datastore communication

findObjects

java.lang.Object[] findObjects(ExecutionContext ectx,
                               java.lang.Object[] ids)
Method to find an array of objects with the specified identities from the datastore. This allows for datastores that perform the instantiation of objects directly (such as ODBMS). With other types of datastores (e.g RDBMS) this method returns null.

Parameters:
ectx - The ExecutionContext
ids - identities of the object(s) to retrieve
Returns:
The persistable objects with these identities (in the same order as
ids
)
Throws:
NucleusObjectNotFoundException - if an object doesn't exist
NucleusDataStoreException - when an error occurs in the datastore communication


Copyright © 2010. All Rights Reserved.