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

Allow having multiple AuditorAware(s) [DATACMNS-894] #1352

Open
spring-projects-issues opened this issue Aug 17, 2016 · 6 comments
Open

Allow having multiple AuditorAware(s) [DATACMNS-894] #1352

spring-projects-issues opened this issue Aug 17, 2016 · 6 comments
Assignees
Labels
type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link

Andrei Ivanov opened DATACMNS-894 and commented

Trying to use the auditing feature in a multi-module project I've reached a limit.

  • module A
public class User implements Serializable {
}
@EntityListeners(AuditingEntityListener.class)
public class Project implements Serializable {
	@CreatedBy
	private User createdBy;
}
public class UserAuditor implements AuditorAware<User> {
}
  • module B
public class Person implements Serializable {
}
@EntityListeners(AuditingEntityListener.class)
public class SiteAccessRequest implements Serializable {
	@LastModifiedBy
	private Person managedBy;
}

public class PersonAuditor implements AuditorAware<Person> {
}

The problem seems to be that I can only use only one AuditorAware instance.
I think it would be nice to be able to have something like the JpaContext to be able to find the proper auditor for a certain type.

public interface AuditorContext {
    AuditorAware<?> getAuditorAwareByManagedType(Class<?> managedType);
}

Affects: 1.12.2 (Hopper SR2)

@msndk
Copy link

msndk commented Mar 3, 2021

bump.
This feature would have been really useful in a refactoring task i am currently working on.

@AlexandreCassagne
Copy link

Bump

@mp911de
Copy link
Member

mp911de commented Dec 9, 2021

@m-horejsi
Copy link

Is there any chance that branch which is solving this issue will be merged? I would appreciate that..

@osmarcf
Copy link

osmarcf commented Jul 26, 2024

Bump.

@DreamStar92
Copy link

Is there any progress on this matter?

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

No branches or pull requests

8 participants