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

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?

Make sure you must be used over Date or Calendar object

you may be used for the Long object.

if you use


Date createTime


Date updateTime

If you can replicate it with this test case templates, you should open a Jira issue.

I’m using the Calendar object as shown below.

@Column(insertable = false, updatable = false, nullable = false)
private java.util.Calendar createdOn;

@Column(insertable = false, updatable = false, nullable = false)
private java.util.Calendar updatedOn;

You can use the @CreationTimestamp and @UpdateTimestamp with the following attribute types:
java.time.LocalDate (since Hibernate 5.2.3)
java.time.LocalDateTime (since Hibernate 5.2.3)

public class MyEntity {

@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = “id”, updatable = false, nullable = false)
private Long id;

private String value;

private LocalDateTime createDateTime;

private LocalDateTime updateDateTime;



It seems to work if you do not embed it. But in my case the @CreationTimestamp and @UpdateTimestamp is in an embeddable and this is where I get the java exception mentioned. Have you tried it recently in an embedded and has it worked for you?

Sound like a bug. You should add a Jira issue for this and provide a replicating test case.

Hi Valad,

Is this issue resolved.
is resolved then in which version it will be applicable.

Please confirm.

It’s only an issue if there’s a replicating test case. If you can replicate it, then you should open a Jira issue.


I created jira issue with issue Id=HHH-13235 and URL=

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.