开发者

How to create your own callback for Ibatis SqlTemplateClientMap

开发者 https://www.devze.com 2023-02-01 12:30 出处:网络
I\'d like to know how to create my own callback fora SqlMapClientTemplate. Specifically so I can do batch ca开发者_开发知识库lls.The way I do it is to override theSqlMapClientCallback<T> method

I'd like to know how to create my own callback for a SqlMapClientTemplate. Specifically so I can do batch ca开发者_开发知识库lls.


The way I do it is to override the SqlMapClientCallback<T> method doInSqlMapClient.

   SqlMapClientCallback<Integer> callback = new SqlMapClientCallback<Integer>() {
        public Integer doInSqlMapClient(SqlMapExecutor executor) throws SQLException {
            executor.startBatch();
            //... do your queries here
            return executor.executeBatch();
        }
    };
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号