title: How to debug the implicit query executed by Hibernate?
body: <p>I get <code>ORA-00942: table or view does not exist</code> at runtime when the code reaches this line : <code>session.merge(role);</code></p>
  
  <p>So how to show the query text executed during this merge ?</p>
  
  <p><strong>update :</strong></p>
  
  <p>here is how I configured the app :</p>
  
  <pre><code>@Configuration
  @ComponentScan("com.ambre.pta")
  @EnableTransactionManagement
  @PropertySources({
      @PropertySource("classpath:jdbc.properties"),
      @PropertySource("classpath:fr/global.properties"),
      @PropertySource("classpath:fr/main.properties"),
      @PropertySource("classpath:fr/admin.properties"),
      @PropertySource("classpath:fr/referentiel.properties"),
      @PropertySource("classpath:fr/departement.properties"),
      @PropertySource("classpath:fr/exercice.properties"),
      @PropertySource("classpath:fr/defi.properties")
  })
  public class ApplicationContextConfig {
  
      @Autowired
      private Environment env;
  
      @Bean
      public static PropertySourcesPlaceholderConfigurer properties() {
          return new PropertySourcesPlaceholderConfigurer();
      }
  
      @Bean(name = "viewResolver")
      public InternalResourceViewResolver getViewResolver() {
          InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
          viewResolver.setPrefix("/WEB-INF/views/");
          viewResolver.setSuffix(".jsp");
          return viewResolver;
      }
  
      @Bean(name = "dataSource")
      public DataSource getDataSource() {
  
          BasicDataSource dataSource = new BasicDataSource();
  
          dataSource.setDriverClassName("oracle.jdbc.driver.OracleDriver");
          dataSource.setUrl("jdbc:oracle:thin:@"+env.getProperty("jdbc.server")+":"+env.getProperty("jdbc.port")+":"+env.getProperty("jdbc.instance"));
          dataSource.setUsername(env.getProperty("jdbc.login.default"));
          dataSource.setPassword(env.getProperty("jdbc.pwd.default"));
  
          return dataSource;
  
      }
  
      @Autowired
      @Bean(name = "sessionFactory")
      public SessionFactory getSessionFactory(DataSource dataSource) {
  
          LocalSessionFactoryBuilder sessionBuilder = new LocalSessionFactoryBuilder(dataSource);
  
          sessionBuilder.scanPackages("com.ambre.pta.model");
  
          return sessionBuilder.buildSessionFactory();
  
      }
  
      @Autowired
      @Bean(name = "transactionManager")
      public HibernateTransactionManager getTransactionManager(SessionFactory sessionFactory) {
  
          HibernateTransactionManager transactionManager = new HibernateTransactionManager(sessionFactory);
  
          return transactionManager;
  
      }
  
      @Autowired
      @Bean(name = "utilisateurDao")
      public UtilisateurDAO getUtilisateurDao(SessionFactory sessionFactory) {
          return new UtilisateurDAOImpl(sessionFactory);
      }
  
      @Autowired
      @Bean(name = "menuDao")
      public MenuDAO getMenuDao(SessionFactory sessionFactory) {
          return new MenuDAOImpl(sessionFactory);
      }
  
      ...
  
  }
  </code></pre>