I have a Service class , injects the RepoService.
In RepoServiceImpl class, injects the Mapper.
In Mapper class, injects the RepoService,as I have to use repoService again to the get the records.
Reposervice is an interface and is implemented in RepoServiceImpl.
class Service {
@Autowired
@Qualifier("repoService")
private RepoService repoService;
public void create() {
repoService.createRecord();
}
}
@Service
@Qualifier("repoService")
class RepoServiceImpl implements RepoService {
@Autowired
private mapper;
createRecord(){
mapper.createMapper();
}
getRecord(){
}
}
@Component
class Mapper {
@Autowired
@Qualifier("repoService")
private RepoService repoService;
createMapper(){
repoService.getRecord();
}
}
Need to check the design flow, do I need to change in the design?