|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.openjpa.jdbc.kernel.JDBCStoreManager
public class JDBCStoreManager
StoreManager plugin that uses JDBC to store persistent data in a relational data store.
| Nested Class Summary | |
|---|---|
protected class |
JDBCStoreManager.RefCountConnection
Connection wrapper that keeps an internal ref count so that it knows when to really close. |
| Field Summary |
|---|
| Fields inherited from interface org.apache.openjpa.kernel.StoreManager |
|---|
FORCE_LOAD_ALL, FORCE_LOAD_DFG, FORCE_LOAD_NONE, FORCE_LOAD_REFRESH, VERSION_DIFFERENT, VERSION_EARLIER, VERSION_LATER, VERSION_SAME |
| Constructor Summary | |
|---|---|
JDBCStoreManager()
|
|
| Method Summary | |
|---|---|
boolean |
assignField(OpenJPAStateManager sm,
int field,
boolean preFlush)
|
boolean |
assignObjectId(OpenJPAStateManager sm,
boolean preFlush)
|
void |
beforeStateChange(OpenJPAStateManager sm,
PCState fromState,
PCState toState)
|
void |
begin()
|
void |
beginOptimistic()
|
boolean |
cancelAll()
|
void |
close()
|
void |
commit()
|
int |
compareVersion(OpenJPAStateManager state,
java.lang.Object v1,
java.lang.Object v2)
|
protected JDBCStoreManager.RefCountConnection |
connectInternal()
Connect to the database. |
java.lang.Object |
copyDataStoreId(java.lang.Object oid,
ClassMetaData meta)
|
ResultObjectProvider |
executeExtent(ClassMetaData meta,
boolean subclasses,
FetchConfiguration fetch)
|
boolean |
exists(OpenJPAStateManager sm,
java.lang.Object context)
|
java.lang.Object |
find(java.lang.Object oid,
ValueMapping vm,
JDBCFetchConfiguration fetch)
Find the object with the given oid. |
java.util.Collection |
flush(java.util.Collection sms)
|
java.lang.Object |
getClientConnection()
|
JDBCConfiguration |
getConfiguration()
Return the configuration for this runtime. |
java.sql.Connection |
getConnection()
Return a SQL connection to the database. |
StoreContext |
getContext()
Current persistence context. |
Seq |
getDataStoreIdSequence(ClassMetaData meta)
|
java.lang.Class |
getDataStoreIdType(ClassMetaData meta)
|
DBDictionary |
getDBDictionary()
Return the dictionary in use. |
JDBCFetchConfiguration |
getFetchConfiguration()
Return the current default fetch configuration. |
JDBCLockManager |
getLockManager()
If the lock manager in use is a JDBCLockManager, return it. |
java.lang.Class |
getManagedType(java.lang.Object oid)
|
SQLFactory |
getSQLFactory()
Return the SQL factory for this runtime. |
Seq |
getValueSequence(FieldMetaData fmd)
|
boolean |
initialize(OpenJPAStateManager sm,
PCState state,
FetchConfiguration fetch,
java.lang.Object context)
|
java.lang.Object |
load(ClassMapping mapping,
JDBCFetchConfiguration fetch,
java.util.BitSet exclude,
Result result)
Load the object in the current row of the given result. |
boolean |
load(OpenJPAStateManager sm,
java.util.BitSet fields,
FetchConfiguration fetch,
int lockLevel,
java.lang.Object context)
|
java.util.Collection |
loadAll(java.util.Collection sms,
PCState state,
int load,
FetchConfiguration fetch,
java.lang.Object context)
|
void |
loadSubclasses(ClassMapping mapping)
Makes sure all subclasses of the given type are loaded in the JVM. |
Id |
newDataStoreId(long id,
ClassMapping mapping,
boolean subs)
Create a new datastore identity object from the given id value and mapping. |
java.lang.Object |
newDataStoreId(java.lang.Object val,
ClassMetaData meta)
|
FetchConfiguration |
newFetchConfiguration()
|
StoreQuery |
newQuery(java.lang.String language)
|
void |
releaseConnection()
|
void |
retainConnection()
|
void |
rollback()
|
void |
rollbackOptimistic()
|
boolean |
select(Select sel,
ClassMapping mapping,
int subs,
OpenJPAStateManager sm,
java.util.BitSet fields,
JDBCFetchConfiguration fetch,
int eager,
boolean ident,
boolean outer)
For implementation use only. |
void |
setContext(StoreContext ctx)
|
boolean |
syncVersion(OpenJPAStateManager sm,
java.lang.Object context)
|
| 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 StoreContext getContext()
JDBCStore
getContext in interface JDBCStorepublic void setContext(StoreContext ctx)
setContext in interface StoreManagerpublic JDBCConfiguration getConfiguration()
JDBCStore
getConfiguration in interface JDBCStorepublic DBDictionary getDBDictionary()
JDBCStore
getDBDictionary in interface JDBCStorepublic SQLFactory getSQLFactory()
JDBCStore
getSQLFactory in interface JDBCStorepublic JDBCLockManager getLockManager()
JDBCStoreJDBCLockManager, return it.
getLockManager in interface JDBCStorepublic JDBCFetchConfiguration getFetchConfiguration()
JDBCStore
getFetchConfiguration in interface JDBCStorepublic void beginOptimistic()
beginOptimistic in interface StoreManagerpublic void rollbackOptimistic()
rollbackOptimistic in interface StoreManagerpublic void begin()
begin in interface StoreManagerpublic void commit()
commit in interface StoreManagerpublic void rollback()
rollback in interface StoreManagerpublic void retainConnection()
retainConnection in interface StoreManagerpublic void releaseConnection()
releaseConnection in interface StoreManagerpublic java.lang.Object getClientConnection()
getClientConnection in interface StoreManagerpublic java.sql.Connection getConnection()
JDBCStoreclose method should always be called on the connection
to free any resources it is using. When appropriate, the close
method is implemented as a no-op.
getConnection in interface JDBCStore
public boolean exists(OpenJPAStateManager sm,
java.lang.Object context)
exists in interface StoreManager
public boolean syncVersion(OpenJPAStateManager sm,
java.lang.Object context)
syncVersion in interface StoreManager
public int compareVersion(OpenJPAStateManager state,
java.lang.Object v1,
java.lang.Object v2)
compareVersion in interface StoreManager
public boolean initialize(OpenJPAStateManager sm,
PCState state,
FetchConfiguration fetch,
java.lang.Object context)
initialize in interface StoreManager
public boolean load(OpenJPAStateManager sm,
java.util.BitSet fields,
FetchConfiguration fetch,
int lockLevel,
java.lang.Object context)
load in interface StoreManager
public java.util.Collection loadAll(java.util.Collection sms,
PCState state,
int load,
FetchConfiguration fetch,
java.lang.Object context)
loadAll in interface StoreManager
public void beforeStateChange(OpenJPAStateManager sm,
PCState fromState,
PCState toState)
beforeStateChange in interface StoreManagerpublic java.util.Collection flush(java.util.Collection sms)
flush in interface StoreManagerpublic boolean cancelAll()
cancelAll in interface StoreManager
public boolean assignObjectId(OpenJPAStateManager sm,
boolean preFlush)
assignObjectId in interface StoreManager
public boolean assignField(OpenJPAStateManager sm,
int field,
boolean preFlush)
assignField in interface StoreManagerpublic java.lang.Class getManagedType(java.lang.Object oid)
getManagedType in interface StoreManagerpublic java.lang.Class getDataStoreIdType(ClassMetaData meta)
getDataStoreIdType in interface StoreManager
public java.lang.Object copyDataStoreId(java.lang.Object oid,
ClassMetaData meta)
copyDataStoreId in interface StoreManager
public java.lang.Object newDataStoreId(java.lang.Object val,
ClassMetaData meta)
newDataStoreId in interface StoreManager
public Id newDataStoreId(long id,
ClassMapping mapping,
boolean subs)
JDBCStore
newDataStoreId in interface JDBCStore
public ResultObjectProvider executeExtent(ClassMetaData meta,
boolean subclasses,
FetchConfiguration fetch)
executeExtent in interface StoreManagerpublic StoreQuery newQuery(java.lang.String language)
newQuery in interface StoreManagerpublic FetchConfiguration newFetchConfiguration()
newFetchConfiguration in interface StoreManagerpublic Seq getDataStoreIdSequence(ClassMetaData meta)
getDataStoreIdSequence in interface StoreManagerpublic Seq getValueSequence(FieldMetaData fmd)
getValueSequence in interface StoreManagerpublic void close()
close in interface StoreManagerclose in interface Closeable
protected JDBCStoreManager.RefCountConnection connectInternal()
throws java.sql.SQLException
java.sql.SQLException
public java.lang.Object find(java.lang.Object oid,
ValueMapping vm,
JDBCFetchConfiguration fetch)
find in interface JDBCStorevm - the mapping holding this oid, or null if not applicable
public java.lang.Object load(ClassMapping mapping,
JDBCFetchConfiguration fetch,
java.util.BitSet exclude,
Result result)
throws java.sql.SQLException
java.sql.SQLException
public boolean select(Select sel,
ClassMapping mapping,
int subs,
OpenJPAStateManager sm,
java.util.BitSet fields,
JDBCFetchConfiguration fetch,
int eager,
boolean ident,
boolean outer)
sel - select to build onmapping - the mapping for the base type to select forsubs - whether the select might include subclasses of the
given mappingsm - state manager if an instance is being loaded or
initialized, else nullfields - if a state manager is being loaded, the set of
fields that must be loaded in order, else nullfetch - the fetch configuration; used if no specific fields
must be loaded, and used when selecting relationseager - eager fetch mode to useident - whether to select primary key columns as distinct
identifiersouter - whether we're outer-joining to this type
public void loadSubclasses(ClassMapping mapping)
loadSubclasses in interface JDBCStore
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||