agrosner / DBFlow

A blazing fast, powerful, and very simple ORM android database library that writes database code for you.
MIT License
4.87k stars 598 forks source link

executeTransaction #1411

Closed gwokwong closed 7 years ago

gwokwong commented 7 years ago

i want executeTransaction return boolean value ,how i do ?

agrosner commented 7 years ago

I mean you can copy paste the body of the method from DatabaseDefinition:

public void executeTransaction(@NonNull ITransaction transaction) {
        DatabaseWrapper database = getWritableDatabase();
        try {
            database.beginTransaction();
            transaction.execute(database);
            database.setTransactionSuccessful();
        } finally {
            database.endTransaction();
        }
    }

and have it return true where needed.