Skip to content
Advertisement

Query id return type

I use spring data. I want to get some contracts from DB. So I create two queries. In first I get contracts id that I need, in second I get contract by this id.

First query in Repository.class

JavaScript

ServiceJPA.class

JavaScript

But in last line above I have an error.

java.lang.IllegalArgumentException: Parameter value element [2] did not match expected type [java.lang.Long (n/a)]

If I simply create

JavaScript

All works fine. Cant figure out what is wrong. In which type do first query return id?

p.s. id type in DB is bigint

p.p.s. I checked first query with System.out.println – it seems to return correct numbers.

Advertisement

Answer

I think the issue is with ContractRepository.findContractsIdForInvoicesCreation();

I think it doesn’t return List<Long> as you expected

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement