title: How can I override the 'map' constructor in a Grails domain class?
body: <p>I need to perform some initialization when new instances of my domain class are created.</p>
  
  <pre><code>class ActivationToken {
      String foo
      String bar
  }
  </code></pre>
  
  <p>When I do this I want bar to be initialized by code inside ActivationToken: </p>
  
  <pre><code>def tok = new ActivationToken(foo:'a')
  </code></pre>
  
  <p>I cannot see how to 'override' the 'constructor' to make this happen. I know in this case I could just add a normal constructor but this is just a simple example.</p>