java - Using a custom field converter in a where clause in JOOQ -


i'm trying select in jooq using syntax:

public final org.jooq.tablefield<mytype, java.lang.string> date = createfield("date", org.jooq.impl.sqldatatype.varchar.length(8), this); cursor<myrecord> cursor =             create.selectfrom(mytable)             .where( mytable.date_string_column.greaterorequal( ??? ) )             .fetchlazy(); 

the code generator knows column sees string. mytype type of myrecord.

the problem have database stores string data need convert java.sql.date. want call custom converter in clause convert native date type string "2014-03-24" java.sql.date. reason wasn't working there no type conversion between string , java.sql.date, you'd type mis-match.

the problem can't seem find right type put in conditional (where have 3 question marks). have custom field converter implements convert() method takes record , returns java.sql.date object, can't seem right type put there. i'm getting around using raw sql string now, looks this: str_to_date(date, '%m-%d-%y') >= now() how can invoke custom field converter inside of clause?


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -