title: getting data from datapicker to entity
body: <p>Given this Entity I need to post the new Object of type Contracts. I
  <a href="http://www.springframework.org/tags/form" rel="nofollow noreferrer">http://www.springframework.org/tags/form</a> tag form/sf. I also got jquery datapicker. The problem I have got is datapicker returns a String not Date object. How can it be parsed? The only solution I think will work is to get date from datepicker as @RequestParam in the @Controller class and parse it as a java.util.Date object.</p>
  
  <pre><code>@Entity
  @Table(name = "contract")
  public class Contracts {
      @Id
      @Column(name = "contract_id")
      private int contractId;
      @Column(name = "date_added")
      private Date creationDate;
      @Column(name = "date_start")
      private Date startDate;
      @Column(name = "date_end")
      private Date finishDate;
      @NotNull
      @Column(name = "payment_amount")
      private Integer paymentAmount;
      @Column(name = "payment_type")
      @Enumerated(EnumType.STRING)
      private PaymentType paymentType;
      private boolean valid;
      @ManyToOne
      @JoinColumn(name = "system_id")
      private Systems system;
  </code></pre>
  
  <p>And this is 'POST' part of my Controller class.</p>
  
  <pre><code>@RequestMapping(value = "/createcontract", method = RequestMethod.POST)
  public String createContract(@ModelAttribute("contract") @Valid final Contracts contract, BindingResult results,
          @RequestParam("system-id") int systemId) {
      if(results.hasErrors())
          return "newcontract";
      return "redirect:contracts";
  </code></pre>
  
  <p>Another question (because I tagged postgresql) is whether is 'all-right' to store java.util.Data object in postgresql as just date or maybe I should store it as 'timestamp with time zone'?</p>