/** * Tune the query by replacing its OrmQueryDetail with a tuned one. * * @return true if the query was tuned, otherwise false. */ public boolean tuneQuery(SpiQuery<?> query) { if (tunedDetail == null) { return false; } boolean tuned; if (query.isDetailEmpty()) { tuned = true; // tune by 'replacement' query.setDetail(tunedDetail.copy()); } else { // tune by 'addition' tuned = query.tuneFetchProperties(tunedDetail); } if (tuned) { query.setAutoTuned(true); } return tuned; }
/** * Tune the query by replacing its OrmQueryDetail with a tuned one. * * @return true if the query was tuned, otherwise false. */ public boolean autoFetchTune(SpiQuery<?> query) { if (tunedDetail == null) { return false; } boolean tuned = false; //Note: tunedDetail is immutable by convention if (query.isDetailEmpty()) { tuned = true; // tune by 'replacement' query.setDetail(tunedDetail.copy()); } else { // tune by 'addition' tuned = query.tuneFetchProperties(tunedDetail); } if (tuned){ query.setAutoFetchTuned(true); // a case for AtomicInteger but good enough for statistics tunedCount++; } return tuned; }
/** * Tune the query by replacing its OrmQueryDetail with a tuned one. * * @return true if the query was tuned, otherwise false. */ public boolean autoFetchTune(SpiQuery<?> query) { if (tunedDetail == null) { return false; } boolean tuned = false; //Note: tunedDetail is immutable by convention if (query.isDetailEmpty()) { tuned = true; // tune by 'replacement' query.setDetail(tunedDetail.copy()); } else { // tune by 'addition' tuned = query.tuneFetchProperties(tunedDetail); } if (tuned){ query.setAutoFetchTuned(true); // a case for AtomicInteger but good enough for statistics tunedCount++; } return tuned; }
copy.readOnly = readOnly; if (detail != null) { copy.detail = detail.copy();
copy.sqlSelect = sqlSelect; if (detail != null){ copy.detail = detail.copy();
copy.sqlSelect = sqlSelect; if (detail != null){ copy.detail = detail.copy();