Search in sources :

Example 6 with Where

use of com.orm.androrm.Where in project androrm by androrm.

the class WhereTest method testHasConstraint.

public void testHasConstraint() {
    Where where = new Where();
    where.and("foo", "bar").or("bar", "baz");
    assertTrue(where.hasConstraint("foo"));
    assertTrue(where.hasConstraint("bar"));
}
Also used : Where(com.orm.androrm.Where)

Example 7 with Where

use of com.orm.androrm.Where in project androrm by androrm.

the class DeleteStatementTest method setUp.

@Override
public void setUp() {
    Where where = new Where();
    where.setStatement(new Statement("foo", "bar"));
    mDelete = new DeleteStatement();
    mDelete.from("table").where(where);
}
Also used : Statement(com.orm.androrm.statement.Statement) DeleteStatement(com.orm.androrm.statement.DeleteStatement) Where(com.orm.androrm.Where) DeleteStatement(com.orm.androrm.statement.DeleteStatement)

Example 8 with Where

use of com.orm.androrm.Where in project androrm by androrm.

the class SelectStatementTest method testWhere.

public void testWhere() {
    Where where = new Where();
    where.setStatement(new Statement("foo", "bar"));
    mSelect.where(where);
    assertEquals("SELECT * FROM `table` WHERE foo = 'bar'", mSelect.toString());
}
Also used : JoinStatement(com.orm.androrm.statement.JoinStatement) SelectStatement(com.orm.androrm.statement.SelectStatement) Statement(com.orm.androrm.statement.Statement) Where(com.orm.androrm.Where)

Aggregations

Where (com.orm.androrm.Where)8 Statement (com.orm.androrm.statement.Statement)3 JoinStatement (com.orm.androrm.statement.JoinStatement)2 SelectStatement (com.orm.androrm.statement.SelectStatement)2 DeleteStatement (com.orm.androrm.statement.DeleteStatement)1