spring-projects / spring-projects/spring-data-relational
PersistentEntity not created when top-level converter [DATAJDBC-295]
@schauder is already working on this.
Since Dec 31, 2020.
- Dominant language
- Java
- Stars
- 827
- Forks
- 394
- PR merge metrics
- No merged PRs in 30d
Description
Greg Potter opened DATAJDBC-295 and commented
When registering a customer Converter that uses Object or some other top-level class (perhaps in the form of a ConditionalConverter), Spring Data JDBC fails to think a PersistentEntity is required for the top-level object and creating the repository fails.
This is actually mentioned in the javadoc for AbstractMappingContext.shouldCreatePersistentEntityFor:
By default this will reject all types considered simple and non-supported Kotlin classes, but it might be necessary to tweak that in case you have registered custom converters for top level types (which renders them to be considered simple) but still need meta-information about them.
However, resolving this does not seem to be trivial since it's not easy to extend that method (simpleTypeHolder is private). I'm thinking we actually might want to try to convert it first (or at least go through the "match" process for a ConditionalConverter) before assuming that all converter sources are not entities
Issue Links:
- DATAJDBC-239 Annotation for sql type
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.