title: Cassandra says "InvalidQueryException: Invalid version for TimeUUID type" when saving java.util.UUID
body: <p>I'm trying to save <code>java.util.UUID</code> to Cassandra column of type <code>timeuuid</code>. For example, that is a default spring-data-cassandra mapping: <a href="http://docs.spring.io/spring-data/cassandra/docs/current/reference/html/#mapping-conversion" rel="nofollow noreferrer">http://docs.spring.io/spring-data/cassandra/docs/current/reference/html/#mapping-conversion</a> . 
  Value of UUID is generated by <code>java.util.UUID#randomUUID()</code>
  I get an exception:
  <code>"com.datastax.driver.core.exceptions.InvalidQueryException: Invalid version for TimeUUID type"</code></p>
  
  <p>Studying code at <a href="https://svn.apache.org/repos/asf/cassandra/trunk/src/java/org/apache/cassandra/db/marshal/TimeUUIDType.java" rel="nofollow noreferrer">https://svn.apache.org/repos/asf/cassandra/trunk/src/java/org/apache/cassandra/db/marshal/TimeUUIDType.java</a> reveals the reason:</p>
  
  <pre><code>    @Override
      public void validate(byte[] bytes)
      {
          if (bytes.length != 16 &amp;&amp; bytes.length != 0)
              throw new MarshalException(String.format("TimeUUID should be 16 or 0 bytes (%d)", bytes.length));
          // version is bits 4-7 of byte 6.
          if (bytes.length &gt; 0)
              if ((bytes[6] &amp; 0xf0) != 0x10)
                  throw new MarshalException("Invalid version for TimeUUID type.");
      }
  </code></pre>