/** * INTERNAL: * To any user of this object with some knowledge of what the query's results may contain. * Return the results of the query. * If the query has never been executed, or does not cache results, * the results will be null. */ protected Object getQueryResults(AbstractSession session) { return getQueryResults(session, getTranslationRow(), true); }
/** * INTERNAL: * To any user of this object with some knowledge of what the query's results may contain. * Return the results of the query. * If the query has never been executed, or does not cache results, * the results will be null. */ protected Object getQueryResults(AbstractSession session, boolean checkExpiry) { return getQueryResults(session, getTranslationRow(), checkExpiry); }
/** * INTERNAL: * To any user of this object with some knowledge of what the query's results may contain. * Return the results of the query. * If the query has never been executed, or does not cache results, * the results will be null. */ protected Object getQueryResults(AbstractSession session, boolean checkExpiry) { return getQueryResults(session, getTranslationRow(), checkExpiry); }
/** * INTERNAL: * To any user of this object with some knowledge of what the query's results may contain. * Return the results of the query. * If the query has never been executed, or does not cache results, * the results will be null. */ protected Object getQueryResults(AbstractSession session) { return getQueryResults(session, getTranslationRow(), true); }
/** * INTERNAL: * To any user of this object with some knowledge of what the query's results may contain. * Return the results of the query. * If the query has never been executed, or does not cache results, * the results will be null. */ protected Object getQueryResults(AbstractSession session) { return getQueryResults(session, getTranslationRow(), true); }
/** * INTERNAL: * To any user of this object with some knowledge of what the query's results may contain. * Return the results of the query. * If the query has never been executed, or does not cache results, * the results will be null. */ protected Object getQueryResults(AbstractSession session, boolean checkExpiry) { return getQueryResults(session, getTranslationRow(), checkExpiry); }
/** * Process against the UOW and attempt to load a local copy before going to the shared cache * If null is returned then the calling UOW will instantiate as normal. */ @Override public Object getValue(UnitOfWorkImpl uow) { if (this.query.isReadObjectQuery()){ return this.query.getQueryMechanism().checkCacheForObject(this.query.getTranslationRow(), uow); } //not able to shortcircuit cache lookup to UOW return null; return null; }
/** * Process against the UOW and attempt to load a local copy before going to the shared cache * If null is returned then the calling UOW will instantiate as normal. */ @Override public Object getValue(UnitOfWorkImpl uow) { if (this.query.isReadObjectQuery()){ return this.query.getQueryMechanism().checkCacheForObject(this.query.getTranslationRow(), uow); } //not able to shortcircuit cache lookup to UOW return null; return null; }
/** * INTERNAL: */ public Cursor(DatabaseCall call, CursorPolicy policy) { ReadQuery query = policy.getQuery(); this.query = query; this.session = query.getSession(); this.executionSession = session.getExecutionSession(query); this.statement = call.getStatement(); this.fields = call.getFields(); this.resultSet = call.getResult(); this.policy = policy; this.objectCollection = new Vector(); if (query.getSession().isUnitOfWork() && query.isObjectLevelReadQuery()) { // Call register on the cursor itself. This will set up // incremental conforming by setting the // selection criteria clone and arguments, and building the // intially conforming index (scans the UOW cache). // The incremental registration/conforming is done // in retrieveNext/PreviousObject -> buildAndRegisterObject ((ObjectLevelReadQuery)query).registerResultInUnitOfWork(this, (UnitOfWorkImpl)this.session, query.getTranslationRow(), false);// object collection is empty, so setting irrelevant. } }
/** * INTERNAL: */ public Cursor(DatabaseCall call, CursorPolicy policy) { ReadQuery query = policy.getQuery(); this.query = query; this.session = query.getSession(); this.executionSession = session.getExecutionSession(query); this.statement = call.getStatement(); this.fields = call.getFields(); this.resultSet = call.getResult(); this.policy = policy; this.objectCollection = new Vector(); if (query.getSession().isUnitOfWork() && query.isObjectLevelReadQuery()) { // Call register on the cursor itself. This will set up // incremental conforming by setting the // selection criteria clone and arguments, and building the // intially conforming index (scans the UOW cache). // The incremental registration/conforming is done // in retrieveNext/PreviousObject -> buildAndRegisterObject ((ObjectLevelReadQuery)query).registerResultInUnitOfWork(this, (UnitOfWorkImpl)this.session, query.getTranslationRow(), false);// object collection is empty, so setting irrelevant. } }
/** * INTERNAL: */ public Cursor(DatabaseCall call, CursorPolicy policy) { this.session = policy.getQuery().getSession(); this.executionSession = session.getExecutionSession(policy.getQuery()); this.statement = call.getStatement(); this.fields = call.getFields(); this.resultSet = call.getResult(); this.policy = policy; setObjectCollection(new Vector()); if (getQuery().getSession().isUnitOfWork() && getQuery().isObjectLevelReadQuery()) { // Call register on the cursor itself. This will set up // incremental conforming by setting the // selection criteria clone and arguments, and building the // intially conforming index (scans the UOW cache). // The incremental registration/conforming is done // in retrieveNext/PreviousObject -> buildAndRegisterObject ObjectLevelReadQuery query = (ObjectLevelReadQuery)getQuery(); query.registerResultInUnitOfWork(this, (UnitOfWorkImpl)this.session, getQuery().getTranslationRow(), false);// object collection is empty, so setting irrelevant. } }
/** * INTERNAL: * Prepare the receiver for execution in a session. */ public void prepareForExecution() throws QueryException { super.prepareForExecution(); DatabaseCall databaseCall = this.getCall(); if ( databaseCall !=null && databaseCall.shouldIgnoreFirstRowMaxResultsSettings() ){ AbstractRecord parameters = this.getTranslationRow(); if (parameters.isEmpty()){ parameters = new DatabaseRecord(); } parameters.add(DatabaseCall.FIRSTRESULT_FIELD, this.getFirstResult()); parameters.add(DatabaseCall.MAXROW_FIELD, session.getPlatform().computeMaxRowsForSQL(this.getFirstResult(), this.getMaxRows())); this.setTranslationRow(parameters); } }
/** * INTERNAL: * Prepare the receiver for execution in a session. */ public void prepareForExecution() throws QueryException { super.prepareForExecution(); DatabaseCall databaseCall = this.getCall(); if ( databaseCall !=null && (databaseCall.shouldIgnoreFirstRowSetting() || databaseCall.shouldIgnoreMaxResultsSetting())){ AbstractRecord parameters = this.getTranslationRow(); if (parameters.isEmpty()){ parameters = new DatabaseRecord(); } //Some DB don't support FirstRow in SELECT statements in spite of supporting MaxResults(Symfoware). //We should check FirstRow and MaxResults separately. if(databaseCall.shouldIgnoreFirstRowSetting()){ parameters.add(DatabaseCall.FIRSTRESULT_FIELD, this.getFirstResult()); } if(databaseCall.shouldIgnoreMaxResultsSetting()){ parameters.add(DatabaseCall.MAXROW_FIELD, session.getPlatform().computeMaxRowsForSQL(this.getFirstResult(), this.getMaxRows())); } this.setTranslationRow(parameters); } }
/** * INTERNAL: * Prepare the receiver for execution in a session. */ public void prepareForExecution() throws QueryException { super.prepareForExecution(); DatabaseCall databaseCall = this.getCall(); if ( databaseCall !=null && (databaseCall.shouldIgnoreFirstRowSetting() || databaseCall.shouldIgnoreMaxResultsSetting())){ AbstractRecord parameters = this.getTranslationRow(); if (parameters.isEmpty()){ parameters = new DatabaseRecord(); } //Some DB don't support FirstRow in SELECT statements in spite of supporting MaxResults(Symfoware). //We should check FirstRow and MaxResults separately. if (databaseCall.shouldIgnoreFirstRowSetting()) { parameters.add(DatabaseCall.FIRSTRESULT_FIELD, this.getFirstResult()); } if (databaseCall.shouldIgnoreMaxResultsSetting()) { // Bug #493771 parameters.add(DatabaseCall.MAXROW_FIELD, ((DatabasePlatform) session.getPlatform(databaseCall.getQuery().getReferenceClass())).computeMaxRowsForSQL(this.getFirstResult(), this.getMaxRows())); } this.setTranslationRow(parameters); } }
Number value = (Number)getSession().executeQuery(query, this.query.getTranslationRow()); if (value == null) { throw QueryException.incorrectSizeQueryForCursorStream(this.query);
Number value = (Number)getSession().executeQuery(query, this.query.getTranslationRow()); if (value == null) { throw QueryException.incorrectSizeQueryForCursorStream(this.query);
Number value = (Number)getSession().executeQuery(query, getQuery().getTranslationRow()); if (value == null) { throw QueryException.incorrectSizeQueryForCursorStream(getQuery());