如何使用JPAContainer DefaultQueryModifierDelegate在vaadin容器中实现GROUP BY?

时间:2013-05-22 17:06:39

标签: java jpa group-by vaadin

我正在使用Vaadin的JPAContainer来添加where子句,但是如何使用group by?

data.getEntityProvider().setQueryModifierDelegate(
                new DefaultQueryModifierDelegate() {

                    @Override
                    public void filtersWillBeAdded(CriteriaBuilder criteriaBuilder, CriteriaQuery<?> query, List<Predicate> predicates) {

                        super.filtersWillBeAdded(criteriaBuilder, query, predicates);

                        //Where clauses

                        //query.groupBy(fromEntity.get(groupByColName)); ???

                    }
                }

我收到错误

result returns more than one elements

1 个答案:

答案 0 :(得分:0)

也许为时已晚......

我开了一张票 http://dev.vaadin.com/ticket/14484

推了一个补丁 https://dev.vaadin.com/review/#/c/4365/

试试吧