I have a JPA entity with a method named getXXX which flexjson assumes is a normal getter (though there's no setter and the getXXX method is annotated with @Transient) and which gets called when flexjson tries to serialize the JPA entity.
Is there a way to tell flexjson to exclude getters annotated with an annotation?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry I didn't see this post before now. I didn't get notified it had been made.
Yes you can use the @JSON(include=false) annotation on any getter/setter/field and flexjson will always exclude it. If you want to include it later you can override that using the include() method. But Flexjson doesn't pay attention to the @Transient notation right now.
Charlie
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It's been in there for a very long time. The website docs are a little behind due a misplaced ssh key. However, the docs in the zip file do discuss the feature so there has been docs out there, but just not on the website I'm afraid.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello
I have a JPA entity with a method named getXXX which flexjson assumes is a normal getter (though there's no setter and the getXXX method is annotated with @Transient) and which gets called when flexjson tries to serialize the JPA entity.
Is there a way to tell flexjson to exclude getters annotated with an annotation?
Sorry I didn't see this post before now. I didn't get notified it had been made.
Yes you can use the @JSON(include=false) annotation on any getter/setter/field and flexjson will always exclude it. If you want to include it later you can override that using the include() method. But Flexjson doesn't pay attention to the @Transient notation right now.
Charlie
wow, that is a great feature, i've been missing this for like 2 years, is this in the documentation some where?
It's been in there for a very long time. The website docs are a little behind due a misplaced ssh key. However, the docs in the zip file do discuss the feature so there has been docs out there, but just not on the website I'm afraid.