• notice
  • Congratulations on the launch of the Sought Tech site

Pass a single String type parameter in mybatis

When using the mybatis interface parameter with only one string, if @Param is not specified, mybatis will default the parameterType parameter to the parameter type of the interface, and then call the get/set method of parameter a under the type for the #{a} parameter in xml. Reported wrong. Using the @Param annotation mybatis will assign a one-to-one correspondence without causing this error.
The interface is as follows:
insert image description here
The xml file is as follows:
insert image description here
The error is as follows:
insert image description here

Change it to the following:
insert image description here


Tags

Technical otaku

Sought technology together

Related Topic

0 Comments

Leave a Reply

+