Difference between defining queries in the repository interface or entity class?
问题 Sorry if this is a very nooby/stupid question, but I was wondering if there was any difference, besides implementation, between defining a query in the repository: public interface EmployeeRepository<Employee, Integer> { @Query("select e from Employee e where e.name like :name") public List<Employee> findByName(@Param("name") String name); } and defining a query in the entity: @Entity @NamedQuery(name="Employee.findByName", query="select e from Employee e where e.name like :name") public