-
Notifications
You must be signed in to change notification settings - Fork 683
Custom BeanNameGenerators are not considered for repository bean name generation [DATACMNS-1497] #1931
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
Oliver Drotbohm commented Spring Data repository naming uses a slightly different variant of the I'll forward that request to the core Spring team. /cc Juergen Hoeller |
slinstaedt commented Thanks for forwarding. Interestingly Generating bean names by using simple class names was in the past probably a good way to strengthen backward compatibility with applications, which still use name-based injection. As (qualified) type-based injection is probably more used these days, this kind of compatibility might not be necessary any more. |
Oliver Drotbohm commented We need Spring Framework tweaked to expose the |
Oliver Drotbohm commented There's a draft implementation available via The fix contains a rather brittle check for the default |
Oliver Drotbohm commented Jürgen was so kind to introduce a dedicate constant to allow us to compare the generator passed around against the default one. I've just merged this to master, feel free to give the snapshots a spin |
slinstaedt commented My contract has ended, so I can't proof this to be functional for the original project, but according to a dummy project, custom BeanNameGenerators are never forwarded from AbstractRepositoryConfigurationSourceSupport. Versions used:
|
slinstaedt opened DATACMNS-1497 and commented
Spring-boot allows to configure a custom BeanNameGenerator. This custom BeanNameGenerator is not picked up by spring-data, but rather the default implementation is still gonna being used. This leads to unexpected bean names at best, or subtile errors at worst, especially with spring-boot 2.0.x versions, which allow to override bean definitions by default.
I am not completely sure, if that's a bug or a feature, at least it is somehow unexpected. When I configure a custom BeanNameGenerator for spring, I would expect it to be used not only in a subset of spring-projects.
Affects: 2.1.5 (Lovelace SR5)
Issue Links:
("supersedes")
("supersedes")
The text was updated successfully, but these errors were encountered: