How to map postgresql “timestamp with time zone” in a JPA 2 entity

前端 未结 2 1108
情深已故
情深已故 2020-12-29 20:32

I have a JPA 2 application ( with Hibernate 3.6 as the JPA implementation ) that uses Postgresql ( with the 9.0-801.jdbc3 JDBC driver ).

I am having trouble mapping

2条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-29 20:58

    Add @Column(columnDefinition= "TIMESTAMP WITH TIME ZONE")

    @Column(name = "run_from", columnDefinition= "TIMESTAMP WITH TIME ZONE")
    @NotNull
    @Temporal(TemporalType.TIMESTAMP)
    private Date runFrom;
    

提交回复
热议问题