/** * INTERNAL: * If there is root expression in the list then indicates whether it shouldUseOuterJoin, * otherwise return false. */ protected boolean hasRootExpressionThatShouldUseOuterJoin(List expressions) { for (Iterator expressionsEnum = expressions.iterator(); expressionsEnum.hasNext();) { Expression next = (Expression)expressionsEnum.next(); // The expressionBuilder can be one of the locked expressions in // the ForUpdateOfClause. if (!next.isQueryKeyExpression()) { continue; } QueryKeyExpression expression = (QueryKeyExpression)next; if (expression.getBaseExpression().isExpressionBuilder() && expression.getName().equals(getAttributeName())) { return expression.shouldUseOuterJoin(); } } return false; }
/** * INTERNAL: * If there is root expression in the list then indicates whether it shouldUseOuterJoin, * otherwise return false. */ protected boolean hasRootExpressionThatShouldUseOuterJoin(List expressions) { for (Iterator expressionsEnum = expressions.iterator(); expressionsEnum.hasNext();) { Expression next = (Expression)expressionsEnum.next(); // The expressionBuilder can be one of the locked expressions in // the ForUpdateOfClause. if (!next.isQueryKeyExpression()) { continue; } QueryKeyExpression expression = (QueryKeyExpression)next; if (expression.getBaseExpression().isExpressionBuilder() && expression.getName().equals(getAttributeName())) { return expression.shouldUseOuterJoin(); } } return false; }
/** * INTERNAL: * If there is root expression in the list then indicates whether it shouldUseOuterJoin, * otherwise return false. */ protected boolean hasRootExpressionThatShouldUseOuterJoin(List expressions) { for (Iterator expressionsEnum = expressions.iterator(); expressionsEnum.hasNext();) { Expression next = (Expression)expressionsEnum.next(); // The expressionBuilder can be one of the locked expressions in // the ForUpdateOfClause. if (!next.isQueryKeyExpression()) { continue; } QueryKeyExpression expression = (QueryKeyExpression)next; if (expression.getBaseExpression().isExpressionBuilder() && expression.getName().equals(getAttributeName())) { return expression.shouldUseOuterJoin(); } } return false; }
if(shouldUseOuterJoin()) { for( int i=1; i < tablesSize; i++) { DatabaseTable table = (DatabaseTable)tables.elementAt(i);
if (shouldUseOuterJoin() || (!getSession().getPlatform().shouldPrintInnerJoinInWhereClause())) { for (int i=1; i < tablesSize; i++) { DatabaseTable table = (DatabaseTable)tables.elementAt(i);
if (shouldUseOuterJoin() || (!getSession().getPlatform().shouldPrintInnerJoinInWhereClause())) { for (int i=1; i < tablesSize; i++) { DatabaseTable table = (DatabaseTable)tables.elementAt(i);
/** * INTERNAL: * Print java for project class generation */ @Override public void printJava(ExpressionJavaPrinter printer) { this.baseExpression.printJava(printer); if (!shouldUseOuterJoin()) { if (!shouldQueryToManyRelationship()) { printer.printString(".get("); } else { printer.printString(".anyOf("); } } else { if (!shouldQueryToManyRelationship()) { printer.printString(".getAllowingNull("); } else { printer.printString(".anyOfAllowingNone("); } } printer.printString("\"" + getName() + "\")"); }
/** * INTERNAL: * Print java for project class generation */ @Override public void printJava(ExpressionJavaPrinter printer) { this.baseExpression.printJava(printer); if (!shouldUseOuterJoin()) { if (!shouldQueryToManyRelationship()) { printer.printString(".get("); } else { printer.printString(".anyOf("); } } else { if (!shouldQueryToManyRelationship()) { printer.printString(".getAllowingNull("); } else { printer.printString(".anyOfAllowingNone("); } } printer.printString("\"" + getName() + "\")"); }
/** * INTERNAL: * Print java for project class generation */ public void printJava(ExpressionJavaPrinter printer) { getBaseExpression().printJava(printer); if (!shouldUseOuterJoin()) { if (!shouldQueryToManyRelationship()) { printer.printString(".get("); } else { printer.printString(".anyOf("); } } else { if (!shouldQueryToManyRelationship()) { printer.printString(".getAllowingNull("); } else { printer.printString(".anyOfAllowingNone("); } } printer.printString("\"" + getName() + "\")"); }
if (shouldUseOuterJoin() && (getSession().getPlatform().isInformixOuterJoin())) { normalizer.getStatement().getOuterJoinExpressions().addElement(this); normalizer.getStatement().getOuterJoinedMappingCriteria().addElement(mappingExpression); normalizer.addAdditionalExpression(mappingExpression.and(additionalExpressionCriteria())); return this; } else if ((shouldUseOuterJoin() || isUsingOuterJoinForMultitableInheritance()) && (!getSession().getPlatform().shouldPrintOuterJoinInWhereClause())) { if(shouldUseOuterJoin()) { normalizer.getStatement().getOuterJoinExpressions().addElement(this); normalizer.getStatement().getOuterJoinedMappingCriteria().addElement(mappingExpression);
public Expression mappingCriteria(Expression base) { Expression selectionCriteria; // First look for a query key, then a mapping if (getQueryKeyOrNull() == null) { if ((getMapping() == null) || (!getMapping().isForeignReferenceMapping())) { return null; } else { // The join criteria is now twisted by the mappings. selectionCriteria = ((ForeignReferenceMapping)getMapping()).getJoinCriteria(this, base); } } else { if (!getQueryKeyOrNull().isForeignReferenceQueryKey()) { return null; } else { selectionCriteria = ((ForeignReferenceQueryKey)getQueryKeyOrNull()).getJoinCriteria(); selectionCriteria = this.baseExpression.twist(selectionCriteria, base); } } if (shouldUseOuterJoin() && getSession().getPlatform().shouldPrintOuterJoinInWhereClause()) { selectionCriteria = selectionCriteria.convertToUseOuterJoin(); } return selectionCriteria; }
public Expression mappingCriteria(Expression base) { Expression selectionCriteria; // First look for a query key, then a mapping if (getQueryKeyOrNull() == null) { if ((getMapping() == null) || (!getMapping().isForeignReferenceMapping())) { return null; } else { // The join criteria is now twisted by the mappings. selectionCriteria = ((ForeignReferenceMapping)getMapping()).getJoinCriteria(this, base); } } else { if (!getQueryKeyOrNull().isForeignReferenceQueryKey()) { return null; } else { selectionCriteria = ((ForeignReferenceQueryKey)getQueryKeyOrNull()).getJoinCriteria(); selectionCriteria = this.baseExpression.twist(selectionCriteria, base); } } if (shouldUseOuterJoin() && getSession().getPlatform().shouldPrintOuterJoinInWhereClause()) { selectionCriteria = selectionCriteria.convertToUseOuterJoin(); } return selectionCriteria; }
public Expression mappingCriteria() { Expression selectionCriteria; // First look for a query key, then a mapping if (getQueryKeyOrNull() == null) { if ((getMapping() == null) || (!getMapping().isForeignReferenceMapping())) { return null; } else { // The join criteria is now twisted by the mappings. selectionCriteria = ((ForeignReferenceMapping)getMapping()).getJoinCriteria(this); } } else { if (!getQueryKeyOrNull().isForeignReferenceQueryKey()) { return null; } else { selectionCriteria = ((ForeignReferenceQueryKey)getQueryKeyOrNull()).getJoinCriteria(); selectionCriteria = getBaseExpression().twist(selectionCriteria, this); } } if (shouldUseOuterJoin() && getSession().getPlatform().shouldPrintOuterJoinInWhereClause()) { selectionCriteria = selectionCriteria.convertToUseOuterJoin(); } return selectionCriteria; }
outerJoin = ((QueryKeyExpression) baseExp).shouldUseOuterJoin(); if (mapping.isAggregateMapping()) { newDescriptor = mapping.getDescriptor();
if ((mappingExpression.getBaseExpression() != null) && mappingExpression.getBaseExpression().isObjectExpression() && (!mappingExpression.shouldUseOuterJoin())) {
if ((mappingExpression.getBaseExpression() != null) && mappingExpression.getBaseExpression().isObjectExpression() && (!mappingExpression.shouldUseOuterJoin())) {
outerJoin = ((QueryKeyExpression)baseExp).shouldUseOuterJoin(); if (mapping.isAggregateMapping()){ newDescriptor = mapping.getDescriptor();
if (criteria != null) { criteria = this.baseExpression.twist(criteria, this); if (shouldUseOuterJoin() && getSession().getPlatform().shouldPrintOuterJoinInWhereClause()) { criteria.convertToUseOuterJoin();
if (criteria != null) { criteria = this.baseExpression.twist(criteria, this); if (shouldUseOuterJoin() && getSession().getPlatform().shouldPrintOuterJoinInWhereClause()) { criteria.convertToUseOuterJoin();
if (criteria != null) { criteria = getBaseExpression().twist(criteria, this); if (shouldUseOuterJoin() && getSession().getPlatform().shouldPrintOuterJoinInWhereClause()) { criteria.convertToUseOuterJoin();