Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
JPAContainer: Filtering on one-to-many relationships
It's clear that JPAContainer can filter on one-to-one and many-to-one relationships as nested properties. Is there a way to apply JPAContainer filters to one-to-many relationships?
Suppose I have
class Person {
int id;
List<Car> cars;
}
class Car {
int id;
Person person;
String color;
}
Any way I can filter a JPAContainer<Person> to show me only those Persons having a blue car?
If not, can anyone suggest a Vaadin best practice here? I was thinking of using JPA directly to query for set of Person ids, then filter the JPA container using Or and Equals filters....although this clearly won't scale...
just for the records: this should be done by adding a com.vaadin.data.Filter sublass to the JPAContainer
Hi Matthew,
This should do:
persons.addContainerFilter(new Like("cars.color", "blue", false) );
Hi Guys,
Im trying to do this but what im getting is : java.lang.IllegalArgumentException: Illegal attempt to dereference path source [null]. What should i do?
You need use JoinFilter, see example in java doc of class JoinFilter