PL-8697 If there are several nested datasources in parentDs any of them can be set as a parent for nested datasources of childDs (from https://github.com/cuba-platform/cuba/pull/13)

This commit is contained in:
Konstantin Krivopustov 2017-02-21 18:47:27 +04:00
parent b00885846e
commit 9685c52526

View File

@ -184,6 +184,7 @@ public abstract class AbstractDatasource<T extends Entity> implements Datasource
// Look for corresponding property datasource in the Parent's DsContext
for (Datasource siblingOfParent : parentDs.getDsContext().getAll()) {
if (siblingOfParent instanceof NestedDatasource
&& ((NestedDatasource) siblingOfParent).getProperty().equals(((NestedDatasource) sibling).getProperty())
&& ((NestedDatasource) siblingOfParent).getMaster() == parentDs) {
// If such corresponding datasource found, set it as a parent for our property datasource
((DatasourceImplementation) sibling).setParent(siblingOfParent);