spring - Applying Jackson annotations on Groovy / Grails / GORM properties to getters instead of fields -


i'm attempting use jackson annotations groovy / grails / gorm.

annotations applied groovy property applied field, not getter.

gorm lazy loads relationship properties default. lazy properties have appropriate default value (null, 0, false, etc.) until object loaded. field access doesn't cause gorm load object; getter access causes unloaded object loaded.

thus, jackson support lazy loaded gorm object, jackson annotations must applied property getters instead of fields.

i not want have set lazy: false relationships, nor want have write explicit getter each property can annotate getter instead of property.

is there:

  1. a way in groovy / grails / gorm associate property annotation getter instead of field
  2. a way in jackson setup access through corresponding getter and/or setter when annotating field
  3. an annotation processor move annotations field corresponding getter and/or setter (i started write one, noticed many potential problems might take while solve, i'd prefer solution other 1 have write myself)
  4. some other solution


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -