spring data jpa使用原生sql查询

spring data jpa使用原生sql查询 

@Repository
public interface AjDao extends JpaRepository<Aj,String> {
    //使用原生sql时Query注解需要添加属性,nativeQuery=true
    @Query(nativeQuery =true,value = "select max(to_number(XH)) FROM AJ")
    String getMaxXh();
}
原文地址:https://www.cnblogs.com/coder-lichao/p/10718087.html