Java Doc for MappedStoreManager.java in  » Database-ORM » JPOX » org » jpox » store » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database ORM » JPOX » org.jpox.store 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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 $


Field Summary
final protected  booleanautoCreateColumns
     Whether to auto create any columns that are missing.
final protected  booleanautoCreateConstraints
    
final protected  booleanautoCreateTables
     Whether to auto create any tables.
final protected  booleanautoCreateWarnOnError
     Whether to warn only when any errors occur on auto-create.
final protected  booleancheckExistTablesOrViews
    
protected  MapdatastoreContainerByIdentifier
     Map of all managed datastore containers (tables) keyed by the datastore identifier.
final protected  booleanvalidateColumns
    
final protected  booleanvalidateConstraints
    
final protected  booleanvalidateTables
    

Constructor Summary
protected  MappedStoreManager(String key, ClassLoaderResolver clr, ObjectManagerFactoryImpl omf)
     Constructor.

Method Summary
public  voidaddDatastoreContainer(DatastoreContainerObject table)
    
abstract public  voidcreateDatastoreColumnsForFieldUsingSubclassTable(JavaTypeMapping m, DatastoreContainerObject table, AbstractMemberMetaData fmd, ClassLoaderResolver clr)
     Method to create the necessary datastore columns for a field using subclass-table inheritance.
abstract public  voidcreateDatastoreColumnsForReferenceField(JavaTypeMapping m, DatastoreContainerObject table, AbstractMemberMetaData fmd, ClassLoaderResolver clr, boolean embedded)
     Method to create the necessary datastore columns for a reference field.
public  voiddeleteObject(StateManager sm)
     Deletes a persistent object from the database.
public  voidfetchObject(StateManager sm, int fieldNumbers)
     Fetches a persistent object from the database.
public  ObjectfindObject(ObjectManager om, Object id)
     Method to return a persistable object with the specified id.
public synchronized  DatastoreContainerObjectgetDatastoreContainerObject(AbstractMemberMetaData fmd)
     Returns the datastore container (table) for the specified field.
abstract public  FetchStatementgetFetchStatement(DatastoreContainerObject table)
     Method to create a new fetch statement for the passed table.
abstract public  FieldManagergetFieldManagerForResultProcessing(StateManager sm, Object rs, StatementExpressionIndex[] stmtExprIndx)
     Accessor for a FieldManager capable of processing the results of a query.
public  MappingManagergetMappingManager()
     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  voidinsertObject(StateManager sm)
     Inserts a persistent object into the database.
public  voidlocateObject(StateManager sm)
     Locates this object in the datastore.
abstract public  DatastoreContainerObjectnewJoinDatastoreContainerObject(AbstractMemberMetaData fmd, ClassLoaderResolver clr)
     Called by Mapping objects to request the creation of a DatastoreObject (table).
public  voidupdateObject(StateManager sm, int fieldNumbers)
     Updates a persistent object in the database.
public  booleanusesDatastoreClass()
     Method returning whether the datastore has a "datastore class" equivalent that the StoreManager uses to represent it.

Field Detail
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




Constructor Detail
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




Method Detail
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



locateObject
public void locateObject(StateManager sm)(Code)
Locates this object in the datastore.
Parameters:
  sm - The StateManager for the object to be found
throws:
  JPOXObjectNotFoundException - if the object doesnt exist
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



Fields inherited from org.jpox.store.StoreManager
final protected static Localiser LOCALISER(Code)(Java Doc)
protected String autoStartMechanism(Code)(Java Doc)
protected DatastoreAdapter dba(Code)(Java Doc)
final protected boolean fixedDatastore(Code)(Java Doc)
protected IdentifierFactory identifierFactory(Code)(Java Doc)
final protected OMFContext omfContext(Code)(Java Doc)
final protected PoidManager poidManager(Code)(Java Doc)
final protected boolean readOnlyDatastore(Code)(Java Doc)
final protected String readOnlyDatastoreAction(Code)(Java Doc)
protected AutoStartMechanism starter(Code)(Java Doc)
protected boolean starterInitialised(Code)(Java Doc)
protected StoreDataManager storeDataMgr(Code)(Java Doc)
final protected String storeManagerKey(Code)(Java Doc)
protected StoreManagerRuntime storeManagerRuntime(Code)(Java Doc)

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)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.