Hi Maverick, This is because of how Java's generics work. Your fields[x] expression is a Field<?> using a wildcard. Unfortunately, there's no way in Java to capture this wildcard in a way for it to be made reusable within a method. You'd have to use an auxiliary private method to work around this limitation.
However, you can resort to workarounds. For example, you can cast your right hand side of an expression to a raw type (Field), which is probably acceptable given that you're writing generic framework logic, and that you're doing this only once. For example: condition = condition.and(fields[x].greaterOrEqual((Field) record.get(x)); or condition = condition.and(fields[x].greaterOrEqual((Field) DSL.zero())); or Integer b = new Integer(5); condition = condition.and(fields[x].greaterOrEqual((Field) DSL.val(b))); I hope this helps, Lukas On Fri, Jun 14, 2019 at 10:02 PM 'Maverick Skywalker' via jOOQ User Group < [email protected]> wrote: > Hi Lukas, > > I really thought I could do the other methods completly by my own, but the > reallity has proven, that I was wrong about that. I tried the following > snippets, where I thought that it was promissing and many other things. > > condition = condition.and(fields[x].greaterOrEqual(record.get(x)); > or > condition = condition.and(fields[x].greaterOrEqual(DSL.zero())); > or > Integer b = new Integer(5); > condition = condition.and(fields[x].greaterOrEqual(b)); > > Snippet three should work at least, accourding to you post > https://stackoverflow.com/questions/35477640/jooq-empty-condition > > Error message "no suitable method found", my project is currently based on > jooq 3.11.5. > > -- > 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/6c0bbc52-8033-4c63-be85-fa5be6b02f53%40googlegroups.com > <https://groups.google.com/d/msgid/jooq-user/6c0bbc52-8033-4c63-be85-fa5be6b02f53%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/CAB4ELO6W3buSJ5Fue5cE8Qicx7faih%2B9GyBTvDKdYRMaqJzMQg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
