mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-17 21:15:50 +00:00
Add @Qualifier to services
This commit is contained in:
parent
bedc97c048
commit
b912cca00f
3 changed files with 4 additions and 0 deletions
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue