Spring 使用注解查询 JPQL 按对象查询

把注解写在接口里面

public interface UserRepository extends JpaRepository<User, Long> {

  @Query("select u from User u where u.emailAddress = ?1")
  User findByEmailAddress(String emailAddress);
}

  

原文地址:https://www.cnblogs.com/max-hou/p/12145016.html