@@ -2,6 +2,10 @@ | |||
All notable changes to this project will be documented in this file. | |||
This project adheres to [Semantic Versioning](http://semver.org/). | |||
### [2.1.1] - 2016-04-07 | |||
#### Added | |||
- Add explicit `where(String)` method to help with non-Java language interop | |||
### [2.1.0] - 2016-04-06 | |||
#### Added | |||
- Add methods to select counts of a group by field (*SELECT field, COUNT(*) FROM table [WHERE conditions] GROUP BY field*) |
@@ -663,6 +663,16 @@ public class Query<T> { | |||
return new QueryWhere<T>(this); | |||
} | |||
/** | |||
* Begin an string field condition clause explicitly defined for interop clarity. | |||
* | |||
* @param x the mapped string to query | |||
* @return a query condition to continue building the condition | |||
*/ | |||
public QueryCondition<T, String> where(String x) { | |||
return new QueryCondition<T, String>(this, x); | |||
} | |||
public QueryWhere<T> where(String fragment, List<?> args) { | |||
return this.where(fragment, args.toArray()); | |||
} |
@@ -218,4 +218,12 @@ public class ModelsTest { | |||
assertEquals("[Condiments=5, Beverages=2, Produce=1, Meat/Poultry=1]", categories.toString()); | |||
} | |||
@Test | |||
public void testWhereByString() { | |||
Product products = new Product(); | |||
List<Product> seafoodProducts = db.from(products).where(products.category).is("Seafood").select(); | |||
assertEquals(1, seafoodProducts.size()); | |||
} | |||
} |