JPOX
JPOX
 JPOX Version 1.0
Configuration | Tutorials | Worked Examples | Developer
JPOX Design
JPOX Tests
JPOX Design : Store

In JPOX, the "store" represents the datastore (for example a RDBMS), and provides a StoreManager to manage the process of accessing this store. The StoreManager has several roles

  • Creation of any database tables to represent persistent classes managed by the associated PersistenceManager.
  • Deletion of any database tables when classes are no longer managed by the associated PersistenceManager.
  • Primary access point for Extent and Query objects.
  • Primary access point for addition, update and deletion of persistent objects (primary intermediary between the StateManagers and the datastore).
  • Provides cached access to the JDBC metadata for the datastore

The StoreManager provides methods to add and remove support for classes, namely addClass, addClasses, and dropAllTables. These initialise/remove the specified class(es) in terms of MetaData, and in terms of the datastore table they are mapped to.

Auto Start Mechanism

The StoreManager can utilise an "auto-start" mechanism for populating its list of classes that are supported by the associated PersistenceManager. Currently there are two options here, to use no mechanism (hence loading the classes from scratch each time), or to use the SchemaAutoStarter class.

The SchemaAutoStarter stores the list of supported classes in the actual datastore that is being used in a table "JPOX_TABLES". This functionality is useful where you have a JDO-enabled application that during a session of the application encounters particular persistence capable classes and these are stored away as being supported. When the application is started the next time, the "auto-start" mechanism loads up these classes when the PersistenceManager is instantiated, so it has knowledge of what it was supporting the previous time for this datastore. It is planned to add alternative "auto-start" mechanisms in the future.