In the following code I am trying to get a List of Products which contains all the products in the database:
public List getAllProducts() throws
if you using sql query, you should add this line at the last of the query to get the list you want:
.setResultTransformer(Transformers.aliasToBean(testDTO.class)).list();