Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for dynamic auditor types [DATACMNS-1269] #1707

Closed
spring-projects-issues opened this issue May 11, 2014 · 6 comments
Closed

Support for dynamic auditor types [DATACMNS-1269] #1707

spring-projects-issues opened this issue May 11, 2014 · 6 comments
Assignees
Labels
status: duplicate A duplicate of another issue type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link

Lee Standen opened DATACMNS-1269 and commented

It would be useful if Spring Data JPA natively supported the ability for variant auditor types, based on the required data type for a field.

For example:

@Entity
public class Table1 {
  ...
  @CreatedBy
  Long createdBy; // stores a primary key identifier
  ...
}

And within the same project

@Entity
public class Table2 {
  ...
  @CreatedBy
  String createdBy; // stores the username

This would allow some legacy schemas (such as the one I'm dealing with) to be easily mapped


Referenced from: commits a778215, fc79c1c, 9a3b5b7, 47c8e5b, 819bce7

3 votes, 5 watchers

@spring-projects-issues
Copy link
Author

@spring-projects-issues
Copy link
Author

Bradley Plies commented

Just a bump for this old ticket. I've encountered a situation while refactoring an app where this would have been great to have

@spring-projects-issues
Copy link
Author

Oliver Drotbohm commented

That should work in Lovelace snapshots now. Just register multiple beans of type AuditorAware<…> an we will automatically select the right one based on the auditor type

@spring-projects-issues
Copy link
Author

Oliver Drotbohm commented

I had to roll back the change as it was causing issues in downstream projects. We have RC2 coming in a day so that we have to postpone this a bit further

@AlexandreCassagne
Copy link

@oliviergierke Have you been able to re-introduce this change?

@odrotbohm odrotbohm added the status: duplicate A duplicate of another issue label Jun 9, 2021
@odrotbohm
Copy link
Member

Closing this in favor of #1352 because that had been created earlier. I'll leave a follow up comment on the other ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants