Я пытаюсь выполнить запрос подстроки, используя jpa 2.0, но я не знаю, как это сделать. До сих пор у меня есть этот код:
time = builder.between(
matchesRoot.<Integer>get("startDateTime").toString().substring(8, 13),
Integer.getInteger(DateTimeUtil.dateTimeWithoutFormat(searchCommercialsDTO.getFinalDate())),
Integer.getInteger(DateTimeUtil.dateTimeWithoutFormat(searchCommercialsDTO.getIniDate()))
);
Но он не работает, так как я не могу его скомпилировать из-за этой ошибки:
no suitable method found for between(String,Integer,Integer) method CriteriaBuilder.between(Expression,Y#1,Y#1) is not applicable (no instance(s) of type variable(s) Y#1 exist so that argument type String conforms to formal parameter type Expression) method CriteriaBuilder.between(Expression,Expression,Expression) is not applicable (no instance(s) of type variable(s) Y#2 exist so that argument type String conforms to formal parameter type Expression) where Y#1,Y#2 are type-variables: Y#1 extends Comparable declared in method between(Expression,Y#1,Y#1) Y#2 extends Comparable declared in method between(Expression,Expression,Expression
Any suggestions? Thanks!