Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Object is not created when all constructor arguments are 'null'. #798

Open
GoogleCodeExporter opened this issue Apr 21, 2015 · 2 comments
Open

Comments

@GoogleCodeExporter
Copy link

What version of the MyBatis are you using?
3.2.0

Please describe the problem.  Unit tests are best!
When <ResultMap> contains a <contstructor> element, and if all of the 
constructor arguments to be injected by MyBatis are 'null', such row is 
silently ignored.
When I debugged the test,  inside the method with signature 
'org.apache.ibatis.executor.resultset.FastResultSetHandler#createParameterizedRe
sultObject',
it ignores such cases and just returns null, instead of invoking 
objectFactory.create(resultType, constructorArgTypes, constructorArgs).

Someone already posted the same issue on mybatis-user 
group.(https://groups.google.com/forum/#!topic/mybatis-user/nAR5lSqywDw)

What is the expected output? What do you see instead?
When <ResultMap> contains a <contstructor> element, and if all of the 
constructor arguments to be injected by MyBatis are 'null', such row is 
silently ignored.
The expected outcome is to invoke constructor with null parameters.

Can you provide stack trace, logs, error messages that are displayed?
I attached the testcode along with the suggested code patch, which simply get 
rids of the 'foundValues' variable.
(I haven't thought of consequences of this change in other circumstances.)

Please provide any additional information below.

Original issue reported on code.google.com by daniel0...@gmail.com on 21 Mar 2013 at 10:58

Attachments:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant