com.force.sdk.jpa.schema
Class ForceStoreSchemaHandler

java.lang.Object
  extended by com.force.sdk.jpa.schema.ForceStoreSchemaHandler
All Implemented Interfaces:
org.datanucleus.store.schema.StoreSchemaHandler

public class ForceStoreSchemaHandler
extends Object
implements org.datanucleus.store.schema.StoreSchemaHandler

Cached information about the schema used by this application is stored in the Schema Handler.

Author:
Fiaz Hossain

Constructor Summary
ForceStoreSchemaHandler(ForceStoreManager storeManager)
          create the schema handler for Force.com sObjects.
 
Method Summary
 TableImpl addTable(org.datanucleus.metadata.AbstractClassMetaData acmd, ForceManagedConnection conn)
          register a table with the cache, create its TableName and TableImpl.
 TableImpl addVirtualTable(org.datanucleus.metadata.AbstractClassMetaData acmd)
          register a virtual table (a table not backed by an actual object in Force.com, like owner).
 void cacheDescribeSObjects(Collection<org.datanucleus.metadata.AbstractClassMetaData> classes, ForceManagedConnection mconn)
          makes a describe call for each class in the collection and caches the results.
 void clear()
           
 void clearDescribeSObjects()
          Clear out the describe results after intitialization.
 void createSchema(Object conn, String schemaName)
           
 void deleteSchema(Object conn, String schemaName)
           
 org.datanucleus.store.schema.StoreSchemaData getSchemaData(Object conn, String objName, Object[] values)
           
 org.datanucleus.store.StoreManager getStoreManager()
           
 TableImpl getTable(org.datanucleus.metadata.AbstractClassMetaData acmd)
          get the table impl for a particular entity from the cache.
 TableImpl getTable(String objName)
          get the table impl for a particular entity name from the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ForceStoreSchemaHandler

public ForceStoreSchemaHandler(ForceStoreManager storeManager)
create the schema handler for Force.com sObjects.

Parameters:
storeManager - the store manager
Method Detail

clear

public void clear()
Specified by:
clear in interface org.datanucleus.store.schema.StoreSchemaHandler

createSchema

public void createSchema(Object conn,
                         String schemaName)
Specified by:
createSchema in interface org.datanucleus.store.schema.StoreSchemaHandler

deleteSchema

public void deleteSchema(Object conn,
                         String schemaName)
Specified by:
deleteSchema in interface org.datanucleus.store.schema.StoreSchemaHandler

getSchemaData

public org.datanucleus.store.schema.StoreSchemaData getSchemaData(Object conn,
                                                                  String objName,
                                                                  Object[] values)
Specified by:
getSchemaData in interface org.datanucleus.store.schema.StoreSchemaHandler

cacheDescribeSObjects

public void cacheDescribeSObjects(Collection<org.datanucleus.metadata.AbstractClassMetaData> classes,
                                  ForceManagedConnection mconn)
makes a describe call for each class in the collection and caches the results.

Parameters:
classes - a collection of class metadata to describe
mconn - the managed connection to the Force.com APIs

clearDescribeSObjects

public void clearDescribeSObjects()
Clear out the describe results after intitialization.


getTable

public TableImpl getTable(String objName)
get the table impl for a particular entity name from the cache.

Parameters:
objName - the name of the object to retrieve a table for
Returns:
the tableImpl, null if it hasn't been registered

getTable

public TableImpl getTable(org.datanucleus.metadata.AbstractClassMetaData acmd)
get the table impl for a particular entity from the cache.

Parameters:
acmd - the metadata to retrieve table info for
Returns:
the tableImpl, null if it hasn't been registered

addTable

public TableImpl addTable(org.datanucleus.metadata.AbstractClassMetaData acmd,
                          ForceManagedConnection conn)
register a table with the cache, create its TableName and TableImpl.

Parameters:
acmd - the class metadata of the entity to register
conn - the managed connection to Force.com APIs, used to get at the namespace
Returns:
the created TableImpl

addVirtualTable

public TableImpl addVirtualTable(org.datanucleus.metadata.AbstractClassMetaData acmd)
register a virtual table (a table not backed by an actual object in Force.com, like owner).

Parameters:
acmd - the class metadata of the virtual table to register with the cache
Returns:
the created TableImpl

getStoreManager

public org.datanucleus.store.StoreManager getStoreManager()
Specified by:
getStoreManager in interface org.datanucleus.store.schema.StoreSchemaHandler


Copyright © 2011. All Rights Reserved.