@@ -0,0 +1,937 @@
+package fi.nls.oskari.mybatis;%0A%0Aimport javax.sql.DataSource;%0A%0Aimport org.apache.ibatis.mapping.Environment;%0Aimport org.apache.ibatis.session.Configuration;%0Aimport org.apache.ibatis.session.SqlSessionFactory;%0Aimport org.apache.ibatis.session.SqlSessionFactoryBuilder;%0Aimport org.apache.ibatis.transaction.TransactionFactory;%0Aimport org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory;%0A%0Apublic class MyBatisHelper %7B%0A%0A    public static SqlSessionFactory initMyBatis(DataSource ds, Class%3C?%3E... mappers) %7B%0A        final TransactionFactory transactionFactory = new JdbcTransactionFactory();%0A        final Environment environment = new Environment(%22development%22, transactionFactory, ds);%0A        final Configuration configuration = new Configuration(environment);%0A        for (Class%3C?%3E mapper : mappers) %7B%0A            configuration.addMapper(mapper);%0A        %7D%0A        return new SqlSessionFactoryBuilder().build(configuration);%0A    %7D%0A%0A%7D%0A

Add MyBatisHelper class with initMyBatis function