public class JDBCStoreManager2 extends Object implements JDBCEntityPersistenceStore
| Modifier and Type | Field and Description |
|---|---|
static AttachmentKey<Schema> |
SCHEMA |
| Constructor and Description |
|---|
JDBCStoreManager2(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 the bean class or a subclass of the bean class.
|
Object |
createEntity(Method m,
Object[] args,
CmpEntityBeanContext ctx)
This method is called whenever an entity is to be created.
|
Collection |
findEntities(Method finderMethod,
Object[] args,
CmpEntityBeanContext instance,
JDBCQueryCommand.EntityProxyFactory factory)
This method is called when collections of entities are to be found.
|
Object |
findEntity(Method finderMethod,
Object[] args,
CmpEntityBeanContext instance,
JDBCQueryCommand.EntityProxyFactory factory)
This method is called when single entities are to be found.
|
Catalog |
getCatalog() |
CmpConfig |
getCmpConfig() |
CmpEntityBeanComponent |
getComponent() |
DataSource |
getDataSource(String name) |
JDBCAbstractEntityBridge |
getEntityBridge() |
EntityBridgeInvocationHandler |
getInvocationHandler() |
JDBCTypeFactory |
getJDBCTypeFactory() |
KeyGeneratorFactory |
getKeyGeneratorFactory(String name) |
org.jboss.msc.inject.Injector<KeyGeneratorFactoryRegistry> |
getKeyGeneratorFactoryInjector() |
JDBCEntityMetaData |
getMetaData() |
QueryFactory |
getQueryFactory() |
Schema |
getSchema() |
boolean |
hasCreateTable(String entityName) |
void |
init(CmpEntityBeanComponent component) |
void |
initEntity(CmpEntityBeanContext ctx)
Initializes the instance context.
|
protected void |
initStoreManager() |
boolean |
isCascadeDeleted(Object key) |
boolean |
isModified(CmpEntityBeanContext instance)
This method is used to determined whether the instance was modified.
|
boolean |
isStoreRequired(CmpEntityBeanContext instance)
This method is used to determine if an entity should be stored.
|
void |
loadEntity(CmpEntityBeanContext ctx)
This method is called whenever an entity shall be load from the
underlying storage.
|
void |
passivateEntity(CmpEntityBeanContext ctx)
This method is called when an entity shall be passivate.
|
Object |
postCreateEntity(Method m,
Object[] args,
CmpEntityBeanContext ctx)
This method is called after the createEntity.
|
boolean |
registerCascadeDelete(Object key,
Object value) |
void |
removeEntity(CmpEntityBeanContext ctx)
This method is called when an entity shall be removed from the
underlying storage.
|
protected void |
startStoreManager() |
void |
stop() |
void |
storeEntity(CmpEntityBeanContext instance)
This method is called whenever an entity shall be stored to the
underlying storage.
|
void |
unregisterCascadeDelete(Object key) |
public static final AttachmentKey<Schema> SCHEMA
public JDBCStoreManager2(DeploymentUnit deploymentUnit, JDBCEntityMetaData metaData, CmpConfig cmpConfig, Catalog catalog)
public Schema getSchema()
public Catalog getCatalog()
getCatalog in interface JDBCEntityPersistenceStorepublic QueryFactory getQueryFactory()
public boolean isCascadeDeleted(Object key)
public void unregisterCascadeDelete(Object key)
public void init(CmpEntityBeanComponent component)
public void stop()
public JDBCAbstractEntityBridge getEntityBridge()
getEntityBridge in interface JDBCEntityPersistenceStorepublic JDBCEntityMetaData getMetaData()
getMetaData in interface JDBCEntityPersistenceStorepublic JDBCTypeFactory getJDBCTypeFactory()
getJDBCTypeFactory in interface JDBCEntityPersistenceStorepublic CmpEntityBeanComponent getComponent()
getComponent in interface JDBCEntityPersistenceStorepublic Object createBeanClassInstance() throws Exception
JDBCEntityPersistenceStorecreateBeanClassInstance 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 m, Object[] args, CmpEntityBeanContext ctx) throws javax.ejb.CreateException
JDBCEntityPersistenceStorecreateEntity in interface JDBCEntityPersistenceStorem - 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 m, Object[] args, CmpEntityBeanContext ctx) throws javax.ejb.CreateException
JDBCEntityPersistenceStorepostCreateEntity in interface JDBCEntityPersistenceStorem - the ejbPostCreate method in the bean class that was
calledargs - any create parametersctx - the instance being used for this create calljavax.ejb.CreateExceptionpublic Object findEntity(Method finderMethod, Object[] args, CmpEntityBeanContext instance, JDBCQueryCommand.EntityProxyFactory factory) throws javax.ejb.FinderException
JDBCEntityPersistenceStorefindEntity in interface JDBCEntityPersistenceStorefinderMethod - the find method in the home interface that was
calledargs - any finder parametersinstance - the instance to use for the finder calljavax.ejb.FinderExceptionpublic Collection findEntities(Method finderMethod, Object[] args, CmpEntityBeanContext instance, JDBCQueryCommand.EntityProxyFactory factory) throws javax.ejb.FinderException
JDBCEntityPersistenceStorefindEntities in interface JDBCEntityPersistenceStorefinderMethod - the find method in the home interface that was
calledargs - any finder parametersinstance - 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)
JDBCEntityPersistenceStoreloadEntity in interface JDBCEntityPersistenceStorectx - the instance to synchronizepublic boolean isStoreRequired(CmpEntityBeanContext instance)
JDBCEntityPersistenceStoreisStoreRequired in interface JDBCEntityPersistenceStoreinstance - the instance to checkpublic boolean isModified(CmpEntityBeanContext instance) throws Exception
JDBCEntityPersistenceStoreisModified in interface JDBCEntityPersistenceStoreExceptionpublic void storeEntity(CmpEntityBeanContext instance)
JDBCEntityPersistenceStorestoreEntity in interface JDBCEntityPersistenceStoreinstance - 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
JDBCEntityPersistenceStoreremoveEntity in interface JDBCEntityPersistenceStorectx - the instance to removejavax.ejb.RemoveException - thrown if the instance could not be removedprotected void initStoreManager()
public CmpConfig getCmpConfig()
getCmpConfig in interface JDBCEntityPersistenceStorepublic DataSource getDataSource(String name)
getDataSource 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 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.