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 JDBCEntityPersistenceStore
public JDBCTypeFactory getJDBCTypeFactory()
getJDBCTypeFactory
in interface JDBCEntityPersistenceStore
public JDBCEntityMetaData getMetaData()
getMetaData
in interface JDBCEntityPersistenceStore
public 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 JDBCEntityPersistenceStore
public org.jboss.msc.inject.Injector<CmpEntityBeanComponent> getComponentInjector()
public Object createBeanClassInstance() throws Exception
createBeanClassInstance
in interface JDBCEntityPersistenceStore
Exception
public void initEntity(CmpEntityBeanContext ctx)
JDBCEntityPersistenceStore
This method is called before createEntity, and should resetStats the value of all cmpFields to 0 or null.
initEntity
in interface JDBCEntityPersistenceStore
public Object createEntity(Method createMethod, Object[] args, CmpEntityBeanContext ctx) throws javax.ejb.CreateException
JDBCEntityPersistenceStore
createEntity
in interface JDBCEntityPersistenceStore
createMethod
- the create method in the home interface that was
calledargs
- any create parametersctx
- the instance being used for this create calljavax.ejb.CreateException
public Object postCreateEntity(Method createMethod, Object[] args, CmpEntityBeanContext ctx)
JDBCEntityPersistenceStore
postCreateEntity
in interface JDBCEntityPersistenceStore
createMethod
- 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
JDBCEntityPersistenceStore
findEntity
in interface JDBCEntityPersistenceStore
finderMethod
- the find method in the home interface that was
calledargs
- any finder parametersctx
- the instance to use for the finder calljavax.ejb.FinderException
public Collection findEntities(Method finderMethod, Object[] args, CmpEntityBeanContext ctx, JDBCQueryCommand.EntityProxyFactory factory) throws javax.ejb.FinderException
JDBCEntityPersistenceStore
findEntities
in interface JDBCEntityPersistenceStore
finderMethod
- the find method in the home interface that was
calledargs
- any finder parametersctx
- the instance to use for the finder calljavax.ejb.FinderException
public void activateEntity(CmpEntityBeanContext ctx)
JDBCEntityPersistenceStore
With 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 JDBCEntityPersistenceStore
ctx
- the instance to use for the activationpublic void loadEntity(CmpEntityBeanContext ctx)
loadEntity
in interface JDBCEntityPersistenceStore
ctx
- - entity context.public boolean loadEntity(CmpEntityBeanContext ctx, boolean failIfNotFound)
public void loadField(JDBCCMPFieldBridge field, CmpEntityBeanContext ctx)
public boolean isStoreRequired(CmpEntityBeanContext ctx)
JDBCEntityPersistenceStore
isStoreRequired
in interface JDBCEntityPersistenceStore
ctx
- the instance to checkpublic boolean isModified(CmpEntityBeanContext ctx)
JDBCEntityPersistenceStore
isModified
in interface JDBCEntityPersistenceStore
public void storeEntity(CmpEntityBeanContext ctx)
JDBCEntityPersistenceStore
storeEntity
in interface JDBCEntityPersistenceStore
ctx
- the instance to synchronizepublic void passivateEntity(CmpEntityBeanContext ctx)
JDBCEntityPersistenceStore
See the activate discussion for the reason for exposing EJB callback calls to the store.
passivateEntity
in interface JDBCEntityPersistenceStore
ctx
- the instance to passivatepublic void removeEntity(CmpEntityBeanContext ctx) throws javax.ejb.RemoveException, RemoteException
JDBCEntityPersistenceStore
removeEntity
in interface JDBCEntityPersistenceStore
ctx
- 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 JDBCEntityPersistenceStore
public CmpConfig getCmpConfig()
getCmpConfig
in interface JDBCEntityPersistenceStore
public Catalog getCatalog()
getCatalog
in interface JDBCEntityPersistenceStore
public boolean hasCreateTable(String entityName)
hasCreateTable
in interface JDBCEntityPersistenceStore
public void addCreateTable(String entityName)
addCreateTable
in interface JDBCEntityPersistenceStore
public void addExistingTable(String entityName)
addExistingTable
in interface JDBCEntityPersistenceStore
public org.jboss.msc.inject.Injector<DataSource> getDataSourceInjector(String name)
public EntityBridgeInvocationHandler getInvocationHandler()
getInvocationHandler
in interface JDBCEntityPersistenceStore
public KeyGeneratorFactory getKeyGeneratorFactory(String name)
getKeyGeneratorFactory
in interface JDBCEntityPersistenceStore
public org.jboss.msc.inject.Injector<KeyGeneratorFactoryRegistry> getKeyGeneratorFactoryInjector()
Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.