Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does ormlite support batch create and update, delete

Does ormlite support batch operations(create and update, delete) on android?

I want to insert a lot of data in tables with one transaction.

for example: insert users, products.

like image 324
Tony.Lu Avatar asked Aug 05 '13 08:08

Tony.Lu


1 Answers

getHelper().getDao().callBatchTasks(new Callable<Void>(){
            @Override
            public Void call() throws Exception {}}) ;

in call method, can insert multi object in it, and the speed is more faster than execute out of the method.

like image 158
Tony.Lu Avatar answered Oct 08 '22 20:10

Tony.Lu