Skip to content
Advertisement

I can’t put a HashMap object in the MyBatis parameter

I’m trying use a HashMap object to look up ids and passwords in database, but I can’t. I can only get error message as follows:

JavaScript

I set my MyBatis mapper as follows:

JavaScript

And, I think it’s ok with my controller and dao, but I’ll attach it.

JavaScript
JavaScript

I checked the HashMap variable in the controller and dao correctly print their items.

So, I think the mapper is the problem. Is there anything wrong in my mapper? or any other problems with my other codes?

FYI, I’ll put my pom.xml dependecies,

JavaScript

Advertisement

Answer

In the selectOneByNTB() method, you need to pass the HashMap parameter as the second argument of selectOne().

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement