Hi all,
I have a table (EVENT) with many records, for example, 10000.
Each record has one boolean attribute (checked).
I would like to recover all the records with this attribute as false.
Which is the faster method?
1. Creates a query like this: getHibernateTemplate().find("Event event where checked='0'");
2. Loops all the records (java foreach), checks if that java attribute is false and returns all of them.
for (Event event: allEvents){
if(!event.isChecked){
list.add(event);
}
}
return list;
Many thanks.
|