[DB] Added search filter helpers

This commit is contained in:
epoupon
2015-09-25 13:20:59 +02:00
parent de58e15c22
commit 6686f88010
2 changed files with 9 additions and 4 deletions
+7
View File
@@ -47,6 +47,7 @@ class SearchFilter
SearchFilter() {}
// Helpers
static SearchFilter IdMatch( const IdMatchType& _idMatch )
{
return SearchFilter(_idMatch);
@@ -57,6 +58,12 @@ class SearchFilter
return SearchFilter(_nameLikeMatch);
}
// Single ID match
static SearchFilter ById(Field field, Wt::Dbo::dbo_default_traits::IdType id)
{
return SearchFilter({{field, {id} }});
}
// The filter is a AND of the following conditions:
// ((Field1.name LIKE STR1-1 OR Field1.name LIKE STR1-2 ...) OR (Field2.name LIKE STR2-1 OR Field2.name LIKE STR2-2 ...) ...