mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-03 19:57:36 +08:00
Exception on opening Workflow User Groups. #PL-6110
This commit is contained in:
parent
e245654997
commit
e383719d5c
@ -209,23 +209,24 @@ public class FetchGroupManager {
|
||||
List<String> result = new ArrayList<>();
|
||||
|
||||
MetaClass propMetaClass = toManyField.metaProperty.getRange().asClass();
|
||||
MetaProperty inverseProp = propMetaClass.getProperties().stream()
|
||||
propMetaClass.getProperties().stream()
|
||||
.filter(mp -> mp.getRange().isClass()
|
||||
&& metadataTools.isPersistent(mp)
|
||||
&& metadataTools.isAssignableFrom(mp.getRange().asClass(), toManyField.metaClass))
|
||||
.findFirst()
|
||||
.orElseThrow(() -> new IllegalStateException("Cannot find inverse property for " + toManyField.metaProperty));
|
||||
.ifPresent(inverseProp -> {
|
||||
for (FetchGroupField fetchGroupField : fetchGroupFields) {
|
||||
if (fetchGroupField.metaClass.equals(toManyField.metaClass)
|
||||
// add only local properties
|
||||
&& !fetchGroupField.metaProperty.getRange().isClass()
|
||||
// do not add properties from subclasses
|
||||
&& fetchGroupField.metaProperty.getDomain().equals(inverseProp.getRange().asClass())) {
|
||||
String attribute = toManyField.path() + "." + inverseProp.getName() + "." + fetchGroupField.metaProperty.getName();
|
||||
result.add(attribute);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
for (FetchGroupField fetchGroupField : fetchGroupFields) {
|
||||
if (fetchGroupField.metaClass.equals(toManyField.metaClass)
|
||||
// add only local properties
|
||||
&& !fetchGroupField.metaProperty.getRange().isClass()
|
||||
// do not add properties from subclasses
|
||||
&& fetchGroupField.metaProperty.getDomain().equals(inverseProp.getRange().asClass())) {
|
||||
String attribute = toManyField.path() + "." + inverseProp.getName() + "." + fetchGroupField.metaProperty.getName();
|
||||
result.add(attribute);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user