mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Add the [+query,+cache,+lazy] query type to the profile label
This commit is contained in:
@@ -23,4 +23,5 @@ public interface LoadBeanBuffer {
|
||||
|
||||
void configureQuery(SpiQuery<?> query, String lazyLoadProperty);
|
||||
|
||||
boolean isCache();
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ public final class LoadBeanRequest extends LoadRequest {
|
||||
public void configureQuery(SpiQuery<?> query, List<Object> idList) {
|
||||
query.setMode(Mode.LAZYLOAD_BEAN);
|
||||
query.setPersistenceContext(loadBuffer.persistenceContext());
|
||||
query.setLoadDescription(lazy ? "+lazy" : "+query", description());
|
||||
query.setLoadDescription(mode(), description());
|
||||
if (lazy) {
|
||||
query.setLazyLoadBatchSize(loadBuffer.batchSize());
|
||||
if (alreadyLoaded) {
|
||||
@@ -97,6 +97,10 @@ public final class LoadBeanRequest extends LoadRequest {
|
||||
}
|
||||
}
|
||||
|
||||
private String mode() {
|
||||
return lazy ? "+lazy" : loadBuffer.isCache() ? "+cache" : "+query";
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the beans into the L2 cache if that is requested and check for load failures due to deletes.
|
||||
*/
|
||||
|
||||
@@ -52,7 +52,7 @@ abstract class DLoadBaseContext {
|
||||
void setLabel(SpiQuery<?> query) {
|
||||
String label = parent.planLabel();
|
||||
if (label != null) {
|
||||
query.setProfilePath(label, fullPath, parent.profileLocation());
|
||||
query.setProfilePath(label, fullPath + "(" + query.getLoadMode() + ")", parent.profileLocation());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -189,6 +189,11 @@ final class DLoadBeanContext extends DLoadBaseContext implements LoadBeanContext
|
||||
context.configureQuery(query, lazyLoadProperty);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCache() {
|
||||
return context.cache;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadBean(EntityBeanIntercept ebi) {
|
||||
// A lock is effectively held by EntityBeanIntercept.loadBean()
|
||||
|
||||
Reference in New Issue
Block a user