/** * INTERNAL: * Return if the expression is for a direct mapped attribute. */ @Override public boolean isAttribute() { if (isAttributeExpression == null) { if (getSession() == null) { // We can't tell, so say no. return false; } QueryKey queryKey = getQueryKeyOrNull(); if (queryKey != null) { isAttributeExpression = Boolean.valueOf(queryKey.isDirectQueryKey()); } else { DatabaseMapping mapping = getMapping(); if (mapping != null) { if (mapping.isVariableOneToOneMapping()) { throw QueryException.cannotQueryAcrossAVariableOneToOneMapping(mapping, mapping.getDescriptor()); } else { isAttributeExpression = Boolean.valueOf(mapping.isDirectToFieldMapping()); } } else { isAttributeExpression = Boolean.FALSE; } } } return isAttributeExpression.booleanValue(); }
/** * INTERNAL: * Return if the expression is for a direct mapped attribute. */ @Override public boolean isAttribute() { if (isAttributeExpression == null) { if (getSession() == null) { // We can't tell, so say no. return false; } QueryKey queryKey = getQueryKeyOrNull(); if (queryKey != null) { isAttributeExpression = Boolean.valueOf(queryKey.isDirectQueryKey()); } else { DatabaseMapping mapping = getMapping(); if (mapping != null) { if (mapping.isVariableOneToOneMapping()) { throw QueryException.cannotQueryAcrossAVariableOneToOneMapping(mapping, mapping.getDescriptor()); } else { isAttributeExpression = Boolean.valueOf(mapping.isDirectToFieldMapping()); } } else { isAttributeExpression = Boolean.FALSE; } } } return isAttributeExpression.booleanValue(); }
/** * INTERNAL: * Return if the expression is for a direct mapped attribute. */ public boolean isAttribute() { if (isAttributeExpression == null) { if (getSession() == null) { // We can't tell, so say no. return false; } QueryKey queryKey = getQueryKeyOrNull(); if (queryKey != null) { isAttributeExpression = Boolean.valueOf(queryKey.isDirectQueryKey()); } else { DatabaseMapping mapping = getMapping(); if (mapping != null) { if (mapping.isVariableOneToOneMapping()) { throw QueryException.cannotQueryAcrossAVariableOneToOneMapping(mapping, mapping.getDescriptor()); } else { isAttributeExpression = Boolean.valueOf(mapping.isDirectToFieldMapping()); } } else { isAttributeExpression = Boolean.FALSE; } } } return isAttributeExpression.booleanValue(); }
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);
if (criteria != null) { criteria = this.baseExpression.twist(criteria, this); if (shouldUseOuterJoin() && getSession().getPlatform().shouldPrintOuterJoinInWhereClause()) { criteria.convertToUseOuterJoin(); if(getSession().getPlatform().shouldPrintOuterJoinInWhereClause()) { if(isUsingOuterJoinForMultitableInheritance()) { Expression childrenCriteria = getDescriptor().getInheritancePolicy().getChildrenJoinExpression();
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);
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; }
if (criteria != null) { criteria = this.baseExpression.twist(criteria, this); if (shouldUseOuterJoin() && getSession().getPlatform().shouldPrintOuterJoinInWhereClause()) { criteria.convertToUseOuterJoin(); if(getSession().getPlatform().shouldPrintOuterJoinInWhereClause()) { if(isUsingOuterJoinForMultitableInheritance()) { Expression childrenCriteria = getDescriptor().getInheritancePolicy().getChildrenJoinExpression();
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; }
if (criteria != null) { criteria = getBaseExpression().twist(criteria, this); if (shouldUseOuterJoin() && getSession().getPlatform().shouldPrintOuterJoinInWhereClause()) { criteria.convertToUseOuterJoin(); if(getSession().getPlatform().shouldPrintOuterJoinInWhereClause()) { if(isUsingOuterJoinForMultitableInheritance()) { Expression childrenCriteria = getDescriptor().getInheritancePolicy().getChildrenJoinExpression();
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; }
if (shouldUseOuterJoin() && (getSession().getPlatform().isInformixOuterJoin())) { setOuterJoinExpIndex(statement.addOuterJoinExpressionsHolders(this, mappingExpression, null, null)); normalizer.addAdditionalExpression(mappingExpression.and(additionalExpressionCriteria())); return this; } else if ((shouldUseOuterJoin() && (!getSession().getPlatform().shouldPrintOuterJoinInWhereClause())) || (!getSession().getPlatform().shouldPrintInnerJoinInWhereClause())) { setOuterJoinExpIndex(statement.addOuterJoinExpressionsHolders(this, mappingExpression, additionalExpressionCriteriaMap(), null)); if ((getDescriptor() != null) && (getDescriptor().getHistoryPolicy() != null)) { } else if (isUsingOuterJoinForMultitableInheritance() && (!getSession().getPlatform().shouldPrintOuterJoinInWhereClause())) { setOuterJoinExpIndex(statement.addOuterJoinExpressionsHolders(null, null, additionalExpressionCriteriaMap(), mapping.getReferenceDescriptor()));
if (shouldUseOuterJoin() && (getSession().getPlatform().isInformixOuterJoin())) { setOuterJoinExpIndex(statement.addOuterJoinExpressionsHolders(this, mappingExpression, null, null)); normalizer.addAdditionalExpression(mappingExpression.and(additionalExpressionCriteria())); return this; } else if ((shouldUseOuterJoin() && (!getSession().getPlatform().shouldPrintOuterJoinInWhereClause())) || (!getSession().getPlatform().shouldPrintInnerJoinInWhereClause())) { setOuterJoinExpIndex(statement.addOuterJoinExpressionsHolders(this, mappingExpression, additionalExpressionCriteriaMap(), null)); if ((getDescriptor() != null) && (getDescriptor().getHistoryPolicy() != null)) { } else if (isUsingOuterJoinForMultitableInheritance() && (!getSession().getPlatform().shouldPrintOuterJoinInWhereClause())) { setOuterJoinExpIndex(statement.addOuterJoinExpressionsHolders(null, null, additionalExpressionCriteriaMap(), mapping.getReferenceDescriptor()));