美文网首页
Spring data JPA query with param

Spring data JPA query with param

作者: mihope | 来源:发表于2019-01-17 17:43 被阅读3次
    @Query("select u from User u where u.age = ?#{[0]}")
    List<User> findUsersByAge(int age);
    
    @Query("select u from User u where u.firstname = :#{#customer.firstname}")
    List<User> findUsersByCustomersFirstname(@Param("customer") Customer customer);
    

    相关文章

      网友评论

          本文标题:Spring data JPA query with param

          本文链接:https://www.haomeiwen.com/subject/httwdqtx.html