SSM Under Maven, mybatis + database queries, returns no data, no error problem

When the integration shiro, connect to the database query data, a problem, do not return any data, nor hold any error

As shown above, after execution of this line to the red line, you can not come to the next step, the output "outcome" of these three words.

Break-point test, look at the code execution, found only ever perform to the red box, we can no longer go down.

Determine mapper layer should be a problem! !

Solution: to test the next, whether the corresponding mapper.xml properly connected and perform the operation, the result is not a problem.

          Next, look at himself wrote mapper.xml operating inside the sql code below

Note that red box, here's the problem! ! !

See I started writing on the inside of this xml id resultMap is BaseResultMap, it represents that Employee this domain, then I query on a statement written by the return type is com.itlike.domain.Employee, it is a problem, it is no way to identify, query data can not be returned. The resultMap into BaseResultMap can! !

Finally, I look at the video to explain the code, use com.itlike.domain.Employee is possible, it is surprising that there friend teach me to understand

Published 22 original articles · won praise 3 · views 10000 +

Guess you like

Origin blog.csdn.net/qq_41623154/article/details/93255704