fixing JPA query for Vets

This commit is contained in:
Mic 2013-05-09 01:26:48 +08:00
parent 5bf31dbe5a
commit 840c0a417d

View file

@ -45,7 +45,7 @@ public class JpaVetRepositoryImpl implements VetRepository {
@Cacheable(value = "vets") @Cacheable(value = "vets")
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public Collection<Vet> findAll() { 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();
} }
} }