use of com.haulmont.cuba.core.global.ViewBuilder in project jmix by jmix-framework.
the class CubaFetchPlanRepository method deployDefaultFetchPlan.
@Override
protected FetchPlan deployDefaultFetchPlan(MetaClass metaClass, String name, Set<FetchPlanLoader.FetchPlanInfo> visited) {
if (View.MINIMAL.equals(name)) {
Class<? extends Entity> javaClass = metaClass.getJavaClass();
FetchPlanLoader.FetchPlanInfo info = new FetchPlanLoader.FetchPlanInfo(metaClass, name);
if (visited.contains(info)) {
throw new DevelopmentException(String.format("Fetch plans cannot have cyclic references. FetchPlan %s for class %s", name, metaClass.getName()));
}
ViewBuilder viewBuilder = (ViewBuilder) fetchPlans.builder(javaClass).name(name);
addAttributesToInstanceNameFetchPlan(metaClass, viewBuilder, info, visited);
storeFetchPlan(metaClass, viewBuilder.build());
return viewBuilder.build();
}
return super.deployDefaultFetchPlan(metaClass, name, visited);
}
Aggregations