Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Hibernate Hibernate4 temporal hibernate

Related Tutorials


 
 

Share on Google+Share on Google+

temporal hibernate

Advertisement
In this section you will learn about annotation temporal in hibernate.

temporal hibernate

In this section you will learn about annotation temporal in hibernate.

The temporal data is the data related to time. For example, in a content management system, the creation-date and last-updated date of an article are temporal data. In some cases, temporal data needs precision and you want to store precise date / time or both(TIMESTAMP) in database table.

The temporal  precision is not specified in core Java APIs. @Temporal is a JPA annotation that convert back and forth between time-stamp and java util date. It also convert time-stamp into time. For example, in below snippet , ?@Temporal(TemporalType.DATE)? drops the time value and only preserves the date :

@Temporal(TemporalType.DATE)
@Column(name=?CREATION_DATE?)
private java.util.Date date;

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: May 18, 2012

Related Tutorials

Discuss: temporal hibernate  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com