mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-10-26 16:01:45 +00:00
#1798 - Fix automatic query label set on nested secondary query when using profileLocation
This commit is contained in:
@@ -289,6 +289,11 @@ public interface SpiQuery<T> extends Query<T>, TxnProfileEventCodes {
|
||||
*/
|
||||
boolean selectAllForLazyLoadProperty();
|
||||
|
||||
/**
|
||||
* Set the on a secondary query given the label, relativePath and profile location of the parent query.
|
||||
*/
|
||||
void setProfilePath(String label, String relativePath, ProfileLocation profileLocation);
|
||||
|
||||
/**
|
||||
* Set the query mode.
|
||||
*/
|
||||
|
||||
@@ -85,9 +85,7 @@ abstract class DLoadBaseContext {
|
||||
|
||||
String label = parent.getPlanLabel();
|
||||
if (label != null) {
|
||||
label += "_" + fullPath;
|
||||
query.setLabel(label);
|
||||
query.setProfileLocation(parent.getProfileLocation());
|
||||
query.setProfilePath(label, fullPath, parent.getProfileLocation());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -380,6 +380,12 @@ public class DefaultOrmQuery<T> implements SpiQuery<T> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setProfilePath(String label, String relativePath, ProfileLocation profileLocation) {
|
||||
this.profileLocation = profileLocation;
|
||||
this.label = ((profileLocation == null) ? label : profileLocation.label()) + "_" + relativePath;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Query<T> setLabel(String label) {
|
||||
this.label = label;
|
||||
|
||||
Reference in New Issue
Block a user