I am using myBatis to write some SQL queries, the problem is that I have tables that have several columns ( around 50 column). So writing the insert query like this :
<insert id="insert" parameterType="com.atos.tables.Table1>
insert into ot ( id, c1, c2, ....,c50) values (#{id}, #{c1},#{c2},... #{c50})
</insert>
is very tedious.
I can create a method in java that generate the String of the queries automatically, but how can I call this method from the mapper.xml ?
And if I use myBatis annotations I cannot call a method in an interface. I don't know if I am missing something, is there a way to do this??
Thanks for helping.