public class NeoDatisStoreManager
extends org.datanucleus.store.AbstractStoreManager
implements org.datanucleus.store.ObjectReferencingStoreManager
DataNucleus will select this StoreManager with URLs of the form "neodatis:...". Support for NeoDatis is for the following URLs
NeoDatis provides methods to hand out memory versions of the datastore objects. Each object has to be "activated" to have its values accessible. Similarly the object can be "deactivated" when it is no longer needed (freeing up resources, and the link to the disk object). When we retrieve an object from NeoDatis it activates the object. This makes all fields accessible. If however one of the fields is a PC object (or collection, or map, or array etc) that object itself is not activated. Consequently all fields are accessible from the start (unlike with RDBMS), but the ObjectProvider manages the list of fields that are considered "loaded", and this is initially just those in the DFG (even though others are available). When the user accesses one of these "not-loaded" fields NeoDatisManager.fetchObject is called and that field is marked as loaded (if it is a SCO mutable it is wrapped, and if it is a PC object it has a ObjectProvider connected and is activated).
Each object is persisted on its own, and we dont use NeoDatis's internal cascade mechanism. Instead the NeoDatisManager.insertObject, or NeoDatisManager.updateObject methods are called for each object that is to be persisted/updated. Each call to insertObject/updateObject provides reachability by use of PersistFieldManager.
Currently objects are deleted one by one since NeoDatis doesn't provide its own cascade delete process. We use DeleteFieldManager to navigate through the objec graph according to dependent field metadata.
Refer to ConnectionFactoryImpl. In simple terms each ExecutionContext has a NeoDatis ODB associated with it, and this is retained until the end of life of the ExecutionContext. With NeoDatis in server mode this allows use of multiple PMs on the same underlying datastore. With NeoDatis in file mode you can only have one PM operating on the same underlying datastore at once. This is a NeoDatis limitation rather than ours.
connectionMgr, flushProcess, namingFactory, nucleusContext, persistenceHandler, primaryConnectionFactoryName, queryMgr, schemaHandler, secondaryConnectionFactoryName, storeDataMgr, storeManagerKey, valueGenerationMgr
OPTION_APPLICATION_COMPOSITE_ID, OPTION_APPLICATION_ID, OPTION_DATASTORE_ID, OPTION_DATASTORE_TIME_STORES_MILLISECS, OPTION_DATASTORE_TIME_STORES_NANOSECS, OPTION_DATASTORE_TIMEOUT, OPTION_NONDURABLE_ID, OPTION_ORM, OPTION_ORM_EMBEDDED_ARRAY, OPTION_ORM_EMBEDDED_ARRAY_NESTED, OPTION_ORM_EMBEDDED_COLLECTION, OPTION_ORM_EMBEDDED_COLLECTION_NESTED, OPTION_ORM_EMBEDDED_MAP, OPTION_ORM_EMBEDDED_MAP_NESTED, OPTION_ORM_EMBEDDED_PC, OPTION_ORM_EMBEDDED_PC_NESTED, OPTION_ORM_FOREIGN_KEYS, OPTION_ORM_SECONDARY_TABLE, OPTION_ORM_SERIALISED_ARRAY_ELEMENT, OPTION_ORM_SERIALISED_COLLECTION_ELEMENT, OPTION_ORM_SERIALISED_MAP_KEY, OPTION_ORM_SERIALISED_MAP_VALUE, OPTION_ORM_SERIALISED_PC, OPTION_QUERY_CANCEL, OPTION_QUERY_JDOQL_BITWISE_OPS, OPTION_QUERY_JDOQL_BULK_DELETE, OPTION_QUERY_JDOQL_BULK_INSERT, OPTION_QUERY_JDOQL_BULK_UPDATE, OPTION_QUERY_JPQL_BULK_DELETE, OPTION_QUERY_JPQL_BULK_INSERT, OPTION_QUERY_JPQL_BULK_UPDATE, OPTION_TXN_ISOLATION_READ_COMMITTED, OPTION_TXN_ISOLATION_READ_UNCOMMITTED, OPTION_TXN_ISOLATION_REPEATABLE_READ, OPTION_TXN_ISOLATION_SERIALIZABLE
Constructor and Description |
---|
NeoDatisStoreManager(org.datanucleus.ClassLoaderResolver clr,
org.datanucleus.PersistenceNucleusContext ctx,
Map<String,Object> props)
Constructor for a new NeoDatis StoreManager.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Release of resources
|
void |
deregisterODB(org.neodatis.odb.ODB odb)
Method to deregister an ODB from this store.
|
org.datanucleus.store.Extent |
getExtent(org.datanucleus.ExecutionContext ec,
Class c,
boolean subclasses)
Accessor for an Extent for a class.
|
Object |
getObjectIdForObject(org.datanucleus.ExecutionContext ec,
Object pc)
Convenience method to get the identity for a Persistable object.
|
String |
getStrategyForNative(org.datanucleus.metadata.AbstractClassMetaData cmd,
int absFieldNumber) |
Collection |
getSupportedOptions()
Accessor for the supported options in string form
|
boolean |
isStrategyDatastoreAttributed(org.datanucleus.metadata.AbstractClassMetaData cmd,
int absFieldNumber)
Check if the strategy is attributed by the database when the persistable object is inserted into
the database.
|
void |
notifyObjectIsOutdated(org.datanucleus.state.ObjectProvider sm)
Hook for the ObjectProvider to notify us that an object is outdated (no longer valid).
|
void |
registerODB(org.neodatis.odb.ODB odb)
Method to register an ODB as active on this store.
|
protected void |
registerStoreData(org.datanucleus.store.StoreData data)
Method to register some data with the store.
|
deregisterAllStoreData, getApiAdapter, getBooleanObjectProperty, getBooleanProperty, getBooleanProperty, getClassNameForObjectID, getConnection, getConnection, getConnection, getConnectionDriverName, getConnectionFactory, getConnectionFactory2, getConnectionFactory2Name, getConnectionFactoryName, getConnectionManager, getConnectionPassword, getConnectionURL, getConnectionUserName, getDatastoreDate, getDefaultObjectProviderClassName, getFlushProcess, getIntProperty, getMetaDataManager, getNamingFactory, getNativeQueryLanguage, getNucleusConnection, getNucleusContext, getNucleusSequence, getPersistenceHandler, getPropertiesForGenerator, getProperty, getQueryCacheKey, getQueryManager, getSchemaHandler, getStoreDataForClass, getStoreManagerKey, getStrategyValue, getStrategyValueForGenerator, getStringProperty, getSubClassesForClass, getValueGenerationManager, hasProperty, isJdbcStore, logConfiguration, manageClasses, manageClassForIdentity, managesClass, newStoreData, printInformation, registerConnectionFactory, registerConnectionMgr, supportsQueryLanguage, supportsValueStrategy, transactionCommitted, transactionRolledBack, transactionStarted, unmanageAllClasses, unmanageClass, useBackedSCOWrapperForMember, usesBackedSCOWrappers
public NeoDatisStoreManager(org.datanucleus.ClassLoaderResolver clr, org.datanucleus.PersistenceNucleusContext ctx, Map<String,Object> props)
clr
- the ClassLoaderResolverctx
- The corresponding context.props
- Properties for the store managerpublic void close()
close
in interface org.datanucleus.store.StoreManager
close
in class org.datanucleus.store.AbstractStoreManager
public String getStrategyForNative(org.datanucleus.metadata.AbstractClassMetaData cmd, int absFieldNumber)
getStrategyForNative
in class org.datanucleus.store.AbstractStoreManager
protected void registerStoreData(org.datanucleus.store.StoreData data)
registerStoreData
in class org.datanucleus.store.AbstractStoreManager
data
- The StoreData to addpublic void registerODB(org.neodatis.odb.ODB odb)
odb
- ODBpublic void deregisterODB(org.neodatis.odb.ODB odb)
odb
- ODBpublic void notifyObjectIsOutdated(org.datanucleus.state.ObjectProvider sm)
notifyObjectIsOutdated
in interface org.datanucleus.store.ObjectReferencingStoreManager
sm
- ObjectProvider of objectpublic boolean isStrategyDatastoreAttributed(org.datanucleus.metadata.AbstractClassMetaData cmd, int absFieldNumber)
isStrategyDatastoreAttributed
in interface org.datanucleus.store.StoreManager
isStrategyDatastoreAttributed
in class org.datanucleus.store.AbstractStoreManager
cmd
- Metadata for the classabsFieldNumber
- FieldNumber of the field (or -1 if datastore id)public Object getObjectIdForObject(org.datanucleus.ExecutionContext ec, Object pc)
ec
- execution contextpc
- The objectpublic org.datanucleus.store.Extent getExtent(org.datanucleus.ExecutionContext ec, Class c, boolean subclasses)
getExtent
in interface org.datanucleus.store.StoreManager
getExtent
in class org.datanucleus.store.AbstractStoreManager
ec
- execution contextc
- The class requiring the Extentsubclasses
- Whether to include subclasses of 'c'public Collection getSupportedOptions()
getSupportedOptions
in interface org.datanucleus.store.StoreManager
getSupportedOptions
in class org.datanucleus.store.AbstractStoreManager
Copyright © 2016. All rights reserved.