public final class JDBCStoreManager extends Object implements JDBCEntityPersistenceStore
| Modifier and Type | Field and Description |
|---|---|
static AttachmentKey<AttachmentList<String>> |
CREATE_TABLES |
static AttachmentKey<AttachmentList<String>> |
EXISTING_TABLES |
static AttachmentKey<Object> |
TX_DATA_MAP |
| Constructor and Description |
|---|
JDBCStoreManager(DeploymentUnit deploymentUnit,
JDBCEntityMetaData metaData,
CmpConfig cmpConfig,
Catalog catalog) |
| Modifier and Type | Method and Description |
|---|---|
void |
activateEntity(CmpEntityBeanContext ctx)
This method is called when an entity shall be activated.
|
void |
addCreateTable(String entityName) |
void |
addExistingTable(String entityName) |
Object |
createBeanClassInstance()
Returns a new instance of a class which implements the bean class.
|
Object |
createEntity(Method createMethod,
Object[] args,
CmpEntityBeanContext ctx)
This method is called whenever an entity is to be created.
|
Collection |
findEntities(Method finderMethod,
Object[] args,
CmpEntityBeanContext ctx,
JDBCQueryCommand.EntityProxyFactory factory)
This method is called when collections of entities are to be found.
|
Object |
findEntity(Method finderMethod,
Object[] args,
CmpEntityBeanContext ctx,
JDBCQueryCommand.EntityProxyFactory factory)
This method is called when single entities are to be found.
|
Object |
getApplicationTxData(Object key) |
Catalog |
getCatalog() |
CmpConfig |
getCmpConfig() |
JDBCCommandFactory |
getCommandFactory() |
CmpEntityBeanComponent |
getComponent() |
org.jboss.msc.inject.Injector<CmpEntityBeanComponent> |
getComponentInjector() |
DataSource |
getDataSource(String name) |
org.jboss.msc.inject.Injector<DataSource> |
getDataSourceInjector(String name) |
JDBCAbstractEntityBridge |
getEntityBridge() |
Object |
getEntityTxData(Object key) |
EntityBridgeInvocationHandler |
getInvocationHandler() |
JDBCTypeFactory |
getJDBCTypeFactory() |
KeyGeneratorFactory |
getKeyGeneratorFactory(String name) |
org.jboss.msc.inject.Injector<KeyGeneratorFactoryRegistry> |
getKeyGeneratorFactoryInjector() |
JDBCEntityMetaData |
getMetaData() |
JDBCQueryManager |
getQueryManager() |
ReadAheadCache |
getReadAheadCache() |
boolean |
hasCreateTable(String entityName) |
void |
initEntity(CmpEntityBeanContext ctx)
Initializes the instance context.
|
boolean |
isModified(CmpEntityBeanContext ctx)
This method is used to determined whether the instance was modified.
|
boolean |
isStoreRequired(CmpEntityBeanContext ctx)
This method is used to determine if an entity should be stored.
|
void |
loadEntity(CmpEntityBeanContext ctx)
Loads entity.
|
boolean |
loadEntity(CmpEntityBeanContext ctx,
boolean failIfNotFound) |
void |
loadField(JDBCCMPFieldBridge field,
CmpEntityBeanContext ctx) |
Collection |
loadRelation(JDBCCMRFieldBridge cmrField,
Object pk) |
void |
passivateEntity(CmpEntityBeanContext ctx)
This method is called when an entity shall be passivate.
|
Object |
postCreateEntity(Method createMethod,
Object[] args,
CmpEntityBeanContext ctx)
This method is called after the createEntity.
|
void |
putApplicationTxData(Object key,
Object value) |
void |
putEntityTxData(Object key,
Object value) |
void |
removeEntity(CmpEntityBeanContext ctx)
This method is called when an entity shall be removed from the
underlying storage.
|
void |
removeEntityTxData(Object key) |
void |
scheduleCascadeDelete(List pks)
Schedules instances for cascade-delete
|
void |
storeEntity(CmpEntityBeanContext ctx)
This method is called whenever an entity shall be stored to the
underlying storage.
|
boolean |
unscheduledCascadeDelete(Object pk)
Unschedules instance cascade delete.
|
public static final AttachmentKey<Object> TX_DATA_MAP
public static final AttachmentKey<AttachmentList<String>> CREATE_TABLES
public static final AttachmentKey<AttachmentList<String>> EXISTING_TABLES
public JDBCStoreManager(DeploymentUnit deploymentUnit, JDBCEntityMetaData metaData, CmpConfig cmpConfig, Catalog catalog)
public JDBCAbstractEntityBridge getEntityBridge()
getEntityBridge in interface JDBCEntityPersistenceStorepublic JDBCTypeFactory getJDBCTypeFactory()
getJDBCTypeFactory in interface JDBCEntityPersistenceStorepublic JDBCEntityMetaData getMetaData()
getMetaData in interface JDBCEntityPersistenceStorepublic JDBCQueryManager getQueryManager()
public JDBCCommandFactory getCommandFactory()
public ReadAheadCache getReadAheadCache()
public void scheduleCascadeDelete(List pks)
public boolean unscheduledCascadeDelete(Object pk)
pk - instance primary key.public void removeEntityTxData(Object key)
public CmpEntityBeanComponent getComponent()
getComponent in interface JDBCEntityPersistenceStorepublic org.jboss.msc.inject.Injector<CmpEntityBeanComponent> getComponentInjector()
public Object createBeanClassInstance() throws Exception
createBeanClassInstance in interface JDBCEntityPersistenceStoreExceptionpublic void initEntity(CmpEntityBeanContext ctx)
JDBCEntityPersistenceStoreThis method is called before createEntity, and should resetStats the value of all cmpFields to 0 or null.
initEntity in interface JDBCEntityPersistenceStorepublic Object createEntity(Method createMethod, Object[] args, CmpEntityBeanContext ctx) throws javax.ejb.CreateException
JDBCEntityPersistenceStorecreateEntity in interface JDBCEntityPersistenceStorecreateMethod - the create method in the home interface that was
calledargs - any create parametersctx - the instance being used for this create calljavax.ejb.CreateExceptionpublic Object postCreateEntity(Method createMethod, Object[] args, CmpEntityBeanContext ctx)
JDBCEntityPersistenceStorepostCreateEntity in interface JDBCEntityPersistenceStorecreateMethod - the ejbPostCreate method in the bean class that was
calledargs - any create parametersctx - the instance being used for this create callpublic Object findEntity(Method finderMethod, Object[] args, CmpEntityBeanContext ctx, JDBCQueryCommand.EntityProxyFactory factory) throws javax.ejb.FinderException
JDBCEntityPersistenceStorefindEntity in interface JDBCEntityPersistenceStorefinderMethod - the find method in the home interface that was
calledargs - any finder parametersctx - the instance to use for the finder calljavax.ejb.FinderExceptionpublic Collection findEntities(Method finderMethod, Object[] args, CmpEntityBeanContext ctx, JDBCQueryCommand.EntityProxyFactory factory) throws javax.ejb.FinderException
JDBCEntityPersistenceStorefindEntities in interface JDBCEntityPersistenceStorefinderMethod - the find method in the home interface that was
calledargs - any finder parametersctx - the instance to use for the finder calljavax.ejb.FinderExceptionpublic void activateEntity(CmpEntityBeanContext ctx)
JDBCEntityPersistenceStoreWith the PersistenceManager factorization most EJB calls should not exists However this calls permits us to introduce optimizations in the persistence store. Particularly the context has a "PersistenceContext" that a PersistenceStore can use (JAWS does for smart updates) and this is as good a callback as any other to set it up.
activateEntity in interface JDBCEntityPersistenceStorectx - the instance to use for the activationpublic void loadEntity(CmpEntityBeanContext ctx)
loadEntity in interface JDBCEntityPersistenceStorectx - - entity context.public boolean loadEntity(CmpEntityBeanContext ctx, boolean failIfNotFound)
public void loadField(JDBCCMPFieldBridge field, CmpEntityBeanContext ctx)
public boolean isStoreRequired(CmpEntityBeanContext ctx)
JDBCEntityPersistenceStoreisStoreRequired in interface JDBCEntityPersistenceStorectx - the instance to checkpublic boolean isModified(CmpEntityBeanContext ctx)
JDBCEntityPersistenceStoreisModified in interface JDBCEntityPersistenceStorepublic void storeEntity(CmpEntityBeanContext ctx)
JDBCEntityPersistenceStorestoreEntity in interface JDBCEntityPersistenceStorectx - the instance to synchronizepublic void passivateEntity(CmpEntityBeanContext ctx)
JDBCEntityPersistenceStoreSee the activate discussion for the reason for exposing EJB callback calls to the store.
passivateEntity in interface JDBCEntityPersistenceStorectx - the instance to passivatepublic void removeEntity(CmpEntityBeanContext ctx) throws javax.ejb.RemoveException, RemoteException
JDBCEntityPersistenceStoreremoveEntity in interface JDBCEntityPersistenceStorectx - the instance to removejavax.ejb.RemoveException - thrown if the instance could not be removedRemoteException - thrown if some system exception occurspublic Collection loadRelation(JDBCCMRFieldBridge cmrField, Object pk)
public DataSource getDataSource(String name)
getDataSource in interface JDBCEntityPersistenceStorepublic CmpConfig getCmpConfig()
getCmpConfig in interface JDBCEntityPersistenceStorepublic Catalog getCatalog()
getCatalog in interface JDBCEntityPersistenceStorepublic boolean hasCreateTable(String entityName)
hasCreateTable in interface JDBCEntityPersistenceStorepublic void addCreateTable(String entityName)
addCreateTable in interface JDBCEntityPersistenceStorepublic void addExistingTable(String entityName)
addExistingTable in interface JDBCEntityPersistenceStorepublic org.jboss.msc.inject.Injector<DataSource> getDataSourceInjector(String name)
public EntityBridgeInvocationHandler getInvocationHandler()
getInvocationHandler in interface JDBCEntityPersistenceStorepublic KeyGeneratorFactory getKeyGeneratorFactory(String name)
getKeyGeneratorFactory in interface JDBCEntityPersistenceStorepublic org.jboss.msc.inject.Injector<KeyGeneratorFactoryRegistry> getKeyGeneratorFactoryInjector()
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.