-
Notifications
You must be signed in to change notification settings - Fork 32
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
Creating vertices from case class with nested case class fields #82
Comments
you don't provide much context so I can only guess, but let me guess that you're trying to persist one of your own classes via a remote connection to orientdb? that wouldn't work because orient doesn't know your classes |
Yup, that's the situation, eventually the ODocument sent off for saving contains an ODocumentEntry with the raw instance of my domain class. I think it should be also wrapped into an ODocument. Would it be a big deal to wrap embedded classes in the orientdb-gremlin driver? |
maybe i wasn't clear enough - you cannot send your own classes via a remote connection to orientdb. you need to transform them into a vertex first. gremlin-scala e.g. has a macro that does that job for you: https://github.com/mpollmeier/gremlin-scala/#mapping-vertices-fromto-case-classes |
Hi, sorry for not being mistaken, but I was under the impression that this would work:
The problem is that the macro doesn't recur. If you step into the addVertex it'll eventually call I don't know if it would be a good approach but the Orient driver (in |
This is general issue with scala classes/types. Funny part is, this works for memory storage, whereas remote doesn't. |
I guess it's because when running "in memory" the JVM knows how to serialize the CCs because they're in the classpath. |
exactly - the in memory instance knows all your classes, but in production you're unlikely to run it this way. and yeah, quite possible that the macro doesn't support nesting. |
Hi,
I'm trying to persist a case class containing several other case classes. TinkerGraph tests work alright whereas when switching to OrientGraph causes a
Seems that in org.apache.tinkerpop.gremlin.orientdb.OrientElement#property(java.lang.Object...) the property is passed on as-is to the ODocument without mapping it first to another ODocument.
The text was updated successfully, but these errors were encountered: