Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@Version Support for Temporal Types #81

Closed
lukasj opened this issue May 22, 2014 · 6 comments · Fixed by #450
Closed

@Version Support for Temporal Types #81

lukasj opened this issue May 22, 2014 · 6 comments · Fixed by #450

Comments

@lukasj
Copy link
Contributor

lukasj commented May 22, 2014

The JPA 2.1 specification currently indicates that Timestamp is the only supported temporal type for @Version properties:

The following types are supported for version properties: int, Integer, short, Short, long, Long, Timestamp.

I'd propose that additional temporal types are supported as well:

java.util.Date, java.util.Calendar, java.sql.Date, java.sql.Time, java.sql.Timestamp

@lukasj
Copy link
Contributor Author

lukasj commented May 22, 2014

@glassfishrobot Commented
Reported by shelleyb

@lukasj
Copy link
Contributor Author

lukasj commented May 22, 2014

@glassfishrobot Commented
shelleyb said:
For reference, Hibernate already seems to support this, and as such, we had initially overlooked this jpa limitation and are already using @Version java.util.Calendar in our entities, and I have observed this usage elsewhere as well:

https://docs.jboss.org/hibernate/orm/4.3/manual/en-US/html/ch05.html#mapping-declaration-timestamp

@lukasj
Copy link
Contributor Author

lukasj commented May 5, 2017

@glassfishrobot Commented
This issue was imported from java.net JIRA JPA_SPEC-81

@lukasj
Copy link
Contributor Author

lukasj commented Aug 31, 2018

@andyjefferson
Copy link

FWIW java.time.Instant would be a much more useful addition here.

@gavinking
Copy link
Contributor

In #450 I propose adding LocaDateTime and Instant. We don't need to add the other date/time types mentioned above, since they're being deprecated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants