loiclacombe / mybatisnet

Automatically exported from code.google.com/p/mybatisnet
0 stars 0 forks source link

Dynamic insert columns and values using mybatis #50

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Dynamic insert columns and values using mybatis
Below i mentioned my code.Is it posible for doing like below...

 <statement id="insert" parameterClass="Attributes">
      insert into DataTable                                
           <iterate open="(" close=")" conjunction=",">
        (#[].AttributeName#) 
      </iterate>
      (TenantID,ObjectID,Slot0,Slot1)
      values
      <iterate open="(" close=")" conjunction=",">
        #[].AttributeValue#
      </iterate>
    </statement>

Like Ex: insert into TableName (id,name) values ('101','sekhar')

Original issue reported on code.google.com by msekhar...@gmail.com on 6 Jun 2013 at 1:52