Today, I encountered a problem when using mybatis. When passing a string parameter, I encountered the following error:
Mapper.xml The code is as follows:
Error report when executing this method:
Maven is used for project jar management, and mybatis version is as follows (I use mybatis plus plug-in)
After browsing the data for half a day on the Internet, we found a solution. We need to use the_ The parameter is replaced uniformly. We modify the previous code as follows:
This is because of the version limitation of mybatis. You may not have this situation in some versions (I don’t understand very well here. Thank you )
Read More:
- There is no getter for property named ‘id‘ in ‘class java.lang.Integer‘
- About the error querying database. Cause: java.lang.nullpointerexception reported in mybatis
- java.lang.NoSuchMethodError: org.json.JSONObject.put(Java/lang/String; Java/util/Collection;) “209151;”
- On the intern () method of string class in Java
- 【PTA:】 Error: class X is public should be declared in a file named X.java
- Error in compiling pcl1.9.1: “class vtkdatasetmapper” has no member named “immediatemode rendering off”
- The java.lang.exceptionininitializererror of mybatis reports an error
- In Java, int is converted to string, and zero is added before the number of bits is insufficient
- Error in idea compilation: java.lang.OutOfMemoryError Java heap space and java.lang.StackOverflowError
- [Solved] Flowable Start Error: ClassCastException: java.time.LocalDateTime cannot be cast to java.lang.String
- build.gradle Warming: cannot be applied to ‘(groovy.lang.Closure)’/'(java.lang.String)’
- Error: java.lang.IllegalArgumentExcept :Property ‘sqlSessionFactory‘ or ‘sqlSessionTemplate‘ are required
- Springboot startup error: java.lang.IllegalArgumentException : Property ‘sqlSessionFactory’ or ‘sqlSessionTempla
- spring mybatis mapper Specified class is an interface
- A repeated string is composed of two identical strings. For example, abcabc is a repeated string with length of 6, while abcba does not have a duplicate string. Given any string, please help Xiaoqiang find the longest repeated substring.
- Failed to convert value of type ‘java.lang.String‘ to required type ‘java.util.Date‘;
- java.lang.AbstractMethodError: Receiver class com.alibaba.cloud.sentinel.feign.SentinelContractHolde
- Setter and getter of JS class attribute
- Solve the problem of testing redis cluster“ java.lang.NumberFormatException : For input string: “ [email protected]@17002 “And so on
- Mybatis exception error setting driver on unpoleddatasource. Cause: java.lang.ClassNotFoundException :