/** * 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); } }