I'm trying to annotate a custom query with specifications. I have around 9 APIs with the same specification and I don't want to create 9 annotated queries. the problem here is each API is filtering depending on a different column but all APIs have the same specifications.
Is that possible without using the find-all method? here is what I tried.
public interface DoctorSpecialityRepository extends JpaRepository<DoctorSpecialityEntity, Integer>, JpaSpecificationExecutor<DoctorSpecialitySpecification> {
ArrayList<DoctorSpecialityEntity> getDoctorsWithFilter(@Param("subSpecialities") ArrayList<SpecialitiesCountriesEntity> subSpecialities, DoctorSpecialitySpecification specification);
but it throws an exception
Using named parameters for method public abstract java.util.ArrayList com.plus.doctors.repositories.DoctorSpecialityRepository.getDoctorsWithFilter