/** * INTERNAL: * return a collection of expressions if PK's are used. */ public Vector getQueryExpressions() { Vector fieldExpressions = NonSynchronizedVector.newInstance(getItems().size()); // For bug 3115576 and an EXISTS subquery only need to return a single field. if (shouldRetrieveFirstPrimaryKey()) { if (!getDescriptor().getPrimaryKeyFields().isEmpty()) { fieldExpressions.addElement(getDescriptor().getPrimaryKeyFields().get(0)); } } if (shouldRetrievePrimaryKeys()) { fieldExpressions.addAll(getDescriptor().getPrimaryKeyFields()); } return fieldExpressions; }
/** * INTERNAL: * return a collection of expressions if PK's are used. */ public Vector getQueryExpressions() { Vector fieldExpressions = NonSynchronizedVector.newInstance(getItems().size()); if (shouldSelectValue1()) { Expression one = new ConstantExpression(new Integer(1), new ExpressionBuilder()); this.addItem("one", one); this.dontUseDistinct(); fieldExpressions.addElement(one); } else // For bug 3115576 and an EXISTS subquery only need to return a single field. if (shouldRetrieveFirstPrimaryKey()) { if (!getDescriptor().getPrimaryKeyFields().isEmpty()) { fieldExpressions.addElement(getDescriptor().getPrimaryKeyFields().get(0)); } } if (shouldRetrievePrimaryKeys()) { fieldExpressions.addAll(getDescriptor().getPrimaryKeyFields()); } return fieldExpressions; }
/** * INTERNAL: * return a collection of expressions if PK's are used. */ public Vector getQueryExpressions() { Vector fieldExpressions = NonSynchronizedVector.newInstance(getItems().size()); if (shouldSelectValue1()) { Expression one = new ConstantExpression(Integer.valueOf(1), new ExpressionBuilder()); this.addItem("one", one); this.dontUseDistinct(); fieldExpressions.addElement(one); } else // For bug 3115576 and an EXISTS subquery only need to return a single field. if (shouldRetrieveFirstPrimaryKey()) { if (!getDescriptor().getPrimaryKeyFields().isEmpty()) { fieldExpressions.addElement(getDescriptor().getPrimaryKeyFields().get(0)); } } if (shouldRetrievePrimaryKeys()) { fieldExpressions.addAll(getDescriptor().getPrimaryKeyFields()); } return fieldExpressions; }
/** * INTERNAL: * Prepare the receiver for execution in a session. * Initialize each item with its DTF mapping */ protected void prepare() throws QueryException { if (prepareFromCachedQuery()) { return; } // Oct 19, 2000 JED // Added exception to be thrown if no attributes have been added to the query if (getItems().size() > 0) { try { for (ReportItem item : getItems()) { item.initialize(this); } } catch (QueryException exception) { exception.setQuery(this); throw exception; } } else { if ((!shouldRetrievePrimaryKeys()) && (!shouldRetrieveFirstPrimaryKey())) { throw QueryException.noAttributesForReportQuery(this); } } super.prepare(); }
/** * INTERNAL: * Prepare the receiver for execution in a session. * Initialize each item with its DTF mapping */ @Override protected void prepare() throws QueryException { if (prepareFromCachedQuery()) { return; } // Oct 19, 2000 JED // Added exception to be thrown if no attributes have been added to the query if (getItems().size() > 0) { try { for (ReportItem item : getItems()) { item.initialize(this); } } catch (QueryException exception) { exception.setQuery(this); throw exception; } } else { if ((!shouldRetrievePrimaryKeys()) && (!shouldRetrieveFirstPrimaryKey()) && !(shouldSelectValue1())) { throw QueryException.noAttributesForReportQuery(this); } } super.prepare(); }
/** * INTERNAL: * Prepare the receiver for execution in a session. * Initialize each item with its DTF mapping */ @Override protected void prepare() throws QueryException { if (prepareFromCachedQuery()) { return; } // Oct 19, 2000 JED // Added exception to be thrown if no attributes have been added to the query if (getItems().size() > 0) { try { for (ReportItem item : getItems()) { item.initialize(this); } } catch (QueryException exception) { exception.setQuery(this); throw exception; } } else { if ((!shouldRetrievePrimaryKeys()) && (!shouldRetrieveFirstPrimaryKey()) && !(shouldSelectValue1())) { throw QueryException.noAttributesForReportQuery(this); } } super.prepare(); }
if (query.shouldRetrievePrimaryKeys()) { setId(query.getDescriptor().getObjectBuilder().extractPrimaryKeyFromRow(row, query.getSession()));
List results = new ArrayList(itemSize); if (query.shouldRetrievePrimaryKeys()) { setPrimaryKeyValues(query.getDescriptor().getObjectBuilder().extractPrimaryKeyFromRow(row, query.getSession()));
List results = new ArrayList(itemSize); if (query.shouldRetrievePrimaryKeys()) { setId(query.getDescriptor().getObjectBuilder().extractPrimaryKeyFromRow(row, query.getSession()));
} else if (reportQuery.shouldRetrievePrimaryKeys()) { method.addLine(queryIdentifier + ".setShouldRetrievePrimaryKeys(true);");
} else if (reportQuery.shouldRetrievePrimaryKeys()) { method.addLine(queryIdentifier + ".setShouldRetrievePrimaryKeys(true);");
} else if (reportQuery.shouldRetrievePrimaryKeys()) { method.addLine(queryIdentifier + ".setShouldRetrievePrimaryKeys(true);");