This post follows the previous post, so set up the environment as
In this example we will perform a full table scan (select * from my_data2) and an index scan (select * from my_data2 where userid=1).
The complete code is here from Severalnines.
Performing a full table scan (no search criteria)
Make sure you have records in the table my_data2.
To perform reads by primary key, we can just use Session::find(..), but here we will do a full table scan.
QueryBuilder qb = s.getQueryBuilder();[Read more]
* Run the query:
List resultList = query.getResultList();