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:
Rob Bygrave
2020-08-24 18:40:36 +12:00
committed by GitHub
parent c8d352b0a8
commit 002014f930
15 changed files with 212 additions and 22 deletions
@@ -283,8 +283,8 @@ public class DLoadContext implements LoadContext {
}
@Override
public void register(String path, BeanCollection<?> bc) {
getManyContext(path).register(bc);
public void register(String path, BeanPropertyAssocMany<?> many, BeanCollection<?> bc) {
getManyContext(path, many).register(bc);
}
DLoadBeanContext getBeanContext(String path) {
@@ -315,11 +315,12 @@ public class DLoadContext implements LoadContext {
}
}
DLoadManyContext getManyContext(String path) {
if (path == null) {
throw new RuntimeException("path is null?");
}
return manyMap.computeIfAbsent(path, p -> createManyContext(p, defaultBatchSize, null));
DLoadManyContext getManyContext(String path, BeanPropertyAssocMany<?> many) {
return manyMap.computeIfAbsent(path, p -> createManyContext(p, many, defaultBatchSize));
}
private DLoadManyContext createManyContext(String path, BeanPropertyAssocMany<?> many, int batchSize) {
return new DLoadManyContext(this, many, path, batchSize, null);
}
private DLoadManyContext createManyContext(String path, int batchSize, OrmQueryProperties queryProps) {