org.intermine.metadata
Class PrimaryKeyUtil

java.lang.Object
  extended by org.intermine.metadata.PrimaryKeyUtil

public abstract class PrimaryKeyUtil
extends java.lang.Object

Utility methods for PrimaryKey objects.


Field Summary
protected static java.util.Map<java.lang.String,java.util.Properties> modelKeys
           
protected static java.util.Map<ClassDescriptor,java.util.Map<java.lang.String,PrimaryKey>> primaryKeyCache
           
 
Method Summary
static java.util.Properties getKeyProperties(java.lang.String modelName)
          Return the Properties that specify the key fields for the classes in this Model
static java.util.Map<java.lang.String,PrimaryKey> getPrimaryKeys(ClassDescriptor cld)
          Retrieve a map from key name to PrimaryKey object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

modelKeys

protected static java.util.Map<java.lang.String,java.util.Properties> modelKeys

primaryKeyCache

protected static java.util.Map<ClassDescriptor,java.util.Map<java.lang.String,PrimaryKey>> primaryKeyCache
Method Detail

getPrimaryKeys

public static java.util.Map<java.lang.String,PrimaryKey> getPrimaryKeys(ClassDescriptor cld)
Retrieve a map from key name to PrimaryKey object. The Map contains all the primary keys that exist on a particular class, without performing any recursion.

Parameters:
cld - the ClassDescriptor to fetch primary keys for
Returns:
the Map from key names to PrimaryKeys

getKeyProperties

public static java.util.Properties getKeyProperties(java.lang.String modelName)
Return the Properties that specify the key fields for the classes in this Model

Parameters:
modelName - name of the model
Returns:
the relevant Properties