开发者

Timestamp in Hibernate

I'm quite fresh in Hibernate, I just have run my first project with Hibernate.

But I want to insert some data in my Postgres DB, one of the column is operationtime TIMESTAMP WITH TIME ZONE , while I was doing this with Postgres I was using current_timestamp(0) to insert date. Wondering how to pr开发者_JAVA百科oceed in hibernate in order to insert date. How to do the map in my map XML file.

For example:

  <property name="time" type="java.util.Date">
    <column name="operationtime"/>
  </property>

I did some research but I wasn't able to find what I want, probably I'm missing something regarding date types in Hibernate. Any advice is welcome.


This code shows how to map a date/timestamp and to persist it. Have a look

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜