Maison  >  Questions et réponses  >  le corps du texte

java - @query注解怎么获取方法参数的某个属性值

PHPzPHPz2717 Il y a quelques jours319

répondre à tous(2)je répondrai

  • 阿神

    阿神2017-04-18 10:15:13

    Semblable à ceci

    @Query("select h from Hotel h where h.city = ?1")
    List<Hotel> queryWorkFormList(City city);

    répondre
    0
  • ringa_lee

    ringa_lee2017-04-18 10:15:13

    Exemple donné par Spring :

    @Query("select u from User u where u.firstname = :#{#customer.firstname}")
    List<User> findUsersByCustomersFirstname(@Param("customer") Customer customer);

    répondre
    0
  • Annulerrépondre