How to exclude fields to be serialized

43 views
Skip to first unread message

Andrea Palmatè

unread,
Sep 16, 2015, 6:52:17 AM9/16/15
to Granite Data Services Forum
Hello,
i'm really getting crazy..
I need to avoid to serialize some fields of my class because there is a field that is a Connection field and when the getter is invoked i receive an error because the connection is closed.
By the way, i've added "transient" to fields i don't want to send to Flash client during the remote call. I've also added @Exclude annotation to those fields.
I've used the EclipseLinkClassGetter

<class-getter type="org.granite.eclipselink.EclipseLinkClassGetter"/>

in the granite-config.xml

But without success. All fields are serialized to the response..
What i'm doing wrong?

Andrea

Erguder Bekrek

unread,
Sep 16, 2015, 7:12:25 AM9/16/15
to gran...@googlegroups.com
Look at the @Transient annotation in JPA

--

---
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "Granite Data Services Forum".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse graniteds+...@googlegroups.com.
Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.



--
Erguder Bekrek

Développeur Flash/Flex ActionScript 2.0/3.0
514.728.5708
erguder...@gmail.com

Andrea Palmatè

unread,
Sep 16, 2015, 7:47:03 AM9/16/15
to Granite Data Services Forum
No way.. :(
The only solution i've found now is using Gson to clone an event that is getting correctly the fields and recreate the object.. :-/

Mercoledì 16 settembre 2015 Il giorno 01:12:25 GMT + 2 deGaia ha scritto:
Guardate theTransient annotazione JPA

E 'Mer, 16 Settembre, 2015 alle 00:52 Andrea palmate <andrea .... @ gmail.com> ha scritto:
Ciao,
davvero impazzendo sto ..
Ho bisogno di serializzare per EVITARE ALCUNI campi di campo classe del mio arroccato C'è CONNESSIONE Una Che E E QUANDO un campo getter VIENE richiamato Ricevo un Errore appollaiato il CONNESSIONE E chiusa.
Tra l'altro, ho aggiunto "transitorio" per i campi io non voglio INVIARE al Chiamata Flash client remoto Durante. Ho aggiunto annotazione aussiExclude ha Settori Tali.
Ho Usato esso EclipseLinkClassGetter

<class tipo di-getter = "org.granite.eclipselink. EclipseLinkClassGetter" />

granito-config.xml nel

Obiettivo Successo senza. Tutti i campi sono serializzato per la Risposta ..
Che cosa sto Facendo maschile?

Andrea

-. --- Ricevuto this Messaggio Hai arroccato sei iscritto al gruppo Google Gruppi "Granito Forum Servizi dati" Per annullare l'iscrizione a this gruppo di posta non Ricevere Messaggi posta elettronica di lui INVIARE E-mail Una affrontare sapeva GraniteDS + ... @ googlegroups.com. Per Altre Opzioni, Vedere pagina https://groups.google.com/d/ optout.









-
Erguder Bekrek Sviluppatore Flash / Flex di ActionScript 2.0 / 3.0 514.728.5708 Erguder ... @ gmail.com




Erguder Bekrek

unread,
Sep 16, 2015, 8:08:07 AM9/16/15
to gran...@googlegroups.com
I'm sorry there is another annotation @Exclude

--

---
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "Granite Data Services Forum".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse graniteds+...@googlegroups.com.
Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.

Andrea Palmatè

unread,
Sep 16, 2015, 8:14:22 AM9/16/15
to Granite Data Services Forum
Yes,
it is the first one i've used. I've also tried to put @IgnoreMethod on getters and setters but with no luck...

Osman Ullah

unread,
Oct 13, 2015, 1:13:12 PM10/13/15
to Granite Data Services Forum
Did you try the @Transient annotation?
Reply all
Reply to author
Forward
0 new messages