Create Infrastructure so users can define custom predicates for query derivation
This is inspired by #1185
@schauder Happy to look into this - do you have an idea of what the predicates will look like?
Thanks
Shane
@ShaneLee a quick pointer would be to look for "PartTree" related classes. You'll find lengthy if/else/switch conditions. Basically we would need to extract all the information of those into an interface which then could be implemented and registered by a user. Or (later) even a Dialect.
HTH.
Would this allow for the use of custom criteria? My current problem is I want to use JSON operators in PostgreSQL with the criteria API.
I wanted to implement org.springframework.data.relational.core.query.CriteriaDefinition for extending sql query functionality with json operators such '@?' or '?|' (and others), but cannot extend enum org.springframework.data.relational.core.query.CriteriaDefinition.Comparator.
I can suggest adding smth like interface IComparator, and then implements interface by enum Comparator. And change CriteriaDefinition method - Comparator getComparator(); with - IComparator getComparator(); And do smth with this throwing - 'default -> throw new UnsupportedOperationException("Comparator " + comparator + " not supported");' in org.springframework.data.jdbc.core.convert.QueryMapper.createCondition method (instead of throwing return smth like this Conditions.just(column_without_table_prefix + " " + comparator + " " + value))
If do this, it will be possible for developers to create custom Comparators and use them with custom Criteria which will implement CriteriaDefinition.
thanks