-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Will Hibernate 4.2.x or 4.3.x support Java 8 Date & Time?
PostPosted: Sat May 04, 2013 11:49 am 
Newbie

Joined: Mon Oct 15, 2012 11:55 pm
Posts: 2
Java 8 adds a whole new Date & Time API that is a significant improvement over java.util.Date, java.util.Calendar, AND Joda types. It would be fantastic if Hibernate 4.2.x or at least 4.3.x could support these datatypes. Is there a plan in place to make this happen? Doing so could be accomplished (through reflection) without compiling Hibernate against Java 8.

In particular, it would be great to see the following classes supported natively without the user having to do anything other than annotate with @Temporal:

java.time.Instant
java.time.LocalDate
java.time.LocalDateTime
java.time.LocalTime
java.time.OffsetDateTime
java.time.OffsetTime
java.time.ZonedDateTime

Also, it would be great to have some kind of support for these types as well:

java.time.Duration (as a string column or a numeric column)
java.time.Period (as a string column or a numeric column)
java.time.YearMonth (as a string column, or as a year-month column if the dialect supports)
java.time.MonthDay (as a string column, or as a month-day column if the dialect supports)
java.time.ZodeId (as a string column)

Thoughts? Is this already happening?


Top
 Profile  
 
 Post subject: Re: Will Hibernate 4.2.x or 4.3.x support Java 8 Date & Time?
PostPosted: Wed Aug 20, 2014 4:35 pm 
Newbie

Joined: Wed Aug 20, 2014 4:29 pm
Posts: 1
I would also very, very much like this functionality.

There is a Jira to address this: https://hibernate.atlassian.net/browse/HHH-8844.

Vote for that issue if it is important to you.


Top
 Profile  
 
 Post subject: Re: Will Hibernate 4.2.x or 4.3.x support Java 8 Date & Time?
PostPosted: Thu Jul 09, 2015 7:24 am 
Newbie

Joined: Thu Jul 09, 2015 5:34 am
Posts: 1
Hibernate 5.0.0 CR2 supports Java 8 Date & Time with the separate module "hibernate-java8....".

But how do we implement this in a class like this:

@Column(name = "date", length = 29)
@Type(type = "de.programm.classes.ZonedDateTimeUserType")
public ZonedDateTime getDate() {
return this.date;
}

while using java 8 syntax?


Best regards!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.