title: Pull domain mapping in bootstrap and modify it Grails
body: <p>I am currently using Grails-2.2.4, I would like to modify the behaviour of my domain mapping from bootstrap to alter the dateCreated Field to custom date. While trying to pull the mapping of domain to modify the autotimestamp behaviour, the GrailsDomainBinder.getMapping is returning null. Am I missing something, here is my code</p>
  
  <pre><code>grailsApplication.domainClasses.each { gdc -&gt;
          def domClass = gdc.clazz
          def grailsSave = domClass.metaClass.pickMethod('save', [Map] as Class[])
  
          domClass.metaClass.save = { Map params -&gt;
  
              def m = GrailsDomainBinder.getMapping(domClass.class)
              println("The mapping ===&gt;&gt;&gt;$m") /* **this gives Null**   */
              m.autoTimestamp = false
              def colList = []
              domClass.declaredFields.each{
                  if(!it.synthetic)
                      colList.add(it.name.toString())
              }
              if(colList.contains("dateCreated")) {
                  println(domClass.metaClass.getProperty(delegate,"dateCreated"));
                  domClass.metaClass.setProperty(delegate,"dateCreated",new Date("11/5/1990"))
                  grailsSave.invoke(delegate, [params] as Object[])
              }
  
              //...
          }
      }
  </code></pre>
  
  <p>I am getting an error </p>
  
  <pre><code>Cannot set property 'autoTimestamp' on null object
  </code></pre>