Open sandking opened 8 years ago
I want to get the number of rows affected by the sql statement execution. But i can't get the result in
greenDao where i do 'update' and 'delete'.
I search the source code , found that:
There are two method in SQLiteStatement ,they are executeUpdateDelete and execute.
SQLiteStatement
executeUpdateDelete
execute
executeUpdateDelete :
public int executeUpdateDelete() { acquireReference(); try { return getSession().executeForChangedRowCount( getSql(), getBindArgs(), getConnectionFlags(), null); } catch (SQLiteDatabaseCorruptException ex) { onCorruption(); throw ex; } finally { releaseReference(); } }
execute :
public void execute() { acquireReference(); try { getSession().execute(getSql(), getBindArgs(), getConnectionFlags(), null); } catch (SQLiteDatabaseCorruptException ex) { onCorruption(); throw ex; } finally { releaseReference(); } }
The source code in android used the executeUpdateDelete and then i can get the number.
But in greenDao , I can't .
Without the number ,i can't get the correct result for this sql statement execution.
This requires API level 11- http://developer.android.com/intl/pt-br/reference/android/database/sqlite/SQLiteStatement.html#executeUpdateDelete()
I want to get the number of rows affected by the sql statement execution. But i can't get the result in
greenDao where i do 'update' and 'delete'.
I search the source code , found that:
There are two method in
SQLiteStatement
,they areexecuteUpdateDelete
andexecute
.executeUpdateDelete
:execute
:The source code in android used the
executeUpdateDelete
and then i can get the number.But in greenDao , I can't .
Without the number ,i can't get the correct result for this sql statement execution.