title: How to insert java.util.Date values into Cassandra date type column using Spring Data Cassandra?
body: <p>I have cassandra table with a date type column as follows:</p>
  
  <pre><code>create table people
  (
     id int primary key, 
     name text, 
     email text, 
     dob date
  );
  </code></pre>
  
  <p>I am using SpringBoot 1.5.2 + Spring Data Cassandra Starter.</p>
  
  <pre><code>@Table("people")
  public class Person {
      @PrimaryKey
      Integer id;
      private String name;
      private String email;
      private java.util.Date dob;
      //setters and getters
  }
  
  public interface PersonRepository extends CrudRepository&lt;Person, Integer&gt;{
  
  }
  </code></pre>
  
  <p>I am inserting new Person as follows:</p>
  
  <pre><code>personRepository.save(new Person(1, "Siva","siva@gmail.com", new java.util.Date()));
  </code></pre>
  
  <p>It is throwing the following error:</p>
  
  <pre><code>Caused by: com.datastax.driver.core.exceptions.InvalidQueryException: Expected 4 byte long for date (8)
      at com.datastax.driver.core.Responses$Error.asException(Responses.java:136) ~[cassandra-driver-core-3.1.4.jar:na]
      at com.datastax.driver.core.DefaultResultSetFuture.onSet(DefaultResultSetFuture.java:179) ~[cassandra-driver-core-3.1.4.jar:na]
      at com.datastax.driver.core.RequestHandler.setFinalResult(RequestHandler.java:177) ~[cassandra-driver-core-3.1.4.jar:na]
      at com.datastax.driver.core.RequestHandler.access$2500(RequestHandler.java:46) ~[cassandra-driver-core-3.1.4.jar:na]
  </code></pre>
  
  <p>But if I make <strong>dob</strong> column type to <strong>timestamp</strong> then it is working fine. Is it possible to have <strong>date</strong> type column and use <strong>java.util.Date</strong> type properties?</p>
  
  <p>P.s: Even if I use java.sql.Date I am getting the same error.</p>