使用持久性js过滤预取实体

时间:2013-05-12 15:44:44

标签: javascript orm

我是持久性js的新手,我不确定是否可以在预取实体上应用过滤器。我使用websql作为商店。

以下是我尝试的示例,

var Category = persistence.define("Category", { categoryName : 'TEXT'});
var Expense = persistence.define("Expense", { expenseAmount : 'INT'});
Category.hasMany("expenses",Expense,"category");

//Query to get all expense related to a category - but this didn't work
Expense.all().prefetch("category").filter("categoryName","=","TestCategory");

有没有办法让它发挥作用?

0 个答案:

没有答案