|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMRFieldBridge org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge
JDBCCMRFieldBridge a bean relationship. This class only supports relationships between entities managed by a JDBCStoreManager in the same application.
Life-cycle: Tied to the EntityBridge. Multiplicity: One for each role that entity has.
Nested Class Summary | |
static class |
JDBCCMRFieldBridge.M2MRelationManager
|
static interface |
JDBCCMRFieldBridge.RelationDataManager
|
Constructor Summary | |
JDBCCMRFieldBridge(JDBCEntityBridge entity,
JDBCStoreManager manager,
JDBCRelationshipRoleMetaData metadata)
Creates a cmr field for the entity based on the metadata. |
Method Summary | |
void |
addRelatedPKsWaitedForMe(EntityEnterpriseContext ctx)
Establishes relationships with related entities waited for passed in context to be created. |
void |
addRelatedPKWaitingForMyPK(Object myPK,
Object relatedPK)
|
void |
addRelation(EntityEnterpriseContext myCtx,
Object fk)
Adds the foreign key to the set of related ids, and updates any foreign key fields. |
boolean |
allFkFieldsMappedToPkFields()
Returns true if all FK fields are mapped to PK fields |
void |
cascadeDelete(EntityEnterpriseContext ctx,
List oldValues)
|
void |
createRelationLinks(EntityEnterpriseContext myCtx,
Object relatedId)
Creates the relation links between the instance associated with the context and the related instance (just the id is passed in). |
void |
createRelationLinks(EntityEnterpriseContext myCtx,
Object relatedId,
boolean updateForeignKey)
|
void |
destroyRelationLinks(EntityEnterpriseContext myCtx,
Object relatedId)
Destroys the relation links between the instance associated with the context and the related instance (just the id is passed in). |
void |
destroyRelationLinks(EntityEnterpriseContext myCtx,
Object relatedId,
boolean updateValueCollection)
Destroys the relation links between the instance associated with the context and the related instance (just the id is passed in). |
void |
destroyRelationLinks(EntityEnterpriseContext myCtx,
Object relatedId,
boolean updateValueCollection,
boolean updateForeignKey)
|
DataSource |
getDataSource()
Gets the datasource of the relation table if relevent. |
JDBCAbstractEntityBridge |
getEntity()
Gets bridge for this entity. |
String |
getFieldName()
Gets the name of this field. |
JDBCFieldBridge[] |
getForeignKeyFields()
Gets the foreign key fields of this entity (i.e., related entities pk fields) |
Object |
getInstanceValue(EntityEnterpriseContext myCtx)
Gets the value of the cmr field for the instance associated with the context. |
JDBCStoreManager |
getJDBCStoreManager()
Gets the manager of this entity. |
JDBCType |
getJDBCType()
Gets the JDBC type of this field. |
JDBCEntityPersistenceStore |
getManager()
|
JDBCRelationshipRoleMetaData |
getMetaData()
Gets the metadata of the relationship role that this field represents. |
String |
getQualifiedTableName()
Gets the name of the relation table if relevent. |
JDBCReadAheadMetaData |
getReadAhead()
Gets the read ahead meta data. |
JDBCAbstractCMRFieldBridge |
getRelatedCMRField()
The related entity's cmr field for this relationship. |
EntityBridge |
getRelatedEntity()
The related entity. |
javax.ejb.EJBLocalObject |
getRelatedEntityByFK(Object fk)
Returns related entity's local interface. |
Object |
getRelatedId(EntityEnterpriseContext myCtx)
Get the related entity's id. |
Object |
getRelatedIdFromContext(EntityEnterpriseContext ctx)
Creates a new instance of related id based on foreign key value in the context. |
LocalProxyFactory |
getRelatedInvoker()
The related entity's local container invoker. |
JDBCEntityBridge |
getRelatedJDBCEntity()
The related entity. |
Class |
getRelatedLocalInterface()
The related entity's local home interface. |
JDBCStoreManager |
getRelatedManager()
The related manger. |
JDBCCMRFieldBridge.RelationDataManager |
getRelationDataManager()
|
JDBCRelationMetaData |
getRelationMetaData()
Gets the relation metadata. |
JDBCFieldBridge[] |
getTableKeyFields()
Gets the key fields that this entity maintains in the relation table. |
String |
getTableName()
|
Object |
getValue(EntityEnterpriseContext ctx)
Gets the value of this field for the specified instance context. |
boolean |
hasFKFieldsMappedToCMPFields()
|
boolean |
hasForeignKey()
Does this cmr field have foreign keys. |
void |
initInstance(EntityEnterpriseContext ctx)
Initialized the foreign key fields. |
boolean |
invalidateCache(EntityEnterpriseContext ctx)
|
boolean |
isBatchCascadeDelete()
|
boolean |
isCMPField()
|
boolean |
isCollectionValued()
Is this a collection valued field. |
boolean |
isDirty(EntityEnterpriseContext ctx)
This method is never called. |
boolean |
isForeignKeyValid(Object fk)
This method is called only for CMR fields with foreign key fields mapped to CMP fields to check the validity of the foreign key value. |
boolean |
isLoaded(EntityEnterpriseContext ctx)
Has the data been loaded? |
boolean |
isPrimaryKeyMember()
Is this field a member of the primary key. |
boolean |
isReadOnly()
Is this field readonly? |
boolean |
isReadTimedOut(EntityEnterpriseContext ctx)
Had the read time expired? |
boolean |
isSingleValued()
Is this a single valued field. |
void |
load(EntityEnterpriseContext myCtx,
Collection values)
|
int |
loadArgumentResults(ResultSet rs,
int parameterIndex,
Object[] fkRef)
Loads the value of this cmp field from result set into argument referance. |
int |
loadInstanceResults(ResultSet rs,
int parameterIndex,
EntityEnterpriseContext ctx)
Loads the data from result set into the instance associated with the specified context. |
boolean |
removeFromRelations(EntityEnterpriseContext ctx,
Object[] oldRelationsRef)
|
void |
removeRelatedPKWaitingForMyPK(Object myPK,
Object relatedPK)
|
void |
removeRelation(EntityEnterpriseContext myCtx,
Object fk)
Removes the foreign key to the set of related ids, and updates any foreign key fields. |
void |
resetPersistenceContext(EntityEnterpriseContext ctx)
resets the persistence context of the foreign key fields |
void |
resolveRelationship()
|
void |
scheduleChildrenForBatchCascadeDelete(EntityEnterpriseContext ctx)
Schedules children for batch cascade delete. |
void |
scheduleChildrenForCascadeDelete(EntityEnterpriseContext ctx)
Schedules children for cascade delete. |
void |
setClean(EntityEnterpriseContext ctx)
This method is never called. |
void |
setForeignKey(EntityEnterpriseContext myCtx,
Object fk)
Sets the foreign key field value. |
int |
setInstanceParameters(PreparedStatement ps,
int parameterIndex,
EntityEnterpriseContext ctx)
Sets the prepared statement parameters with the data from the instance associated with the context. |
void |
setInstanceValue(EntityEnterpriseContext myCtx,
Object newValue)
Sets the value of the cmr field for the instance associated with the context. |
void |
setValue(EntityEnterpriseContext ctx,
Object value)
Sets new value. |
void |
start()
The third phase of deployment. |
String |
toString()
|
Methods inherited from class org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMRFieldBridge |
getPrimaryKeyValue |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public JDBCCMRFieldBridge(JDBCEntityBridge entity, JDBCStoreManager manager, JDBCRelationshipRoleMetaData metadata) throws org.jboss.deployment.DeploymentException
Method Detail |
public JDBCCMRFieldBridge.RelationDataManager getRelationDataManager()
public void resolveRelationship() throws org.jboss.deployment.DeploymentException
org.jboss.deployment.DeploymentException
public void start() throws org.jboss.deployment.DeploymentException
org.jboss.deployment.DeploymentException
public boolean removeFromRelations(EntityEnterpriseContext ctx, Object[] oldRelationsRef)
public void cascadeDelete(EntityEnterpriseContext ctx, List oldValues) throws javax.ejb.RemoveException, RemoteException
javax.ejb.RemoveException
RemoteException
public boolean isBatchCascadeDelete()
public JDBCStoreManager getJDBCStoreManager()
public JDBCAbstractEntityBridge getEntity()
getEntity
in class JDBCAbstractCMRFieldBridge
public JDBCRelationshipRoleMetaData getMetaData()
getMetaData
in class JDBCAbstractCMRFieldBridge
public JDBCRelationMetaData getRelationMetaData()
public String getFieldName()
public String getQualifiedTableName()
getQualifiedTableName
in class JDBCAbstractCMRFieldBridge
public String getTableName()
getTableName
in class JDBCAbstractCMRFieldBridge
public DataSource getDataSource()
public JDBCReadAheadMetaData getReadAhead()
public JDBCType getJDBCType()
JDBCFieldBridge
public boolean isPrimaryKeyMember()
JDBCFieldBridge
public boolean hasForeignKey()
hasForeignKey
in class JDBCAbstractCMRFieldBridge
public boolean allFkFieldsMappedToPkFields()
public boolean isCollectionValued()
public boolean isSingleValued()
public JDBCFieldBridge[] getTableKeyFields()
getTableKeyFields
in class JDBCAbstractCMRFieldBridge
public JDBCFieldBridge[] getForeignKeyFields()
getForeignKeyFields
in class JDBCAbstractCMRFieldBridge
public JDBCAbstractCMRFieldBridge getRelatedCMRField()
getRelatedCMRField
in class JDBCAbstractCMRFieldBridge
public JDBCStoreManager getRelatedManager()
public EntityBridge getRelatedEntity()
public JDBCEntityBridge getRelatedJDBCEntity()
public final Class getRelatedLocalInterface()
public final LocalProxyFactory getRelatedInvoker()
public boolean isLoaded(EntityEnterpriseContext ctx)
JDBCFieldBridge
ctx
- - entity's context
public void addRelatedPKsWaitedForMe(EntityEnterpriseContext ctx)
ctx
- - entity's context.public boolean isReadOnly()
public boolean isReadTimedOut(EntityEnterpriseContext ctx)
public Object getValue(EntityEnterpriseContext ctx)
FieldBridge
ctx
- - entity's context.
public void setValue(EntityEnterpriseContext ctx, Object value)
ctx
- - entity's context;value
- - new value.public Object getInstanceValue(EntityEnterpriseContext myCtx)
myCtx
- the context for which this field's value should be fetched
public javax.ejb.EJBLocalObject getRelatedEntityByFK(Object fk)
fk
- - foreign key value.
public boolean isForeignKeyValid(Object fk)
fk
- the foreign key to check
public void setInstanceValue(EntityEnterpriseContext myCtx, Object newValue)
myCtx
- the context for which this field's value should be setnewValue
- the new value of this fieldpublic void createRelationLinks(EntityEnterpriseContext myCtx, Object relatedId)
public void createRelationLinks(EntityEnterpriseContext myCtx, Object relatedId, boolean updateForeignKey)
public void destroyRelationLinks(EntityEnterpriseContext myCtx, Object relatedId)
public void destroyRelationLinks(EntityEnterpriseContext myCtx, Object relatedId, boolean updateValueCollection)
public void destroyRelationLinks(EntityEnterpriseContext myCtx, Object relatedId, boolean updateValueCollection, boolean updateForeignKey)
public void scheduleChildrenForCascadeDelete(EntityEnterpriseContext ctx)
public void scheduleChildrenForBatchCascadeDelete(EntityEnterpriseContext ctx)
public Object getRelatedId(EntityEnterpriseContext myCtx)
public Object getRelatedIdFromContext(EntityEnterpriseContext ctx)
ctx
- - entity's context.
public void addRelation(EntityEnterpriseContext myCtx, Object fk)
public void removeRelation(EntityEnterpriseContext myCtx, Object fk)
public void load(EntityEnterpriseContext myCtx, Collection values)
public void setForeignKey(EntityEnterpriseContext myCtx, Object fk)
public void initInstance(EntityEnterpriseContext ctx)
public void resetPersistenceContext(EntityEnterpriseContext ctx)
public int setInstanceParameters(PreparedStatement ps, int parameterIndex, EntityEnterpriseContext ctx)
JDBCFieldBridge
public int loadInstanceResults(ResultSet rs, int parameterIndex, EntityEnterpriseContext ctx)
JDBCFieldBridge
public int loadArgumentResults(ResultSet rs, int parameterIndex, Object[] fkRef)
JDBCFieldBridge
public boolean isDirty(EntityEnterpriseContext ctx)
public boolean invalidateCache(EntityEnterpriseContext ctx)
public void setClean(EntityEnterpriseContext ctx)
public boolean isCMPField()
public JDBCEntityPersistenceStore getManager()
public boolean hasFKFieldsMappedToCMPFields()
public void addRelatedPKWaitingForMyPK(Object myPK, Object relatedPK)
public void removeRelatedPKWaitingForMyPK(Object myPK, Object relatedPK)
public String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |