I've tried registering only the top-level class and annotating the
contained class with @Embedded, but I get this error at runtime
14102 [main] ERROR orient.TestOrientDb$ - Caught exception
com.orientechnologies.orient.core.exception.OSerializationException:
Linked type [class test.Foo:test.Foo@549b6220] can't be serialized
because is not part of registered entities. To fix this error register
this class
at
com.orientechnologies.orient.core.serialization.serializer.object.OObjectSerializerHelper.typeToStream(OObjectSerializerHelper.java:
734)
at
com.orientechnologies.orient.core.serialization.serializer.object.OObjectSerializerHelper.multiValueToStream(OObjectSerializerHelper.java:
810)
at
com.orientechnologies.orient.core.serialization.serializer.object.OObjectSerializerHelper.typeToStream(OObjectSerializerHelper.java:
706)
If I register the embedded class then it gets stored as separate
documents, by default in a separate cluster, that are referenced from
the containing document. That's not what I want. I want the contents
of both classes stored in a single document like this:
{
"bar": "bar value",
"foos": [
{ "foo1": "foo1 value" },
{ "foo2": "foo2 value" } ]
}
Since the underlying store of OrientDB is a document store, this is
how I understood it to work.
I get the exception
java.lang.IllegalArgumentException: Type EMBEDDED must be a multi
value type (collection or map)
at
com.orientechnologies.orient.core.serialization.serializer.object.OObjectSerializerHelper.multiValueToStream(OObjectSerializerHelper.java:
812)
The value of iType at that point is the enum value EMBEDDED and the
name is "Embedded".
Is there anything I need to do to get my list recognized as such?