[英]Need to write Spring Data JPA interface method for Query
如何将以下本机转换为 Spring Data JPA 接口方法:
@Query(nativeQuery = true,
value = " select count(*) from TABLE "
+ "where ( ColumOne =:xyz or ColumnTwo =:xyz ) "
+ "and STATUS_TX in ('On Hold')")
int countAllByStatusAndName(@Param("xyz") String xyx);
我已经写成
Long countByStatusTXAndColumnOnOrColumnTwo (String status, String xyz)
。 但它不起作用
我特别需要 ColumnOne 和 ColumnTwo 之间的那个或条件。
方法名称中似乎有拼写错误。 ColumnOn
而不是ColumnOne
。 尝试Long countByStatusTXAndColumnOneOrColumnTwo (String status, String xyz)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.