mybatis mapping relationship --POJO mapping and mapping methods

  Mapping relationship mapper.xml in:

  1. <resultMap> used to map POJO, which is Java entity classes, type attribute specifies the permissions for a given class name mapping class (If you have specified mapping package for your mybatis in the application configuration file, here also write directly to the class name can). Entity class member variables will generally use camelCasing, and the database fields may contain "_ '', <id> and <result> property attribute used to develop the member variables in POJO mapping.

 

                          

 

 

 

 

   2. <select> DML tags have attributes like id, used to develop the corresponding method Mapper class name (path map is specified to be written directly to the class name), The resultMap specify the type of SQL execution result receiving set, the corresponding <resultMap> id attribute value, if it is <insert>, <update>, <delete> these tags, the return value thereof represents the number of rows affected, without specifying the type of the return value. Analyzing the parameters corresponding to # {} field conditions where the latter statement, field conditions corresponding to the parameters passed mapper.java interface, the two names to be consistent.

     

   

 

Guess you like

Origin www.cnblogs.com/masTerpie/p/11546584.html