Hi.
A question about embedded attribute update
let's assume a have 2 classes
val city = db.getMetadata.getSchema.createClass("City")
city.createProperty("name",OType.STRING)
city.createProperty("country",OType.STRING)
val person = db.getMetadata.getSchema.createClass("Person")
person.createProperty("name",OType.STRING)
person.createProperty("location",OType.EMBEDDEDSET,city)
let's insert city document into person document
val cdoc: ODocument = new
ODocument("City").field("name","Odessa").field("name","Ukraine")
val cds = new java.util.HashSet[ODocument]()
cds.add(cdoc)
val pdoc = new
ODocument("Person").field("name","Mary").field("location",cds)
pdoc.save()
now when quering select expand(location) from Person we see
@class name country
City Odessa Ukraine
so far so good
let's try to do the same action with OCommandSQL
val sql = s"update Person add location = '$cdoc'"
val q = new OCommandSQL(sql)
db.command(q).execute()
now when quering select expand(location) from Person we see
@class value
null City{name:Odessa,country:Ukraine}
Where is my mistake and what is needed to be changed to see previous result
Thank you
--
---
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 [email protected].
For more options, visit https://groups.google.com/d/optout.