org.jpox.store
Class StoreManager

java.lang.Object
  extended by org.jpox.store.StoreManager
Direct Known Subclasses:
RDBMSManager

public abstract class StoreManager
extends java.lang.Object

An abstract representation of a Store Manager. Manages the persistence of objects to the store. Will be implemented for the type of datastore (RDBMS, ODBMS, OLAP) in question. The store manager's responsibilities include:

A store manager's knowledge of its contents is typically not complete. It knows about the classes that it has encountered in its lifetime. The PersistenceManager can make the StoreManager aware of a class, and can check if the StoreManager knows about a particular class. The Auto-Start mechanism provides a way of inheriting knowledge from the last time the store was used.

Version:
$Revision: 1.84.2.4 $

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  boolean checkExistTablesOrViews
          Whether to check if table/view exists
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  javax.sql.DataSource[] ds
          Datasource
protected  javax.sql.DataSource[] dsNonTx
          Non transactional Datasource
protected  boolean fixedDatastore
          Whether this datastore is fixed (no mods to datastore classes allowed).
protected  IdentifierFactory identifierFactory
          Factory for identifiers for this datastore.
protected static Localiser LOCALISER
           
protected  java.lang.String password
          Password for the datastore being used.
protected  PMFContext pmfContext
          PMF context.
protected  PoidManager poidManager
          Manager for identity generation.
protected  boolean readOnlyDatastore
          Whether this datastore is read only.
protected  java.lang.String readOnlyDatastoreAction
          What should happen when readonly and an update occurs.
protected  AutoStartMechanism starter
          Auto-Start mechanism to use.
protected  boolean starterInitialised
          Whether the AutoStart mechanism is initialised
protected  MultiMap storeDataByAppIdClass
          Map of all managed store data using Application Identity, keyed by the app id PK class
protected  java.util.Map storeDataByClass
          Map of all managed store data, keyed by the class/field name.
protected  java.lang.String userName
          Username for the datastore being used.
protected  boolean validateColumns
          Whether to validate any columns
protected  boolean validateConstraints
          Whether to validate any constraints
protected  boolean validateTables
          Whether to validate any tables
 
Constructor Summary
protected StoreManager(ClassLoaderResolver clr, AbstractPersistenceManagerFactory pmf, java.lang.String userName, java.lang.String password)
          Constructor for a new StoreManager.
 
Method Summary
abstract  void addClass(java.lang.String className, ClassLoaderResolver clr)
          Method to add a class to the managed list for this datastore manager.
abstract  void addClasses(java.lang.String[] classes, ClassLoaderResolver clr, java.io.FileWriter writer)
          Add classes to the persistence model for the datastore.
 void addDatastoreContainer(DatastoreContainerObject table)
          Method to add a datastore container to the managed datastore classes
protected  void clearAutoStarter()
          Method to clear the Auto-Starter status.
 void close()
          Release of resources
 void delete(StateManager sm)
          Deletes a persistent object from the database.
 void deleteDependent(StateManager sm, int[] fieldNumbers)
          Delete dependent objects of a persistent object.
protected  void deregisterAllStoreData()
          Method to deregister all existing store data so that we are managing nothing.
 void fetch(StateManager sm, int[] fieldNumbers)
          Fetches a persistent object from the database.
 AutoStartMechanism getAutoStartMechanism()
          Accessor for the AutoStartMechanism
abstract  ArrayStore getBackingStoreForArray(AbstractPropertyMetaData fmd, DatastoreObject datastoreTable, ClassLoaderResolver clr)
          Method to return a backing store for an array, consistent with this store and the instantiated type.
abstract  CollectionStore getBackingStoreForCollection(AbstractPropertyMetaData fmd, DatastoreObject datastoreTable, ClassLoaderResolver clr, boolean instantiated, boolean listBased)
          Method to return a backing store for a Collection, consistent with this store and the instantiated type.
abstract  MapStore getBackingStoreForMap(AbstractPropertyMetaData fmd, DatastoreObject datastoreTable, ClassLoaderResolver clr)
          Method to return a backing store for a Map, consistent with this store and the instantiated type.
 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.
abstract  java.lang.String getClassNameForObjectID(java.lang.Object id, ClassLoaderResolver clr, PersistenceManager pm)
          Returns the class corresponding to the given object JDO ID.
 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.
 DatastoreClass getDatastoreContainerForIdentifier(DatastoreIdentifier identifier)
          Accessor for the datastore container (table) for a given datastore identifier
 DatastoreContainerObject getDatastoreContainerObject(AbstractPropertyMetaData fmd)
          Returns the datastore container (table) for the specified field.
abstract  javax.jdo.Extent getExtent(PersistenceManager pm, java.lang.Class c, boolean subclasses)
          Interface to getting an Extent for a class.
abstract  FetchStatement getFetchStatement(DatastoreContainerObject table)
          Method to create a new fetch statement for the passed table.
 IdentifierFactory getIdentifierFactory()
          Accessor for the identifier factory.
 java.util.Collection getManagedClasses()
          Accessor for the names of the classes currently managed by this store.
abstract  Transaction getManagedTransaction(ManagedConnectionImpl pm, javax.resource.spi.security.PasswordCredential credential)
          Method to obtain a managed transaction for the specified persistence manager for this store.
 MappingManager getMappingManager()
          Gets the MappingManager to use for this store.
 MetaDataManager getMetaDataManager()
          Gets the MetaDataManager to use for this store.
abstract  Transaction getNonmanagedTransaction(PersistenceManagerImpl pm, java.lang.String userName, java.lang.String password)
          Method to obtain a nonmanaged transaction for the specified persistence manager for this store.
 PMFContext getPMFContext()
          Accessor for the context in which this RDBMSManager is running
abstract  javax.jdo.datastore.Sequence getSequence(PersistenceManager pm, SequenceMetaData seqmd)
          Method to return a datastore sequence for this datastore matching the passed sequence MetaData.
 StoreData[] getStoreDataForDatastoreContainerObject(DatastoreIdentifier tableIdentifier)
          Utility to return all StoreData for a Datastore Container identifier.
abstract  java.lang.Object getStrategyValue(PersistenceManager pm, DatastoreClass table, AbstractClassMetaData cmd, int absoluteFieldNumber, IdentityStrategy strategy, java.lang.String sequence, ExtensionMetaData[] extensions)
          Method to retrieve the value for a strategy for a particular field.
 java.util.HashSet getSubClassesForClass(java.lang.String className, boolean includeDescendents, ClassLoaderResolver clr)
          Utility to return the names of the classes that are known subclasses of the provided class.
protected  void initialiseAutoStart(java.lang.String mechanism, java.lang.String mode, ClassLoaderResolver clr)
          Method to initialise the auto-start mechanism, loading up the classes from its store into memory so that we start from where we got to last time.
 void insert(StateManager sm)
          Inserts a persistent object into the database.
 boolean isStrategyDatastoreAttributed(IdentityStrategy identityStrategy)
          Check if the strategy is attributed by the database when the PersistenceCapable object is inserted into the database
 void locate(StateManager sm)
          Locates this object in the datastore.
 java.lang.String manageClassForIdentity(OID id, ClassLoaderResolver clr)
          Convenience method to ensure that the class defined by the passed OID is managed by this store.
 java.lang.String manageClassForIdentity(javax.jdo.identity.SingleFieldIdentity id, ClassLoaderResolver clr)
          Convenience method to ensure that the class defined by the passed SingleFieldIdentity is managed by this store.
 boolean managesClass(java.lang.String className)
          Accessor for whether the specified class is managed currently
abstract  DatastoreContainerObject newJoinDatastoreContainerObject(AbstractPropertyMetaData fmd, ClassLoaderResolver clr)
          Called by Mapping objects to request the creation of a DatastoreObject (table).
 java.lang.Object newObjectID(PersistenceManager pm, java.lang.String className, javax.jdo.spi.PersistenceCapable pc)
          Returns a new, unique ID for an object of the given class.
 javax.jdo.Query newQuery(java.lang.String language, PersistenceManager pm, java.lang.Object query)
          Method to generate a new query using the passed query as basis.
protected  void registerStoreData(StoreData data)
          Method to register some data with the store.
abstract  void removeAllClasses(ClassLoaderResolver clr)
          Drops all tables in the datastore.
abstract  void resolveIdentifierMacro(MacroString.IdentifierMacro im, ClassLoaderResolver clr)
          Resolves an identifier macro.
abstract  boolean supportsQueryLanguage(java.lang.String language)
          Accessor for whether this query language is supported.
 void update(StateManager sm, int[] fieldNumbers)
          Updates a persistent object in the database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCALISER

protected static final Localiser LOCALISER

ds

protected final javax.sql.DataSource[] ds
Datasource


dsNonTx

protected final javax.sql.DataSource[] dsNonTx
Non transactional Datasource


dba

protected DatastoreAdapter dba
Adapter for the datastore being used.


userName

protected final java.lang.String userName
Username for the datastore being used.


password

protected final java.lang.String password
Password for the datastore being used.


readOnlyDatastore

protected final boolean readOnlyDatastore
Whether this datastore is read only.


readOnlyDatastoreAction

protected final java.lang.String readOnlyDatastoreAction
What should happen when readonly and an update occurs.


fixedDatastore

protected final boolean fixedDatastore
Whether this datastore is fixed (no mods to datastore classes allowed).


starter

protected AutoStartMechanism starter
Auto-Start mechanism to use.


starterInitialised

protected boolean starterInitialised
Whether the AutoStart mechanism is initialised


pmfContext

protected final PMFContext pmfContext
PMF context.


autoCreateTables

protected final boolean autoCreateTables
Whether to auto create any tables.


autoCreateColumns

protected final boolean autoCreateColumns
Whether to auto create any columns that are missing.


autoCreateConstraints

protected final boolean autoCreateConstraints
Whether to auto create any constraints


autoCreateWarnOnError

protected final boolean autoCreateWarnOnError
Whether to warn only when any errors occur on auto-create.


validateTables

protected final boolean validateTables
Whether to validate any tables


validateColumns

protected final boolean validateColumns
Whether to validate any columns


validateConstraints

protected final boolean validateConstraints
Whether to validate any constraints


checkExistTablesOrViews

protected final boolean checkExistTablesOrViews
Whether to check if table/view exists


poidManager

protected final PoidManager poidManager
Manager for identity generation.


identifierFactory

protected IdentifierFactory identifierFactory
Factory for identifiers for this datastore.


storeDataByClass

protected java.util.Map storeDataByClass
Map of all managed store data, keyed by the class/field name.


storeDataByAppIdClass

protected MultiMap storeDataByAppIdClass
Map of all managed store data using Application Identity, keyed by the app id PK class


datastoreContainerByIdentifier

protected java.util.Map datastoreContainerByIdentifier
Map of all managed datastore containers (tables) keyed by the datastore identifier. Only currently used for storing SequenceTable.

Constructor Detail

StoreManager

protected StoreManager(ClassLoaderResolver clr,
                       AbstractPersistenceManagerFactory pmf,
                       java.lang.String userName,
                       java.lang.String password)
Constructor for a new StoreManager. Stores the basic information required for the datastore management.

Parameters:
clr - the ClassLoaderResolver
pmf - The corresponding PersistenceManagerFactory. This factory's non-transactional data source will be used to get database connections as needed to perform management functions.
userName - The database user name.
password - The database user's password.
See Also:
StoreManagerFactory
Method Detail

close

public void close()
Release of resources


getNonmanagedTransaction

public abstract Transaction getNonmanagedTransaction(PersistenceManagerImpl pm,
                                                     java.lang.String userName,
                                                     java.lang.String password)
Method to obtain a nonmanaged transaction for the specified persistence manager for this store.

Parameters:
pm - The PersistenceManager
userName - The username
password - The password
Returns:
The transaction

getManagedTransaction

public abstract Transaction getManagedTransaction(ManagedConnectionImpl pm,
                                                  javax.resource.spi.security.PasswordCredential credential)
Method to obtain a managed transaction for the specified persistence manager for this store.

Parameters:
pm - The PersistenceManager implementation for managed environment
credential - Password credential
Returns:
The transaction

getSequence

public abstract javax.jdo.datastore.Sequence getSequence(PersistenceManager pm,
                                                         SequenceMetaData seqmd)
Method to return a datastore sequence for this datastore matching the passed sequence MetaData.

Parameters:
pm - The PersistenceManager
seqmd - SequenceMetaData
Returns:
The Sequence

registerStoreData

protected void registerStoreData(StoreData data)
Method to register some data with the store. This will also register the data with the starter process.

Parameters:
data - The StoreData to add

deregisterAllStoreData

protected void deregisterAllStoreData()
Method to deregister all existing store data so that we are managing nothing.


getStoreDataForDatastoreContainerObject

public StoreData[] getStoreDataForDatastoreContainerObject(DatastoreIdentifier tableIdentifier)
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
Returns:
The StoreData for this table (if managed).

getDatastoreContainerForIdentifier

public DatastoreClass getDatastoreContainerForIdentifier(DatastoreIdentifier identifier)
Accessor for the datastore container (table) for a given datastore identifier

Parameters:
identifier - The identifier
Returns:
The datastore container (or null if not managed here)

addDatastoreContainer

public void addDatastoreContainer(DatastoreContainerObject table)
Method to add a datastore container to the managed datastore classes

Parameters:
table - The datastore container

initialiseAutoStart

protected void initialiseAutoStart(java.lang.String mechanism,
                                   java.lang.String mode,
                                   ClassLoaderResolver clr)
                            throws DatastoreInitialisationException
Method to initialise the auto-start mechanism, loading up the classes from its store into memory so that we start from where we got to last time.

Parameters:
mechanism - AutoStart mechanism
mode - Mode for autostart mechanism
clr - The ClassLoaderResolver
Throws:
DatastoreInitialisationException

clearAutoStarter

protected void clearAutoStarter()
Method to clear the Auto-Starter status.


getAutoStartMechanism

public AutoStartMechanism getAutoStartMechanism()
Accessor for the AutoStartMechanism

Returns:
may return null if auto start mechanism is not initialized

getManagedClasses

public java.util.Collection getManagedClasses()
Accessor for the names of the classes currently managed by this store.

Returns:
Collection of the names of the classes being managed

managesClass

public boolean managesClass(java.lang.String className)
Accessor for whether the specified class is managed currently

Parameters:
className - The name of the class
Returns:
Whether it is managed

addClass

public abstract void addClass(java.lang.String className,
                              ClassLoaderResolver clr)
Method to add a class to the managed list for this datastore manager.

Parameters:
className - Name of the class
clr - The ClassLoaderResolver

addClasses

public abstract void addClasses(java.lang.String[] classes,
                                ClassLoaderResolver clr,
                                java.io.FileWriter writer)
Add classes to the persistence model for the datastore. In the case of an RDBMS, this will map these classes to RDBMS tables. In the case of XML, this will map these classes to XML datafiles.

This method is primarily useful for applications that wish to perform all of their datastore initialization up front, rather than wait for the JPOX runtime to do it on-demand.

Parameters:
classes - The class(es) to be added.
clr - The ClassLoaderResolver
writer - Optional writer when you just want the DDL for persisting the specified classes
Throws:
DatastoreValidationException - If there is some mismatch between the current datastore contents and those necessary to enable persistence of the given classes.

removeAllClasses

public abstract void removeAllClasses(ClassLoaderResolver clr)
Drops all tables in the datastore. This empties the datastore of all datastore objects managed by JPOX. All objects not managed by JPOX are left untouched.

Parameters:
clr - The ClassLoaderResolver

getClassesManagingTableForClass

public 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. For the 3 inheritance strategies, the following occurs :-

Parameters:
cmd - The supplied class.
clr - ClassLoader resolver
Returns:
The ClassMetaData's managing the fields of the supplied class

manageClassForIdentity

public java.lang.String manageClassForIdentity(OID id,
                                               ClassLoaderResolver clr)
Convenience method to ensure that the class defined by the passed OID is managed by this store.

Parameters:
id - OID
clr - ClassLoader resolver
Returns:
The class name of the class associated to this identity

manageClassForIdentity

public java.lang.String manageClassForIdentity(javax.jdo.identity.SingleFieldIdentity id,
                                               ClassLoaderResolver clr)
Convenience method to ensure that the class defined by the passed SingleFieldIdentity is managed by this store.

Parameters:
id - Single Field Identity
clr - ClassLoader resolver
Returns:
The class name of the class associated to this identity

getExtent

public abstract javax.jdo.Extent getExtent(PersistenceManager pm,
                                           java.lang.Class c,
                                           boolean subclasses)
Interface to getting an Extent for a class.

Parameters:
pm - The Persistence Manager
c - The class requiring the Extent
subclasses - Whether to include subclasses of 'c'
Returns:
The Extent.

supportsQueryLanguage

public abstract boolean supportsQueryLanguage(java.lang.String language)
Accessor for whether this query language is supported.

Parameters:
language - The language
Returns:
Whether it is supported.
See Also:
supportsQueryLanguage(java.lang.String)

newQuery

public javax.jdo.Query newQuery(java.lang.String language,
                                PersistenceManager pm,
                                java.lang.Object query)
Method to generate a new query using the passed query as basis.

Parameters:
language - The query language
pm - The PM
query - The query filter (String) or a previous Query
Returns:
The Query

getClassNameForObjectID

public abstract java.lang.String getClassNameForObjectID(java.lang.Object id,
                                                         ClassLoaderResolver clr,
                                                         PersistenceManager pm)
Returns the class corresponding to the given object JDO ID. If the object is an OID, return the PersistenceCapable class. If the object is a SCOID, return the SCO class. If the object is a PersistenceCapable class, return the class. If the object is an AppID PK, return the PersistenceCapable class.

Parameters:
id - The JDO identity of some object.
clr - ClassLoader resolver
pm - Persistence Manager
Returns:
For datastore identity, return the class of the corresponding object. For application identity, return the class of the corresponding object or null if object does not exist.
Throws:
java.lang.ClassCastException - If the type of ID is not recognized (OID or SCOID).

isStrategyDatastoreAttributed

public boolean isStrategyDatastoreAttributed(IdentityStrategy identityStrategy)
Check if the strategy is attributed by the database when the PersistenceCapable object is inserted into the database

Parameters:
identityStrategy - the identityStrategy
Returns:
if the object for the strategy is attributed by the database

getStrategyValue

public abstract java.lang.Object getStrategyValue(PersistenceManager pm,
                                                  DatastoreClass table,
                                                  AbstractClassMetaData cmd,
                                                  int absoluteFieldNumber,
                                                  IdentityStrategy strategy,
                                                  java.lang.String sequence,
                                                  ExtensionMetaData[] extensions)
Method to retrieve the value for a strategy for a particular field.

Parameters:
pm - The Persistence Manager
table - The datastore table
cmd - AbstractClassMetaData for the class
absoluteFieldNumber - The field number
strategy - The strategy
sequence - The sequence name if strategy is sequence-based
extensions - Any extensions to control the value generation process
Returns:
The value

newObjectID

public java.lang.Object newObjectID(PersistenceManager pm,
                                    java.lang.String className,
                                    javax.jdo.spi.PersistenceCapable pc)
Returns a new, unique ID for an object of the given class.

Parameters:
pm - The PersistenceManager
className - Name of the class of the object.
pc - The persistenceCapable object. Useful for AppID
Returns:
A new object ID.

insert

public void insert(StateManager sm)
Inserts a persistent object into the database.

Parameters:
sm - The state manager of the object to be inserted.

fetch

public void fetch(StateManager sm,
                  int[] fieldNumbers)
Fetches a persistent object from the database.

Parameters:
sm - The state manager of the object to be fetched.
fieldNumbers - The numbers of the fields to be fetched.

update

public void update(StateManager sm,
                   int[] fieldNumbers)
Updates a persistent object in the database.

Parameters:
sm - The state manager of the object to be updated.
fieldNumbers - The numbers of the fields to be updated.

delete

public void delete(StateManager sm)
Deletes a persistent object from the database.

Parameters:
sm - The state manager of the object to be deleted.

locate

public void locate(StateManager sm)
Locates this object in the datastore.

Parameters:
sm - The StateManager for the object to be found
Throws:
javax.jdo.JDOObjectNotFoundException - If the instance does not exist in the datastore

deleteDependent

public void deleteDependent(StateManager sm,
                            int[] fieldNumbers)
Delete dependent objects of a persistent object.

Parameters:
sm - StateManager for the object being deleted.
fieldNumbers - the fields to delete.
Since:
1.1

newJoinDatastoreContainerObject

public abstract DatastoreContainerObject newJoinDatastoreContainerObject(AbstractPropertyMetaData fmd,
                                                                         ClassLoaderResolver clr)
Called by Mapping objects to request the creation of a DatastoreObject (table).

Parameters:
fmd - The field metadata describing the field.
clr - The ClassLoaderResolver
Returns:
The DatastoreContainerObject

getSubClassesForClass

public java.util.HashSet getSubClassesForClass(java.lang.String className,
                                               boolean includeDescendents,
                                               ClassLoaderResolver clr)
Utility to return the names of the classes that are known subclasses of the provided class. Actually uses the MetaDataManager for determining what is a subclass since the MetaData is often registered before being needed by the Store.

Parameters:
className - Class for which we search for subclasses.
includeDescendents - Whether to include subclasses of subclasses etc
clr - The ClassLoaderResolver
Returns:
Set of classes that are subclasses of the input class.

getIdentifierFactory

public IdentifierFactory getIdentifierFactory()
Accessor for the identifier factory.

Returns:
Returns the identifier factory.

getPMFContext

public PMFContext getPMFContext()
Accessor for the context in which this RDBMSManager is running

Returns:
Returns the pmfContext.

getMetaDataManager

public MetaDataManager getMetaDataManager()
Gets the MetaDataManager to use for this store.

Returns:
Returns the MetaDataManager.

getMappingManager

public MappingManager getMappingManager()
Gets the MappingManager to use for this store.

Returns:
Returns the MappingManager.

getDatastoreAdapter

public DatastoreAdapter getDatastoreAdapter()
Gets the DatastoreAdapter to use for this store.

Returns:
Returns the DatastoreAdapter

getDatastoreClass

public DatastoreClass getDatastoreClass(java.lang.String className,
                                        ClassLoaderResolver clr)
Returns the primary datastore container serving as backing for the given class. If the class is not yet known to the store manager, 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.

Parameters:
className - Name of the class whose table is be returned.
clr - The ClassLoaderResolver
Returns:
The corresponding class table.
Throws:
NoTableManagedException - If the given class has no table managed in the database.

getDatastoreContainerObject

public DatastoreContainerObject getDatastoreContainerObject(AbstractPropertyMetaData fmd)
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.
Returns:
The corresponding datastore container, or 'null'.

getDatastoreClass

public DatastoreClass getDatastoreClass(DatastoreIdentifier name)
Returns the JDO table having the given SQL identifier. Returns 'null' if no such table is (yet) known to the store manager.

Parameters:
name - The identifier name of the table.
Returns:
The corresponding JDO table, or 'null'

getClassWithPrimaryKeyForClass

public 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. This will either go up to the next class in the hierarchy that has a table OR go up to the base class, whichever is first.

Parameters:
cmd - AbstractClassMetaData for this class
clr - The ClassLoaderResolver
Returns:
The AbstractClassMetaData for the class defining the primary keys

resolveIdentifierMacro

public abstract void resolveIdentifierMacro(MacroString.IdentifierMacro im,
                                            ClassLoaderResolver clr)
Resolves an identifier macro. The public fields clazz , fieldName , and subfieldName of the given macro are taken as inputs, and the public value field is set to the SQL identifier of the corresponding database table or column.

Parameters:
im - The macro to resolve.
clr - The ClassLoaderResolver

getFetchStatement

public abstract FetchStatement getFetchStatement(DatastoreContainerObject table)
Method to create a new fetch statement for the passed table.

Parameters:
table - The table to fetch from
Returns:
The fetch statement

getBackingStoreForCollection

public abstract CollectionStore getBackingStoreForCollection(AbstractPropertyMetaData fmd,
                                                             DatastoreObject datastoreTable,
                                                             ClassLoaderResolver clr,
                                                             boolean instantiated,
                                                             boolean listBased)
Method to return a backing store for a Collection, consistent with this store and the instantiated type.

Parameters:
fmd - MetaData for the field that has this collection
datastoreTable - The datastore object
clr - ClassLoader resolver
instantiated - Whether it is already instantiated
listBased - whether the collection is list based
Returns:
The Backing store for this collection in this store

getBackingStoreForMap

public abstract MapStore getBackingStoreForMap(AbstractPropertyMetaData fmd,
                                               DatastoreObject datastoreTable,
                                               ClassLoaderResolver clr)
Method to return a backing store for a Map, consistent with this store and the instantiated type.

Parameters:
fmd - MetaData for the field that has this map
datastoreTable - The datastore object
clr - ClassLoader resolver
Returns:
The Backing store for this map in this store

getBackingStoreForArray

public abstract ArrayStore getBackingStoreForArray(AbstractPropertyMetaData fmd,
                                                   DatastoreObject datastoreTable,
                                                   ClassLoaderResolver clr)
Method to return a backing store for an array, consistent with this store and the instantiated type.

Parameters:
fmd - MetaData for the field that has this array
datastoreTable - The datastore object
clr - ClassLoader resolver
Returns:
The Backing store for this array in this store


Copyright © -2008 . All Rights Reserved.