Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parameter value [0] did not match expected type [java.lang.Integer]

Fun issue where I'm passing an int in and it's complaining about it not matching the type:

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's being called like so:

public void someOtherMethod(int clientId){
  clientRepository.coolClientStuff(clientId);
}
like image 456
Kingpin2k Avatar asked Jul 29 '15 17:07

Kingpin2k


1 Answers

It turns out there is something stupid/funky with it, where it really wants me to put in the class type and not a primitive type.

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

@Procedure(procedureName = "dbo.do_cool_stuff_to_client")
void coolClientStuff(Integer clientId);
like image 141
Kingpin2k Avatar answered Nov 10 '22 17:11

Kingpin2k