if (getDescriptor() == null) { return null; Vector tables = getDescriptor().getTables(); for( int i=1; i < tablesSize; i++) { DatabaseTable table = (DatabaseTable)tables.elementAt(i); Expression joinExpression = (Expression)getDescriptor().getQueryManager().getTablesJoinExpressions().get(table); joinExpression = getBaseExpression().twist(joinExpression, this); tablesJoinExpressions.put(table, joinExpression); List childrenTables = getDescriptor().getInheritancePolicy().getChildrenTables(); tablesSize = childrenTables.size(); for( int i=0; i < tablesSize; i++) { DatabaseTable table = (DatabaseTable)childrenTables.get(i); Expression joinExpression = (Expression)getDescriptor().getInheritancePolicy().getChildrenTablesJoinExpressions().get(table); joinExpression = getBaseExpression().twist(joinExpression, this); tablesJoinExpressions.put(table, joinExpression);
if (getDescriptor() == null) { return null; Vector tables = getDescriptor().getTables(); for (int i=1; i < tablesSize; i++) { DatabaseTable table = (DatabaseTable)tables.elementAt(i); Expression joinExpression = getDescriptor().getQueryManager().getTablesJoinExpressions().get(table); joinExpression = this.baseExpression.twist(joinExpression, this); if (getDescriptor().getHistoryPolicy() != null) { joinExpression = joinExpression.and(getDescriptor().getHistoryPolicy().additionalHistoryExpression(this, this, i)); List childrenTables = getDescriptor().getInheritancePolicy().getChildrenTables(); tablesSize = childrenTables.size(); for (int i=0; i < tablesSize; i++) { DatabaseTable table = (DatabaseTable)childrenTables.get(i); Expression joinExpression = getDescriptor().getInheritancePolicy().getChildrenTablesJoinExpressions().get(table); joinExpression = this.baseExpression.twist(joinExpression, this); tablesJoinExpressions.put(table, joinExpression);
if (getDescriptor() == null) { return null; Vector tables = getDescriptor().getTables(); for (int i=1; i < tablesSize; i++) { DatabaseTable table = (DatabaseTable)tables.elementAt(i); Expression joinExpression = getDescriptor().getQueryManager().getTablesJoinExpressions().get(table); joinExpression = this.baseExpression.twist(joinExpression, this); if (getDescriptor().getHistoryPolicy() != null) { joinExpression = joinExpression.and(getDescriptor().getHistoryPolicy().additionalHistoryExpression(this, this, i)); List childrenTables = getDescriptor().getInheritancePolicy().getChildrenTables(); tablesSize = childrenTables.size(); for (int i=0; i < tablesSize; i++) { DatabaseTable table = (DatabaseTable)childrenTables.get(i); Expression joinExpression = getDescriptor().getInheritancePolicy().getChildrenTablesJoinExpressions().get(table); joinExpression = this.baseExpression.twist(joinExpression, this); tablesJoinExpressions.put(table, joinExpression);
if (getDescriptor() == null) { return null; Expression criteria = getDescriptor().getQueryManager().getAdditionalJoinExpression(); if (criteria != null) { criteria = getBaseExpression().twist(criteria, this); Expression childrenCriteria = getDescriptor().getInheritancePolicy().getChildrenJoinExpression(); childrenCriteria = getBaseExpression().twist(childrenCriteria, this); childrenCriteria.convertToUseOuterJoin(); if ((getDescriptor() != null) && (getDescriptor().getHistoryPolicy() != null)) { Expression historyCriteria = getDescriptor().getHistoryPolicy().additionalHistoryExpression(this); if (criteria != null) { criteria = criteria.and(historyCriteria);
if (getDescriptor() == null) { return null; Expression criteria = getDescriptor().getQueryManager().getAdditionalJoinExpression(); if (criteria != null) { criteria = this.baseExpression.twist(criteria, this); Expression childrenCriteria = getDescriptor().getInheritancePolicy().getChildrenJoinExpression(); childrenCriteria = this.baseExpression.twist(childrenCriteria, this); childrenCriteria.convertToUseOuterJoin(); if (getDescriptor().getHistoryPolicy() != null) { Expression historyCriteria = getDescriptor().getHistoryPolicy().additionalHistoryExpression(this, this); if (criteria != null) { criteria = criteria.and(historyCriteria);
if (getDescriptor() == null) { return null; Expression criteria = getDescriptor().getQueryManager().getAdditionalJoinExpression(); if (criteria != null) { criteria = this.baseExpression.twist(criteria, this); Expression childrenCriteria = getDescriptor().getInheritancePolicy().getChildrenJoinExpression(); childrenCriteria = this.baseExpression.twist(childrenCriteria, this); childrenCriteria.convertToUseOuterJoin(); if (getDescriptor().getHistoryPolicy() != null) { Expression historyCriteria = getDescriptor().getHistoryPolicy().additionalHistoryExpression(this, this); if (criteria != null) { criteria = criteria.and(historyCriteria);
descriptor = expression.getDescriptor(); this.targetTable = expression.getReferenceTable(); this.targetAlias = expression.aliasForTable(this.targetTable);
descriptor = expression.getDescriptor(); this.targetTable = expression.getReferenceTable(); this.targetAlias = expression.aliasForTable(this.targetTable);
/** * Calculate the reference table for based on the various QueryKeyExpression * usages (join query keys, custom defined query keys, or query keys for * mappings). * * Called from {@link SQLSelectStatement#appendFromClauseForOuterJoin}. * * @return DatabaseTable */ public DatabaseTable getReferenceTable() { if(getMapping() != null) { if (getMapping().isDirectCollectionMapping()) { return ((DirectCollectionMapping)getMapping()).getReferenceTable(); } else { return getMapping().getReferenceDescriptor().getTables().firstElement(); } } else { return ((ForeignReferenceQueryKey)getQueryKeyOrNull()).getReferenceTable(getDescriptor()); } }
/** * Calculate the reference table for based on the various QueryKeyExpression * usages (join query keys, custom defined query keys, or query keys for * mappings). * * Called from {@link SQLSelectStatement#appendFromClauseForOuterJoin}. * * @return DatabaseTable */ public DatabaseTable getReferenceTable() { if(getMapping() != null) { if (getMapping().isDirectCollectionMapping()) { return ((DirectCollectionMapping)getMapping()).getReferenceTable(); } else { return getMapping().getReferenceDescriptor().getTables().firstElement(); } } else { return ((ForeignReferenceQueryKey)getQueryKeyOrNull()).getReferenceTable(getDescriptor()); } }
/** * Calculate the reference table for based on the various QueryKeyExpression * usages (join query keys, custom defined query keys, or query keys for * mappings). * * Called from {@link SQLSelectStatement#appendFromClauseForOuterJoin}. * * @return DatabaseTable */ public DatabaseTable getReferenceTable() { if(getMapping() != null) { if (getMapping().isDirectCollectionMapping()) { return ((DirectCollectionMapping)getMapping()).getReferenceTable(); } else { return getMapping().getReferenceDescriptor().getTables().firstElement(); } } else { return ((ForeignReferenceQueryKey)getQueryKeyOrNull()).getReferenceTable(getDescriptor()); } }
/** * Calculate the relation table for based on the various QueryKeyExpression * usages (join query keys, custom defined query keys, or query keys for * mappings). * * Called from {@link SQLSelectStatement#appendFromClauseForOuterJoin}. * * @return DatabaseTable */ @Override public DatabaseTable getRelationTable() { if(getMapping() != null) { if(getMapping().isManyToManyMapping()) { return ((ManyToManyMapping)getMapping()).getRelationTable(); } else if(getMapping().isOneToOneMapping()) { return ((OneToOneMapping)getMapping()).getRelationTable(); } } else { if(getQueryKeyOrNull().isForeignReferenceQueryKey()) { return ((ForeignReferenceQueryKey)getQueryKeyOrNull()).getRelationTable(getDescriptor()); } } return null; } }
/** * Calculate the relation table for based on the various QueryKeyExpression * usages (join query keys, custom defined query keys, or query keys for * mappings). * * Called from {@link SQLSelectStatement#appendFromClauseForOuterJoin}. * * @return DatabaseTable */ public DatabaseTable getRelationTable() { if(getMapping() != null) { if(getMapping().isManyToManyMapping()) { return ((ManyToManyMapping)getMapping()).getRelationTable(); } else if(getMapping().isOneToOneMapping()) { return ((OneToOneMapping)getMapping()).getRelationTable(); } } else { if(getQueryKeyOrNull().isForeignReferenceQueryKey()) { return ((ForeignReferenceQueryKey)getQueryKeyOrNull()).getRelationTable(getDescriptor()); } } return null; } }
/** * Calculate the relation table for based on the various QueryKeyExpression * usages (join query keys, custom defined query keys, or query keys for * mappings). * * Called from {@link SQLSelectStatement#appendFromClauseForOuterJoin}. * * @return DatabaseTable */ public DatabaseTable getRelationTable() { if(getMapping() != null) { if(getMapping().isManyToManyMapping()) { return ((ManyToManyMapping)getMapping()).getRelationTable(); } else if(getMapping().isOneToOneMapping()) { return ((OneToOneMapping)getMapping()).getRelationTable(); } } else { if(getQueryKeyOrNull().isForeignReferenceQueryKey()) { return ((ForeignReferenceQueryKey)getQueryKeyOrNull()).getRelationTable(getDescriptor()); } } return null; } }
descriptor = ((QueryKeyExpression) baseExp).getDescriptor(); } else { descriptor = query.getDescriptor();
|| (!getSession().getPlatform().shouldPrintInnerJoinInWhereClause())) { setOuterJoinExpIndex(statement.addOuterJoinExpressionsHolders(this, mappingExpression, additionalExpressionCriteriaMap(), null)); if ((getDescriptor() != null) && (getDescriptor().getHistoryPolicy() != null)) { Expression historyOnClause = getDescriptor().getHistoryPolicy().additionalHistoryExpression(this, this, 0); if (getOnClause() != null) { setOnClause(getOnClause().and(historyOnClause));
|| (!getSession().getPlatform().shouldPrintInnerJoinInWhereClause())) { setOuterJoinExpIndex(statement.addOuterJoinExpressionsHolders(this, mappingExpression, additionalExpressionCriteriaMap(), null)); if ((getDescriptor() != null) && (getDescriptor().getHistoryPolicy() != null)) { Expression historyOnClause = getDescriptor().getHistoryPolicy().additionalHistoryExpression(this, this, 0); if (getOnClause() != null) { setOnClause(getOnClause().and(historyOnClause));
Expression rightChild = ((RelationExpression)criteria).getSecondChild(); if (rightChild instanceof QueryKeyExpression) { subQuery.setReferenceClass(((QueryKeyExpression)rightChild).getDescriptor().getJavaClass());
Expression rightChild = ((RelationExpression)criteria).getSecondChild(); if (rightChild instanceof QueryKeyExpression) { ClassDescriptor descriptor = ((QueryKeyExpression)rightChild).getDescriptor();
Expression rightChild = ((RelationExpression)criteria).getSecondChild(); if (rightChild instanceof QueryKeyExpression) { ClassDescriptor descriptor = ((QueryKeyExpression)rightChild).getDescriptor();