use of io.jmix.core.FetchPlan in project jmix by jmix-framework.
the class ViewBuilderTest method testMerging.
@Test
public void testMerging() {
FetchPlan view1 = ViewBuilder.of(Pet.class).add("owner", FetchPlan.LOCAL).build();
FetchPlan view2 = ViewBuilder.of(Pet.class).addView(view1).add("name").build();
FetchPlanProperty ownerProp = view2.getProperty("owner");
assertTrue(ownerProp != null && ownerProp.getFetchPlan() != null);
assertTrue(ownerProp.getFetchPlan().containsProperty("name"));
}
use of io.jmix.core.FetchPlan in project jmix by jmix-framework.
the class ViewBuilderTest method testProperties.
@Test
public void testProperties() {
FetchPlan view = ViewBuilder.of(Pet.class).addAll("name", "nick").build();
assertFalse(containsSystemProperties(view));
assertTrue(view.containsProperty("name"));
}
use of io.jmix.core.FetchPlan in project jmix by jmix-framework.
the class ViewBuilderTest method testInlineRefProperty.
@Test
public void testInlineRefProperty() {
FetchPlan view = ViewBuilder.of(Pet.class).add("owner.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 io.jmix.core.FetchPlan in project jmix by jmix-framework.
the class ViewBuilderTest method testSystem.
@Test
public void testSystem() {
FetchPlan view = ViewBuilder.of(Pet.class).addSystem().addAll("name").build();
assertTrue(containsSystemProperties(view));
assertTrue(view.containsProperty("name"));
view = ViewBuilder.of(Pet.class).addSystem().addView(FetchPlan.LOCAL).build();
assertTrue(containsSystemProperties(view));
assertTrue(view.containsProperty("name"));
}
use of io.jmix.core.FetchPlan in project jmix by jmix-framework.
the class ViewBuilderTest method testRefProperty.
@Test
public void testRefProperty() {
FetchPlan view = ViewBuilder.of(Pet.class).add("owner").build();
assertFalse(containsSystemProperties(view));
assertNotNull(view.getProperty("owner"));
FetchPlan ownerView = view.getProperty("owner").getFetchPlan();
assertNotNull(ownerView);
assertFalse(containsSystemProperties(ownerView));
assertFalse(ownerView.containsProperty("name"));
}
Aggregations