Jpa EclipseLink中NamedQuery的SQL
我想在Jpa EclipseLink中NamedQuery的SQL,jpa,eclipselink,Jpa,Eclipselink,我想在Eclipselink select o from user o where trunc(o.TRSF_DATE) = ?1 and o.contrno in(?2,?3,?4,?5,?6,?7,?8,?9,?10,?11) 我得到以下错误 Internal Exception: NoViableAltException(83!=[661:1: simpleConditionalExpressionRemainder[Object left] returns [Object
Eclipselink
select o from user o where trunc(o.TRSF_DATE) = ?1 and o.contrno in(?2,?3,?4,?5,?6,?7,?8,?9,?10,?11)
我得到以下错误
Internal Exception: NoViableAltException(83!=[661:1: simpleConditionalExpressionRemainder[Object left] returns [Object node] : (n= compariso
nExpression[left] | (n1= NOT )? n= conditionWithNotExpression[(n1!=null), left] | IS (n2= NOT )? n= isExpression[(n2!=null), left] );])
at org.eclipse.persistence.exceptions.JPQLException.unexpectedToken(JPQLException.java:372)
关于,我的猜测是错误是由trunc引起的,它不是有效的JPQL函数。在EclipseLink中,可以使用FUNC关键字调用数据库函数 看,,
我猜错误是由trunc引起的,它不是有效的JPQL函数。在EclipseLink中,可以使用FUNC关键字调用数据库函数 看,,
谢谢你解决我的问题。以下是工作名称查询从用户o中选择o,其中FUNC('trunc',o.trsf_date)=1和o.contrno在(?2、?3、?4、?5、?6、?7、?8、?9、?10、?11)感谢FUNC解决了我的问题。以下是工作名称查询从用户o中选择o,其中FUNC('trunc',o.trsf_date)=1和o.contrno在(?2、?3、?4、?5、?6、?7、?8、?9、?10、?11)