@Override public <T> int save(Collection<T> collection) { acquireReference(); try { if (!Checker.isEmpty(collection)) { SQLiteDatabase db = mHelper.getWritableDatabase(); Object entity = collection.iterator().next(); mTableManager.checkOrCreateTable(db, entity); SQLStatement stmt = SQLBuilder.buildReplaceAllSql(entity); return stmt.execInsertCollection(db, collection); } } catch (Exception e) { e.printStackTrace(); } finally { releaseReference(); } return SQLStatement.NONE; }