I found this on http://old.nabble.com/insert-statement-td21157498.html I want to do the same thing .I have two columns in my table .I am able to insert hash map values by mapping the hashmap key to the column name.Now i want put the key values pairs in the table irrespective of key name.
Pasted from the link above.
I would like to write a dynamic insert statement, but both fields and values are dynamic.
I mean
<insert id="someIDhere" parameterClass="java.util.HashMap">
insert into table_one (
!!! dynamic list of keys from the HashMap
) values (
!!! values
);
</insert>