What is the correct way to write this JPA query? I am just guessing as I cant work it out or find it in my JPA book.
Query query=em.createQuery("select m from Meeting m where count(m.attendees) = 0");
return query.getResultList();
I am currently trying this with Hibernate and I get a mysql error!
ERROR org.hibernate.util.JDBCExceptionReporter - You have an error in your
SQL syntax; check the manual that corresponds to your MySQL server version
for the right syntax to use near ')=0' at line 1
To strictly answer the title of the question, use
SIZE:From the JPA specification:
In the particular case of
0, you could also useIS EMPTYI would test both to see which one is the most efficient (check the query plan).