|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface StoreManager
StoreManager represents the datastore to the rest of the JDO components. It provides the means to write and read instances, to get the extent of classes, and to get the object id for a persistence capable object.
Method Summary | |
---|---|
void |
copyKeyFieldsFromObjectId(StateManagerInternal sm,
java.lang.Class pcClass)
This method copies PK field values from internal Object Id into the Hollow instance. |
java.lang.Object |
createObjectId(StateManagerInternal sm,
PersistenceManagerInternal pm)
Creates a new Object Id for the given StateManagerInternal. |
int |
delete(java.util.BitSet loadedFields,
java.util.BitSet dirtyFields,
StateManagerInternal sm)
Causes the object managed by the given state manager to be deleted in the database. |
void |
fetch(StateManagerInternal sm,
int[] fieldNums)
Causes values for fields required by the state manager's object to be retrieved from the store and supplied to the state manager. |
void |
flush(java.util.Iterator it,
PersistenceManagerInternal pm)
Flushes all elements in the given iterator. |
Connector |
getConnector()
Returns a Connector suitable for committing or rolling back operations on this store. |
Connector |
getConnector(java.lang.String userid,
java.lang.String password)
Returns a Connector suitable for committing or rolling back operations on this store for a specific userid. |
javax.jdo.Extent |
getExtent(java.lang.Class pcClass,
boolean subclasses,
PersistenceManagerInternal pm)
Provides the means to get all instances of a particular class, or of that class and its subclasses. |
java.lang.Object |
getExternalObjectId(java.lang.Object objectId,
javax.jdo.spi.PersistenceCapable pc)
Returns an Object Id that can be given to user/client code and which is a copy or external representation of the given objectId. |
java.lang.Object |
getInternalObjectId(java.lang.Object objectId,
PersistenceManagerInternal pm)
Returns an Object Id that can be used by the runtime code and which is a an internal representation of the given objectId. |
java.lang.Class |
getPCClassForOid(java.lang.Object oid,
PersistenceManagerInternal pm)
Returns the Class of the PersistenceCapable instance identified by the given oid. |
boolean |
hasActualPCClass(java.lang.Object objectId)
Returns true if actual Class for a PersistenceCapable instance can be resolved only in the database. |
int |
insert(java.util.BitSet loadedFields,
java.util.BitSet dirtyFields,
StateManagerInternal sm)
Causes the object managed by the given state manager's object to be inserted into the database. |
java.lang.Object |
newObjectIdInstance(java.lang.Class pcClass,
java.lang.String str)
This method returns an object id instance corresponding to the Class and String arguments. |
QueryResult |
newQueryResult(QueryResultHelper qrh)
Returns a QueryResult instance which is then returned as the result of Query.execute(...). |
int |
update(java.util.BitSet loadedFields,
java.util.BitSet dirtyFields,
StateManagerInternal sm)
Causes the object managed by the given state manager to be updated in the database. |
int |
verifyFields(java.util.BitSet loadedFields,
java.util.BitSet dirtyFields,
StateManagerInternal sm)
Causes the object managed by the given state manager to be verified in the database. |
Method Detail |
---|
Connector getConnector()
Connector getConnector(java.lang.String userid, java.lang.String password)
userid
- the userid for the connectionpassword
- the password for the connectionint insert(java.util.BitSet loadedFields, java.util.BitSet dirtyFields, StateManagerInternal sm)
loadedFields
- BitSet of fields to be inserted in the database (may be
ignored).dirtyFields
- BitSet of all fields as all fields are marked as dirty for
insert
. After return, bits will remain as set for fields that
were not inserted. If any bits are set, the return will be
FLUSHED_PARTIAL
.sm
- The state manager whose object is to be inserted.
StateManagerInternal.FLUSHED_{COMPLETE, PARTIAL,
NONE}
,
depending on the success of the operation in inserting specified fields
into the database.int update(java.util.BitSet loadedFields, java.util.BitSet dirtyFields, StateManagerInternal sm)
loadedFields
- BitSet of fields loaded from the database.dirtyFields
- BitSet of changed fields that are to be flushed to the
database. It is the StoreManager policy which fields are to be verified
against those in the database, if this update
is within the
context of an optimistic transaction. After return, bits will remain set
for fields that were not flushed, and in such case the return will be
FLUSHED_PARTIAL
.sm
- The state manager whose object is to be updated.
StateManagerInternal.FLUSHED_{COMPLETE, PARTIAL,
NONE}
, depending on the success of the operation in updating
specified fields into the database.int verifyFields(java.util.BitSet loadedFields, java.util.BitSet dirtyFields, StateManagerInternal sm)
loadedFields
- BitSet of fields to be verified against those in the
database.dirtyFields
- Unused as there are no changed fields in this transaction.sm
- The state manager whose object is to be verified.
JDODataStoreException
- if data in memory does not match that in
the database.int delete(java.util.BitSet loadedFields, java.util.BitSet dirtyFields, StateManagerInternal sm)
loadedFields
- BitSet of fields loaded from the database.dirtyFields
- BitSet of changed fields. It is the StoreManager policy
which fields are to be verified against those in the database, if this
delete
is within the context of an optimistic transaction. After
return, bits will remain set for the fields that were not flushed, if the
update
was performed to resolve dependencies. In such case the
return will be StateManagerInternal.FLUSHED_PARTIAL
.sm
- The state manager whose object is to be deleted.
StateManagerInternal.FLUSHED_{COMPLETE,
NONE}
, depending on the success of the delete operation.void fetch(StateManagerInternal sm, int[] fieldNums)
sm
- The state manager whose fields are to be read.fieldNums
- The fields which are to be read.javax.jdo.Extent getExtent(java.lang.Class pcClass, boolean subclasses, PersistenceManagerInternal pm)
pcClass
- Indicates the class of the instances that are in the
returned Extent.subclasses
- If true, then instances subclasses of pcClass are
included in the resulting Extent. If false, then only instances of
pcClass are included.pm
- PersistenceManagerInternal making the request.
java.lang.Object createObjectId(StateManagerInternal sm, PersistenceManagerInternal pm)
sm
- StateManagerInternal for which an Object Id is needed.pm
- PersistenceManagerInternal in which the sm's object is
created.
java.lang.Object getExternalObjectId(java.lang.Object objectId, javax.jdo.spi.PersistenceCapable pc)
objectId
- Object Id for which an external Object Id is needed.pc
- PersistenceCapable instance associated with this Object Id.
java.lang.Object getInternalObjectId(java.lang.Object objectId, PersistenceManagerInternal pm)
objectId
- Object Id for which an internal Object Id is needed.pm
- PersistenceManagerInternal which requested the Object Id.
java.lang.Class getPCClassForOid(java.lang.Object oid, PersistenceManagerInternal pm)
oid
- object id whose java.lang.Class is wanted.pm
- PersistenceManagerInternal to use in loading the oid's
Class.
boolean hasActualPCClass(java.lang.Object objectId)
objectId
- Object Id whose java.lang.Class needs to be resolved.
java.lang.Object newObjectIdInstance(java.lang.Class pcClass, java.lang.String str)
pcClass
- the Class of the persistence-capable instancestr
- the String form of the object id
void copyKeyFieldsFromObjectId(StateManagerInternal sm, java.lang.Class pcClass)
sm
- StateManagerInternal for which an operation is needed.pcClass
- the Class of the persistence-capable instancevoid flush(java.util.Iterator it, PersistenceManagerInternal pm)
it
- Iterator of StateManagerInternal instances to be flushed.pm
- PersistenceManagerInternal on whose behalf instances are being
flushed.
JDOFatalDataStoreException
- if instances could not all be flushed
as determined by sm.isFlushed()
.QueryResult newQueryResult(QueryResultHelper qrh)
qrh
- the helper providing the query tree, the candidates
and the actual parameters.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |