-
Notifications
You must be signed in to change notification settings - Fork 872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ORecordLazyList.get(index) started to return ORecordId instead of ODocument #9421
Comments
@tglman, @Laa, @luigidellaquila, OrientDB team, do you have ideas how to fix that? 3.1.4 is unusable due to this issue... |
Apparently, the reason is in fact that mentioned above commit doesn't affect logic of @Test
public void testLinkListAndODocumentConversion()
{
ODatabaseSession db = wicket.getTester().getDatabaseSession();
OSchemaHelper helper = OSchemaHelper.bind(db);
helper.oClass("TestODocumentConverstion")
.oProperty("name", OType.STRING)
.oProperty("items", OType.LINKLIST);
ODocument mainDoc = helper.oDocument("name", "document").saveDocument().getODocument();
helper.oClass("TestODocumentConverstionItems")
.oProperty("name", OType.STRING);
ODocument doc1 = helper.oDocument("name", "item1").saveDocument().getODocument();
ODocument doc2 = helper.oDocument("name", "item2").saveDocument().getODocument();
ODocument doc3 = helper.oDocument("name", "item3").saveDocument().getODocument();
List<ODocument> items = Arrays.asList(doc1, doc2, doc3);
mainDoc.field("items", items);
mainDoc.save();
db.commit();
db.begin();
mainDoc = (ODocument)mainDoc.reload();
items = mainDoc.field("items", List.class);
items.iterator().next(); // IMPORTANT LINE
assertTrue(items.get(0) instanceof ODocument);
assertEquals(doc1, items.get(0));
assertTrue(items.get(1) instanceof ODocument);
assertEquals(doc2, items.get(1));
assertTrue(items.get(2) instanceof ODocument);
assertEquals(doc3, items.get(2));
db.commit();
} This test-case will fail, but if you comment out line marked as |
Investigation shown that |
Issue was fixed by PR #9437 |
Fix issue #9421: broken conversion within ORecordLazyList
Issue can be closed, because corresponding PR was merged. Thank you, @tglman ! |
OrientDB Version: 3.1.4
Java Version: 8
OS: Windows, Linux
Some of our tests started to fail after switching from 3.1.3 to 3.1.4 due to ClassCastException.
After review we have figured out that problem is in ORecordLazyList: first item is ODocument, but all subsequent are just ORecordId (but a corresponding ODocument does exist)
Expected behavior
ORecordLazyList should return ODocument
Actual behavior
All items after first one are ORecordId
Steps to reproduce
Not fully sure how to reproduce from scratch. The following our testcase stopped working: https://github.com/OrienteerBAP/Orienteer/blob/future/orienteer-notification/src/test/java/org/orienteer/notifications/test/TestNotificationLifecycle.java
The text was updated successfully, but these errors were encountered: