-
Notifications
You must be signed in to change notification settings - Fork 12.9k
mybatis can not parse #{list[0][0]} correctly #2103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi daodefengshang , this should be a bug . But I can't understand why you write the condition statement like that. |
Sorry, I did not find the foreach method for @SelectProvider like the tag in xml. I found it when I wrote the nested foreach tool. |
I will try to fix this bug. |
I got the same error when upgrade project to
|
@leyewen , Like @hugbgithub , I'm also wondering why you guys need to write |
@harawata |
@harawata Your right, I retest it in list of older version, results pay the same error
by using:
Some time, we need to write update
|
MyBatis version
3.4.4
Database vendor and version
All
Test case or example project
CREATE TABLE
TABLE_DEMO
(
ID NUMBER(6) NOT NULL,
NAME VARCHAR2(24) NOT NULL,
PRIMARY KEY (ID)
);
INSERT INTO TABLE_DEMO (ID, NAME) VALUES (1, '001');
List<Map<String, Object>> query(@param("list") List<List> list);
select id, name from table_demo where id = #{list[0][0], jdbcType=NUMERIC}Steps to reproduce
public List<Map<String, Object>> query() {
List<List> lists = new ArrayList<>();
List li = new ArrayList<>();
li.add(1);
lists.add(li);
List<Map<String, Object>> list = mapper.query(lists);
return list;
}
Expected result
result: [{id: 1, name: "001"}]
Actual result
[org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver.logException(AbstractHandlerExceptionResolver.java:186)]Handler execution resulted in exception: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
###Error querying database. Cause: java.lang.NumberFormatException: For input string: "0][0"
###Cause: java.lang.NumberFormatException: For input string: "0][0"
The text was updated successfully, but these errors were encountered: