I have a method in JPA repository that takes Set as an argument which I am having an Integer to be passed which I have to convert into Long and then add it to a Set and pass it to the method.
After doing these steps I am getting InvalidDataAccessApiUsageException: Parameter value [1410] did not match expected type [java.util.Set (n/a)] Exception.
My Repository method:
@Query("select detail from #{#entityName} detail"
+ " WHERE " + " detail.master.id = :masterId"
+ " and detail.product = :product and detail.llMERestrictedProviders in :providerId"
)
Optional<List<BlackholeDetailEntity>> findByProductLLME(@Param("product") ProductType product,
@Param("masterId") Long masterId, @Param("providerId") Set<Long> providerId);
My calling Code:
Set<Long> providers = new HashSet<Long>();
providers.add(new Long(pricingCopyRequestBO.getProviderId()));
blackholeOfferlist =
blackholeDetailRepository.findByProductLLME(pricingCopyRequestBO.getProductType(),
pricingCopyRequestBO.getSourcePolygonId(), providers);
I have tried Long.valueof(pricingCopyRequestBO.getProviderId()) as well