Save This Page
Home » jboss-5.0.0.CR1-src » org.jboss.ejb.plugins.cmp » jdbc » bridge » [javadoc | source]
org.jboss.ejb.plugins.cmp.jdbc.bridge
public final class: JDBCCMRFieldBridge [javadoc | source]
java.lang.Object
   org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMRFieldBridge
      org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge

All Implemented Interfaces:
    JDBCFieldBridge, CMRFieldBridge

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:
public static interface  JDBCCMRFieldBridge.RelationDataManager   
public static class  JDBCCMRFieldBridge.M2MRelationManager   
Constructor:
 public JDBCCMRFieldBridge(JDBCEntityBridge entity,
    JDBCStoreManager manager,
    JDBCRelationshipRoleMetaData metadata) throws DeploymentException 
    Creates a cmr field for the entity based on the metadata.
Method from org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge Summary:
addRelatedPKWaitingForMyPK,   addRelatedPKsWaitedForMe,   addRelation,   allFkFieldsMappedToPkFields,   cascadeDelete,   createRelationLinks,   createRelationLinks,   destroyRelationLinks,   destroyRelationLinks,   destroyRelationLinks,   getDataSource,   getEntity,   getFieldName,   getForeignKeyFields,   getInstanceValue,   getJDBCStoreManager,   getJDBCType,   getManager,   getMetaData,   getQualifiedTableName,   getReadAhead,   getRelatedCMRField,   getRelatedEntity,   getRelatedEntityByFK,   getRelatedId,   getRelatedIdFromContext,   getRelatedInvoker,   getRelatedJDBCEntity,   getRelatedLocalInterface,   getRelatedManager,   getRelationDataManager,   getRelationMetaData,   getTableKeyFields,   getTableName,   getValue,   hasFKFieldsMappedToCMPFields,   hasForeignKey,   initInstance,   invalidateCache,   isBatchCascadeDelete,   isCMPField,   isCollectionValued,   isDirty,   isForeignKeyValid,   isLoaded,   isPrimaryKeyMember,   isReadOnly,   isReadTimedOut,   isSingleValued,   load,   loadArgumentResults,   loadInstanceResults,   removeFromRelations,   removeRelatedPKWaitingForMyPK,   removeRelation,   resetPersistenceContext,   resolveRelationship,   scheduleChildrenForBatchCascadeDelete,   scheduleChildrenForCascadeDelete,   setClean,   setForeignKey,   setInstanceParameters,   setInstanceValue,   setValue,   start,   toString
Methods from org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMRFieldBridge:
getEntity,   getForeignKeyFields,   getMetaData,   getPrimaryKeyValue,   getQualifiedTableName,   getRelatedCMRField,   getTableKeyFields,   getTableName,   hasForeignKey
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge Detail:
 public  void addRelatedPKWaitingForMyPK(Object myPK,
    Object relatedPK) 
 public  void addRelatedPKsWaitedForMe(EntityEnterpriseContext ctx) 
    Establishes relationships with related entities waited for passed in context to be created.
 public  void addRelation(EntityEnterpriseContext myCtx,
    Object fk) 
    Adds the foreign key to the set of related ids, and updates any foreign key fields.
 public boolean allFkFieldsMappedToPkFields() 
    Returns true if all FK fields are mapped to PK fields
 public  void cascadeDelete(EntityEnterpriseContext ctx,
    List oldValues) throws RemoveException, RemoteException 
 public  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).

    This method calls a.addRelation(b) and b.addRelation(a)

 public  void createRelationLinks(EntityEnterpriseContext myCtx,
    Object relatedId,
    boolean updateForeignKey) 
 public  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).

    This method calls a.removeRelation(b) and b.removeRelation(a)

 public  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).

    This method calls a.removeRelation(b) and b.removeRelation(a)

    If updateValueCollection is false, the related id collection is not updated. This form is only used by the RelationSet iterator.

 public  void destroyRelationLinks(EntityEnterpriseContext myCtx,
    Object relatedId,
    boolean updateValueCollection,
    boolean updateForeignKey) 
 public DataSource getDataSource() 
    Gets the datasource of the relation table if relevent.
 public JDBCAbstractEntityBridge getEntity() 
    Gets bridge for this entity.
 public String getFieldName() 
    Gets the name of this field.
 public JDBCFieldBridge[] getForeignKeyFields() 
    Gets the foreign key fields of this entity (i.e., related entities pk fields)
 public Object getInstanceValue(EntityEnterpriseContext myCtx) 
    Gets the value of the cmr field for the instance associated with the context.
 public JDBCStoreManager getJDBCStoreManager() 
    Gets the manager of this entity.
 public JDBCType getJDBCType() 
 public JDBCEntityPersistenceStore getManager() 
 public JDBCRelationshipRoleMetaData getMetaData() 
    Gets the metadata of the relationship role that this field represents.
 public String getQualifiedTableName() 
    Gets the name of the relation table if relevent.
 public JDBCReadAheadMetaData getReadAhead() 
    Gets the read ahead meta data.
 public JDBCAbstractCMRFieldBridge getRelatedCMRField() 
    The related entity's cmr field for this relationship.
 public EntityBridge getRelatedEntity() 
    The related entity.
 public EJBLocalObject getRelatedEntityByFK(Object fk) 
    Returns related entity's local interface. If there are foreign key fields mapped to CMP fields, existence of related entity is checked with findByPrimaryKey and if, in this case, related instance is not found, null is returned. If foreign key fields mapped to its own columns then existence of related entity is not checked and just its local object is returned.
 public Object getRelatedId(EntityEnterpriseContext myCtx) 
    Get the related entity's id. This only works on single valued cmr fields.
 public Object getRelatedIdFromContext(EntityEnterpriseContext ctx) 
    Creates a new instance of related id based on foreign key value in the context.
 public final LocalProxyFactory getRelatedInvoker() 
    The related entity's local container invoker.
 public JDBCEntityBridge getRelatedJDBCEntity() 
    The related entity.
 public final Class getRelatedLocalInterface() 
    The related entity's local home interface.
 public JDBCStoreManager getRelatedManager() 
    The related manger.
 public JDBCCMRFieldBridge.RelationDataManager getRelationDataManager() 
 public JDBCRelationMetaData getRelationMetaData() 
    Gets the relation metadata.
 public JDBCFieldBridge[] getTableKeyFields() 
    Gets the key fields that this entity maintains in the relation table.
 public String getTableName() 
 public Object getValue(EntityEnterpriseContext ctx) 
 public boolean hasFKFieldsMappedToCMPFields() 
 public boolean hasForeignKey() 
    Does this cmr field have foreign keys.
 public  void initInstance(EntityEnterpriseContext ctx) 
    Initialized the foreign key fields.
 public boolean invalidateCache(EntityEnterpriseContext ctx) 
 public boolean isBatchCascadeDelete() 
 public boolean isCMPField() 
 public boolean isCollectionValued() 
    Is this a collection valued field.
 public boolean isDirty(EntityEnterpriseContext ctx) 
    This method is never called. In case of a CMR with foreign key fields, only the foreign key fields are asked for the dirty state.
 public 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.
 public boolean isLoaded(EntityEnterpriseContext ctx) 
 public boolean isPrimaryKeyMember() 
 public boolean isReadOnly() 
    Is this field readonly?
 public boolean isReadTimedOut(EntityEnterpriseContext ctx) 
    Had the read time expired?
 public boolean isSingleValued() 
    Is this a single valued field.
 public  void load(EntityEnterpriseContext myCtx,
    Collection values) 
 public int loadArgumentResults(ResultSet rs,
    int parameterIndex,
    Object[] fkRef) 
 public int loadInstanceResults(ResultSet rs,
    int parameterIndex,
    EntityEnterpriseContext ctx) 
 public boolean removeFromRelations(EntityEnterpriseContext ctx,
    Object[] oldRelationsRef) 
 public  void removeRelatedPKWaitingForMyPK(Object myPK,
    Object relatedPK) 
 public  void removeRelation(EntityEnterpriseContext myCtx,
    Object fk) 
    Removes the foreign key to the set of related ids, and updates any foreign key fields.
 public  void resetPersistenceContext(EntityEnterpriseContext ctx) 
    resets the persistence context of the foreign key fields
 public  void resolveRelationship() throws DeploymentException 
 public  void scheduleChildrenForBatchCascadeDelete(EntityEnterpriseContext ctx) 
    Schedules children for batch cascade delete.
 public  void scheduleChildrenForCascadeDelete(EntityEnterpriseContext ctx) 
    Schedules children for cascade delete.
 public  void setClean(EntityEnterpriseContext ctx) 
    This method is never called. In case of a CMR - with foreign key fields, the foreign key fields are cleaned when necessary according to CMP fields' behaviour. - from m:m relationship, added/removed key pairs are cleared in application tx data map on sync.
 public  void setForeignKey(EntityEnterpriseContext myCtx,
    Object fk) 
    Sets the foreign key field value.
 public int setInstanceParameters(PreparedStatement ps,
    int parameterIndex,
    EntityEnterpriseContext ctx) 
 public  void setInstanceValue(EntityEnterpriseContext myCtx,
    Object newValue) 
    Sets the value of the cmr field for the instance associated with the context.
 public  void setValue(EntityEnterpriseContext ctx,
    Object value) 
    Sets new value.
 public  void start() throws DeploymentException 
    The third phase of deployment. The method is called when relationships are already resolved.
 public String toString()