Search code examples
persistencepojograils-2.0

grails: marking field transient when domain class is a persistence annotated POJO


I have a persistence annotated POJO for a domain class and all works great, but I can'f figure out how to make one of the fields transient. The examples I've seen and the field to transients right in the class. Can this be done in the controller instead? Thanks.


Solution

  • Turns out I had to annotate the field in POJO itself:

    @Transient
    String someString;
    // getters, setters, etc. omitted for brevity