use of ru.ydn.wicket.wicketorientdb.model.OQueryModel in project wicket-orientdb by OrienteerBAP.
the class TestModels method testOQueryModelDBTouch.
@Test
public void testOQueryModelDBTouch() {
OClass classA = wicket.getTester().getSchema().getClass("ClassA");
ODocument doc = new ODocument(classA);
doc.field("other", Arrays.asList(doc));
OQueryModel<ODocument> queryModel = new OQueryModel<ODocument>("select from ClassA where :doc in other");
queryModel.setParameter("doc", new ODocumentModel(doc));
long was = classA.count();
assertTrue(doc.getIdentity().isNew());
assertEquals(0, queryModel.size());
assertTrue(doc.getIdentity().isNew());
assertEquals(was, classA.count());
}
Aggregations