use of ru.ydn.wicket.wicketorientdb.model.ODocumentModel in project wicket-orientdb by OrienteerBAP.
the class TestFilters method testODocumentLinkQueryProvider.
@Test
public void testODocumentLinkQueryProvider() {
IFilterCriteriaManager manager = new FilterCriteriaManager(wicket.getProperty(NUMBER_FIELD));
IFilterCriteria equalsFilterCriteria = manager.createEqualsFilterCriteria(Model.of(NUM_VALUE_1), Model.of(true));
manager.addFilterCriteria(equalsFilterCriteria);
String numField = wicket.getProperty(NUMBER_FIELD).getObject().getName();
queryModel.addFilterCriteriaManager(numField, manager);
ODocument doc = queryModel.getObject().get(0);
IModel<OProperty> property = wicket.getProperty(LINK_LIST_FIELD);
ODocumentLinksQueryDataProvider provider = new ODocumentLinksQueryDataProvider(new ODocumentModel(doc), property);
OQueryModel<ODocument> state = provider.getFilterState();
state.addFilterCriteriaManager(numField, manager);
state.detach();
assertTrue("size must be 1, but it is " + provider.size(), provider.size() == 1);
assertTrue(state.getObject().get(0) != null);
}
Aggregations