* Initialize lockRelationTableQuery.
*/
protected void initializeLockRelationTableQuery(AbstractSession session, ForeignReferenceMapping mapping, Expression startCriteria) {
lockRelationTableQuery = new DirectReadQuery();
Expression criteria = buildSelectionCriteriaAndAddFieldsToQueryInternal(mapping, startCriteria, false, false);
SQLSelectStatement statement = new SQLSelectStatement();
statement.addTable(this.relationTable);
statement.addField((DatabaseField)this.sourceRelationKeyFields.get(0).clone());
statement.setWhereClause(criteria);
statement.normalize(session, null);
lockRelationTableQuery.setSQLStatement(statement);
lockRelationTableQuery.setSessionName(session.getName());
}