0
我试图得到一个查询返回的顺序在Play中计算的字段。 这是我正在使用的查询。锡纳有可能通过计算字段进行订购吗?
return all().order("points").fetch();
其中点被定义为
public Integer points;
,并取得得益于此getter
public int getPoints(){
List<EventVote> votesP = votes.filter("isPositive", true).fetch();
List<EventVote> votesN = votes.filter("isPositive", false).fetch();
this.points= votesP.size()-votesN.size();
return this.points;
}
吸气剂正确调用,当我做
int votes=objectWithPoints.points;
我有感觉我是假装从锡耶纳有点太多,但我会喜欢这个工作(或一些类似的代码)。目前它只是跳过订单条件。在任何其他领域订购都能正常工作。