title: grails using uuid as id and mapping to to binary column
body: <p>I want to use a UUID for the id for my domain objects. The idea is that the uuid could be provided by a client and if not a UUID will be generated. I have the definition as like so :  : </p>
  
  <pre><code>class Person {
          static mapping = {
          id generator:'assigned' 
          }
  
          String id
  
          def getUUID  ={
              return java.util.UUID.randomUUID().toString();
          }
  
  
            transient beforeInsert = {
              if ( id == null || id.equals(""))
                        id = getUUID();
             }
  }
  </code></pre>
  
  <p>Now assuming I strip the dashes out that are included in the java UUID or client provided UUID  I'd like this to be stored in a binary field in my MySQL database. And also on retrieval have the correct format to send back. </p>
  
  <p>How can I accomplish that? Thoughts on a better way to do this?</p>