/** * INTERNAL: * Used by DirectMapMapping to rebuild select query. */ protected void initOrRebuildSelectQuery() { this.selectionQuery.setSQLStatement(new SQLSelectStatement()); }
/** * INTERNAL: * Used by DirectMapMapping to rebuild select query. */ protected void initOrRebuildSelectQuery() { this.selectionQuery.setSQLStatement(new SQLSelectStatement()); }
/** * INTERNAL: * Used by DirectMapMapping to rebuild select query. */ protected void initOrRebuildSelectQuery() { this.selectionQuery.setSQLStatement(new SQLSelectStatement()); }
/** * INTERNAL: * Certain key mappings favor different types of selection query. Return the appropriate * type of selectionQuery * @return */ public ReadQuery buildSelectionQueryForDirectCollectionKeyMapping(ContainerPolicy containerPolicy){ DataReadQuery query = new DataReadQuery(); query.setSQLStatement(new SQLSelectStatement()); query.setContainerPolicy(containerPolicy); return query; }
/** * INTERNAL: * Certain key mappings favor different types of selection query. Return the appropriate * type of selectionQuery * @return */ public ReadQuery buildSelectionQueryForDirectCollectionKeyMapping(ContainerPolicy containerPolicy){ DataReadQuery query = new DataReadQuery(); query.setSQLStatement(new SQLSelectStatement()); query.setContainerPolicy(containerPolicy); return query; }
/** * INTERNAL: * Certain key mappings favor different types of selection query. Return the appropriate * type of selectionQuery. */ public ReadQuery buildSelectionQueryForDirectCollectionKeyMapping(ContainerPolicy containerPolicy){ DataReadQuery query = new DataReadQuery(); query.setSQLStatement(new SQLSelectStatement()); query.setContainerPolicy(containerPolicy); return query; }
/** * INTERNAL: * Certain key mappings favor different types of selection query. Return the appropriate * type of selectionQuery. */ public ReadQuery buildSelectionQueryForDirectCollectionKeyMapping(ContainerPolicy containerPolicy){ DataReadQuery query = new DataReadQuery(); query.setSQLStatement(new SQLSelectStatement()); query.setContainerPolicy(containerPolicy); return query; }
/** * INTERNAL: * This * Certain key mappings favor different types of selection query. Return the appropriate * type of selectionQuery * @return */ public ReadQuery buildSelectionQueryForDirectCollectionMapping(){ DirectReadQuery query = new DirectReadQuery(); query.setSQLStatement(new SQLSelectStatement()); query.setContainerPolicy(this); return query; }
/** * INTERNAL: * Certain key mappings favor different types of selection query. Return the appropriate * type of selectionQuery * @return */ public ReadQuery buildSelectionQueryForDirectCollectionKeyMapping(ContainerPolicy containerPolicy){ DataReadQuery query = new DataReadQuery(); query.setSQLStatement(new SQLSelectStatement()); query.setContainerPolicy(containerPolicy); return query; }
/** * INTERNAL: * Certain key mappings favor different types of selection query. Return the appropriate * type of selectionQuery * @return */ public ReadQuery buildSelectionQueryForDirectCollectionKeyMapping(ContainerPolicy containerPolicy){ DataReadQuery query = new DataReadQuery(); query.setSQLStatement(new SQLSelectStatement()); query.setContainerPolicy(containerPolicy); return query; }
/** * INTERNAL: * This * Certain key mappings favor different types of selection query. Return the appropriate * type of selectionQuery * @return */ public ReadQuery buildSelectionQueryForDirectCollectionMapping(){ DirectReadQuery query = new DirectReadQuery(); query.setSQLStatement(new SQLSelectStatement()); query.setContainerPolicy(this); return query; }
/** * INTERNAL: * This * Certain key mappings favor different types of selection query. Return the appropriate * type of selectionQuery * @return */ public ReadQuery buildSelectionQueryForDirectCollectionMapping(){ DirectReadQuery query = new DirectReadQuery(); query.setSQLStatement(new SQLSelectStatement()); query.setContainerPolicy(this); return query; }
/** * INTERNAL: * 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(this.sourceRelationKeyFields.get(0).clone()); statement.setWhereClause(criteria); statement.normalize(session, null); lockRelationTableQuery.setSQLStatement(statement); lockRelationTableQuery.setSessionName(session.getName()); }
/** * INTERNAL: * 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()); }
/** * INTERNAL: * Returns a query that */ ReadQuery getLockRelationTableQueryClone(AbstractSession session, short lockMode) { DirectReadQuery lockRelationTableQueryClone = (DirectReadQuery)lockRelationTableQuery.clone(); SQLSelectStatement statement = new SQLSelectStatement(); statement.addTable(this.relationTable); statement.addField(this.sourceRelationKeyFields.get(0).clone()); statement.setWhereClause((Expression)lockRelationTableQuery.getSelectionCriteria().clone()); statement.setLockingClause(new ForUpdateClause(lockMode)); statement.normalize(session, null); lockRelationTableQueryClone.setSQLStatement(statement); lockRelationTableQueryClone.setIsExecutionClone(true); return lockRelationTableQueryClone; }
protected void initializeSelectionStatement(AbstractSession session) { SQLSelectStatement statement = new SQLSelectStatement(); statement.addTable(getReferenceTable()); statement.addField((DatabaseField)getDirectField().clone()); statement.setWhereClause(getSelectionCriteria()); if(listOrderField != null) { Expression expField = getListOrderFieldExpression(statement.getBuilder()); statement.addField(expField); } statement.normalize(session, null); getSelectionQuery().setSQLStatement(statement); }
protected void initializeSelectionStatement(AbstractSession session) { SQLSelectStatement statement = new SQLSelectStatement(); statement.addTable(getReferenceTable()); statement.addField(getDirectField().clone()); statement.setWhereClause(getSelectionCriteria()); statement.setOrderByExpressions(orderByExpressions); getSelectionQuery().setSQLStatement(statement); getContainerPolicy().addAdditionalFieldsToQuery(selectionQuery, getAdditionalFieldsBaseExpression(getSelectionQuery())); statement.normalize(session, null); }
protected void initializeSelectionStatement(AbstractSession session) { SQLSelectStatement statement = new SQLSelectStatement(); statement.addTable(getReferenceTable()); statement.addField(getDirectField().clone()); statement.setWhereClause(getSelectionCriteria()); statement.setOrderByExpressions(orderByExpressions); getSelectionQuery().setSQLStatement(statement); getContainerPolicy().addAdditionalFieldsToQuery(selectionQuery, getAdditionalFieldsBaseExpression(getSelectionQuery())); statement.normalize(session, null); }
/** * Return the appropriate select statement to perform a does exist check * @param field fields for does exist check. */ protected SQLSelectStatement buildSelectStatementForDoesExist(DatabaseField field) { // Build appropriate select statement SQLSelectStatement selectStatement; selectStatement = new SQLSelectStatement(); selectStatement.addField(field); selectStatement.setWhereClause(((Expression)getDescriptor().getObjectBuilder().getPrimaryKeyExpression().clone()).and(getDescriptor().getQueryManager().getAdditionalJoinExpression())); selectStatement.setTranslationRow(getTranslationRow()); selectStatement.normalize(getSession(), getQuery().getDescriptor()); selectStatement.setHintString(getQuery().getHintString()); return selectStatement; }
/** * Return the appropriate select statement to perform a does exist check * @param field fields for does exist check. */ protected SQLSelectStatement buildSelectStatementForDoesExist(DatabaseField field) { // Build appropriate select statement SQLSelectStatement selectStatement; selectStatement = new SQLSelectStatement(); selectStatement.addField(field); selectStatement.setWhereClause(((Expression)getDescriptor().getObjectBuilder().getPrimaryKeyExpression().clone()).and(getDescriptor().getQueryManager().getAdditionalJoinExpression())); selectStatement.setTranslationRow(getTranslationRow()); selectStatement.normalize(getSession(), getQuery().getDescriptor()); selectStatement.setHintString(getQuery().getHintString()); return selectStatement; }