|
EclipseLink 2.3.2, build 'v20111125-r10461' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.persistence.mappings.RelationTableMechanism
public class RelationTableMechanism
Purpose: Contains relation table functionality that was originally defined in ManyToManyMapping and now is shared with OneToOneMapping.
Field Summary | |
---|---|
protected DataModifyQuery |
deleteQuery
Query used for single row deletion. |
protected boolean |
hasCustomDeleteQuery
|
protected boolean |
hasCustomInsertQuery
|
protected DataModifyQuery |
insertQuery
Used for insertion. |
protected ReadQuery |
lockRelationTableQuery
|
protected org.eclipse.persistence.internal.helper.DatabaseTable |
relationTable
The intermediate relation table. |
protected java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> |
sourceKeyFields
The field in the source table that corresponds to the key in the relation table |
protected java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> |
sourceRelationKeyFields
The field in the intermediate table that corresponds to the key in the source table |
protected java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> |
targetKeyFields
The field in the target table that corresponds to the key in the relation table |
protected java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> |
targetRelationKeyFields
The field in the intermediate table that corresponds to the key in the target table |
Constructor Summary | |
---|---|
RelationTableMechanism()
|
Method Summary | |
---|---|
org.eclipse.persistence.internal.sessions.AbstractRecord |
addRelationTableSourceRow(org.eclipse.persistence.internal.sessions.AbstractRecord sourceRow,
org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow)
INTERNAL: Add to a row source relation fields with values extracted from the source row. |
org.eclipse.persistence.internal.sessions.AbstractRecord |
addRelationTableSourceRow(java.lang.Object sourceObject,
org.eclipse.persistence.internal.sessions.AbstractSession session,
org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
ForeignReferenceMapping mapping)
INTERNAL: Add to a row source relation fields with values extracted from the source object. |
org.eclipse.persistence.internal.sessions.AbstractRecord |
addRelationTableTargetRow(java.lang.Object targetObject,
org.eclipse.persistence.internal.sessions.AbstractSession session,
org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
ForeignReferenceMapping mapping)
INTERNAL: Add to a row target relation fields with values extracted from the target object. |
void |
addSourceRelationKeyField(org.eclipse.persistence.internal.helper.DatabaseField sourceRelationKeyField,
org.eclipse.persistence.internal.helper.DatabaseField sourcePrimaryKeyField)
PUBLIC: Add the fields in the intermediate table that corresponds to the primary key in the source table. |
void |
addSourceRelationKeyFieldName(java.lang.String sourceRelationKeyFieldName,
java.lang.String sourcePrimaryKeyFieldName)
PUBLIC: Add the fields in the intermediate table that corresponds to the primary key in the source table. |
void |
addTargetRelationKeyField(org.eclipse.persistence.internal.helper.DatabaseField targetRelationKeyField,
org.eclipse.persistence.internal.helper.DatabaseField targetPrimaryKeyField)
PUBLIC: Add the fields in the intermediate table that corresponds to the primary key in the target table. |
void |
addTargetRelationKeyFieldName(java.lang.String targetRelationKeyFieldName,
java.lang.String targetPrimaryKeyFieldName)
PUBLIC: Add the fields in the intermediate table that corresponds to the primary key in the target table. |
protected Expression |
buildBatchCriteria(ExpressionBuilder builder,
ObjectLevelReadQuery query)
INTERNAL: Return the selection criteria used to IN batch fetching. |
org.eclipse.persistence.internal.sessions.AbstractRecord |
buildRelationTableSourceAndTargetRow(org.eclipse.persistence.internal.sessions.AbstractRecord sourceRow,
java.lang.Object targetObject,
org.eclipse.persistence.internal.sessions.AbstractSession session,
ForeignReferenceMapping mapping)
INTERNAL: Create a row that contains source relation fields with values extracted from the source row and target relation fields with values extracted from the target object. |
org.eclipse.persistence.internal.sessions.AbstractRecord |
buildRelationTableSourceAndTargetRow(java.lang.Object sourceObject,
java.lang.Object targetObject,
org.eclipse.persistence.internal.sessions.AbstractSession session,
ForeignReferenceMapping mapping)
INTERNAL: Create a row that contains source relation fields with values extracted from the source object and target relation fields with values extracted from the target object. |
org.eclipse.persistence.internal.sessions.AbstractRecord |
buildRelationTableSourceRow(org.eclipse.persistence.internal.sessions.AbstractRecord sourceRow)
INTERNAL: Create a row that contains source relation fields with values extracted from the source row. |
org.eclipse.persistence.internal.sessions.AbstractRecord |
buildRelationTableSourceRow(java.lang.Object sourceObject,
org.eclipse.persistence.internal.sessions.AbstractSession session,
ForeignReferenceMapping mapping)
INTERNAL: Create a row that contains source relation fields with values extracted from the source object. |
Expression |
buildSelectionCriteriaAndAddFieldsToQueryInternal(ForeignReferenceMapping mapping,
Expression criteria,
boolean shouldAddTargetFields,
boolean shouldAddFieldsToQuery)
INTERNAL: Build the selection criteria to join the source, relation, and target tables. |
java.lang.Object |
clone()
INTERNAL: The mapping clones itself to create deep copy. |
protected java.util.Vector |
cloneFields(java.util.Vector fields)
INTERNAL: Helper method to clone vector of fields (used in aggregate initialization cloning). |
protected void |
collectQueryParameters(java.util.Set<org.eclipse.persistence.internal.helper.DatabaseField> cacheFields)
INTERNAL: This method is used to store the FK fields that can be cached that correspond to noncacheable mappings the FK field values will be used to re-issue the query when cloning the shared cache entity |
protected java.lang.Object |
extractBatchKeyFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Extract the foreign key value from the source row. |
protected java.lang.Object |
extractKeyFromTargetRow(org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Extract the source primary key value from the relation row. |
protected DataModifyQuery |
getDeleteQuery()
|
protected DataModifyQuery |
getInsertQuery()
|
org.eclipse.persistence.internal.helper.DatabaseField |
getRelationFieldForTargetField(org.eclipse.persistence.internal.helper.DatabaseField targetField)
INTERNAL: Return the relation field for the target field. |
org.eclipse.persistence.internal.helper.DatabaseTable |
getRelationTable()
INTERNAL: Return the relation table associated with the mapping. |
java.lang.String |
getRelationTableName()
PUBLIC: Return the relation table name associated with the mapping. |
java.lang.String |
getRelationTableQualifiedName()
PUBLIC: Return the relation table qualified name associated with the mapping. |
java.util.Vector |
getSourceKeyFieldNames()
PUBLIC: Return the source key field names associated with the mapping. |
java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> |
getSourceKeyFields()
INTERNAL: Return all the source key fields associated with the mapping. |
java.util.Vector |
getSourceRelationKeyFieldNames()
PUBLIC: Return the source relation key field names associated with the mapping. |
java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> |
getSourceRelationKeyFields()
INTERNAL: Return all the source relation key fields associated with the mapping. |
java.util.Vector |
getTargetKeyFieldNames()
PUBLIC: Return the target key field names associated with the mapping. |
java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> |
getTargetKeyFields()
INTERNAL: Return all the target keys associated with the mapping. |
java.util.Vector |
getTargetRelationKeyFieldNames()
PUBLIC: Return the target relation key field names associated with the mapping. |
java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> |
getTargetRelationKeyFields()
INTERNAL: Return all the target relation key fields associated with the mapping. |
protected boolean |
hasCustomDeleteQuery()
|
protected boolean |
hasCustomInsertQuery()
|
boolean |
hasRelationTable()
INTERNAL: Indicates whether the mechanism has relation table. |
void |
initialize(org.eclipse.persistence.internal.sessions.AbstractSession session,
ForeignReferenceMapping mapping)
INTERNAL: Initialize |
protected void |
initializeDeleteQuery(org.eclipse.persistence.internal.sessions.AbstractSession session,
ForeignReferenceMapping mapping)
INTERNAL: Initialize delete query. |
protected void |
initializeExtendPessipisticLockScope(org.eclipse.persistence.internal.sessions.AbstractSession session,
ForeignReferenceMapping mapping)
INTERNAL: Initialize extendPessimisticLockeScope and lockRelationTableQuery (if required). |
protected void |
initializeInsertQuery(org.eclipse.persistence.internal.sessions.AbstractSession session,
ForeignReferenceMapping mapping)
INTERNAL: Initialize insert query. |
protected void |
initializeLockRelationTableQuery(org.eclipse.persistence.internal.sessions.AbstractSession session,
ForeignReferenceMapping mapping,
Expression startCriteria)
INTERNAL: Initialize lockRelationTableQuery. |
protected void |
initializeRelationTable(org.eclipse.persistence.internal.sessions.AbstractSession session,
ForeignReferenceMapping mapping)
INTERNAL: Set the table qualifier on the relation table if required |
protected void |
initializeSourceKeys(ForeignReferenceMapping mapping)
INTERNAL: All the source key field names are converted to DatabaseField and stored. |
protected void |
initializeSourceKeysWithDefaults(DatabaseMapping mapping)
INTERNAL: If a user does not specify the source key then the primary keys of the source table are used. |
protected void |
initializeSourceRelationKeys(ForeignReferenceMapping mapping)
INTERNAL: All the source relation key field names are converted to DatabaseField and stored. |
protected void |
initializeTargetKeys(org.eclipse.persistence.internal.sessions.AbstractSession session,
ForeignReferenceMapping mapping)
INTERNAL: All the target key field names are converted to DatabaseField and stored. |
protected void |
initializeTargetKeysWithDefaults(org.eclipse.persistence.internal.sessions.AbstractSession session,
ForeignReferenceMapping mapping)
INTERNAL: If a user does not specify the target key then the primary keys of the target table are used. |
protected void |
initializeTargetRelationKeys(ForeignReferenceMapping mapping)
INTERNAL: All the target relation key field names are converted to DatabaseField and stored. |
protected boolean |
isSingleSourceRelationKeySpecified()
INTERNAL: Checks if a single source key was specified. |
protected boolean |
isSingleTargetRelationKeySpecified()
INTERNAL: Checks if a single target key was specified. |
Expression |
joinRelationTableField(Expression expression,
Expression baseExpression)
INTERNAL: Adds to the passed expression a single relation table field joined to source field. |
void |
postPrepareNestedBatchQuery(ReadQuery batchQuery,
ObjectLevelReadQuery query)
INTERNAL: Add the addition join fields to the batch query. |
void |
setCustomDeleteQuery(DataModifyQuery query)
PUBLIC: The default delete query for mapping can be overridden by specifying the new query. |
void |
setCustomInsertQuery(DataModifyQuery query)
PUBLIC: The default insert query for mapping can be overridden by specifying the new query. |
void |
setDeleteCall(Call call)
PUBLIC: Set the receiver's delete Call. |
protected void |
setDeleteQuery(DataModifyQuery deleteQuery)
|
void |
setDeleteSQLString(java.lang.String sqlString)
PUBLIC: Set the receiver's delete SQL string. |
protected void |
setHasCustomDeleteQuery(boolean hasCustomDeleteQuery)
|
protected void |
setHasCustomInsertQuery(boolean bool)
|
void |
setInsertCall(Call call)
PUBLIC: Set the receiver's insert Call. |
protected void |
setInsertQuery(DataModifyQuery insertQuery)
|
void |
setInsertSQLString(java.lang.String sqlString)
PUBLIC: Set the receiver's insert SQL string. |
void |
setRelationTable(org.eclipse.persistence.internal.helper.DatabaseTable relationTable)
PUBLIC: Set the relational table. |
void |
setRelationTableLockingClause(ObjectLevelReadQuery targetQuery,
ObjectBuildingQuery sourceQuery)
INTERNAL: Return relation table locking clause. |
void |
setRelationTableName(java.lang.String tableName)
PUBLIC: Set the name of the relational table. |
void |
setSessionName(java.lang.String name)
PUBLIC: Set the name of the session to execute the mapping's queries under. |
void |
setSourceKeyFieldNames(java.util.Vector fieldNames)
PUBLIC: Set the source key field names associated with the mapping. |
void |
setSourceKeyFields(java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> sourceKeyFields)
INTERNAL: Set the source fields. |
void |
setSourceRelationKeyFieldName(java.lang.String sourceRelationKeyFieldName)
PUBLIC: Set the source key field in the relation table. |
void |
setSourceRelationKeyFieldNames(java.util.Vector fieldNames)
PUBLIC: Set the source relation key field names associated with the mapping. |
void |
setSourceRelationKeyFields(java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> sourceRelationKeyFields)
INTERNAL: Set the source fields. |
void |
setTargetKeyFieldNames(java.util.Vector fieldNames)
INTERNAL: Set the target key field names associated with the mapping. |
void |
setTargetKeyFields(java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> targetKeyFields)
INTERNAL: Set the target fields. |
void |
setTargetRelationKeyFieldName(java.lang.String targetRelationKeyFieldName)
PUBLIC: Set the target key field in the relation table. |
void |
setTargetRelationKeyFieldNames(java.util.Vector fieldNames)
INTERNAL: Set the target relation key field names associated with the mapping. |
void |
setTargetRelationKeyFields(java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> targetRelationKeyFields)
INTERNAL: Set the target fields. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected org.eclipse.persistence.internal.helper.DatabaseTable relationTable
protected java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> sourceKeyFields
protected java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> targetKeyFields
protected java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> sourceRelationKeyFields
protected java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> targetRelationKeyFields
protected DataModifyQuery deleteQuery
protected boolean hasCustomDeleteQuery
protected DataModifyQuery insertQuery
protected boolean hasCustomInsertQuery
protected ReadQuery lockRelationTableQuery
Constructor Detail |
---|
public RelationTableMechanism()
Method Detail |
---|
public void addSourceRelationKeyField(org.eclipse.persistence.internal.helper.DatabaseField sourceRelationKeyField, org.eclipse.persistence.internal.helper.DatabaseField sourcePrimaryKeyField)
public void addSourceRelationKeyFieldName(java.lang.String sourceRelationKeyFieldName, java.lang.String sourcePrimaryKeyFieldName)
public void addTargetRelationKeyField(org.eclipse.persistence.internal.helper.DatabaseField targetRelationKeyField, org.eclipse.persistence.internal.helper.DatabaseField targetPrimaryKeyField)
public void addTargetRelationKeyFieldName(java.lang.String targetRelationKeyFieldName, java.lang.String targetPrimaryKeyFieldName)
public Expression buildSelectionCriteriaAndAddFieldsToQueryInternal(ForeignReferenceMapping mapping, Expression criteria, boolean shouldAddTargetFields, boolean shouldAddFieldsToQuery)
protected void collectQueryParameters(java.util.Set<org.eclipse.persistence.internal.helper.DatabaseField> cacheFields)
public java.lang.Object clone()
clone
in class java.lang.Object
protected java.util.Vector cloneFields(java.util.Vector fields)
protected DataModifyQuery getDeleteQuery()
public void setRelationTableLockingClause(ObjectLevelReadQuery targetQuery, ObjectBuildingQuery sourceQuery)
protected DataModifyQuery getInsertQuery()
public org.eclipse.persistence.internal.helper.DatabaseTable getRelationTable()
public java.lang.String getRelationTableName()
public java.lang.String getRelationTableQualifiedName()
public java.util.Vector getSourceKeyFieldNames()
protected Expression buildBatchCriteria(ExpressionBuilder builder, ObjectLevelReadQuery query)
public void postPrepareNestedBatchQuery(ReadQuery batchQuery, ObjectLevelReadQuery query)
protected java.lang.Object extractBatchKeyFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)
protected java.lang.Object extractKeyFromTargetRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)
public java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> getSourceKeyFields()
public java.util.Vector getSourceRelationKeyFieldNames()
public java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> getSourceRelationKeyFields()
public java.util.Vector getTargetKeyFieldNames()
public org.eclipse.persistence.internal.helper.DatabaseField getRelationFieldForTargetField(org.eclipse.persistence.internal.helper.DatabaseField targetField)
public java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> getTargetKeyFields()
public java.util.Vector getTargetRelationKeyFieldNames()
public java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> getTargetRelationKeyFields()
protected boolean hasCustomDeleteQuery()
protected boolean hasCustomInsertQuery()
public boolean hasRelationTable()
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session, ForeignReferenceMapping mapping) throws DescriptorException
DescriptorException
protected void initializeDeleteQuery(org.eclipse.persistence.internal.sessions.AbstractSession session, ForeignReferenceMapping mapping)
protected void initializeExtendPessipisticLockScope(org.eclipse.persistence.internal.sessions.AbstractSession session, ForeignReferenceMapping mapping)
protected void initializeInsertQuery(org.eclipse.persistence.internal.sessions.AbstractSession session, ForeignReferenceMapping mapping)
protected void initializeLockRelationTableQuery(org.eclipse.persistence.internal.sessions.AbstractSession session, ForeignReferenceMapping mapping, Expression startCriteria)
protected void initializeRelationTable(org.eclipse.persistence.internal.sessions.AbstractSession session, ForeignReferenceMapping mapping) throws DescriptorException
DescriptorException
protected void initializeSourceKeys(ForeignReferenceMapping mapping)
protected void initializeSourceKeysWithDefaults(DatabaseMapping mapping)
protected void initializeSourceRelationKeys(ForeignReferenceMapping mapping) throws DescriptorException
DescriptorException
protected void initializeTargetKeys(org.eclipse.persistence.internal.sessions.AbstractSession session, ForeignReferenceMapping mapping)
protected void initializeTargetKeysWithDefaults(org.eclipse.persistence.internal.sessions.AbstractSession session, ForeignReferenceMapping mapping)
protected void initializeTargetRelationKeys(ForeignReferenceMapping mapping)
protected boolean isSingleSourceRelationKeySpecified()
protected boolean isSingleTargetRelationKeySpecified()
public Expression joinRelationTableField(Expression expression, Expression baseExpression)
public void setCustomDeleteQuery(DataModifyQuery query)
public void setCustomInsertQuery(DataModifyQuery query)
protected void setDeleteQuery(DataModifyQuery deleteQuery)
public void setDeleteSQLString(java.lang.String sqlString)
public void setDeleteCall(Call call)
protected void setHasCustomDeleteQuery(boolean hasCustomDeleteQuery)
protected void setHasCustomInsertQuery(boolean bool)
protected void setInsertQuery(DataModifyQuery insertQuery)
public void setInsertSQLString(java.lang.String sqlString)
public void setInsertCall(Call call)
public void setRelationTable(org.eclipse.persistence.internal.helper.DatabaseTable relationTable)
public void setRelationTableName(java.lang.String tableName)
public void setSessionName(java.lang.String name)
public void setSourceKeyFieldNames(java.util.Vector fieldNames)
public void setSourceKeyFields(java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> sourceKeyFields)
public void setSourceRelationKeyFieldName(java.lang.String sourceRelationKeyFieldName)
public void setSourceRelationKeyFieldNames(java.util.Vector fieldNames)
public void setSourceRelationKeyFields(java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> sourceRelationKeyFields)
public void setTargetKeyFieldNames(java.util.Vector fieldNames)
public void setTargetKeyFields(java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> targetKeyFields)
public void setTargetRelationKeyFieldName(java.lang.String targetRelationKeyFieldName)
public void setTargetRelationKeyFieldNames(java.util.Vector fieldNames)
public void setTargetRelationKeyFields(java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> targetRelationKeyFields)
public org.eclipse.persistence.internal.sessions.AbstractRecord buildRelationTableSourceRow(java.lang.Object sourceObject, org.eclipse.persistence.internal.sessions.AbstractSession session, ForeignReferenceMapping mapping)
public org.eclipse.persistence.internal.sessions.AbstractRecord addRelationTableSourceRow(java.lang.Object sourceObject, org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, ForeignReferenceMapping mapping)
public org.eclipse.persistence.internal.sessions.AbstractRecord buildRelationTableSourceRow(org.eclipse.persistence.internal.sessions.AbstractRecord sourceRow)
public org.eclipse.persistence.internal.sessions.AbstractRecord addRelationTableSourceRow(org.eclipse.persistence.internal.sessions.AbstractRecord sourceRow, org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow)
public org.eclipse.persistence.internal.sessions.AbstractRecord addRelationTableTargetRow(java.lang.Object targetObject, org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, ForeignReferenceMapping mapping)
public org.eclipse.persistence.internal.sessions.AbstractRecord buildRelationTableSourceAndTargetRow(java.lang.Object sourceObject, java.lang.Object targetObject, org.eclipse.persistence.internal.sessions.AbstractSession session, ForeignReferenceMapping mapping)
public org.eclipse.persistence.internal.sessions.AbstractRecord buildRelationTableSourceAndTargetRow(org.eclipse.persistence.internal.sessions.AbstractRecord sourceRow, java.lang.Object targetObject, org.eclipse.persistence.internal.sessions.AbstractSession session, ForeignReferenceMapping mapping)
|
EclipseLink 2.3.2, build 'v20111125-r10461' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |