From 8ba66af878a4e788a16d77011ebdcc298d1c61d3 Mon Sep 17 00:00:00 2001 From: rbygrave Date: Thu, 10 Jun 2021 22:11:45 +1200 Subject: [PATCH] Modify test TestQueryDefaultBatchSize to show use of ProfileLocation --- .../tests/query/lazy/TestQueryDefaultBatchSize.java | 10 ++++++++++ ebean-core/src/test/resources/ebean.properties | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ebean-core/src/test/java/org/tests/query/lazy/TestQueryDefaultBatchSize.java b/ebean-core/src/test/java/org/tests/query/lazy/TestQueryDefaultBatchSize.java index a8685f985..e1d9afd02 100644 --- a/ebean-core/src/test/java/org/tests/query/lazy/TestQueryDefaultBatchSize.java +++ b/ebean-core/src/test/java/org/tests/query/lazy/TestQueryDefaultBatchSize.java @@ -2,6 +2,7 @@ package org.tests.query.lazy; import io.ebean.BaseTestCase; import io.ebean.Ebean; +import io.ebean.ProfileLocation; import org.tests.model.basic.Customer; import org.tests.model.basic.Order; import org.tests.model.basic.OrderDetail; @@ -13,12 +14,18 @@ import java.util.List; public class TestQueryDefaultBatchSize extends BaseTestCase { + private static final ProfileLocation loc0 = ProfileLocation.create(); + private static final ProfileLocation loc1 = ProfileLocation.create(); + private static final ProfileLocation loc2 = ProfileLocation.create(); + private static final ProfileLocation loc3 = ProfileLocation.create(); + @Test public void test_findEach() { ResetBasicData.reset(); Ebean.find(Order.class) + .setProfileLocation(loc0) .setLazyLoadBatchSize(2) .findEach(bean -> doStuff(bean)); } @@ -29,6 +36,7 @@ public class TestQueryDefaultBatchSize extends BaseTestCase { ResetBasicData.reset(); Ebean.find(Order.class) + .setProfileLocation(loc1) .fetch("details", "id") .fetch("details.product", "sku") .fetch("customer") @@ -44,6 +52,7 @@ public class TestQueryDefaultBatchSize extends BaseTestCase { List orders = Ebean.find(Order.class) + .setProfileLocation(loc2) .setLazyLoadBatchSize(2) .findList(); @@ -59,6 +68,7 @@ public class TestQueryDefaultBatchSize extends BaseTestCase { List orders = Ebean.find(Order.class) + .setProfileLocation(loc3) .fetch("details", "id") .fetch("details.product", "sku") .fetch("customer") diff --git a/ebean-core/src/test/resources/ebean.properties b/ebean-core/src/test/resources/ebean.properties index aa1210739..49aae2a31 100644 --- a/ebean-core/src/test/resources/ebean.properties +++ b/ebean-core/src/test/resources/ebean.properties @@ -26,7 +26,7 @@ datasource.default=h2 #datasource.h2.capturestacktrace=true ebean.dumpMetricsOnShutdown=true -ebean.dumpMetricsOptions=sql,hash +ebean.dumpMetricsOptions=sql,hash,loc #ebean.queryPlan.thresholdMicros=1000 ebean.queryPlan.enable=true