2017-08-03 42 views
0

QueryDsl 4中是否有替代StringTemplate.create(“”)?Querydsl 4 StringTemplate的创建

在3版本,我可以这样写:

final StringExpression createdMonthYear = StringTemplate.create("to_char(CREATED_DATETIME, 'YYYY.MM')"); 

但由于Querydsl 4这是不行的。

编辑:

没关系。我找到了答案......

final StringExpression createdMonthYear = Expressions.asString("to_char(CREATED_DATETIME, 'YYYY.MM')"); 

回答

0

由于OP发现

final StringExpression createdMonthYear = Expressions.asString("to_char(CREATED_DATETIME, 
'YYYY.MM')");