On Friday, June 14, 2019 at 1:08:12 PM UTC+2, Lukas Eder wrote:
>
> The current idea was to keep it as simple as possible and to provide a 
>> company object for each condition type ("like", ">", and so on). The 
>> subject is to implement a filter mechanism of a table, in each column you 
>> have one filter input as String. I'm building everything from scratch, thus 
>> I'm free how to implement it.
>>
>
> I see, interesting. I'll give this some thoughts. Surely, the default of 
> using "=" can be overridden in a meaningful way that is easy to discover 
> and simple to use. I'll revert back to this discussion once I have a more 
> clear idea.
>

Giving this more thought, I conclude (again) that QBE is a treacherous 
paradigm. It seems to offera quick win and we're tempted as ever so often 
to treat it like a one-size-fits-all solution. However, we already have the 
one-size-fits-all solution: SQL. We can combine arbitrary fields, values, 
and operators using the jOOQ API to construct dynamic SQL statements, which 
is exactly what you're doing right now. You translate your own JSON based 
query language to SQL using jOOQ, which is great.

Having extended QBE APIs akin to DSL.condition() is not going to work, 
though, as we would also have to build some sort of translation tool where 
we can decide based on arbitrary input whether to generate equality, non 
equality, or entirely different kinds of predicates from a record. A 
record, however, is not a good starting point for such decisions, as it can 
only really accommodate COL = VALUE style predicates.

So, I prefer to currently not go any further in this QBE paradigm. For 
example, I find what Spring Data is doing not a viable path in an API that 
already supports the entirety of the SQL language (Spring Data does not, so 
QBE is more viable there): 
https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#query-by-example.matchers

>

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jooq-user/fac724f7-c2d7-4953-8c7f-2fa28fde02f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to