How to filter Entity without a request in the database and no cycle?

Please tell me whether JPA analogue Link from the NET, well, to be able to filter the loaded records TestEntity. For example, I did request and downloaded all the records from the table TEST, then as needed, I select only the desired records. Thanks In Advance!
public List findResult() {
return em.createQuery("SELECT t FROM TestEntity t").getResultList();
}
July 8th 19 at 12:07
3 answers
July 8th 19 at 12:09
Solution
JPA has its own object-oriented query language. In Hibernate's HQL, JPA JPQL.
https://ru.wikipedia.org/wiki/Java_Persistence_Que...
July 8th 19 at 12:11
If you want to filter the list of records retrieved from the database. you can do this using lambdas and StreamAPI. Something like:
list.stream()
 .filter(entity -> "bar".equals(entity.getFoo()))
 .collect(Collectors.toList());


In General, you need to filter in the query to the database.
July 8th 19 at 12:13
Uploaded where? In array?

Find more questions by tags Java