use of com.haulmont.cuba.core.model.Owner in project jmix by jmix-framework.
the class ViewBuilderTest method testRefView.
@Test
public void testRefView() {
FetchPlan view = ViewBuilder.of(Pet.class).add("owner", builder -> builder.add("name")).build();
assertFalse(containsSystemProperties(view));
assertNotNull(view.getProperty("owner"));
FetchPlan ownerView = view.getProperty("owner").getFetchPlan();
assertNotNull(ownerView);
assertFalse(containsSystemProperties(ownerView));
assertTrue(ownerView.containsProperty("name"));
}
use of com.haulmont.cuba.core.model.Owner in project jmix by jmix-framework.
the class DlcBaseScreen method ownersDlLoadDelegate.
@Install(to = "ownersDl", target = Target.DATA_LOADER)
private List<Owner> ownersDlLoadDelegate(LoadContext<Owner> loadContext) {
events.add(new LoadEvent("ownersDl", loadContext));
List<Owner> list = new ArrayList<>();
Owner owner = metadata.create(Owner.class);
owner.setName("Joe");
list.add(owner);
if (loadContext.getQuery().getParameters().isEmpty()) {
owner = metadata.create(Owner.class);
owner.setName("Jane");
list.add(owner);
}
return list;
}
Aggregations