Hallo,

I'm new to OrientDB and, despite I've used it intensely for just few days, 
I was able to do most of the basic operations via http protocol and I found 
the product fantastic!

Right now I'm trying with a class that has a linkset to another class as a 
property, the classes are like:

class Utente/* : LevanteSync */
    {
        [JsonProperty("@type")]
        public String Type { get; set; }
        [JsonProperty("@rid")]
        public String Id { get; set; }
        [JsonProperty("@version")]
        public Int32 Version { get; set; }
        [JsonProperty("@class")]
        public String Class { get; set; }

        [JsonProperty("Nome")]
        public String Nome { get; set; }
        [JsonProperty("Cognome")]
        public String Cognome { get; set; }
        [JsonProperty("Immagine")]
        public Byte[] Immagine { get; set; }
        [JsonProperty("Ruoli")]
        public List<Ruolo> Ruoli { get; set; }

        public Utente()
        {
            Id = "";
            Type = "d";
            Class = "Utente";
            Ruoli = new List<Ruolo>();
        }
    }

    class Ruolo
    {
        [JsonProperty("@type")]
        public String Type { get; set; }
        [JsonProperty("@rid")]
        public String Id { get; set; }
        [JsonProperty("@version")]
        public Int32 Version { get; set; }
        [JsonProperty("@class")]
        public String Class { get; set; }

        [JsonProperty("Descrizione")]
        public String Descrizione { get; set; }

        public Ruolo()
        {
            Id = "";
            Type = "d";
            Class = "Ruolo";
        }
    }

... so basically the class "Utente" contains a LinkSet to the class 
"Ruolo", and so a document of type "Utente" can have 0 to N objects of type 
"Ruolo".

Im trying to insert a new record with this call:
- method: POST
- url: document/DBName
- post content:
{
  "@type": "d",
  "@rid": "",
  "@version": 0,
  "@class": "Utente",
  "Nome": "Stefano",
  "Cognome": "Levante",
  "Immagine": null,
  "Ruoli": [
    {
      "@type": "d",
      "@rid": "#-2:1",
      "@version": 0,
      "@class": "Ruolo",
      "Descrizione": "Utente"
    }
  ]
}


... it seems correct to me, but when I execute it and call the http 
protocol the server replies:
"2014-10-28 15:15:59:180 SEVE Internal server error:
java.lang.ArrayIndexOutOfBoundsException: -2 [ONetworkProtocolHttpDb]"

What is wrong with it?

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.

Reply via email to