我有这样的功能:
def getList(gig: Gig, createdBy: User = null, all: Boolean = true): List[Bid] = {
var bys = List[QueryParam](By(Bid.gig, gig))
if (createdBy!=null) bys = By(Bid.createdBy, createdBy) :: bys
if (!all) bys = By(Bid.deleted, false) :: bys
Bid.findAll(bys) //gives error as do not accept List[QueryParam]
}
如何为 findAll 提供动态数量的 QueryParam?