我有vaadin8网格和vaadin-grid-util(2.1.1)插件,过滤器在字符串,日期,布尔值,int上工作正常,但是在它是实体或实体集时不能在列上工作。
示例:
class Parent {
...
@ManyToMany{...}
private Set<Child> children = new HashSet<Child>(0);
//getters, setters
}
class Child {
...
@ManyToMany(mappedBy = "children")
private Set<Parent> parent = new Parent<>();
//getters, setters
}
在“一切都看似标准”中
private final Grid<Parent> table = new Grid<Parent>(Parent.class);
private GridCellFilter<Parent> filters;
private buildGrid{
//1st example of implementation returns java.lang.ClassCastException: org.hibernate.collection.internal.PersistentSet cannot be cast to java.lang.String
//filters.setTextFilter("children", true, false);
//2nd example implementation doesn't filter rows, it hides all rows by selecting combobox
filters.setComboBoxFilter("children", Child.class, ((MyUI) MyUI.getCurrent()).childService.getItemList());
}
我的问题是:如何对具有实体或实体集的单元实施过滤?