title: StaleStateException: Hibernate tries update instead of insert?
body: <p>I've got the following domain mapped to a mysql-database:</p>
  
  <pre><code>class User {
    String username
    String passwordHash 
  
  static mapping={
      table 'team'
      version false
      passwordHash column: 'Password' 
      id column: 'username', name: 'username'
     }
  }
  </code></pre>
  
  <p>When trying to execute the save() of an instance, hibernate always executes this query:</p>
  
  <blockquote>
    <p>Hibernate: update team set Password=? where username=?</p>
  </blockquote>
  
  <p>calling of save():</p>
  
  <pre><code>def save(){
     def userInstance = new User()
     userInstance.username = "test"
     userInstance.passwordHash = "abcd"
     if(!userInstance.save(flush:true)){
         //
     }
  }
  </code></pre>
  
  <p>I already tried to change flush:true to insert:true. No effect.</p>