MyTetra Share
Делитесь знаниями!
ViewRepository
Время создания: 07.07.2020 15:00
Раздел: INFO - Development - CUBA - BC
Запись: wwwlir/Tetra/master/base/1568179325rszr7eu98g/text.html на raw.githubusercontent.com

import com.haulmont.cuba.core.global.ViewRepository;

import com.haulmont.cuba.core.global.View;


//@Inject

//private ViewRepository vRep;

ViewRepository vRep = AppBeans.get(ViewRepository.NAME)


View contragentView = vRep.getView(Contragent.class, "_minimal");

contragentView.addProperty("inn");

contragentView.addProperty("hasWasteGenerationProject");

contragentView.addProperty("notUseReductionFactor");

contragentView.addProperty("realEstates", vRep.getView(ContragentRealEstate.class, "_minimal"));

contragentView.addProperty("wasteGenerationProjects", vRep.getView(WasteGenerationProject.class, "_minimal"));

contragentView.addProperty("legalAddress");


//View creView = new View(ContragentRealEstate.class);

View creView = vRep.getView(ContragentRealEstate.class, "_minimal");

creView.addProperty("realEstate", vRep.getView(RealEstate.class, "_minimal"));

//creView.addProperty("containerYards",

// vRep.getView(RealEstateContainerYard.class, "_minimal")

// .addProperty("containerYard",

// vRep.getView(ContainerYard.class, "_minimal"))

// );

View containerYardsView = vRep.getView(RealEstateContainerYard.class, "_minimal");

containerYardsView.addProperty("containerYard", vRep.getView(ContainerYard.class, "_minimal"));

creView.addProperty("containerYards", containerYardsView);


View wgpView = vRep.getView(WasteGenerationProject.class, "_base");

wgpView.addProperty("realEstates", vRep.getView(ContragentRealEstate.class, "_minimal"));




View.ViewParams viewParam = new View.ViewParams().entityClass(Payment.class).name("_local");
viewParam.includeSystemProperties = true;
View view = new View(viewParam);



LoadContext<Payment> loadContext = LoadContext.create(Payment.class)
.setQuery(LoadContext.
createQuery("select p from rtneo$Payment p where p.inn = :inn and p.updateTs < '25.11.2019'")
.setParameter(
"inn", contract.getContragent().getInn()))
.setView(
new View(Payment.class, "_local", true)).setSoftDeletion(true);
return
dataManager.loadList(loadContext);

Так же в этом разделе:
 
MyTetra Share v.0.65
Яндекс индекс цитирования