Skip to content
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

OGM wrapper does not set internal _type property of list relationships if they are null #40

Closed
oxisto opened this issue Jul 28, 2020 · 0 comments · Fixed by #41
Closed

Comments

@oxisto
Copy link
Member

oxisto commented Jul 28, 2020

The OGM wrapper seems to stored internally the type of a list relationship in the property field_name, to instantiate it later with the correct list/collection-subtype. However, there is an issue, if a collection element, that is considered as a relationship, such as the newly introduced annotations field of a Node is null. More specifically, the function vertexToNode crashes because it will look for the property type here:

className = (String) v.property(f.getName() + "_type").value();
collectionType = Class.forName(className);

However, the createEdges function only sets this special property, if the value of that property is not null, probably to not save unnecessary properties.

v.property(f.getName() + "_type", x.getClass().getName());

Even this would be caught by an exception, but this exception tries to rely on the fact that the node property is there, which is not mandatory and thus, the caught exception triggers an exception

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant