When debugging it could be useful to see what are the queries Hibernate executes. To do so there are some ways of enabling debug logging:

Using Log4J configuration

log4j.logger.org.hibernate.SQL=DEBUG

(in Liferay: you can change it from the admin panel without restarting the server)

Modifying Hibernate XML configuration

You need to change the factory bean that handles Hibernate sessions (a subclass of LocalSessionFactoryBean).

<property name="hibernateProperties">
  <props>
    <property name="show_sql">true</property> 
    <property name="format_sql">true</property> 
    <property name="use_sql_comments">true</property>
  </props>
</property>