* Return relation table locking clause.
*/
public void setRelationTableLockingClause(ObjectLevelReadQuery targetQuery, ObjectBuildingQuery sourceQuery) {
ForUpdateOfClause lockingClause = new ForUpdateOfClause();
lockingClause.setLockMode(sourceQuery.getLockMode());
FieldExpression exp = (FieldExpression)targetQuery.getExpressionBuilder().getTable(this.relationTable).getField(this.sourceRelationKeyFields.get(0));
lockingClause.addLockedExpression(exp);
targetQuery.setLockingClause(lockingClause);
// locking clause is not compatible with DISTINCT
targetQuery.setShouldOuterJoinSubclasses(true);
}