public class SQLStoreManager extends Object implements PersistenceStore
This class connects to a persistent store. It supports relational databases such as Oracle and MS SQLServer. This class knows how to generate SQL statements to access and manipulate objects stored in a relational database.
| Constructor and Description |
|---|
SQLStoreManager(DatabaseMetaData databaseMetaData,
String identifier) |
| Modifier and Type | Method and Description |
|---|---|
void |
execute(PersistenceManager pm,
Collection actions)
Executes the list of SQL requests contained in
actions. |
void |
executeBatch(PersistenceManager pm,
UpdateObjectDesc request,
boolean forceFlush)
Retrieves the update query plan for the specified request and
calls executeUpdateBatch for all statements in this plan.
|
Class |
getClassByOidClass(Class oidType) |
ConfigCache |
getConfigCache()
Returns ConfigCache associated with this store.
|
PersistenceConfig |
getPersistenceConfig(Class classType)
Returns the sqlstore model for class
classType. |
RetrieveDesc |
getRetrieveDesc(Class classType)
Returns a new retrieve descriptor for anexternal (user) query.
|
RetrieveDesc |
getRetrieveDesc(String fieldName,
Class classType)
Returns a new retrieve descriptor for anexternal (user) query.
|
StateManager |
getStateManager(Class classType) |
UpdateObjectDesc |
getUpdateObjectDesc(Class classType) |
DBVendorType |
getVendorType() |
Object |
retrieve(PersistenceManager pm,
RetrieveDesc action,
ValueFetcher parameters)
The retrieve method builds and executes the SQL query described by
the action parameter.
|
public SQLStoreManager(DatabaseMetaData databaseMetaData, String identifier)
databaseMetaData - Instance of DatabaseMetaDataidentifier - identifier of the caller creating a new instance
of SQLStoreManager. Typically this is identifier of
PersistenceManagerFacory initializing this SQLStoreManager.public PersistenceConfig getPersistenceConfig(Class classType)
classType.
Sqlstore model information is cached. If the model cache does
not already hold a model instance for the particular class,
a new instance is created, initialized and put into the cache.
The access to the model cache is synchronized.getPersistenceConfig in interface PersistenceStorepublic ConfigCache getConfigCache()
PersistenceStoregetConfigCache in interface PersistenceStorepublic void execute(PersistenceManager pm, Collection actions)
actions.
Requests can be INSERT, UPDATE or DELETE operations.execute in interface PersistenceStoreJDODataStoreException - Will be thrown in case of errors or if the affected rows are
less than the minimum rows required.public Class getClassByOidClass(Class oidType)
getClassByOidClass in interface PersistenceStorepublic StateManager getStateManager(Class classType)
getStateManager in interface PersistenceStorepublic RetrieveDesc getRetrieveDesc(Class classType)
getRetrieveDesc in interface PersistenceStoreclassType - Type of the persistence capable class to be queried.public RetrieveDesc getRetrieveDesc(String fieldName, Class classType)
name.getRetrieveDesc in interface PersistenceStorefieldName - Name of the foreign field to be queried.classType - Persistence capable class including fieldName.public UpdateObjectDesc getUpdateObjectDesc(Class classType)
getUpdateObjectDesc in interface PersistenceStorepublic DBVendorType getVendorType()
public Object retrieve(PersistenceManager pm, RetrieveDesc action, ValueFetcher parameters)
retrieve in interface PersistenceStoreaction - The action parameter holds the RetrieveDesc describing what
should be selected from the database.parameters - Query parameters.public void executeBatch(PersistenceManager pm, UpdateObjectDesc request, boolean forceFlush)
executeBatch in interface PersistenceStorepm - the persistence managerrequest - the request corresponding with the current state managerforceFlush - all in the update query plan must be executedCopyright © 2017. All rights reserved.