Hi Lukas, Thank you for a quick reply! The solution is working for me.
Your plan to inherit from SelectField will definitely make the life of users easier! Thank you, Elena пятница, 11 сентября 2015 г., 3:54:34 UTC+10 пользователь Lukas Eder написал: > > Hi Elena, > > In order to use a "Condition" like a "Field" in jOOQ, you will have to > convert the types by using DSL.field(Condition): > > http://www.jooq.org/javadoc/latest/org/jooq/impl/DSL.html#field-org.jooq.Condition- > > As a matter of fact, I'm wondering whether we should enhance the Condition > type to extend SelectField in some way - could certainly be very useful for > cases like yours. > > Hope this helps, > Lukas > > 2015-09-10 9:54 GMT+02:00 <[email protected] <javascript:>>: > >> Hi, >> >> Please, advice how to implement table fields comparison in select >> statement in jOOQ. >> >> For example: >> >> select (result.update_time > result.snapshot_time) as compare from result >> >> In jOOQ there was a problem of casting SelectField to CompareCondition >> when I tried to use greaterThan operation in dsl.select() >> >> >> dsl.select(RESULT.UPDATE_TIME.greaterThan(RESULT.SNAPSHOT_TIME)).from(RESULT) >> >> results in >> ClassCastException: org.jooq.impl.CompareCondition cannot be cast to >> org.jooq.SelectField >> >> >> Thank you, >> Elena >> >> -- >> 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] <javascript:>. >> 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]. For more options, visit https://groups.google.com/d/optout.
