public class RDBMSPersistenceHandler
extends org.datanucleus.store.AbstractPersistenceHandler
Constructor and Description |
---|
RDBMSPersistenceHandler(org.datanucleus.store.StoreManager storeMgr)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Method to close the handler and release any resources.
|
void |
deleteObject(org.datanucleus.state.ObjectProvider op)
Deletes a persistent object from the database.
|
void |
fetchObject(org.datanucleus.state.ObjectProvider op,
int[] memberNumbers)
Fetches (fields of) a persistent object from the database.
|
Object |
findObject(org.datanucleus.ExecutionContext ec,
Object id)
Method to return a persistable object with the specified id.
|
void |
insertObject(org.datanucleus.state.ObjectProvider op)
Inserts a persistent object into the database.
|
void |
insertObjects(org.datanucleus.state.ObjectProvider... ops) |
void |
locateObject(org.datanucleus.state.ObjectProvider op)
Locates this object in the datastore.
|
void |
locateObjects(org.datanucleus.state.ObjectProvider[] ops) |
void |
removeAllRequests()
Convenience method to remove all requests since the schema has changed.
|
void |
removeRequestsForTable(DatastoreClass table)
Convenience method to remove all requests that use a particular table since the structure
of the table has changed potentially leading to missing columns in the cached version.
|
void |
updateObject(org.datanucleus.state.ObjectProvider op,
int[] fieldNumbers)
Updates a persistent object in the database.
|
public RDBMSPersistenceHandler(org.datanucleus.store.StoreManager storeMgr)
storeMgr
- StoreManagerpublic void close()
public void insertObjects(org.datanucleus.state.ObjectProvider... ops)
insertObjects
in interface org.datanucleus.store.StorePersistenceHandler
insertObjects
in class org.datanucleus.store.AbstractPersistenceHandler
public void insertObject(org.datanucleus.state.ObjectProvider op)
op
- The ObjectProvider of the object to be inserted.org.datanucleus.exceptions.NucleusDataStoreException
- when an error occurs in the datastore communicationpublic void fetchObject(org.datanucleus.state.ObjectProvider op, int[] memberNumbers)
op
- Object Provider of the object to be fetched.memberNumbers
- The numbers of the members to be fetched.org.datanucleus.exceptions.NucleusObjectNotFoundException
- if the object doesn't existorg.datanucleus.exceptions.NucleusDataStoreException
- when an error occurs in the datastore communicationpublic void updateObject(org.datanucleus.state.ObjectProvider op, int[] fieldNumbers)
op
- The ObjectProvider of the object to be updated.fieldNumbers
- The numbers of the fields to be updated.org.datanucleus.exceptions.NucleusDataStoreException
- when an error occurs in the datastore communicationpublic void deleteObject(org.datanucleus.state.ObjectProvider op)
op
- The ObjectProvider of the object to be deleted.org.datanucleus.exceptions.NucleusDataStoreException
- when an error occurs in the datastore communicationpublic void locateObjects(org.datanucleus.state.ObjectProvider[] ops)
locateObjects
in interface org.datanucleus.store.StorePersistenceHandler
locateObjects
in class org.datanucleus.store.AbstractPersistenceHandler
public void locateObject(org.datanucleus.state.ObjectProvider op)
op
- ObjectProvider for the object to be foundorg.datanucleus.exceptions.NucleusObjectNotFoundException
- if the object doesnt existorg.datanucleus.exceptions.NucleusDataStoreException
- when an error occurs in the datastore communicationpublic Object findObject(org.datanucleus.ExecutionContext ec, Object id)
StoreManager implementations may simply return null, indicating that they leave the object instantiate to us. Other implementations may instantiate the object in question (whether the implementation may trust that the object is not already instantiated has still to be determined). If an implementation believes that an object with the given ID should exist, but in fact does not exist, then the implementation should throw a RuntimeException. It should not silently return null in this case.
ec
- execution contextid
- the id of the object in question.public void removeAllRequests()
public void removeRequestsForTable(DatastoreClass table)
table
- The tableCopyright © 2017. All rights reserved.