Paarek
2018-07-10 23:22:53 UTC
Hi! I am using OrientDB3.0.2 and need to use embeddedList (or embeddedSet)
I tried following but does not work, not sure why. Any help is much
appreciated.
--------------
Schema:
create class Phone EXTENDS V
create property Phone.number String
create class Profile EXTENDS V
create property Profile.name String
create property Profile.phone embeddedList Phone
--------------
CREATE VERTEX Profile CONTENT { "name" : "John", "phone" : {"@type":"d",
"number" : "212" }}
CREATE VERTEX Profile SET name = "John", phone = { "@type":"d", "number" :
"212" }
INSERT INTO Profile (name, phone) VALUES ("John", { "@type": "d", "number":
"212", "@version": 0 })
Results In:
Error: com.orientechnologies.orient.core.exception.OValidationException:
The field 'Profile.phone' has been declared as EMBEDDEDLIST but an
incompatible type is used. Value: 212
-- But following Works because profile has no address property --
INSERT INTO Profile (name, address) VALUES ('John', { "@type": "d",
"number": "212", "@version": 0 })
--------------
I tried the same with Java but also getting exception as follows:
com.orientechnologies.orient.core.exception.OValidationException: The field
'Profile.phone' has been declared as EMBEDDEDLIST but an incompatible type
is used.
at
com.orientechnologies.orient.core.record.impl.ODocument.validateEmbedded(ODocument.java:814)
at
com.orientechnologies.orient.core.record.impl.ODocument.validateField(ODocument.java:601)
at
com.orientechnologies.orient.core.record.impl.ODocument.validate(ODocument.java:2364)
at
com.orientechnologies.orient.core.db.document.ODatabaseDocumentAbstract.saveInternal(ODatabaseDocumentAbstract.java:2039)
at
com.orientechnologies.orient.core.db.document.ODatabaseDocumentAbstract.save(ODatabaseDocumentAbstract.java:2019)
at
com.orientechnologies.orient.core.db.document.ODatabaseDocumentAbstract.save(ODatabaseDocumentAbstract.java:84)
at
com.orientechnologies.orient.core.record.impl.ODocument.save(ODocument.java:2108)
at
com.orientechnologies.orient.core.record.impl.ODocument.save(ODocument.java:2099)
at
com.orientechnologies.orient.core.record.impl.ODocument.save(ODocument.java:63)
at
com.sqad.repository.OrientDBOperationsImpl.updateVertexProperty(OrientDBOperationsImpl.java:330)
I tried following but does not work, not sure why. Any help is much
appreciated.
--------------
Schema:
create class Phone EXTENDS V
create property Phone.number String
create class Profile EXTENDS V
create property Profile.name String
create property Profile.phone embeddedList Phone
--------------
CREATE VERTEX Profile CONTENT { "name" : "John", "phone" : {"@type":"d",
"number" : "212" }}
CREATE VERTEX Profile SET name = "John", phone = { "@type":"d", "number" :
"212" }
INSERT INTO Profile (name, phone) VALUES ("John", { "@type": "d", "number":
"212", "@version": 0 })
Results In:
Error: com.orientechnologies.orient.core.exception.OValidationException:
The field 'Profile.phone' has been declared as EMBEDDEDLIST but an
incompatible type is used. Value: 212
-- But following Works because profile has no address property --
INSERT INTO Profile (name, address) VALUES ('John', { "@type": "d",
"number": "212", "@version": 0 })
--------------
I tried the same with Java but also getting exception as follows:
com.orientechnologies.orient.core.exception.OValidationException: The field
'Profile.phone' has been declared as EMBEDDEDLIST but an incompatible type
is used.
at
com.orientechnologies.orient.core.record.impl.ODocument.validateEmbedded(ODocument.java:814)
at
com.orientechnologies.orient.core.record.impl.ODocument.validateField(ODocument.java:601)
at
com.orientechnologies.orient.core.record.impl.ODocument.validate(ODocument.java:2364)
at
com.orientechnologies.orient.core.db.document.ODatabaseDocumentAbstract.saveInternal(ODatabaseDocumentAbstract.java:2039)
at
com.orientechnologies.orient.core.db.document.ODatabaseDocumentAbstract.save(ODatabaseDocumentAbstract.java:2019)
at
com.orientechnologies.orient.core.db.document.ODatabaseDocumentAbstract.save(ODatabaseDocumentAbstract.java:84)
at
com.orientechnologies.orient.core.record.impl.ODocument.save(ODocument.java:2108)
at
com.orientechnologies.orient.core.record.impl.ODocument.save(ODocument.java:2099)
at
com.orientechnologies.orient.core.record.impl.ODocument.save(ODocument.java:63)
at
com.sqad.repository.OrientDBOperationsImpl.updateVertexProperty(OrientDBOperationsImpl.java:330)
--
---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-database+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-database+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.