ODocument testLinkClassDocument = new ODocument("TestLinkClass");
testLinkClassDocument.field("testString", "Test Link Class 2");
testLinkClassDocument.field("testBoolean", true);
testClassDocument.field("testLink", testLinkClassDocument);
testClassDocument.save();
db.commit();
// THIS WILL THROW A java.lang.ClassCastException: com.orientechnologies.orient.core.id.ORecordId cannot be cast to
// java.lang.Boolean
List<ODocument> result = db.query(new OSQLSynchQuery<ODocument>("select from TestClass where testLink.testBoolean = true"));
Assert.assertEquals(result.size(), 2);