Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4270818
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:21:28+00:00 2026-05-21T07:21:28+00:00

My project’s copy contains the following snippet in HibernateGrailsPlugin.groovy : def doWithDynamicMethods = {

  • 0

My project’s copy contains the following snippet in HibernateGrailsPlugin.groovy :

def doWithDynamicMethods = {
        def dynamicMethods = HibernatePluginSupport.doWithDynamicMethods
        dynamicMethods.delegate = delegate
        dynamicMethods.call(it)

        // aids in generating appropriate documentation in plugin.xml since 
        // domain class methods are lazily loaded we initialize them here
        if(plugin.basePlugin) {
            try {
                def clz = application.classLoader.loadClass("org.grails.Behavior")
                clz.count()             
            }
            catch(e) {
                // ignore
            }
        }
    }

I’m new to grails/groovy, but if I understand correctly, this closure is delegating the add/removal of dynamic methods to the doWithDynamicMethods closure of the HibernatePluginSupport class.
It seems the HibernatePluginSupport class is compiled with the rest of grails specific code, if the code for HibernatedPluginSupport lived in my project’s copy of the plugin I could easily customize it to my needs.
My question is, how do I modify the autogenerated methods for specific classes? The only way I see is rewriting the doWithDynamicMethods closure in the groovy file, but I don’t want to do that since I’m only customizing it for some domain classes. More specifically, How do I remove/replace dynamic methods added by the ‘HibernatePluginSupport.doWithDynamicMethods’ closure?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T07:21:29+00:00Added an answer on May 21, 2026 at 7:21 am

    first of all: dynamic finders are based on Groovy’s meta-programming features.

    You should not modify the HibernateGrailsPlugin.groovy. This file is part of the Grails Hibernate plugin and will be overridden when executing certain Grails commands.

    Since you are free to modify your Groovy objects meta-classes at any time from within your application you could

    a) create your own grails plugin that sneaks in custom dynamic finders (with a dependency on the Hibernate Grails plugin) or

    b) throw your meta-class modifications into Bootstrap.groovy to apply them on application startup

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Project A contains a WPF Window (Data Entry Form) with a stack panel of
My project has the following scenario: [Preview View Controller] --(Modal)--> Navigation Controller --(Top)--> [Photo
My project demands and upgrade from groovy 1.7.2 to 1.8.x stable release, there are
Project Euler problem 14: The following iterative sequence is defined for the set of
Project info: WPF, PRISM, C# 4.0, WCF, Entity framework, SQL(express) My database contains several
My project directory contains a CMakeLists.txt file and src and include directories at its
Project was running fine, i made a change some where and couldn't figure out
Project Requirements: I need to build a web service that will receive chunks of
Project a cubic bezier p1,p2,p3,p4 onto the line p1,p4. When p2 or p3 does
Project CompetitionServer.exe raised exception class ESQLiteException with message 'Error executing SQL. Error [1]: SQL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.