mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-15 20:35:49 +00:00
fixing JPA query for Vets
This commit is contained in:
parent
5bf31dbe5a
commit
840c0a417d
1 changed files with 1 additions and 1 deletions
|
@ -45,7 +45,7 @@ public class JpaVetRepositoryImpl implements VetRepository {
|
|||
@Cacheable(value = "vets")
|
||||
@SuppressWarnings("unchecked")
|
||||
public Collection<Vet> findAll() {
|
||||
return this.em.createQuery("SELECT vet FROM Vet vet join fetch vet.specialties ORDER BY vet.lastName, vet.firstName").getResultList();
|
||||
return this.em.createQuery("SELECT distinct vet FROM Vet vet left join fetch vet.specialties ORDER BY vet.lastName, vet.firstName").getResultList();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue