In general applications, the ORM will be used to map the database isolated records as an entity class, the entity class we are generally a class written in a class file, but sometimes we will use the internal class, this time mapping file configuration should be noted:
If the class is:
Com.xxx.entity.DataWrapper.InnerEntity
Innerentity as a public static member of Datawrapper, the declaration is as follows
1.
Import com.xxx.entity;
...
Datawrapper.innerentity myObject = null;
2.
Com.xxx.entity.DataWrapper.InnerEntity myObject = null;
In mybatis like above as ReturnType or Paramtype will appear ClassNotFound exception, which is related to his classloader mechanism, the above class Javac compiled inner class result is Datawrapper$ Innerentity.class file.
Therefore, when configuring the mapping file, change com.xxx.entity.DataWrapper.InnerEntity to Com.xxx.entity.DataWrapper$innerentity, So the mybatis can be loaded normally.
Mybatis the data encapsulation class in the mapping file uses the inner class