List of all domain classes in BootStrap

阅读更多

import org.codehaus.groovy.grails.commons.ApplicationHolder

class BootStrap {

    def init = {servletContext ->
        ApplicationHolder.application.domainClasses.each() {
            println it.fullName // full name with package
            println it.name // simple class name

            it.metaClass.delete = {->
                throw new RuntimeException("Don't delete!")
            }


        }

 

http://www.nabble.com/List-of-all-domain-classes-td16243551.html#a16243801

http://www.nabble.com/flag-for-deletion-%28how-do-I-do-that%29-td13556641.html#a13561051

http://www.nabble.com/before-after-interceptor-for-domain-class-td10028732.html#a10032495

你可能感兴趣的:(Grails,Groovy,HTML)