mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
For #2038 - updated from 12.3.6 to 12.3.7 - NPE BeanDescriptor.findPropertyFromPath(BeanDescriptor.java:1965) (#2047)
* #2038 - lazy loading ToMany with path * #2038 - Failing test for NPE BeanDescriptor.findPropertyFromPath(BeanDescriptor.java:1965) * #2038 Refactor internals DbReadContext use BeanPropertyAssocMany
This commit is contained in:
@@ -5,6 +5,7 @@ import io.ebean.FetchConfig;
|
||||
import io.ebean.Query;
|
||||
import io.ebeaninternal.server.core.OrmQueryRequest;
|
||||
import io.ebeaninternal.server.core.OrmQueryRequestTestHelper;
|
||||
import io.ebeaninternal.server.deploy.BeanPropertyAssocMany;
|
||||
import org.tests.model.basic.Order;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -94,13 +95,14 @@ public class DLoadContextTest extends BaseTestCase {
|
||||
@Test
|
||||
public void construct_when_fetch_expect_100_100_batchSize() {
|
||||
|
||||
BeanPropertyAssocMany<?> many = (BeanPropertyAssocMany<?>)getBeanDescriptor(Order.class).getBeanProperty("details");
|
||||
// the fetch is converted to a query join due to the maxRows
|
||||
OrmQueryRequest<Order> queryRequest = queryRequest(query().fetch("details").setMaxRows(100));
|
||||
queryRequest.initTransIfRequired();
|
||||
queryRequest.endTransIfRequired();
|
||||
|
||||
DLoadContext graphContext = (DLoadContext) queryRequest.getGraphContext();
|
||||
DLoadManyContext details = graphContext.getManyContext("details");
|
||||
DLoadManyContext details = graphContext.getManyContext("details", many);
|
||||
|
||||
assertThat(details.firstBatchSize).isEqualTo(100);
|
||||
assertThat(details.secondaryBatchSize).isEqualTo(100);
|
||||
|
||||
Reference in New Issue
Block a user