title: Java: JPA classes, refactoring from Date to DateTime
body: <p>With a table created using this SQL</p>
  
  <pre><code>Create Table X (
      ID varchar(4) Not Null,
      XDATE date
  );
  </code></pre>
  
  <p>and an entity class defined like so</p>
  
  <pre><code>@Entity
  @Table(name = "X")
  public class X implements Serializable {
      @Id
      @Basic(optional = false)
      @Column(name = "ID", nullable = false, length = 4)
      private String id;
      @Column(name = "XDATE")
      @Temporal(TemporalType.DATE)
      private Date xDate; //java.util.Date
      ...
  }
  </code></pre>
  
  <p>With the above, I can use JPA to achieve object relational mapping. However, the <code>xDate</code> attribute can only store dates, e.g. <code>dd/MM/yyyy</code>.</p>
  
  <p>How do I refactor the above to store a full date object using just one field, i.e. <code>dd/MM/yyyy HH24:mm</code>?</p>