Reputation: 81
While using JOOQ, dsl.select() with .and() I got "The method and(Boolean) from the type Condition is deprecated" such kind of warning. Iam using jooq 3.8.3. Does anybody can brief me about this?
Upvotes: 2
Views: 1169
Reputation: 220932
That method (and many other similar methods) were deprecated in jOOQ 3.8 with issue #4763, precisely for the reason you've experienced and documented yourself in your own answer.
Many people accidentally used the Object.equals()
method rather than the Field.equal()
method (e.g. because of accidental IDE auto completion), believing that they are producing a valid jOOQ Condition
, when they were really producing a boolean
constant.
If there wasn't any Condition.and(Boolean)
"convenience methods", you would have simply gotten a compilation error and fixed your mistake. But with the Condition.and(Boolean)
method, your code compiles and runs fine, but your query doesn't do what you intentioned.
Thus the "convenience method" that produced this confusing results was deprecated again.
On a side-note, you can avoid this problem by using the two-letter abbreviated forms like Field.eq()
instead.
Upvotes: 1
Reputation: 81
I got it, I was using equals method instead of equal,like
.where(AePlan.AE_PLAN.PLAN_ID**.equals**(planId)
.and(AePlan.AE_PLAN.PHARMACYNETWORK_ID.**equals**(pharmacyNW_Id))
Use of equal is worked for me!!
Upvotes: 5