我想重寫我的模型之一的CRUD模塊的list()函數。如何覆蓋CRUD/list()函數?玩!框架
我發現this谷歌組基本上是我遇到的問題。
基本上我想根據certian類別過濾列表,我嘗試這樣做:
控制器
public static void list(string category){
List<Duty> object = Duty.getByCategory(category);
render(object);
}
模型
public static List<Duty> getByCategory(String category){
List<Duty> result = Duty.find("select distinct d from Duty d join " +
"d.category c where c.name = ? order by d.name", category).fetch();
return result;
}
我收到以下錯誤:
如何覆蓋列表操作?
任何幫助將不勝感激。