title: Get reference to domain id in grails audit-logging plugin
body: <p>I'm trying to use grails <code>audit-logging</code> plugin. It seems to do what I need to do.</p>
  
  <p>But, I'm having problem referencing <code>id</code> for a domain class where <code>id</code> is automatically generated. </p>
  
  <pre><code>class Person {
   static auditable = true
  
   String name
   String email
  
  
   def onSave = { newState -&gt;
       println "new person inserted"
  
       // I want to get id of newly inserted person 
       // When I do newState[id], I get null
  
       // newState[name] works as expected
   }
  
  }
  </code></pre>
  
  <p>When I try to reference <code>id</code> as for other attributes, I get <code>null</code>.</p>
  
  <p>How can I get reference to <code>id</code> so that I can get <code>id</code> of newly inserted <code>Person</code> entity?</p>