Open
Description
Hi,
in previous versions it was possible to register custom converter for proxy projections via shared instance:
https://github.com/spring-projects/spring-data-commons/blob/2.3.x/src/main/java/org/springframework/data/projection/ProxyProjectionFactory.java#L64
However in most recent version (2.4.x) it is not possible anymore as new instance is used instead of shared one. What is the correct way to register custom converter?
Thank you
Martin
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
mp911de commentedon Mar 22, 2021
We never intended to allow converter registration in the first place. They kind-of worked by accident.
Can you help us understand your use-case, why you want to register a converter and what conversion you try to make work?
martashorak commentedon Mar 22, 2021
I see, i was following example from stack overflow and it is connected to native query which is also my case:
https://stackoverflow.com/questions/58417190/spring-data-jpa-custom-type-conversion-in-interface-based-projection
Here you can try simple failing test for it:
https://github.com/martashorak/spring-data-projection-test/blob/master/src/test/java/com/example/demoprojection/ProjectionConverterTest.java
If you change version of parent pom to 2.3.9.RELEASE it is passing
joshiste commentedon Apr 8, 2021
@mp911de We have projections with custom value types for Ids (mostly wrapping String or UUID) this has stopped working:
markoknez commentedon Nov 25, 2022
Is there any news on this topic? We are facing the same issue
asiaon123 commentedon May 29, 2024
Also facing this issue, in my case, i want to convert string like
2024-05
toYearMonth
interface:
repo: