20201229-mybatis fancy error

I typed the wrong name when I tried the interface proxy. I typed the
wrong file name when the permanent layer was loaded in the implementation class. I
thought about it for a while. The
core configuration file can have a custom name, and the mapping file name can be customized.
Just don’t make a mistake when configuring the mapping in the core Yes, for the same reason, as long as the name of the core configuration file is loaded when the SqlSession is created, the name is not wrong, the name can be customized


The configuration file must be placed under src, don’t be as stupid as the jar package, just throw the project directory

But the permanent layer interface name can't be messed up. Must match the configuration scheme namespace corresponding to the mapping file
. The abstract method in the interface corresponds to the sql statement id in the configuration file.

Now it is interface name + abstract method name = SQL statement found instead.
Mapping scheme namespace + sql statement id = SQL statement found



-------------------------------------------------- ----------------20201229 Diary-----------------

org.apache.ibatis.binding.BindingException: Type interface Mapper.MoneyMapper is not known to the MapperRegistry.

The name space of the mapping file must be consistent with the interface, the full class name!


------------------------------------------2020-12-31----------------------------------------------
@Insert("INSERT INTO student values (sid=#{sid},gender=#{gender},class_id=#{class_id},sname=#{sname})")

The sql statement like stupid B actually added = in the parameter when adding it. . . . .

This is only used in modification, which means to assign the obtained # to the previous variable in the table
-------------------------- -------The last day of 2020-------------------------------------- --------


happy New Year!
__Kangsao RBI=-=__ -----------------------2020-1-4

Don’t add "" to the data of the configuration file, even if you want to be a string for a while, if it is a number, you will get cold to Inteager.parseInt and it becomes ""1234""
 public Jedis getjedis() {
    
    
    ResourceBundle Jedisio = ResourceBundle.getBundle("jedis");
    String host = Jedisio.getString("host");
        String pos = Jedisio.getString("post");
        int post=Integer.parseInt(pos);
        System.out.println(host);
        System.out.println(post);
    Jedis jedis = new Jedis(host, post);
    //System.out.println(host+","+post);
        return jedis;

Guess you like

Origin blog.csdn.net/m0_49194578/article/details/111935928