use of org.eclipse.persistence.queries.FetchGroupTracker in project cuba by cuba-platform.
the class GlobalPersistentAttributesLoadChecker method isLoadedCommonCheck.
protected PropertyLoadedState isLoadedCommonCheck(Object entity, String property) {
if (entity instanceof BaseGenericIdEntity) {
BaseGenericIdEntity baseGenericIdEntity = (BaseGenericIdEntity) entity;
String[] inaccessibleAttributes = BaseEntityInternalAccess.getInaccessibleAttributes(baseGenericIdEntity);
if (inaccessibleAttributes != null) {
for (String inaccessibleAttr : inaccessibleAttributes) {
if (inaccessibleAttr.equals(property))
return PropertyLoadedState.NO;
}
}
if (entity instanceof FetchGroupTracker) {
FetchGroup fetchGroup = ((FetchGroupTracker) entity)._persistence_getFetchGroup();
if (fetchGroup != null) {
boolean inFetchGroup = fetchGroup.getAttributeNames().contains(property);
if (!inFetchGroup) {
// definitely not loaded
return PropertyLoadedState.NO;
} else {
// requires additional check specific for the tier
return PropertyLoadedState.UNKNOWN;
}
}
}
}
return PropertyLoadedState.UNKNOWN;
}
Aggregations