What Mybatis that? mybatis in for a configuration and how many relationship

Mybatis what is?

. 1 , MyBatis before it, the java the jdbc connected database, MyBatis out after the jdbc encapsulated to achieve more effective connection;
   2 , MyBatis object the SqlSession, SqlSessionFactoryBuilder, SqlSessionFactory
        jdbc objects: Connection, PreparedStatement, ResultSet
   . 3 , MyBatis is a semi-automated orm framework, compared to hiberbate , the mybatis by xml be flexible or write notes sql statement

 

mybatis in for a configuration and how many relationship

To one, two. One is nested result , one is nested query

By defining resultMap define a second inside Association , with javaType specify the fully qualified class names. The two primary key id indicate which one.

 

Nested Results

By defining resultMap further defined inside a collection , by select specified attributes second sql statement, in the collection of the specified column above the column of the main data id

Many definitions association with javaType specifying the full class name

To use multi resultMap package with inside Collection , by ofType full class name designated to be wrapped, of course, id or to specified.

Guess you like

Origin www.cnblogs.com/lingboweifu/p/11912525.html