use of com.blazebit.persistence.view.testsuite.filter.basic.model.ViewFilterPrimitiveDocumentView in project blaze-persistence by Blazebit.
the class AttributeFilterTest method testViewFilter.
@Test
public void testViewFilter() {
EntityViewManager evm = build(ViewFilterPrimitiveDocumentView.class);
EntityViewSetting<ViewFilterPrimitiveDocumentView, CriteriaBuilder<ViewFilterPrimitiveDocumentView>> setting = EntityViewSetting.create(ViewFilterPrimitiveDocumentView.class);
setting.addViewFilter("viewFilter1");
List<ViewFilterPrimitiveDocumentView> results = evm.applySetting(setting, cbf.create(em, PrimitiveDocument.class)).getResultList();
assertEquals(1, results.size());
Assert.assertEquals(Long.valueOf(doc1.getId()), results.get(0).getId());
}
use of com.blazebit.persistence.view.testsuite.filter.basic.model.ViewFilterPrimitiveDocumentView in project blaze-persistence by Blazebit.
the class AttributeFilterTest method testMultipleViewFilter.
@Test
public void testMultipleViewFilter() {
EntityViewManager evm = build(ViewFilterPrimitiveDocumentView.class);
EntityViewSetting<ViewFilterPrimitiveDocumentView, CriteriaBuilder<ViewFilterPrimitiveDocumentView>> setting = EntityViewSetting.create(ViewFilterPrimitiveDocumentView.class);
setting.addViewFilter("viewFilter1");
setting.addViewFilter("viewFilter2");
setting.withOptionalParameter("viewFilterParam", "Jack");
List<ViewFilterPrimitiveDocumentView> results = evm.applySetting(setting, cbf.create(em, PrimitiveDocument.class)).getResultList();
assertEquals(0, results.size());
}
Aggregations