1, MyBatis ID write-back: There is a business in the development process, the business object itself is a table, business object extension information is another table, here in the new when the business object table to insert a piece of data, and then the Business Object Extension table to insert the extension information, which is used here ID write-Back in Mybaitis
Liezi:
Session.insert ("mm.xxx", map);//Insert business object information corresponding Sql<insert id= "xxx" parametertype= "Java.util.Map" ><selectkey Resulttype= "Java.lang.Long" keyproperty= "Backid" order= "before" >select seq_id. Nextval as Backid from Dual</selectkey>insert into business object Table (ID,...) VALUES (#{backid},... </insert> after the first step, Mybaitis automatically writes back the Backid back to the incoming map. The map in the following code automatically contains the ID of the new business object, which is Backidsession.insert ("mm.yyy", map);//Save Extended object information
Summary of common knowledge in Java development