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();
}

 

posted @ 2019-04-16 16:37  coderLC  阅读(5855)  评论(0编辑  收藏  举报