What is fastest?

i would like to know what is fastest, a query filtering the data with JPA or select all the data on the table and then search with java in the collection of entities

the less amount of data transfer from db to appserver is the fastest.