Using Hibernate, what is the most efficient way to determine if a table is empty or non-empty? In other words, does the table have 0, or more than 0 rows?
I could execute the HQL query select count(*) from tablename
and then check if result is 0 or non-0, but this isn't optimal as I would be asking the database for more detail than I really need.