|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jpox.store.AbstractStoreManager
org.jpox.store.mapped.MappedStoreManager
public abstract class MappedStoreManager
Manager for a datastore that has a schema and maps classes to associated objects in the datastore. Datastores such as RDBMS will extend this type of StoreManager.
In a "mapped" datastore, a class is associated with a DatastoreClass. Similarly a field of a class is associated with a DatastoreField. Where a relation is stored separately this is associated with a DatastoreContainerObject. In an RDBMS datastore this will be
This type of StoreManager allows creation/validation of the schema. A schema is split into "tables", "columns", "constraints" currently. The PMF/EMF allows specification of a set of properties that will apply to this type of datastore.
| Field Summary | |
|---|---|
protected boolean |
autoCreateColumns
Whether to auto create any columns that are missing. |
protected boolean |
autoCreateConstraints
Whether to auto create any constraints |
protected boolean |
autoCreateTables
Whether to auto create any tables. |
protected boolean |
autoCreateWarnOnError
Whether to warn only when any errors occur on auto-create. |
protected java.util.Map |
datastoreContainerByIdentifier
Map of all managed datastore containers (tables) keyed by the datastore identifier. |
protected DatastoreAdapter |
dba
Adapter for the datastore being used. |
protected IdentifierFactory |
identifierFactory
Factory for identifiers for this datastore. |
protected boolean |
validateColumns
Whether to validate any columns |
protected boolean |
validateConstraints
Whether to validate any constraints |
protected boolean |
validateTables
Whether to validate any tables |
| Fields inherited from class org.jpox.store.AbstractStoreManager |
|---|
autoStartMechanism, fixedDatastore, LOCALISER, nontxConnectionFactoryName, omfContext, persistenceHandler, poidManager, readOnlyDatastore, readOnlyDatastoreAction, schemaHandler, starter, starterInitialised, storeDataMgr, storeManagerKey, storeManagerRuntime, txConnectionFactoryName |
| Constructor Summary | |
|---|---|
protected |
MappedStoreManager(java.lang.String key,
ClassLoaderResolver clr,
OMFContext omfContext)
Constructor. |
| Method Summary | |
|---|---|
void |
addDatastoreContainer(DatastoreContainerObject table)
Method to add a datastore container to the managed datastore classes |
void |
close()
Release of resources. |
abstract void |
createDatastoreColumnsForFieldUsingSubclassTable(JavaTypeMapping m,
DatastoreContainerObject table,
AbstractMemberMetaData fmd,
ClassLoaderResolver clr)
Method to create the necessary datastore columns for a field using subclass-table inheritance. |
abstract void |
createDatastoreColumnsForReferenceField(JavaTypeMapping m,
DatastoreContainerObject table,
AbstractMemberMetaData fmd,
ClassLoaderResolver clr,
boolean embedded)
Method to create the necessary datastore columns for a reference field. |
AbstractClassMetaData[] |
getClassesManagingTableForClass(AbstractClassMetaData cmd,
ClassLoaderResolver clr)
Method to return the class(es) that has a table managing the persistence of the fields of the supplied class. |
AbstractClassMetaData |
getClassWithPrimaryKeyForClass(AbstractClassMetaData cmd,
ClassLoaderResolver clr)
Utility to navigate the inheritance hierarchy to find the base class that defines the primary keys for this tree. |
DatastoreAdapter |
getDatastoreAdapter()
Gets the DatastoreAdapter to use for this store. |
DatastoreClass |
getDatastoreClass(DatastoreIdentifier name)
Returns the JDO table having the given SQL identifier. |
DatastoreClass |
getDatastoreClass(java.lang.String className,
ClassLoaderResolver clr)
Returns the primary datastore container serving as backing for the given class. |
DatastoreContainerObject |
getDatastoreContainerObject(AbstractMemberMetaData fmd)
Returns the datastore container (table) for the specified field. |
abstract FetchStatement |
getFetchStatement(DatastoreContainerObject table)
Method to create a new fetch statement for the passed table. |
abstract FieldManager |
getFieldManagerForResultProcessing(StateManager sm,
java.lang.Object rs,
StatementExpressionIndex[] stmtExprIndx)
Accessor for a FieldManager capable of processing the results of a query. |
IdentifierFactory |
getIdentifierFactory()
|
MappingManager |
getMappingManager()
Gets the MappingManager to use for this store. |
StoreData[] |
getStoreDataForDatastoreContainerObject(DatastoreIdentifier tableIdentifier)
Utility to return all StoreData for a Datastore Container identifier. |
abstract DatastoreContainerObject |
newJoinDatastoreContainerObject(AbstractMemberMetaData fmd,
ClassLoaderResolver clr)
Called by Mapping objects to request the creation of a DatastoreObject (table). |
boolean |
supportsValueStrategy(java.lang.String strategy)
Accessor for whether this value strategy is supported. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected DatastoreAdapter dba
protected IdentifierFactory identifierFactory
protected final boolean autoCreateTables
protected final boolean autoCreateColumns
protected final boolean autoCreateConstraints
protected final boolean autoCreateWarnOnError
protected final boolean validateTables
protected final boolean validateColumns
protected final boolean validateConstraints
protected java.util.Map datastoreContainerByIdentifier
| Constructor Detail |
|---|
protected MappedStoreManager(java.lang.String key,
ClassLoaderResolver clr,
OMFContext omfContext)
key - Key for this StoreManagerclr - the ClassLoaderResolveromfContext - The corresponding ObjectManagerFactory context.StoreManagerFactory| Method Detail |
|---|
public void close()
StoreManager
close in interface StoreManagerclose in class AbstractStoreManagerpublic boolean supportsValueStrategy(java.lang.String strategy)
supportsValueStrategy in interface StoreManagersupportsValueStrategy in class AbstractStoreManagerstrategy - The strategy
public IdentifierFactory getIdentifierFactory()
public DatastoreAdapter getDatastoreAdapter()
public MappingManager getMappingManager()
public abstract FetchStatement getFetchStatement(DatastoreContainerObject table)
table - The table to fetch from
public abstract DatastoreContainerObject newJoinDatastoreContainerObject(AbstractMemberMetaData fmd,
ClassLoaderResolver clr)
fmd - The field metadata describing the field.clr - The ClassLoaderResolver
public StoreData[] getStoreDataForDatastoreContainerObject(DatastoreIdentifier tableIdentifier)
tableIdentifier - Identifier for the table
public DatastoreContainerObject getDatastoreContainerObject(AbstractMemberMetaData fmd)
fmd - The metadata for the field.
public void addDatastoreContainer(DatastoreContainerObject table)
table - The datastore container
public abstract void createDatastoreColumnsForReferenceField(JavaTypeMapping m,
DatastoreContainerObject table,
AbstractMemberMetaData fmd,
ClassLoaderResolver clr,
boolean embedded)
m - (Java) Mapping for the fieldtable - The datastore container where the datastore columns will be createdfmd - MetaData for the field/propertyclr - ClassLoader resolverembedded - Whether the field is embedded
public abstract void createDatastoreColumnsForFieldUsingSubclassTable(JavaTypeMapping m,
DatastoreContainerObject table,
AbstractMemberMetaData fmd,
ClassLoaderResolver clr)
m - (Java) Mapping for the fieldtable - The datastore container where the datastore columns will be createdfmd - MetaData for the field/propertyclr - ClassLoader resolver
public abstract FieldManager getFieldManagerForResultProcessing(StateManager sm,
java.lang.Object rs,
StatementExpressionIndex[] stmtExprIndx)
sm - StateManager for the objectrs - The resultsstmtExprIndx - Statement expression indices for results -> fields mapping
public DatastoreClass getDatastoreClass(java.lang.String className,
ClassLoaderResolver clr)
AbstractStoreManager.addClass(java.lang.String, org.jpox.ClassLoaderResolver)is called
to add it. Classes which have inheritance strategy of "new-table" and
"superclass-table" will return a table here, whereas "subclass-table" will
return null since it doesn't have a table as such.
className - Name of the class whose table is be returned.clr - The ClassLoaderResolver
NoTableManagedException - If the given class has no table managed in the database.public DatastoreClass getDatastoreClass(DatastoreIdentifier name)
name - The identifier name of the table.
public AbstractClassMetaData getClassWithPrimaryKeyForClass(AbstractClassMetaData cmd,
ClassLoaderResolver clr)
cmd - AbstractClassMetaData for this classclr - The ClassLoaderResolver
public AbstractClassMetaData[] getClassesManagingTableForClass(AbstractClassMetaData cmd,
ClassLoaderResolver clr)
cmd - The supplied class.clr - ClassLoader resolver
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||