title: Getting java.lang.Byte cannot be cast to [B when trying to update a domain object
body: <p>Using Grails, I have defined a domain class that looks like this:</p>
  
  <pre><code>class User implements Serializable {
      .
      .
      .
      int id
      byte [] password_Salt
      .
      .
      .
  }
  </code></pre>
  
  <p>When I retrieve an instance of this, the "password_Salt" property is populated correctly.</p>
  
  <p>However, I want to update just that field, so I am using the following:</p>
  
  <pre><code>def valuesMap = [:]
  valuesMap['salt'] = new byte [] { .... };
  valuesMap['userId'] = ....
  User.executeUpdate("update User set password_Salt=:salt where id=:userId", valuesMap)
  </code></pre>
  
  <p>but I get Grails runtime exception "java.lang.Byte cannot be cast to [B"</p>
  
  <p>I'm sure there must be an obvious solution, but I've been looking at this for hours.</p>
  
  <p>Thanks,</p>
  
  <p>Carl</p>