本文整理匯總了Java中com.orm.SugarRecord.find方法的典型用法代碼示例。如果您正苦於以下問題:Java SugarRecord.find方法的具體用法?Java SugarRecord.find怎麽用?Java SugarRecord.find使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.orm.SugarRecord
的用法示例。
在下文中一共展示了SugarRecord.find方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: list
import com.orm.SugarRecord; //導入方法依賴的package包/類
public List<T> list() {
if (arguments == null) {
arguments = convertArgs(args);
}
return SugarRecord.find(record, whereClause, arguments, groupBy, orderBy, limit);
}
示例2: findTest
import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void findTest() throws Exception {
save(new SimpleExtendedModel());
save(new SimpleExtendedModel());
List<SimpleExtendedModel> models =
SugarRecord.find(SimpleExtendedModel.class, "id = ?", "2");
assertEquals(1, models.size());
assertEquals(new Long(2L), models.get(0).getId());
}
示例3: findTest
import com.orm.SugarRecord; //導入方法依賴的package包/類
@Test
public void findTest() throws Exception {
save(new SimpleAnnotatedModel());
save(new SimpleAnnotatedModel());
List<SimpleAnnotatedModel> models =
SugarRecord.find(SimpleAnnotatedModel.class, "id = ?", "2");
assertEquals(1, models.size());
assertEquals(new Long(2L), models.get(0).getId());
}
示例4: first
import com.orm.SugarRecord; //導入方法依賴的package包/類
public T first() {
if (arguments == null) {
arguments = convertArgs(args);
}
List<T> list = SugarRecord.find(record, whereClause, arguments, groupBy, orderBy, "1");
return list.size() > 0 ? list.get(0) : null;
}
示例5: exists
import com.orm.SugarRecord; //導入方法依賴的package包/類
public boolean exists(String name)
{
List<Category> categories = SugarRecord.find(Category.class, "name = ?", name);
return (!categories.isEmpty());
}
示例6: isInCart
import com.orm.SugarRecord; //導入方法依賴的package包/類
private boolean isInCart(Product product)
{
List<CartItem> cartItems = SugarRecord.find(CartItem.class, "product = ?", String.valueOf(product.getId()));
return (!cartItems.isEmpty());
}
示例7: exists
import com.orm.SugarRecord; //導入方法依賴的package包/類
public boolean exists(String name, Category category)
{
List<Product> products = SugarRecord.find(Product.class, "(name = ?) AND (category = ?)", name, String.valueOf(category.getId()));
return (!products.isEmpty());
}