use of android.arch.persistence.db.SimpleSQLiteQuery in project sqlbrite by square.
the class BriteDatabaseTest method synchronousQueryWithSupportSQLiteQueryDuringTransactionSeesChanges.
@Test
public void synchronousQueryWithSupportSQLiteQueryDuringTransactionSeesChanges() {
Transaction transaction = db.newTransaction();
try {
assertCursor(db.query(new SimpleSQLiteQuery(SELECT_EMPLOYEES))).hasRow("alice", "Alice Allison").hasRow("bob", "Bob Bobberson").hasRow("eve", "Eve Evenson").isExhausted();
db.insert(TABLE_EMPLOYEE, CONFLICT_NONE, employee("john", "John Johnson"));
db.insert(TABLE_EMPLOYEE, CONFLICT_NONE, employee("nick", "Nick Nickers"));
assertCursor(db.query(new SimpleSQLiteQuery(SELECT_EMPLOYEES))).hasRow("alice", "Alice Allison").hasRow("bob", "Bob Bobberson").hasRow("eve", "Eve Evenson").hasRow("john", "John Johnson").hasRow("nick", "Nick Nickers").isExhausted();
transaction.markSuccessful();
} finally {
transaction.end();
}
}
use of android.arch.persistence.db.SimpleSQLiteQuery in project sqlbrite by square.
the class BriteDatabaseTest method synchronousQueryWithSupportSQLiteQueryDuringTransaction.
@Test
public void synchronousQueryWithSupportSQLiteQueryDuringTransaction() {
Transaction transaction = db.newTransaction();
try {
transaction.markSuccessful();
assertCursor(db.query(new SimpleSQLiteQuery(SELECT_EMPLOYEES))).hasRow("alice", "Alice Allison").hasRow("bob", "Bob Bobberson").hasRow("eve", "Eve Evenson").isExhausted();
} finally {
transaction.end();
}
}
Aggregations