Hi Maverick,

Your example uses the "Query By Example" (QBE) API, which mostly translates
to equality comparisons. I think those are a reasonable default. Surely,
QBE can also work with ranges, but how would such an API be configured? How
would it detect what kind of predicate you want to have expressed given
only an input record?

Given that we currently don't have this tool, the obvious solution is to
write your own QBE API, where you define your own set of rules, possibly
encoded in that JSON data structure (e.g. a range would be encoded not as
{"employees": 5}, which translates to company.employees = 5, but as
{"employees": [5, 10]}, which translates to company.employees between 5 and
10

Lukas

On Fri, Jun 14, 2019 at 7:20 AM 'Maverick Skywalker' via jOOQ User Group <
[email protected]> wrote:

> Hello together,
>
> is there a way to create "like" filters, based on CompanyRecord like the
> example below? My issue with it is, it uses only equal (=) commands and not
> "like". I'm also looking for a solution with greater (>), greater equal
> (>=), smaller (<) and smaller equal (<=) for different types. Is there may
> be a way to create a user defined "condition" function, that is capable to
> access the entities dynamically. To hardcode the "like" conditions, like
> shown in the documentation, doesn't helps.
>
> Company filter = gson.fromJson(filterAsJSON, Company.class);
> CompanyRecord filterRecord = tx.newRecord(COMPANY, filter);
>
> companys = tx.selectFrom(COMPANY)
> .where(condition(filterRecord))
> .fetch();
>
> Best regards
> Maverick Skywalker
>
> --
> 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/9d4a1960-6813-4f61-9eac-28620b70955e%40googlegroups.com
> <https://groups.google.com/d/msgid/jooq-user/9d4a1960-6813-4f61-9eac-28620b70955e%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAB4ELO4KEV4DGDzrmucD1gM9qCo_8rCdd%3DBa7AP9sbiicPgksw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to