Closed BarrieShieh closed 4 years ago
@Bean
public Object rsqlConfiguration(RSQLCommonSupport rsqlCommonSupport) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
RSQLCommonSupport.addConverter(Date.class, s -> {
try {
return sdf.parse(s);
} catch (Exception e) {
return null;
}
});
return rsqlCommonSupport;
}
I've create a test case for your reference, please refer to io.github.perplexhub.rsql.RSQLQueryDslSupportTest.testBetweenDateTime()
It works, thanks for replying.
Hi, When I use rsql-querydsl to parse the string for the query, I found the parser can not work properly The class I use is in the below. For String Boolean List Integer, it works fine. when comes to Date, If I use
createdDate=='2020-03-16 05:00:47.584'
, It will generate empty query value.When i use
createdDate=lt='2020-03-16 05:00:47.584'
, it will throw an exceptionThe entity class I use: