public final class JDBCCMRFieldBridge extends JDBCAbstractCMRFieldBridge
Modifier and Type | Class and Description |
---|---|
static class |
JDBCCMRFieldBridge.M2MRelationManager |
static interface |
JDBCCMRFieldBridge.RelationDataManager |
Constructor and Description |
---|
JDBCCMRFieldBridge(JDBCEntityBridge entity,
JDBCStoreManager manager,
JDBCRelationshipRoleMetaData metadata)
Creates a cmr field for the entity based on the metadata.
|
Modifier and Type | Method and Description |
---|---|
void |
addRelatedPKsWaitedForMe(CmpEntityBeanContext ctx)
Establishes relationships with related entities waited for passed in context
to be created.
|
void |
addRelatedPKWaitingForMyPK(Object myPK,
Object relatedPK) |
void |
addRelation(CmpEntityBeanContext 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(CmpEntityBeanContext ctx,
List oldValues) |
void |
createRelationLinks(CmpEntityBeanContext 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(CmpEntityBeanContext myCtx,
Object relatedId,
boolean updateForeignKey) |
void |
destroyRelationLinks(CmpEntityBeanContext 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(CmpEntityBeanContext 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(CmpEntityBeanContext myCtx,
Object relatedId,
boolean updateValueCollection,
boolean updateForeignKey) |
DataSource |
getDataSource()
Gets the datasource of the relation table if relevant.
|
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(CmpEntityBeanContext 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 relevant.
|
JDBCReadAheadMetaData |
getReadAhead()
Gets the read ahead meta data.
|
JDBCAbstractCMRFieldBridge |
getRelatedCMRField()
The related entity's cmr field for this relationship.
|
CmpEntityBeanComponent |
getRelatedComponent()
The related container
|
EntityBridge |
getRelatedEntity()
The related entity.
|
javax.ejb.EJBLocalObject |
getRelatedEntityByFK(Object fk)
Returns related entity's local interface.
|
Object |
getRelatedId(CmpEntityBeanContext myCtx)
Get the related entity's id.
|
Object |
getRelatedIdFromContext(CmpEntityBeanContext ctx)
Creates a new instance of related id based on foreign key value in the context.
|
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(CmpEntityBeanContext 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(CmpEntityBeanContext ctx)
Initialized the foreign key fields.
|
boolean |
invalidateCache(CmpEntityBeanContext ctx) |
boolean |
isBatchCascadeDelete() |
boolean |
isCMPField() |
boolean |
isCollectionValued()
Is this a collection valued field.
|
boolean |
isDirty(CmpEntityBeanContext 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(CmpEntityBeanContext 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(CmpEntityBeanContext ctx)
Had the read time expired?
|
boolean |
isSingleValued()
Is this a single valued field.
|
void |
load(CmpEntityBeanContext myCtx,
Collection values) |
int |
loadArgumentResults(ResultSet rs,
int parameterIndex,
Object[] fkRef)
Loads the value of this cmp field from result set into argument reference.
|
int |
loadInstanceResults(ResultSet rs,
int parameterIndex,
CmpEntityBeanContext ctx)
Loads the data from result set into the instance associated with
the specified context.
|
boolean |
removeFromRelations(CmpEntityBeanContext ctx,
Object[] oldRelationsRef) |
void |
removeRelatedPKWaitingForMyPK(Object myPK,
Object relatedPK) |
void |
removeRelation(CmpEntityBeanContext myCtx,
Object fk)
Removes the foreign key to the set of related ids, and updates any foreign key fields.
|
void |
resetPersistenceContext(CmpEntityBeanContext ctx)
resets the persistence context of the foreign key fields
|
void |
resolveRelationship() |
void |
scheduleChildrenForBatchCascadeDelete(CmpEntityBeanContext ctx)
Schedules children for batch cascade delete.
|
void |
scheduleChildrenForCascadeDelete(CmpEntityBeanContext ctx)
Schedules children for cascade delete.
|
void |
setClean(CmpEntityBeanContext ctx)
This method is never called.
|
void |
setForeignKey(CmpEntityBeanContext myCtx,
Object fk)
Sets the foreign key field value.
|
int |
setInstanceParameters(PreparedStatement ps,
int parameterIndex,
CmpEntityBeanContext ctx)
Sets the prepared statement parameters with the data from the
instance associated with the context.
|
void |
setInstanceValue(CmpEntityBeanContext myCtx,
Object newValue)
Sets the value of the cmr field for the instance associated with
the context.
|
void |
setValue(CmpEntityBeanContext ctx,
Object value)
Sets new value.
|
void |
start()
The third phase of deployment.
|
String |
toString() |
getPrimaryKeyValue
public JDBCCMRFieldBridge(JDBCEntityBridge entity, JDBCStoreManager manager, JDBCRelationshipRoleMetaData metadata)
public JDBCCMRFieldBridge.RelationDataManager getRelationDataManager()
public void resolveRelationship()
public void start()
public boolean removeFromRelations(CmpEntityBeanContext ctx, Object[] oldRelationsRef)
public void cascadeDelete(CmpEntityBeanContext 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 CmpEntityBeanComponent getRelatedComponent()
public Class getRelatedLocalInterface()
public boolean isLoaded(CmpEntityBeanContext ctx)
JDBCFieldBridge
ctx
- - entity's contextpublic void addRelatedPKsWaitedForMe(CmpEntityBeanContext ctx)
ctx
- - entity's context.public boolean isReadOnly()
public boolean isReadTimedOut(CmpEntityBeanContext ctx)
public Object getValue(CmpEntityBeanContext ctx)
FieldBridge
ctx
- - entity's context.public void setValue(CmpEntityBeanContext ctx, Object value)
ctx
- - entity's context;value
- - new value.public Object getInstanceValue(CmpEntityBeanContext myCtx)
myCtx
- the context for which this field's value should be fetchedpublic javax.ejb.EJBLocalObject getRelatedEntityByFK(Object fk)
fk
- - foreign key value.public boolean isForeignKeyValid(Object fk)
fk
- the foreign key to checkpublic void setInstanceValue(CmpEntityBeanContext myCtx, Object newValue)
myCtx
- the context for which this field's value should be setnewValue
- the new value of this fieldpublic void createRelationLinks(CmpEntityBeanContext myCtx, Object relatedId)
public void createRelationLinks(CmpEntityBeanContext myCtx, Object relatedId, boolean updateForeignKey)
public void destroyRelationLinks(CmpEntityBeanContext myCtx, Object relatedId)
public void destroyRelationLinks(CmpEntityBeanContext myCtx, Object relatedId, boolean updateValueCollection)
public void destroyRelationLinks(CmpEntityBeanContext myCtx, Object relatedId, boolean updateValueCollection, boolean updateForeignKey)
public void scheduleChildrenForCascadeDelete(CmpEntityBeanContext ctx)
public void scheduleChildrenForBatchCascadeDelete(CmpEntityBeanContext ctx)
public Object getRelatedId(CmpEntityBeanContext myCtx)
public Object getRelatedIdFromContext(CmpEntityBeanContext ctx)
ctx
- - entity's context.public void addRelation(CmpEntityBeanContext myCtx, Object fk)
public void removeRelation(CmpEntityBeanContext myCtx, Object fk)
public void load(CmpEntityBeanContext myCtx, Collection values)
public void setForeignKey(CmpEntityBeanContext myCtx, Object fk)
public void initInstance(CmpEntityBeanContext ctx)
public void resetPersistenceContext(CmpEntityBeanContext ctx)
public int setInstanceParameters(PreparedStatement ps, int parameterIndex, CmpEntityBeanContext ctx)
JDBCFieldBridge
public int loadInstanceResults(ResultSet rs, int parameterIndex, CmpEntityBeanContext ctx)
JDBCFieldBridge
public int loadArgumentResults(ResultSet rs, int parameterIndex, Object[] fkRef)
JDBCFieldBridge
public boolean isDirty(CmpEntityBeanContext ctx)
public boolean invalidateCache(CmpEntityBeanContext ctx)
public void setClean(CmpEntityBeanContext ctx)
public boolean isCMPField()
public JDBCEntityPersistenceStore getManager()
public boolean hasFKFieldsMappedToCMPFields()
public void removeRelatedPKWaitingForMyPK(Object myPK, Object relatedPK)
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All rights reserved.