title: mysql datetime mapped to JPA Temporal.Type TIMESTAMP. Getting only date, no time in JSON response
body: <p>Here is scenario.</p>
  
  <p>I have a JPA entity class with the field <br></p>
  
  <blockquote>
    <p><code>@Temporal(TemporalType.TIMESTAMP)</code><br>
    <code>@Column(name = "CREATED_DATE", length = 19)</code><br>
    <code>private Date createdDate = null;</code><br></p>
  </blockquote>
  
  <p>And this field is mapped to a column CREATED_DATE with the type <code>datetime</code> (i am using mysql) in a Table. <br>
  When I <code>select</code> the rows of the table, CREATED_DATE column shows the Date and Time both. When I fetch the row data using <code>query.getSingleResult</code>  and typecast the returned object to the Entity class, the <code>createdDate</code> field of the entity class also has both Date and Time :  <br></p>
  
  <pre><code>request = (MyEntityClass) query.getSingleResult();&lt;br&gt;
  System.out.println(request.getCreatedDate());
  </code></pre>
  
  <p>prints <code>2012-05-18 06:32:57.0</code> in the catalina.out log.</p>
  
  <p><br></p>
  
  <p>Now I am sending this Entity Class object to a particular client request as a Json object. The Json response the client receives though, when printed, does not show date time, it shows only date:<br></p>
  
  <pre><code>ClientResponse&lt;String&gt; response = clientRequest.get(String.class);
  System.out.println("Response getResource ::"+response.getStatus()+"::"+response.getEntity());
  </code></pre>
  
  <p>console output: <br>
  <code>Response getResource ::200::[{ ....... ,"createdDate":"18-05-2012", ......}]</code><br>
  I am using RestEasy Json api at the server side.<br></p>
  
  <p>I have seen a similar question ( <a href="https://stackoverflow.com/questions/6347532/jpa-entity-get-the-hours-minutes-and-sec-from-oracle-date-column">similar SO post</a>) in SO, but the answer discussed there doesn't seem to work with me. </p>
  
  <p>Please help.</p>