spring-projects / spring-projects/spring-data-commons

Auditing: `ConversionService` support for `CreatedBy`/`LastUpdatedBy`

Open
#3,437 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

type: enhancement
Dominant language
Java
Stars
838
Forks
730
PR merge metrics
No merged PRs in 30d

Description

We have the use case, that createdby is sometimes the username (string) and sometimes the userid (Long), it depends whether data is only for internal use or not.
Currently ConversionService is only supported for date fields. It would be nice, if this could be also possible for auditor fields.
With ConversionService support it would be possible to use a single AuditorAware bean which will be converted to the right target type.
In addition its currently not possible to define two different AuditorAware as an alternative solution.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is identified. Start by locating the existing ConversionService handling for date auditing and the code that resolves CreatedBy and LastUpdatedBy values, then inspect related tests. Done means auditor values can be converted to their target types through one AuditorAware implementation, with coverage for string and Long targets.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.