#1665 - Incorrect query execution metrics for ORM query converted to DTO query via asDto()

This commit is contained in:
rob bygrave
2019-04-01 23:11:16 +13:00
parent 4119c02f0d
commit 18e0ff7067
4 changed files with 31 additions and 27 deletions
@@ -144,15 +144,13 @@ public abstract class AbstractSqlQueryRequest {
* Prepare and execute the SQL using the Binder.
*/
public void executeSql(Binder binder, SpiQuery.Type type) throws SQLException {
startNano = System.nanoTime();
executeAsSql(binder);
}
protected void executeAsSql(Binder binder) throws SQLException {
startNano = System.nanoTime();
prepareSql();
Connection conn = trans.getInternalConnection();
pstmt = conn.prepareStatement(sql);
@@ -44,6 +44,7 @@ public final class DtoQueryRequest<T> extends AbstractSqlQueryRequest {
*/
@Override
public void executeSql(Binder binder, SpiQuery.Type type) throws SQLException {
startNano = System.nanoTime();
SpiQuery<?> ormQuery = query.getOrmQuery();
if (ormQuery != null) {
ormQuery.setType(type);