Possible to change fetch type of java entity with MOP ?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Possible to change fetch type of java entity with MOP ?

366388

Hi,

Im reusing a prepackaged jar containing a hibernate jave entity model..

long story short, but a plugin im using is not recognizing the default lazy fetch type associated properties in some entities, so my question is this:

Can I change the association fetch type (of an entity in the imported java lib jar) via MOP/meta class in the bootstrap of my Grails app?

I know I can manipulate fetch type at query time but the plugin im using hides all the querying so I prefer to change fetch type once at startup if possible..

e.g. i would like to change fetch type of this association via mop without having to touch this java class directly..

    @OneToOne
    @JoinTable(
    name = "ql_user_category_item",
    joinColumns = [@JoinColumn(name = "itemId")],
    inverseJoinColumns = [@JoinColumn(name = "userId")]
    )
    UserNew user

thanks