-
Notifications
You must be signed in to change notification settings - Fork 132
Custom comparators for R2dbcRepository in Spring Data #263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I was also facing the issue that I wanted to use a jsonb operator in a condition, such as |
E.g. I would see some value in enhancing the Criteria builder one way or the other... I noticed there's |
This ticket isn't an exact duplicate of #289 but the referenced ticket contains a few details on why this enhancement isn't really going to work. We recommend using the |
Hi @mp911de, understood, I had to resort to the Though if you don't know upfront which conditions there are going to be (think: taking filters from http request params) I found it difficult because having to |
|
Criteria API it is a high level and provides a certain level of security, if we move to a lower level as jOOQ, then we will have to write a bunch of code to fully repeat the Criteria API functionality with only possibility of custom comparators ))) |
In #265, we provide two rather simple examples. Without introducing another abstraction level we cannot infer type and parameter binding information that would be required to render proper criteria. Spring Data's support for relational databases is primary a library to implement the repository pattern and to aid common use-cases. It's by no means an exhaustive library that supports all types of features that are provided by the underlying databases. |
@mp911de
|
yes, but Hibernate support custom operators |
@LaoTsing
To give you an idea: databaseClient.execute("SELECT data FROM things WHERE data ? $1").bind(0, "foo"); |
Thank you, but i think to as clean is supporting custom operators in Criteria API, because each database have a lot inline operators |
Feature Request
Needed custom comparators for supporting special iLike, Jsonb, Arrays, Ranges and Full Text Search of PostgreSQL inline querying in Criteria builder (do not custom, only inline)
Describe the solution you'd like
As solution may be create comparators as bean and dynamic extending collection:
enum Comparator { EQ, NEQ, LT, LTE, GT, GTE, IS_NULL, IS_NOT_NULL, LIKE, NOT_IN, IN, }
The text was updated successfully, but these errors were encountered: