Auditing fields are not saved for Couchbase entities declared as Java records.
For example:
@Document
record AuditedRecord(
@Id String id,
@CreatedDate Instant createdDate,
@LastModifiedDate Instant lastModifiedDate) {}
When saving a new record with Couchbase auditing enabled:
var saved = repository.save(new AuditedRecord(null, null, null));
the record read back from Couchbase has null audit fields:
var found = repository.findById(saved.id()).orElseThrow();
assertThat(found.createdDate()).isNotNull(); // fails
assertThat(found.lastModifiedDate()).isNotNull(); // fails
Auditing fields are not saved for Couchbase entities declared as Java records.
For example:
When saving a new record with Couchbase auditing enabled:
the record read back from Couchbase has null audit fields: