use of com.blazebit.persistence.view.testsuite.correlation.expression.model.DocumentSimpleCorrelationViewJoinId in project blaze-persistence by Blazebit.
the class ExpressionCorrelationTest method testFilterSortJoinCorrelatedSingularBasicPaginated.
@Test
// @Category({ NoHibernate42.class, NoHibernate43.class, NoHibernate50.class, NoDatanucleus4.class, NoOpenJPA.class, NoEclipselink.class })
@Category({ NoHibernate42.class, NoHibernate43.class, NoHibernate50.class, NoDatanucleus.class, NoOpenJPA.class, NoEclipselink.class })
public void testFilterSortJoinCorrelatedSingularBasicPaginated() {
EntityViewManager evm = buildEntityViewManagerForFilter();
CriteriaBuilder<Document> criteria = cbf.create(em, Document.class, "d");
EntityViewSetting<DocumentSimpleCorrelationViewJoinId, PaginatedCriteriaBuilder<DocumentSimpleCorrelationViewJoinId>> setting;
setting = EntityViewSetting.create(DocumentSimpleCorrelationViewJoinId.class, 0, 1);
setting.addAttributeFilter("correlatedOwnerId", doc2.getOwner().getId());
setting.addAttributeSorter("correlatedOwnerId", Sorters.ascending());
setting.addAttributeSorter("id", Sorters.ascending());
PaginatedCriteriaBuilder<DocumentSimpleCorrelationViewJoinId> cb = evm.applySetting(setting, criteria);
PagedList<DocumentSimpleCorrelationViewJoinId> results = cb.getResultList();
assertEquals(1, results.size());
assertEquals(3, results.getTotalSize());
}
use of com.blazebit.persistence.view.testsuite.correlation.expression.model.DocumentSimpleCorrelationViewJoinId in project blaze-persistence by Blazebit.
the class ExpressionCorrelationTest method testFilterSortJoinCorrelatedPluralBasicPaginated.
@Test
// @Category({ NoHibernate42.class, NoHibernate43.class, NoHibernate50.class, NoDatanucleus4.class, NoOpenJPA.class, NoEclipselink.class })
@Category({ NoHibernate42.class, NoHibernate43.class, NoHibernate50.class, NoDatanucleus.class, NoOpenJPA.class, NoEclipselink.class })
public void testFilterSortJoinCorrelatedPluralBasicPaginated() {
EntityViewManager evm = buildEntityViewManagerForFilter();
CriteriaBuilder<Document> criteria = cbf.create(em, Document.class, "d");
EntityViewSetting<DocumentSimpleCorrelationViewJoinId, PaginatedCriteriaBuilder<DocumentSimpleCorrelationViewJoinId>> setting;
setting = EntityViewSetting.create(DocumentSimpleCorrelationViewJoinId.class, 0, 1);
setting.addAttributeFilter("correlatedOwnerIdList", doc2.getOwner().getId());
setting.addAttributeSorter("correlatedOwnerIdList", Sorters.ascending());
setting.addAttributeSorter("id", Sorters.ascending());
PaginatedCriteriaBuilder<DocumentSimpleCorrelationViewJoinId> cb = evm.applySetting(setting, criteria);
PagedList<DocumentSimpleCorrelationViewJoinId> results = cb.getResultList();
assertEquals(1, results.size());
assertEquals(3, results.getTotalSize());
}
use of com.blazebit.persistence.view.testsuite.correlation.expression.model.DocumentSimpleCorrelationViewJoinId in project blaze-persistence by Blazebit.
the class ExpressionCorrelationTest method testFilterSortJoinCorrelatedPluralViewPaginated.
@Test
// @Category({ NoHibernate42.class, NoHibernate43.class, NoHibernate50.class, NoDatanucleus4.class, NoOpenJPA.class, NoEclipselink.class })
@Category({ NoHibernate42.class, NoHibernate43.class, NoHibernate50.class, NoDatanucleus.class, NoOpenJPA.class, NoEclipselink.class })
public void testFilterSortJoinCorrelatedPluralViewPaginated() {
EntityViewManager evm = buildEntityViewManagerForFilter();
CriteriaBuilder<Document> criteria = cbf.create(em, Document.class, "d");
EntityViewSetting<DocumentSimpleCorrelationViewJoinId, PaginatedCriteriaBuilder<DocumentSimpleCorrelationViewJoinId>> setting;
setting = EntityViewSetting.create(DocumentSimpleCorrelationViewJoinId.class, 0, 1);
setting.addAttributeFilter("correlatedOwnerViewList.name", "PERS2");
setting.addAttributeSorter("correlatedOwnerViewList.name", Sorters.ascending());
setting.addAttributeSorter("id", Sorters.ascending());
PaginatedCriteriaBuilder<DocumentSimpleCorrelationViewJoinId> cb = evm.applySetting(setting, criteria);
PagedList<DocumentSimpleCorrelationViewJoinId> results = cb.getResultList();
assertEquals(1, results.size());
assertEquals(3, results.getTotalSize());
}
use of com.blazebit.persistence.view.testsuite.correlation.expression.model.DocumentSimpleCorrelationViewJoinId in project blaze-persistence by Blazebit.
the class ExpressionCorrelationTest method testFilterSortJoinCorrelatedSingularViewPaginated.
@Test
// @Category({ NoHibernate42.class, NoHibernate43.class, NoHibernate50.class, NoDatanucleus4.class, NoOpenJPA.class, NoEclipselink.class })
@Category({ NoHibernate42.class, NoHibernate43.class, NoHibernate50.class, NoDatanucleus.class, NoOpenJPA.class, NoEclipselink.class })
public void testFilterSortJoinCorrelatedSingularViewPaginated() {
EntityViewManager evm = buildEntityViewManagerForFilter();
CriteriaBuilder<Document> criteria = cbf.create(em, Document.class, "d");
EntityViewSetting<DocumentSimpleCorrelationViewJoinId, PaginatedCriteriaBuilder<DocumentSimpleCorrelationViewJoinId>> setting;
setting = EntityViewSetting.create(DocumentSimpleCorrelationViewJoinId.class, 0, 1);
setting.addAttributeFilter("correlatedOwnerView.name", "PERS2");
setting.addAttributeSorter("correlatedOwnerView.name", Sorters.ascending());
setting.addAttributeSorter("id", Sorters.ascending());
PaginatedCriteriaBuilder<DocumentSimpleCorrelationViewJoinId> cb = evm.applySetting(setting, criteria);
PagedList<DocumentSimpleCorrelationViewJoinId> results = cb.getResultList();
assertEquals(1, results.size());
assertEquals(3, results.getTotalSize());
}
Aggregations