2017-08-03 404 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')");