|
SolarMetric Kodo JDO 2.4.3 generated on March 27 2003 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager
StoreManager plugin for the common JDO runtime environent that uses JDBC to store persistent data in a relational data store.
| Constructor Summary | |
|---|---|
JDBCStoreManager()
|
|
| Method Summary | |
|---|---|
boolean |
addSQLExecutionListener(SQLExecutionListener listener)
Add a listener for all SQLExecution events. |
void |
begin()
Begin a data store transaction. |
void |
beginOptimistic()
Notification that an optimistic transaction has started. |
boolean |
checkVersion(StateManagerImpl sm)
Determine whether the given StateManager is the same version as the datastore version. |
void |
commit()
Commit the current data store transaction. |
Object |
copyDataStoreId(Object oid,
ClassMetaData meta)
Copy the given object id value. |
Object |
createFromResultSet(ClassMapping cm,
SQLExecutionManager sqlem,
ResultSet rs,
FieldMetaData[] fmds,
int index)
Create an instance from the given result set; if the instance is already cached it will be returned. |
protected ResultList |
executeQuery(ClassMapping cm,
SQLExecutionManager sqlem,
PreparedStatement stmnt,
boolean subs)
Execute the given prepared statement loading instances through the given mapping. |
protected ResultList |
executeQuery(ObjectSelect sel,
Class type,
boolean subs)
Load all matching objects for the given query. |
boolean |
exists(Object oid,
ClassMetaData meta)
Verify that the given instance exists in the data store. |
Collection |
flush(Collection states)
Flush the given state manager collection to the datastore, returning a collection of user exceptions encountered during flushing. |
JDBCConfiguration |
getConfiguration()
Return the configuration for this store. |
Connection |
getConnection()
Returns a Connection to the data store. |
Connector |
getConnector()
Returns a Connector, which can be used to
obtain a Connection instance. |
Class |
getDataStoreIdClass(ClassMetaData meta)
Return the class used by this StoreManager for datastore identity values. |
DBDictionary |
getDictionary()
Obtain a DBDictionary that used this PersistenceManagerImpl's Connector. |
PersistenceManagerImpl |
getPersistenceManager()
Return the PersistenceManager this StoreManager is owned by. |
JDBCPersistenceManagerFactory |
getPersistenceManagerFactory()
|
SQLExecutionManager |
getSQLExecutionManager()
Return a SQLExecutionManager for interaction with the
database; if there is a transaction
in progress the connection will be transactionally consistent. |
boolean |
initialize(StateManagerImpl sm,
com.solarmetric.kodo.runtime.JDOState state,
Object connection)
Initialize the given StateManager. |
boolean |
isActive()
Returns true if there is a data store transaction active. |
void |
load(StateManagerImpl sm,
Object connection,
BitSet fields,
boolean setVersion)
Load the given StateManager. |
Object |
newDataStoreId(ClassMetaData meta)
Create a new unique datastore identity for the given type. |
Object |
newDataStoreId(String str,
ClassMetaData meta)
Create a new unique datastore identity for the given type from the given string. |
Extent |
newExtent(ClassMetaData meta,
boolean subclasses)
Return an extent of the given candidate class, optionally including subclasses. |
com.solarmetric.kodo.query.FilterExtensions |
newFilterExtensions()
Return a FilterExtensions implementation for use in queries. |
Query |
newQuery(String language,
Object copy)
Return a query implementation suitable for this runtime. |
void |
release(SQLExecutionManager manager)
Release the SQLExecutionManager if appropriate (i.e., if we do not have an active datastore transaction). |
void |
releaseConnection(Connection c)
Releases the obtained Connection. |
boolean |
removeSQLExecutionListener(SQLExecutionListener listener)
Remove a listener for all SQLExecution events. |
void |
rollback()
Rollback the current data store transaction. |
void |
setPersistenceManager(PersistenceManagerImpl pm)
Set the PersistenceManager this StoreManager is owned by. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public JDBCStoreManager()
| Method Detail |
public PersistenceManagerImpl getPersistenceManager()
public void setPersistenceManager(PersistenceManagerImpl pm)
setPersistenceManager in interface StoreManagerpublic JDBCPersistenceManagerFactory getPersistenceManagerFactory()
public JDBCConfiguration getConfiguration()
public void beginOptimistic()
StoreManagerStoreManager.begin() method, which will still be called
when a true data store transaction should begin.beginOptimistic in interface StoreManagerpublic void begin()
StoreManagerbegin in interface StoreManagerpublic void commit()
StoreManagercommit in interface StoreManagerpublic void rollback()
StoreManagerrollback in interface StoreManager
public boolean exists(Object oid,
ClassMetaData meta)
StoreManagerexists in interface StoreManagerpublic boolean checkVersion(StateManagerImpl sm)
StoreManagercheckVersion in interface StoreManagercom.solarmetric.kodo.runtime.StoreManagersm - the instance to check
public boolean initialize(StateManagerImpl sm,
com.solarmetric.kodo.runtime.JDOState state,
Object connection)
StoreManageroid of the
StateManager will be set, and the meta field of the
StateManager will be set to the class of the instance to load, or
possibly one of its superclasses. Initialization involves first
calling the StateManagerImpl#setPersistenceCapable method with
a new instance of the correct type constructed with the
JDOImplHelper#newInstance(Class,StateManager,Object) method
(this will reset the meta field of the StateManager if
the actual type was a subclass), then possibly loading any fields if
desired. The version information for the StateManager should also be
set via the StateManagerImpl.setVersion(java.lang.Object) method. If this
method is called during a data store transaction, the instance should
be locked.initialize in interface StoreManagercom.solarmetric.kodo.runtime.StoreManagersm - the instance to initializestate - the JDO state to pass through to the state
manager's initialize methodconnection - the current connection information, or null if not
given to the calling method of the persistence
manager
public void load(StateManagerImpl sm,
Object connection,
BitSet fields,
boolean setVersion)
StoreManagerload in interface StoreManagercom.solarmetric.kodo.runtime.StoreManagersm - the instance to loadconnection - the current connection information, or null if not
given to the calling method of the persistence
managerfields - the fields to load; the field corrsponding to the
metadata field at each set bit position should
be loaded; additional fields can be loaded if
desired; attempting to load an additional field that
has been dirtied will cause the load to be ignored;
this bit set should not be modifiedsetVersion - if true, the version information should also be
loaded from the db and set in the instance via
the StateManagerImpl.setVersion(java.lang.Object) methodpublic Collection flush(Collection states)
StoreManagerStateManagerImpl.setNextVersion(java.lang.Object) method. The current version
will roll over to this next version upon successful commit.flush in interface StoreManagerpublic Class getDataStoreIdClass(ClassMetaData meta)
StoreManagergetDataStoreIdClass in interface StoreManager
public Object copyDataStoreId(Object oid,
ClassMetaData meta)
StoreManagercopyDataStoreId in interface StoreManagerpublic Object newDataStoreId(ClassMetaData meta)
StoreManagernewDataStoreId in interface StoreManager
public Object newDataStoreId(String str,
ClassMetaData meta)
StoreManagernewDataStoreId in interface StoreManager
public Extent newExtent(ClassMetaData meta,
boolean subclasses)
StoreManagernewExtent in interface StoreManager
public Query newQuery(String language,
Object copy)
StoreManagernewQuery in interface StoreManagercom.solarmetric.kodo.runtime.StoreManagerthe - query language; implementations are only required to
support javax.jdo.query.JDOQLa - template query instance also from this StoreManager; this
instance may be null; if not null, the filter, variables,
parameters, imports, and candidate class should be copied from
the template to the returned Query instancepublic com.solarmetric.kodo.query.FilterExtensions newFilterExtensions()
StoreManagerreturn FilterExtensions.DefaultExtensions.newExtensions ()newFilterExtensions in interface StoreManagerpublic boolean isActive()
public Connection getConnection()
throws SQLException
Connection to the data store. If a transaction
is not currently in progress, then the Connection will not
be associated with this store manager's transaction, otherwise
it will be the same transaction that is currently being used
by the transaction.
public void releaseConnection(Connection c)
throws SQLException
public SQLExecutionManager getSQLExecutionManager()
SQLExecutionManager for interaction with the
database; if there is a transaction
in progress the connection will be transactionally consistent.public Connector getConnector()
Connector, which can be used to
obtain a Connection instance.public DBDictionary getDictionary()
DBDictionary that used this PersistenceManagerImpl's Connector.public void release(SQLExecutionManager manager)
SQLExceptions will be consummed and logged to the runtime log.
protected ResultList executeQuery(ClassMapping cm,
SQLExecutionManager sqlem,
PreparedStatement stmnt,
boolean subs)
protected ResultList executeQuery(ObjectSelect sel,
Class type,
boolean subs)
subs - if true, matching subclasses will also be returned
public Object createFromResultSet(ClassMapping cm,
SQLExecutionManager sqlem,
ResultSet rs,
FieldMetaData[] fmds,
int index)
cm - the mapping for a base type of the instancesqlem - A SQLExecutionManager that can be used for
loading additional data.rs - the result set to load fromfmds - an array of FieldMetaData objects to loadindex - the column index to start at when loadingpublic boolean addSQLExecutionListener(SQLExecutionListener listener)
public boolean removeSQLExecutionListener(SQLExecutionListener listener)
|
SolarMetric Kodo JDO 2.4.3 generated on March 27 2003 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||