org.datanucleus.store.rdbms.scostore
Class BaseContainerStore

java.lang.Object
  extended by org.datanucleus.store.rdbms.scostore.BaseContainerStore
Direct Known Subclasses:
AbstractMapStore, ElementContainerStore

public abstract class BaseContainerStore
extends Object

Base class for all mapped container stores (collections, maps, arrays). Provides a series of helper methods for handling the store process.


Field Summary
protected  boolean allowNulls
          Whether the container allows null elements/values.
protected  org.datanucleus.store.mapped.DatastoreAdapter dba
          Datastore adapter in use by this store.
protected static org.datanucleus.util.Localiser LOCALISER
          Localiser for messages.
protected  org.datanucleus.store.mapped.mapping.JavaTypeMapping ownerMapping
          Mapping to the owner of the container.
protected  org.datanucleus.metadata.AbstractMemberMetaData ownerMemberMetaData
          MetaData for the field/property in the owner with this container.
protected  int relationType
          Type of relation (1-N uni, 1-N bi, M-N).
protected  RDBMSStoreManager storeMgr
          Manager for the store.
 
Constructor Summary
protected BaseContainerStore(RDBMSStoreManager storeMgr)
          Constructor.
 
Method Summary
protected  boolean allowsBatching()
          Convenience method to return if the datastore supports batching and the user wants batching.
 org.datanucleus.store.mapped.DatastoreAdapter getDatastoreAdapter()
           
 org.datanucleus.store.mapped.mapping.JavaTypeMapping getOwnerMapping()
          Accessor for the owner mapping.
 org.datanucleus.metadata.AbstractMemberMetaData getOwnerMemberMetaData()
           
 int getRelationType()
           
 org.datanucleus.store.ObjectProvider getStateManagerForEmbeddedPCObject(org.datanucleus.store.ObjectProvider sm, Object obj, org.datanucleus.metadata.AbstractMemberMetaData ownerMmd, short pcType)
          Method to return the StateManager for an embedded PC object (element, key, value).
 RDBMSStoreManager getStoreManager()
          Accessor for the StoreManager.
protected  boolean isEmbeddedMapping(org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping)
          Check if the mapping correspond to a non pc object or embedded field
protected  void setOwner(org.datanucleus.metadata.AbstractMemberMetaData mmd, org.datanucleus.ClassLoaderResolver clr)
          Method to set the owner for this backing store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCALISER

protected static final org.datanucleus.util.Localiser LOCALISER
Localiser for messages.


storeMgr

protected RDBMSStoreManager storeMgr
Manager for the store.


dba

protected org.datanucleus.store.mapped.DatastoreAdapter dba
Datastore adapter in use by this store.


ownerMapping

protected org.datanucleus.store.mapped.mapping.JavaTypeMapping ownerMapping
Mapping to the owner of the container.


ownerMemberMetaData

protected org.datanucleus.metadata.AbstractMemberMetaData ownerMemberMetaData
MetaData for the field/property in the owner with this container.


relationType

protected int relationType
Type of relation (1-N uni, 1-N bi, M-N).


allowNulls

protected boolean allowNulls
Whether the container allows null elements/values.

Constructor Detail

BaseContainerStore

protected BaseContainerStore(RDBMSStoreManager storeMgr)
Constructor.

Parameters:
storeMgr - Manager for the datastore being used
Method Detail

setOwner

protected void setOwner(org.datanucleus.metadata.AbstractMemberMetaData mmd,
                        org.datanucleus.ClassLoaderResolver clr)
Method to set the owner for this backing store. Sets the metadata of the owner field/property, as well as whether nulls are allowed, and the relation type.

Parameters:
mmd - MetaData for the member owning this backing store.
clr - ClassLoader resolver

getStoreManager

public RDBMSStoreManager getStoreManager()
Accessor for the StoreManager.

Returns:
The StoreManager.

getOwnerMapping

public org.datanucleus.store.mapped.mapping.JavaTypeMapping getOwnerMapping()
Accessor for the owner mapping.

Returns:
Owner mapping.

isEmbeddedMapping

protected boolean isEmbeddedMapping(org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping)
Check if the mapping correspond to a non pc object or embedded field

Parameters:
mapping - the mapping
Returns:
true if the field is embedded into one column

getStateManagerForEmbeddedPCObject

public org.datanucleus.store.ObjectProvider getStateManagerForEmbeddedPCObject(org.datanucleus.store.ObjectProvider sm,
                                                                               Object obj,
                                                                               org.datanucleus.metadata.AbstractMemberMetaData ownerMmd,
                                                                               short pcType)
Method to return the StateManager for an embedded PC object (element, key, value). It creates one if the element is not currently managed.

Parameters:
sm - State Manager of the owner
obj - The embedded PC object
ownerMmd - The meta data for the owner field
pcType - Object type for the embedded object (see ObjectProvider EMBEDDED_PC etc)
Returns:
The state manager

allowsBatching

protected boolean allowsBatching()
Convenience method to return if the datastore supports batching and the user wants batching.

Returns:
If batching of statements is permissible

getRelationType

public int getRelationType()

getOwnerMemberMetaData

public org.datanucleus.metadata.AbstractMemberMetaData getOwnerMemberMetaData()

getDatastoreAdapter

public org.datanucleus.store.mapped.DatastoreAdapter getDatastoreAdapter()


Copyright © 2012. All Rights Reserved.