Add @Qualifier to services

This commit is contained in:
Vitaliy Fedoriv 2016-11-01 00:20:43 +02:00
parent bedc97c048
commit b912cca00f
3 changed files with 4 additions and 0 deletions

View file

@ -22,6 +22,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@Service @Service
@Qualifier("ClinicServiceExt")
public class ClinicServiceExtImpl implements ClinicServiceExt { public class ClinicServiceExtImpl implements ClinicServiceExt {
private SpecialtyRepositoryExt specialtyRepositoryExt; private SpecialtyRepositoryExt specialtyRepositoryExt;

View file

@ -40,6 +40,7 @@ import org.springframework.transaction.annotation.Transactional;
* @author Michael Isvy * @author Michael Isvy
*/ */
@Service @Service
@Qualifier("ClinicService")
public class ClinicServiceImpl implements ClinicService { public class ClinicServiceImpl implements ClinicService {
private PetRepository petRepository; private PetRepository petRepository;

View file

@ -22,6 +22,7 @@ import java.util.Date;
import org.junit.Test; import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.samples.petclinic.model.Owner; import org.springframework.samples.petclinic.model.Owner;
import org.springframework.samples.petclinic.model.Pet; import org.springframework.samples.petclinic.model.Pet;
import org.springframework.samples.petclinic.model.PetType; import org.springframework.samples.petclinic.model.PetType;
@ -53,6 +54,7 @@ import org.springframework.transaction.annotation.Transactional;
public abstract class AbstractClinicServiceTests { public abstract class AbstractClinicServiceTests {
@Autowired @Autowired
@Qualifier("ClinicService")
protected ClinicService clinicService; protected ClinicService clinicService;
@Test @Test