spring-data-relational icon indicating copy to clipboard operation
spring-data-relational copied to clipboard

Disable auto-apply custom converts [DATAJDBC-379]

Open spring-projects-issues opened this issue 6 years ago • 4 comments
trafficstars

James Clark opened DATAJDBC-379 and commented

We should add the ability to disable auto-applied custom converters. I.E. just because a conversion exists, doesn't mean it should be used by default. We should then provide a "@Convert" annotation, similar to the JPA one, that allows columns to specify which converter to use


Issue Links:

  • DATACMNS-1036 Add API for property specific converters ("depends on")

1 votes, 1 watchers

spring-projects-issues avatar May 24 '19 23:05 spring-projects-issues

Jens Schauder commented

Do you have an example where the application of converters causes a problem?

spring-projects-issues avatar May 25 '19 06:05 spring-projects-issues

James Clark commented

It's not a problem per se, just a nice feature to have. If, for instance, dates were stored as integers in the database, then a converter for integer -> LocalDate would be useful, but you don't want all integers to be converted to LocalDate. 

spring-projects-issues avatar May 25 '19 12:05 spring-projects-issues

Jens Schauder commented

Thanks for the clarification. That makes sense

spring-projects-issues avatar May 25 '19 14:05 spring-projects-issues

Mark Paluch commented

Since Spring Data Commons 2.4, you can configure which converters to register (or not register to be more precise) in CustomConversions. Other than that, the topic of property-based converters comes up regularly but we haven’t found a good generic approach yet. 

spring-projects-issues avatar Nov 24 '20 20:11 spring-projects-issues