Skip to content

@CreationTimestamp and @UpdateTimestamp with the same value after persistAndFlush #39016

@hugo-testslick

Description

@hugo-testslick

Describe the bug

Hi,

I'm using quarkus-hibernate-reactive-panache v3.6.4

After updating an entity both createdAt and updatedAt are returned with the the updatedAt value. However, createdAt is not being persisted to the database. When I list the records from the database the results are returned correctly. I'm using the same DTO object for both operations.

@Column(name = "created_at", updatable = false, nullable = false)
@CreationTimestamp
public LocalDateTime createdAt;

@Column(name = "updated_at", nullable = false)
@UpdateTimestamp
public LocalDateTime updatedAt;

Expected behavior

createdAt keeps the original value.

Actual behavior

createdAt is getting updatedAt

How to Reproduce?

  1. persistAndFlush an existing entity that contains the createdAt and updatedAt described above
  2. Check the result of the createdAt it gets exactly the same value as the updatedAt

Output of uname -a or ver

Darwin Kernel Version 23.2.0: Wed Nov 15 21:59:33 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T8112 arm64

Output of java -version

OpenJDK 64-Bit Server VM (build 21.0.1+12-29, mixed mode, sharing)

Quarkus version or git rev

3.6.4

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.6

Additional information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions