@Component
public class RepositoryContainer {
@Autowired
public CommentRepository commentRepository;
@Autowired
public ItemRepository itemRepository;
@Autowired
public UserRepository userRepository;
@Autowired
public PostRepository postRepository;
}
In this way, I just need to inject a single god RepositoryContainer and don't need to inject every repository that will pollute my controller.
Aucun commentaire:
Enregistrer un commentaire