Thanks everybody. Lots of good ideas. This is my first application in Spring and Hibernate.. so a little more patience when dealing with "novices" like me..
Please read Tom Anderson and Roman C.'s answers. They explained very well the problem. And all of you helped me.I replaced
SELECT COUNT(*) FROM Books
with
select count(book.id) from Book book
And of course, I have this Spring config:
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="packagesToScan" value="extjs.model"/>
Thank you all again!