-
Notifications
You must be signed in to change notification settings - Fork 100
EnversRevisionRepositoryFactoryBean doesn't use custom RevisionEntity #4
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
Comments
The public class CustomEnversRevisionRepositoryFactoryBean extends EnversRevisionRepositoryFactoryBean {
public FooCustomEnversRevisionRepositoryFactoryBean() {
setRevisionEntityClass(RevEntity.class);
}
} then you can alter your Spring Data JPA config as follows: <jpa:repositories base-package="…" factory-class="….CustomEnversRevisionRepositoryFactoryBean" /> We'll probably add a custom |
Thnx, extending is a good idea. |
In the version of hibernate-envers 5.1.1.Final and spring-data-envers 1.1.15.RELEASE this code doesn't work since EnversRevisionRepositoryFactoryBean has no default constructor (and keeping in mind that "Foo" in constructor name is a typo).
|
Hi @odrotbohm, I couldn't find anything about it so I guess this was never added. Is it something you would still consider or is subclassing the preferred approach? |
We have no plans to extend our XML based configurations at the moment. |
Thanks for the fast feedback! What about something for Java config? I could imagine a custom annotation to avoid the I'm happy to contribute if the idea is acceptable. |
We just created #289. |
I use a custom
RevisionEntity
with@RevisionNumber
of typeLong
(instead ofInteger
).The creation of my repository
fails:
in line 121 of the
EnversRevisionRepositoryFactoryBean
. Debugging showed me that therevisionEntityInformation
attribute contains aDefaultRevisionEntityInformation
object. I would expect aReflectionRevisionEntityInformation
object that contains information about my customRevisionEntity
. MyRevisionEntity
looks like this:The text was updated successfully, but these errors were encountered: