/** * Pre-build the SQL statement from the expression. */ public void prepareCursorSelectAllRows() { if (getQuery().isReportQuery()) { SQLSelectStatement statement = buildReportQuerySelectStatement(false); setSQLStatement(statement); // For bug 2718118 inheritance with cursors is supported provided there is a read all subclasses view. } else if (getDescriptor().hasInheritance() && getDescriptor().getInheritancePolicy().requiresMultipleTableSubclassRead() && getDescriptor().getInheritancePolicy().hasView()) { InheritancePolicy inheritancePolicy = getDescriptor().getInheritancePolicy(); SQLSelectStatement statement = inheritancePolicy.buildViewSelectStatement((ObjectLevelReadQuery)getQuery()); setSQLStatement(statement); } else { setSQLStatement(buildNormalSelectStatement()); } super.prepareCursorSelectAllRows(); }
/** * Pre-build the SQL statement from the expression. */ public void prepareSelectOneRow() { if (getDescriptor().hasInheritance() && getDescriptor().getInheritancePolicy().requiresMultipleTableSubclassRead()) { if (getDescriptor().getInheritancePolicy().hasView()) { // CR#3158703 if the descriptor has a view, then it requires a single select, // so can be prepared. setSQLStatement(getDescriptor().getInheritancePolicy().buildViewSelectStatement((ObjectLevelReadQuery)getQuery())); super.prepareSelectOneRow(); } else if (!getDescriptor().getInheritancePolicy().hasClassExtractor()) { // CR#3158703 otherwise if using a type indicator at least the type select can be prepared. setSQLStatement(getDescriptor().getInheritancePolicy().buildClassIndicatorSelectStatement((ObjectLevelReadQuery)getQuery())); super.prepareSelectOneRow(); } // else - otherwise cannot prepare the select. } else { setSQLStatement(buildNormalSelectStatement()); super.prepareSelectOneRow(); } }
/** * Pre-build the SQL statement from the expression. */ public void prepareSelectAllRows() { if (getDescriptor().hasInheritance() && getDescriptor().getInheritancePolicy().requiresMultipleTableSubclassRead()) { if (getDescriptor().getInheritancePolicy().hasView()) { // CR#3158703 if the descriptor has a view, then it requires a single select, // so can be prepared. setSQLStatement(getDescriptor().getInheritancePolicy().buildViewSelectStatement((ObjectLevelReadQuery)getQuery())); super.prepareSelectAllRows(); } else if (!getDescriptor().getInheritancePolicy().hasClassExtractor()) { // CR#3158703 otherwise if using a type indicator at least the type select can be prepared. setSQLStatement(getDescriptor().getInheritancePolicy().buildClassIndicatorSelectStatement((ObjectLevelReadQuery)getQuery())); super.prepareSelectAllRows(); } // else - otherwise cannot prepare the select. } else { setSQLStatement(buildNormalSelectStatement()); super.prepareSelectAllRows(); } }