Pefect!

Thank you, I solve it!

Il giorno martedì 28 ottobre 2014 18:04:43 UTC+1, Lvc@ ha scritto:
>
> Hi Stefano,
> Use the .include() function for this purpose.
>
> Lvc@
>
>
> On 28 October 2014 17:49, Stefano Levante <[email protected] 
> <javascript:>> wrote:
>
>> Hi Lvc@!
>>
>> Thank you for the reply!
>>
>> That's perfect and I'm trying to use it, I've only a problem ...
>>
>> I created that class "Utente" with a property "Id" and the attribute 
>> "[JsonProperty("@rid")]" because when I retrieve the JSON of an object 
>> "Utente" from the http protocol (e.g. the response of a Document Update) I 
>> serialize the JSON immediately inside the class having the property "@rid" 
>> of the JSON directly connected with the property "Id" of my local class 
>> "Utente", so I get correctly the RID inside the new object ...
>>
>> the problem of serializing the response of the GET call into the class is 
>> that it'll continue to get the wrong value in @rid and not the correct 
>> value that I put e.g. in the property "rid":
>> SELECT @rid as rid , Nome, Cognome, Immagine, Ruoli FROM Utente WHERE 
>> Nome.toUpperCase() like '%ST%'
>>
>> with this query the correct RID is in the property "rid", but the 
>> serialization from the returned JSON into the class "Utente" will always 
>> put the value of "@rid" into "Id" because of the JsonProperty I defined.
>>
>> Thank you again,
>> Stefano Sega
>>
>> Il giorno martedì 28 ottobre 2014 16:42:00 UTC+1, Lvc@ ha scritto:
>>>
>>> When you use projection, you loose the original RID, because the 
>>> returning document is a projection made by part of one or more records. If 
>>> you want to retrieve it you could:
>>> - use @this.include() function (look at the documentation)
>>> - use @this.exclude() function (look at the documentation)
>>> - put @rid in projection. Example: select @rid as rid from ...
>>>
>>> Lvc@
>>>
>>>
>>> On 28 October 2014 16:26, Stefano Levante <[email protected]> wrote:
>>>
>>>> ... also, dunno if it's related but when I try to get the document with 
>>>> this GET call (the url is correctly encoded for special chars):
>>>> query/DBName/sql/SELECT Utente.@type, Utente.@rid, Utente.@version, 
>>>> Utente.@class, Utente.Nome, Utente.Cognome, Utente.Ruoli FROM Utente
>>>>
>>>> ... it return me the correct class "Utente" with all the datas but the 
>>>> RID value is "#-2:1" while in the DB the correct RID value is "#10:2019 
>>>> <http://localhost:2480/studio/index.html#/database/Test/browse/edit/10:2019>
>>>> ".
>>>>
>>>> Thank you again
>>>>
>>>> -- 
>>>>
>>>> --- 
>>>> 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.
>>>>
>>>
>>>  -- 
>>
>> --- 
>> 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] <javascript:>.
>> 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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to