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 JDBCEntityPersistenceStore
public 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 JDBCEntityPersistenceStore
public JDBCEntityMetaData getMetaData()
getMetaData
in interface JDBCEntityPersistenceStore
public JDBCTypeFactory getJDBCTypeFactory()
getJDBCTypeFactory
in interface JDBCEntityPersistenceStore
public CmpEntityBeanComponent getComponent()
getComponent
in interface JDBCEntityPersistenceStore
public Object createBeanClassInstance() throws Exception
JDBCEntityPersistenceStore
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 m, Object[] args, CmpEntityBeanContext ctx) throws javax.ejb.CreateException
JDBCEntityPersistenceStore
createEntity
in interface JDBCEntityPersistenceStore
m
- 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 m, Object[] args, CmpEntityBeanContext ctx) throws javax.ejb.CreateException
JDBCEntityPersistenceStore
postCreateEntity
in interface JDBCEntityPersistenceStore
m
- the ejbPostCreate method in the bean class that was
calledargs
- any create parametersctx
- the instance being used for this create calljavax.ejb.CreateException
public Object findEntity(Method finderMethod, Object[] args, CmpEntityBeanContext instance, 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 parametersinstance
- the instance to use for the finder calljavax.ejb.FinderException
public Collection findEntities(Method finderMethod, Object[] args, CmpEntityBeanContext instance, 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 parametersinstance
- 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)
JDBCEntityPersistenceStore
loadEntity
in interface JDBCEntityPersistenceStore
ctx
- the instance to synchronizepublic boolean isStoreRequired(CmpEntityBeanContext instance)
JDBCEntityPersistenceStore
isStoreRequired
in interface JDBCEntityPersistenceStore
instance
- the instance to checkpublic boolean isModified(CmpEntityBeanContext instance) throws Exception
JDBCEntityPersistenceStore
isModified
in interface JDBCEntityPersistenceStore
Exception
public void storeEntity(CmpEntityBeanContext instance)
JDBCEntityPersistenceStore
storeEntity
in interface JDBCEntityPersistenceStore
instance
- 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
JDBCEntityPersistenceStore
removeEntity
in interface JDBCEntityPersistenceStore
ctx
- the instance to removejavax.ejb.RemoveException
- thrown if the instance could not be removedprotected void initStoreManager()
public CmpConfig getCmpConfig()
getCmpConfig
in interface JDBCEntityPersistenceStore
public DataSource getDataSource(String name)
getDataSource
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 EntityBridgeInvocationHandler getInvocationHandler()
getInvocationHandler
in interface JDBCEntityPersistenceStore
public KeyGeneratorFactory getKeyGeneratorFactory(String name)
getKeyGeneratorFactory
in interface JDBCEntityPersistenceStore
public org.jboss.msc.inject.Injector<KeyGeneratorFactoryRegistry> getKeyGeneratorFactoryInjector()
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All rights reserved.