com.bm.introspectors.relations
Class GlobalPrimaryKeyStore

java.lang.Object
  extended by com.bm.introspectors.relations.GlobalPrimaryKeyStore

public class GlobalPrimaryKeyStore
extends java.lang.Object

Global store for storing the primary key properties of entity classes. Such a global store is necessary to avoid cyclic dependencies while processing relations.

Author:
Peter Doornbosch

Method Summary
 java.util.Set<Property> getPrimaryKeyInfo(java.lang.Class entityClass)
          Retrieves primary key info.
static GlobalPrimaryKeyStore getStore()
          Returns the singleton instance.
 void put(java.lang.Class entityClass, java.util.Map<Property,PrimaryKeyInfo> pkFieldInfo)
          Stores primary key info of a given entity class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getStore

public static GlobalPrimaryKeyStore getStore()
Returns the singleton instance.

Returns:
- the singleton instance

put

public void put(java.lang.Class entityClass,
                java.util.Map<Property,PrimaryKeyInfo> pkFieldInfo)
Stores primary key info of a given entity class.

Parameters:
entityClass - the entity class
pkFieldInfo - the primary key property and field info; usually the map will contain just one entry, but it might contain more entries in case of a composite primary key.

getPrimaryKeyInfo

public java.util.Set<Property> getPrimaryKeyInfo(java.lang.Class entityClass)
Retrieves primary key info.

Parameters:
entityClass -
Returns:
one or more (in case of a composite primary key) properties that specify the primary key(s), or null if no primary key info is registered for the given class.


Copyright © 2008. All Rights Reserved.