The value of parameter [0] does not match the expected type [java.lang.Integer]

An interesting problem is when I pass an int and it complains that it is not type-appropriate:

org.springframework.dao.InvalidDataAccessApiUsageException: Parameter value [0] did not match expected type [java.lang.Integer]

 @Procedure(procedureName = "dbo.do_cool_stuff_to_client") void coolClientStuff(int clientId); 

It is called like this:

 public void someOtherMethod(int clientId){ clientRepository.coolClientStuff(clientId); } 
+5
source share
1 answer

Turns out there is something stupid / funky with him where he really wants me to introduce a class type, not a primitive type.

Changing the method signature to use Integer instead of int fixed.

 @Procedure(procedureName = "dbo.do_cool_stuff_to_client") void coolClientStuff(Integer clientId); 
+4
source

All Articles