spring-data-relational
spring-data-relational copied to clipboard
Disable auto-apply custom converts [DATAJDBC-379]
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
Jens Schauder commented
Do you have an example where the application of converters causes a problem?
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.
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.