title: grails command object data binding of id field
body: <p>When using command objects it seems I do not get automatic binding of the id field</p>
  
  <pre><code>class somethingCommand {
  
   int id
   String A
   String B
  
   // some methods here like Domain.get(id)
  
  }
  </code></pre>
  
  <p>My A and B string get auto-magically data binded from the form properties but not id. The other "hidden fields" of grails like version, dateCreated or lastUpdated also get binded correctly.</p>
  
  <p>My current patched solution is the following:
  I resort to defining another hidden id field in my form </p>
  
  <pre><code>&lt;g:hiddenField name="blogId" value="${blog?.id}"/&gt;
  </code></pre>
  
  <p>And rename id to blogId in the command obect and that works.</p>
  
  <p>This does not seem to be in line with the elegance of Grails. What am I missing in the data binding rules of Command object vs controller?</p>