[英]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: 一个有趣的问题,我传入一个
int
,并且抱怨它与类型不匹配:
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);
}
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. 将方法签名更改为使用
Integer
而不是int
固定它。
@Procedure(procedureName = "dbo.do_cool_stuff_to_client")
void coolClientStuff(Integer clientId);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.