org.datanucleus.store
Class StoreDataManager

java.lang.Object
  extended by org.datanucleus.store.StoreDataManager

public class StoreDataManager
extends java.lang.Object

Manager for store information. Keeps a record of which classes are managed by this datastore, and key information about how that class is handled.


Field Summary
protected static Localiser LOCALISER
           
protected  java.util.Map savedStoreDataByClass
          the memory image of schema data beforing running it
protected  java.util.Map<java.lang.Object,StoreData> storeDataByClass
          Map of all managed store data, keyed by the class/field name.
 
Constructor Summary
StoreDataManager()
           
 
Method Summary
 void begin()
          Begin a transaction that changes the StoreData cache
 void clear()
          Clear the cache
 void commit()
          Commit the transaction changes to the StoreData cache
 StoreData get(AbstractMemberMetaData apmd)
          Get the StoreData by the given field/property
 StoreData get(java.lang.String className)
          Get the StoreData by the given className
 java.util.Collection<StoreData> getManagedStoreData()
          Accessor for the StoreData currently managed by this store.
 StoreData[] getStoreDataForProperties(java.lang.String key1, java.lang.Object value1, java.lang.String key2, java.lang.Object value2)
          Convenience accessor for all store data where property 1 has value1 and property 2 has value2.
 boolean managesClass(java.lang.String className)
          Accessor for whether the specified class is managed currently
protected  void registerStoreData(StoreData data)
          Method to register some data with the store.
 void rollback()
          Rollbacks the transaction changes to the StoreData cache
 int size()
          Acessor to the number of StoreData in cache
 
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

storeDataByClass

protected java.util.Map<java.lang.Object,StoreData> storeDataByClass
Map of all managed store data, keyed by the class/field name.


savedStoreDataByClass

protected java.util.Map savedStoreDataByClass
the memory image of schema data beforing running it

Constructor Detail

StoreDataManager

public StoreDataManager()
Method Detail

clear

public void clear()
Clear the cache


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

getStoreDataForProperties

public StoreData[] getStoreDataForProperties(java.lang.String key1,
                                             java.lang.Object value1,
                                             java.lang.String key2,
                                             java.lang.Object value2)
Convenience accessor for all store data where property 1 has value1 and property 2 has value2. Uses equals() on the values. Doesnt cater for null values.

Parameters:
key1 - Property 1 name
value1 - Property 1 value
key2 - Property 2 name
value2 - Property 2 value
Returns:
Store data with the specified property values

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

getManagedStoreData

public java.util.Collection<StoreData> getManagedStoreData()
Accessor for the StoreData currently managed by this store.

Returns:
Collection of the StoreData being managed

get

public StoreData get(java.lang.String className)
Get the StoreData by the given className

Parameters:
className - the fully qualified class name
Returns:
the StoreData

get

public StoreData get(AbstractMemberMetaData apmd)
Get the StoreData by the given field/property

Parameters:
apmd - the field/property
Returns:
the StoreData

size

public int size()
Acessor to the number of StoreData in cache

Returns:
the number of StoreData in cache

begin

public void begin()
Begin a transaction that changes the StoreData cache


rollback

public void rollback()
Rollbacks the transaction changes to the StoreData cache


commit

public void commit()
Commit the transaction changes to the StoreData cache



Copyright © 2010. All Rights Reserved.