You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was attempting to upgrade a project from an old version of mybatis (3.2.2) and ran into an issue where associations that select on multiple columns fail when the nested query uses @param annotations. The same queries work fine in 3.2.2. I have confirmed the problem exists in 3.2.8, 3.3.1 and 3.4.0.
I have modified the existing complex column test suite to add a failing test case that uses an association to a mapped statement that uses @param annotations. Other than the query being defined in the java interface and using @param instead of being in the XML the test is the same as the existing scenarios.
Expected result
Test should pass and result should be identical to the query that uses XML.
Actual result
Test throws the following exception
org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: org.apache.ibatis.binding.BindingException: Parameter 'firstName' not found. Available parameters are []
### The error may exist in org/apache/ibatis/submitted/complex_column/PersonMapper.java (best guess)
### The error may involve org.apache.ibatis.submitted.complex_column.PersonMapper.getComplexWithParamAttributes
### The error occurred while handling results
### SQL: SELECT id, firstName, lastName, parent_id, parent_firstName, parent_lastName FROM Person WHERE id = ?
### Cause: org.apache.ibatis.binding.BindingException: Parameter 'firstName' not found. Available parameters are []
The text was updated successfully, but these errors were encountered:
Hi emacarron, here i encounter a similar exception Caused by: org.apache.ibatis.binding.BindingException: Parameter '_now' not found. Available parameters are [param1, domainId]
I was attempting to upgrade a project from an old version of mybatis (3.2.2) and ran into an issue where associations that select on multiple columns fail when the nested query uses @param annotations. The same queries work fine in 3.2.2. I have confirmed the problem exists in 3.2.8, 3.3.1 and 3.4.0.
MyBatis version
3.2.3 +
Database vendor and version
Any
Test case or example project
Pull request with failing test #648
Steps to reproduce
I have modified the existing complex column test suite to add a failing test case that uses an association to a mapped statement that uses @param annotations. Other than the query being defined in the java interface and using @param instead of being in the XML the test is the same as the existing scenarios.
Expected result
Test should pass and result should be identical to the query that uses XML.
Actual result
Test throws the following exception
The text was updated successfully, but these errors were encountered: