Java exception when using @CreationTimestamp or @UpdateTimestamp annotation in Embeddable

Description

When I use the @CreationTimestamp or @UpdateTimestamp in an embeddable java throws exception:

javax.persistence.PersistenceException: Unable to build Hibernate SessionFactory

…which is caused by:
Caused by: org.hibernate.cfg.NotYetImplementedException: Still need to wire in composite in-memory value generation

I’ve tried with both Hibernate ORM 5.1, 5.2, and 5.3 with the same results. Does anybody know if this is a reported bug or are those annotations not supported?

Attachments

1
  • 29 Jan 2019, 08:38 AM

Activity

Show:

Christian Beikov October 23, 2023 at 2:31 PM

Closing this as the issue is most likely out of date already as generators have been completely reworked in Hibernate ORM 6. If this is still an issue for you, please create a new Jira and attach a test case working against the latest Hibernate ORM version that reproduces the problem.

Ganapathi Basimsetti March 29, 2019 at 7:12 PM

Sure, Vlad. I will go a little deeper and come back with an analysis.

Vlad Mihalcea March 29, 2019 at 6:53 PM

I'm not sure whether it's easy to implement. You should try it anyway as it's going to be a very useful experience anyway.

Ganapathi Basimsetti March 29, 2019 at 12:18 PM

Hi Vlad,

I too got the same exception and the usage is also the same. I am looking at the EntityMetaModel class where the exception is occurring. I want to work on this one if someone else is not working. I consider myself a beginner in Hibernate, so do you think this can be done by a beginner?

Vlad Mihalcea January 29, 2019 at 5:39 PM

Thanks. You could also try to implement it if it’s urgent to you.

Otherwise, you could use @PrePersist and @PreUpdate to emulate the @CreationTimestamp and @UpdateTimestamp behavior. Check out this article for more details.

Out of Date

Details

Assignee

Reporter

Labels

Components

Sprint

Affects versions

Priority

Created January 29, 2019 at 8:42 AM
Updated October 23, 2023 at 2:31 PM
Resolved October 23, 2023 at 2:31 PM