/** * Convenience method */ protected ClassDescriptor getDescriptor() { return this.query.getDescriptor(); }
/** * Convenience method */ protected ClassDescriptor getDescriptor() { return this.query.getDescriptor(); }
/** * Convenience method */ protected ClassDescriptor getDescriptor() { return this.query.getDescriptor(); }
/** * Prepare and validate. * Set the element class. */ @Override public void prepare(DatabaseQuery query, AbstractSession session) throws QueryException { if ((getElementClass() == null) && (query.getDescriptor() != null)) { setElementClass(query.getDescriptor().getJavaClass()); } super.prepare(query, session); }
/** * INTERNAL: */ protected DatabaseField createField(String fieldName) { if (getQuery().getDescriptor() != null) { return getQuery().getDescriptor().buildField(fieldName); } return new XMLField(fieldName); }
/** * INTERNAL: */ protected DatabaseField createField(String fieldName) { if (getQuery().getDescriptor() != null) { return getQuery().getDescriptor().buildField(fieldName); } return new XMLField(fieldName); }
/** * Prepare and validate. * Set the element class. */ @Override public void prepare(DatabaseQuery query, AbstractSession session) throws QueryException { if ((getElementClass() == null) && (query.getDescriptor() != null)) { setElementClass(query.getDescriptor().getJavaClass()); } super.prepare(query, session); }
/** * INTERNAL: */ protected DatabaseField createField(String fieldName) { if (getQuery().getDescriptor() != null) { return getQuery().getDescriptor().buildField(fieldName); } return new XMLField(fieldName); }
/** * Prepare and validate. * Set the element class. */ public void prepare(DatabaseQuery query, AbstractSession session) throws QueryException { if ((getElementClass() == null) && (query.getDescriptor() != null)) { setElementClass(query.getDescriptor().getJavaClass()); } super.prepare(query, session); }
/** * INTERNAL: Generates the object level stored procedure based on the passed in query */ protected StoredProcedureDefinition generateObjectStoredProcedure(DatabaseQuery query, List fields, String namePrefix) { String className = Helper.getShortClassName(query.getDescriptor().getJavaClass()); return generateStoredProcedure(query, fields, getPrefix() + namePrefix + className); }
/** * INTERNAL: Generates the object level stored procedure based on the passed in query */ protected StoredProcedureDefinition generateObjectStoredProcedure(DatabaseQuery query, List fields, String namePrefix) { String className = Helper.getShortClassName(query.getDescriptor().getJavaClass()); return generateStoredProcedure(query, fields, getPrefix() + namePrefix + className); }
/** * INTERNAL: * This method will be used to update the query with any settings required * For this session. It can also be used to validate execution. */ @Override public void validateQuery(DatabaseQuery query) { if (query.isObjectLevelReadQuery() && ((query.getDescriptor().getCachePolicy().isIsolated()) || ((ObjectLevelReadQuery)query).shouldUseExclusiveConnection())) { throw QueryException.isolatedQueryExecutedOnServerSession(); } }
/** * INTERNAL: * Allow the call to translate the XQuery arguments. */ public void translate(AbstractRecord translationRow, AbstractRecord modifyRow, AbstractSession session) { // may need to set the session on the translation row if (translationRow != EmptyRecord.getEmptyRecord() && getQuery() != null && getQuery().getDescriptor() != null) { ((XMLRecord) translationRow).setSession(session); } setInputRow(modifyRow); translateQueryString(translationRow, modifyRow, session); }
/** * Prepare and validate. * Allow subclasses to override. */ public void prepare(DatabaseQuery query, AbstractSession session) throws QueryException { if (query.isReadAllQuery() && (!query.isReportQuery()) && query.shouldUseWrapperPolicy()) { setElementDescriptor(query.getDescriptor()); //make sure DataReadQuery points to this container policy } else if (query.isDataReadQuery()) { ((DataReadQuery)query).setContainerPolicy(this); } }
/** * INTERNAL: * Allow the call to translate the XQuery arguments. */ public void translate(AbstractRecord translationRow, AbstractRecord modifyRow, AbstractSession session) { // may need to set the session on the translation row if (translationRow != EmptyRecord.getEmptyRecord() && getQuery() != null && getQuery().getDescriptor() != null) { ((XMLRecord) translationRow).setSession(session); } setInputRow(modifyRow); translateQueryString(translationRow, modifyRow, session); }
/** * Prepare and validate. * Allow subclasses to override. */ public void prepare(DatabaseQuery query, AbstractSession session) throws QueryException { if (query.isReadAllQuery() && (!query.isReportQuery()) && query.shouldUseWrapperPolicy()) { setElementDescriptor(query.getDescriptor()); //make sure DataReadQuery points to this container policy } else if (query.isDataReadQuery()) { ((DataReadQuery)query).setContainerPolicy(this); } }
/** * INTERNAL: * Allow the call to translate the XQuery arguments. */ public void translate(AbstractRecord translationRow, AbstractRecord modifyRow, AbstractSession session) { // may need to set the session on the translation row if (translationRow != EmptyRecord.getEmptyRecord() && getQuery() != null && getQuery().getDescriptor() != null) { ((XMLRecord) translationRow).setSession(session); } setInputRow(modifyRow); translateQueryString(translationRow, modifyRow, session); }
protected SQLSelectStatement createSQLSelectStatementForAssignedExpressionForUpdateAll(Expression value) { ReportQuery reportQuery = new ReportQuery(getQuery().getReferenceClass(), value.getBuilder()); reportQuery.setDescriptor(getQuery().getDescriptor()); reportQuery.setSession(getSession()); reportQuery.addAttribute("", value); SQLSelectStatement selectStatement = ((ExpressionQueryMechanism)reportQuery.getQueryMechanism()).buildReportQuerySelectStatement(false); reportQuery.setSession(null); return selectStatement; }
protected SQLSelectStatement createSQLSelectStatementForAssignedExpressionForUpdateAll(Expression value) { ReportQuery reportQuery = new ReportQuery(getQuery().getReferenceClass(), value.getBuilder()); reportQuery.setDescriptor(getQuery().getDescriptor()); reportQuery.setSession(getSession()); reportQuery.addAttribute("", value); SQLSelectStatement selectStatement = ((ExpressionQueryMechanism)reportQuery.getQueryMechanism()).buildReportQuerySelectStatement(false); reportQuery.setSession(null); return selectStatement; }
protected SQLSelectStatement createSQLSelectStatementForAssignedExpressionForUpdateAll(Expression value) { ReportQuery reportQuery = new ReportQuery(getQuery().getReferenceClass(), value.getBuilder()); reportQuery.setDescriptor(getQuery().getDescriptor()); reportQuery.setSession(getSession()); reportQuery.addAttribute("", value); SQLSelectStatement selectStatement = ((ExpressionQueryMechanism)reportQuery.getQueryMechanism()).buildReportQuerySelectStatement(false); reportQuery.setSession(null); return selectStatement; }