Skip to content

PersistentEntity not created when top-level converter [DATAJDBC-295] #520

Open
@spring-projects-issues

Description

@spring-projects-issues

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:

Metadata

Metadata

Assignees

Labels

in: mappingMapping and conversion infrastructuretype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions