| java.lang.Object org.jpox.store.StoreManager org.jpox.store.MappedStoreManager
MappedStoreManager | abstract public class MappedStoreManager extends StoreManager (Code) | | 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
- class <-> table
- field <-> column
- relation <-> join-table / foreign-key
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.
version: $Revision: 1.11 $ |
Method Summary | |
public void | addDatastoreContainer(DatastoreContainerObject table) | abstract public 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 public void | createDatastoreColumnsForReferenceField(JavaTypeMapping m, DatastoreContainerObject table, AbstractMemberMetaData fmd, ClassLoaderResolver clr, boolean embedded) Method to create the necessary datastore columns for a reference field. | public void | deleteObject(StateManager sm) Deletes a persistent object from the database. | public void | fetchObject(StateManager sm, int fieldNumbers) Fetches a persistent object from the database. | public Object | findObject(ObjectManager om, Object id) Method to return a persistable object with the specified id. | public synchronized DatastoreContainerObject | getDatastoreContainerObject(AbstractMemberMetaData fmd) Returns the datastore container (table) for the specified field. | abstract public FetchStatement | getFetchStatement(DatastoreContainerObject table) Method to create a new fetch statement for the passed table. | abstract public FieldManager | getFieldManagerForResultProcessing(StateManager sm, Object rs, StatementExpressionIndex[] stmtExprIndx) Accessor for a FieldManager capable of processing the results of a query. | public MappingManager | getMappingManager() Gets the MappingManager to use for this store. | public synchronized TableStoreData[] | getStoreDataForDatastoreContainerObject(DatastoreIdentifier tableIdentifier) Utility to return all StoreData for a Datastore Container identifier. | public void | insertObject(StateManager sm) Inserts a persistent object into the database. | public void | locateObject(StateManager sm) Locates this object in the datastore. | abstract public DatastoreContainerObject | newJoinDatastoreContainerObject(AbstractMemberMetaData fmd, ClassLoaderResolver clr) Called by Mapping objects to request the creation of a DatastoreObject (table). | public void | updateObject(StateManager sm, int fieldNumbers) Updates a persistent object in the database. | public boolean | usesDatastoreClass() Method returning whether the datastore has a "datastore class" equivalent that the StoreManager
uses to represent it. |
autoCreateColumns | final protected boolean autoCreateColumns(Code) | | Whether to auto create any columns that are missing.
|
autoCreateConstraints | final protected boolean autoCreateConstraints(Code) | | Whether to auto create any constraints
|
autoCreateTables | final protected boolean autoCreateTables(Code) | | Whether to auto create any tables.
|
autoCreateWarnOnError | final protected boolean autoCreateWarnOnError(Code) | | Whether to warn only when any errors occur on auto-create.
|
checkExistTablesOrViews | final protected boolean checkExistTablesOrViews(Code) | | Whether to check if table/view exists
|
datastoreContainerByIdentifier | protected Map datastoreContainerByIdentifier(Code) | | Map of all managed datastore containers (tables) keyed by the datastore identifier.
Only currently used for storing SequenceTable.
|
validateColumns | final protected boolean validateColumns(Code) | | Whether to validate any columns
|
validateConstraints | final protected boolean validateConstraints(Code) | | Whether to validate any constraints
|
validateTables | final protected boolean validateTables(Code) | | Whether to validate any tables
|
MappedStoreManager | protected MappedStoreManager(String key, ClassLoaderResolver clr, ObjectManagerFactoryImpl omf)(Code) | | Constructor. Stores the basic information required for the datastore management.
Parameters: key - Key for this StoreManager Parameters: clr - the ClassLoaderResolver Parameters: omf - The corresponding ObjectManagerFactory. See Also: StoreManagerFactory |
addDatastoreContainer | public void addDatastoreContainer(DatastoreContainerObject table)(Code) | | Method to add a datastore container to the managed datastore classes
Parameters: table - The datastore container |
createDatastoreColumnsForFieldUsingSubclassTable | abstract public void createDatastoreColumnsForFieldUsingSubclassTable(JavaTypeMapping m, DatastoreContainerObject table, AbstractMemberMetaData fmd, ClassLoaderResolver clr)(Code) | | Method to create the necessary datastore columns for a field using subclass-table inheritance.
Parameters: m - (Java) Mapping for the field Parameters: table - The datastore container where the datastore columns will be created Parameters: fmd - MetaData for the field/property Parameters: clr - ClassLoader resolver |
createDatastoreColumnsForReferenceField | abstract public void createDatastoreColumnsForReferenceField(JavaTypeMapping m, DatastoreContainerObject table, AbstractMemberMetaData fmd, ClassLoaderResolver clr, boolean embedded)(Code) | | Method to create the necessary datastore columns for a reference field.
Parameters: m - (Java) Mapping for the field Parameters: table - The datastore container where the datastore columns will be created Parameters: fmd - MetaData for the field/property Parameters: clr - ClassLoader resolver Parameters: embedded - Whether the field is embedded |
deleteObject | public void deleteObject(StateManager sm)(Code) | | Deletes a persistent object from the database.
Parameters: sm - The state manager of the object to be deleted. throws: JPOXDataStoreException - when an error occurs in the datastore communication |
fetchObject | public void fetchObject(StateManager sm, int fieldNumbers)(Code) | | Fetches a persistent object from the database.
Parameters: sm - The state manager of the object to be fetched. Parameters: fieldNumbers - The numbers of the fields to be fetched. throws: JPOXObjectNotFoundException - if the object doesnt exist throws: JPOXDataStoreException - when an error occurs in the datastore communication |
findObject | public Object findObject(ObjectManager om, Object id)(Code) | | Method to return a persistable object with the specified id. Optional operation for StoreManagers.
Should return a (at least) hollow PersistenceCapable object if the store manager supports the operation.
If the StoreManager is managing the in-memory object instantiation (as part of co-managing the object lifecycle
in general), then the StoreManager has to create the object during this call (if it is not already created).
Most relational databases leave the in-memory object instantion to JPOX Core, but some object databases may manage
the in-memory object instantion, effectively preventing JPOX Core of doing this.
StoreManager implementations may simply return null, indicating that they leave the object instantiate to JPOX.
Other implementations may instantiate the object in question (whether the implementation may trust that the object
is not already instantiated has still to be determined). If an implementation believes that an object with the
given ID should exist, but in fact does not exist, then the implementation should throw a RuntimeException.
It should not silently return null in this case.
Parameters: om - the ObjectManager which will manage the object Parameters: id - the id of the object in question. a persistable object with a valid object state (for example: hollow) or null, indicating that the implementation leaves the instantiation work to JPOX. |
getDatastoreContainerObject | public synchronized DatastoreContainerObject getDatastoreContainerObject(AbstractMemberMetaData fmd)(Code) | | Returns the datastore container (table) for the specified field.
Returns 'null' if the field is not (yet) known to the store manager.
Parameters: fmd - The metadata for the field. The corresponding datastore container, or 'null'. |
getFetchStatement | abstract public FetchStatement getFetchStatement(DatastoreContainerObject table)(Code) | | Method to create a new fetch statement for the passed table.
Parameters: table - The table to fetch from The fetch statement |
getFieldManagerForResultProcessing | abstract public FieldManager getFieldManagerForResultProcessing(StateManager sm, Object rs, StatementExpressionIndex[] stmtExprIndx)(Code) | | Accessor for a FieldManager capable of processing the results of a query.
Parameters: sm - StateManager for the object Parameters: rs - The results Parameters: stmtExprIndx - Statement expression indices for results -> fields mapping The FieldManager |
getMappingManager | public MappingManager getMappingManager()(Code) | | Gets the MappingManager to use for this store.
Returns the MappingManager. |
getStoreDataForDatastoreContainerObject | public synchronized TableStoreData[] getStoreDataForDatastoreContainerObject(DatastoreIdentifier tableIdentifier)(Code) | | Utility to return all StoreData for a Datastore Container identifier.
Returns StoreData with this table identifier and where the class is the owner of the table.
Parameters: tableIdentifier - Identifier for the table The StoreData for this table (if managed). |
insertObject | public void insertObject(StateManager sm)(Code) | | Inserts a persistent object into the database.
Parameters: sm - The state manager of the object to be inserted. throws: JPOXDataStoreException - when an error occurs in the datastore communication |
newJoinDatastoreContainerObject | abstract public DatastoreContainerObject newJoinDatastoreContainerObject(AbstractMemberMetaData fmd, ClassLoaderResolver clr)(Code) | | Called by Mapping objects to request the creation of a DatastoreObject (table).
Parameters: fmd - The field metadata describing the field. Parameters: clr - The ClassLoaderResolver The DatastoreContainerObject |
updateObject | public void updateObject(StateManager sm, int fieldNumbers)(Code) | | Updates a persistent object in the database.
Parameters: sm - The state manager of the object to be updated. Parameters: fieldNumbers - The numbers of the fields to be updated. throws: JPOXDataStoreException - when an error occurs in the datastore communication |
usesDatastoreClass | public boolean usesDatastoreClass()(Code) | | Method returning whether the datastore has a "datastore class" equivalent that the StoreManager
uses to represent it. For datastores like RDBMS this will return "true" since we have a "table".
For object datastores this is typically "false" since the objects are stored in some internal form
not visible via its API.
Whether datastore classes are used by the StoreManager |
Methods inherited from org.jpox.store.StoreManager | public void addClass(String className, ClassLoaderResolver clr)(Code)(Java Doc) abstract public void addClasses(String[] classes, ClassLoaderResolver clr, Writer writer, boolean completeDdl)(Code)(Java Doc) public void addClasses(String[] classNames, ClassLoaderResolver clr)(Code)(Java Doc) protected void clearAutoStarter()(Code)(Java Doc) public void close()(Code)(Java Doc) abstract public void deleteObject(StateManager sm)(Code)(Java Doc) protected void deregisterAllStoreData()(Code)(Java Doc) abstract public void fetchObject(StateManager sm, int fieldNumbers)(Code)(Java Doc) abstract public Object findObject(ObjectManager om, Object id)(Code)(Java Doc) public ApiAdapter getApiAdapter()(Code)(Java Doc) public AutoStartMechanism getAutoStartMechanism()(Code)(Java Doc) public String getClassNameForObjectID(Object id, ClassLoaderResolver clr, ObjectManager om)(Code)(Java Doc) public AbstractClassMetaData getClassWithPrimaryKeyForClass(AbstractClassMetaData cmd, ClassLoaderResolver clr)(Code)(Java Doc) public AbstractClassMetaData[] getClassesManagingTableForClass(AbstractClassMetaData cmd, ClassLoaderResolver clr)(Code)(Java Doc) public DatastoreAdapter getDatastoreAdapter()(Code)(Java Doc) public DatastoreClass getDatastoreClass(String className, ClassLoaderResolver clr)(Code)(Java Doc) public synchronized DatastoreClass getDatastoreClass(DatastoreIdentifier name)(Code)(Java Doc) abstract public Date getDatastoreDate()(Code)(Java Doc) abstract public Extent getExtent(ObjectManager om, Class c, boolean subclasses)(Code)(Java Doc) public IdentifierFactory getIdentifierFactory()(Code)(Java Doc) abstract public JPOXConnection getJPOXConnection(ObjectManager om)(Code)(Java Doc) abstract public JPOXSequence getJPOXSequence(ObjectManager om, SequenceMetaData seqmd)(Code)(Java Doc) public MetaDataManager getMetaDataManager()(Code)(Java Doc) public OMFContext getOMFContext()(Code)(Java Doc) public PoidManager getPoidManager()(Code)(Java Doc) abstract public Store getStore(ClassLoaderResolver clr, AbstractMemberMetaData fmd, Class type)(Code)(Java Doc) public String getStoreManagerKey()(Code)(Java Doc) abstract public Object getStrategyValue(ObjectManager om, DatastoreClass table, AbstractClassMetaData cmd, int absoluteFieldNumber)(Code)(Java Doc) public HashSet getSubClassesForClass(String className, boolean includeDescendents, ClassLoaderResolver clr)(Code)(Java Doc) protected void initialiseAutoStart(String mechanism, String mode, ClassLoaderResolver clr) throws DatastoreInitialisationException(Code)(Java Doc) abstract public void insertObject(StateManager sm)(Code)(Java Doc) public boolean isStrategyDatastoreAttributed(IdentityStrategy identityStrategy, boolean datastoreIdentityField)(Code)(Java Doc) abstract public void locateObject(StateManager sm)(Code)(Java Doc) public String manageClassForIdentity(Object id, ClassLoaderResolver clr)(Code)(Java Doc) public boolean managesClass(String className)(Code)(Java Doc) public Object newObjectID(ObjectManager om, String className, Object pc)(Code)(Java Doc) public void notifyObjectIsOutdated(StateManager sm)(Code)(Java Doc) abstract public void outputDatastoreInformation(PrintStream ps) throws Exception(Code)(Java Doc) abstract public void outputSchemaInformation(PrintStream ps) throws Exception(Code)(Java Doc) public void performVersionCheck(StateManager sm, Object versionDatastore, VersionMetaData versionMetaData)(Code)(Java Doc) protected void registerStoreData(StoreData data)(Code)(Java Doc) abstract public void removeAllClasses(ClassLoaderResolver clr)(Code)(Java Doc) abstract public void resolveIdentifierMacro(MacroString.IdentifierMacro im, ClassLoaderResolver clr)(Code)(Java Doc) abstract public boolean supportsQueryLanguage(String language)(Code)(Java Doc) abstract public void updateObject(StateManager sm, int fieldNumbers)(Code)(Java Doc) public boolean usesDatastoreClass()(Code)(Java Doc)
|
|
|