This is my project structure
MODEL
- TodoItem.java - this is an interface
- TodoType1 - this implements the interface
- TodoType2 - this implements the interface
Repo
- TodoRepo.java - extends JPA repo with <TodoItem, Integer>
Controller (uses the TodoRepo for CRUD operations)
- request 1 - needs to work with todotype1
- request 2 - needs to work with todotype2
I am a bit confused, how should i go about using qualifiers here? Should I create different Repositories for each type?
TodoRepo.java - extends JPA repo with <TodoItem, Integer>
Here TodoItem is an interface. Springboot JPA gets confused about which entity it is going to handle(two class implements the TodItem interface). Instead of Interface, declaring a specified entity class won't throw the error.