> Markdown version of [Filtering JPAContainer](https://vaadin.com/docs/v7/framework/jpacontainer/jpacontainer-filtering). Section index: [llms.txt](https://vaadin.com/docs/v7/framework/llms.txt)

# <a id="jpacontainer.filtering"></a>Filtering JPAContainer

Normally, a JPAContainer contains all instances of a particular entity type in the persistence context. Hence, it is equivalent to a database table or query. Just like with database queries, you often want to narrow the results down. JPAContainer implements the Filterable interface in Vaadin containers, described in ["Filterable Containers"](https://vaadin.com/docs/v7/framework/datamodel/datamodel-container.md#datamodel.container.filtered). All filtering is done at the database level with queries, not in the container.

For example, let us filter all the people older than 117:

```
Filter filter = new Compare.Greater("age", 117);
persons.addContainerFilter(filter);
```

This would create a JPQL query somewhat as follows:

```
SELECT id FROM Person WHERE (AGE > 117)
```

The filtering implementation uses the JPA 2.0 Criteria API transparently. As the filtering is done at the database-level, custom filters that use the Filterable API do not work.

When using Hibernate, note that it does not support implicit joins. See ["Joins in Hibernate vs EclipseLink"](https://vaadin.com/docs/v7/framework/jpacontainer/jpacontainer-hibernate.md#jpacontainer.hibernate.joins) for more details.
