use of com.squareup.sqldelight.SqlDelightStatement in project sqldelight by square.
the class IntegrationTests method namedIndexArgs.
@Test
public void namedIndexArgs() {
// :name is the only arg
SqlDelightStatement equivalentNames = Person.FACTORY.equivalent_names_named("Bob");
Cursor cursor = database.rawQuery(equivalentNames.statement, equivalentNames.args);
assertThat(cursor.getCount()).isEqualTo(1);
cursor.moveToFirst();
Person person = Person.FACTORY.equivalent_names_namedMapper().map(cursor);
assertThat(person).isEqualTo(new AutoValue_Person(4, "Bob", "Bob"));
}
use of com.squareup.sqldelight.SqlDelightStatement in project sqldelight by square.
the class IntegrationTests method startIndexAtTwo.
@Test
public void startIndexAtTwo() {
// ?2 is the only arg
SqlDelightStatement equivalentNames = Person.FACTORY.equivalent_names_2("Bob");
Cursor cursor = database.rawQuery(equivalentNames.statement, equivalentNames.args);
assertThat(cursor.getCount()).isEqualTo(1);
cursor.moveToFirst();
Person person = Person.FACTORY.equivalent_names_2Mapper().map(cursor);
assertThat(person).isEqualTo(new AutoValue_Person(4, "Bob", "Bob"));
}
Aggregations