title: What’s wrong with my Hibernate configuration?
body: <p>I´ve an application with Spring + JSF + PrimeFaces + Hibernate + MySQL, so I was told that I needed to migrate the database from MySQL to Oracle, and I did it.
  So when I was testing the app I found that some queries created by hibernate weren´t working.</p>
  
  <p>For example my app had a query like this:</p>
  
  <p><code>select U.ID from usuarios U</code>
  and with mysql it works, but with oracle 11g it tells me that it can´t find the table or view.
  So I test it with sql developer and the only way to make it work was to change it to:</p>
  
  <pre><code>select U.ID from "ROOT"."usuarios" U
  </code></pre>
  
  <p>So now how should I configure hibernate so it creates queries like my second query instead of my first query??</p>
  
  <p>Here is my hibernate configuration:</p>
  
  <pre><code>    &lt;bean id="DataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"&gt;
      &lt;property name="driverClass" value="oracle.jdbc.driver.OracleDriver" /&gt; 
      &lt;property name="jdbcUrl" value="jdbc:oracle:thin:@127.0.0.1:1521:xe" /&gt;
      &lt;property name="user" value="user" /&gt;   
      &lt;property name="password" value="pass" /&gt;   
      &lt;property name="maxPoolSize" value="50" /&gt;
      &lt;property name="maxStatements" value="0" /&gt;
      &lt;property name="minPoolSize" value="5" /&gt; 
  &lt;/bean&gt;    
  &lt;bean id="SessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"&gt;
      &lt;property name="dataSource"&gt;
          &lt;ref bean="dataSource" /&gt;
      &lt;/property&gt;
      &lt;property name="annotatedClasses"&gt;
          &lt;list&gt;
              &lt;value&gt;com.proximate.model.Usuarios&lt;/value&gt;
          &lt;/list&gt;
      &lt;/property&gt;
      &lt;property name="hibernateProperties"&gt;
          &lt;props&gt;
              &lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.Oracle10gDialect&lt;/prop&gt;
              &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt;
              &lt;!--prop key="hibernate.use_sql_comments"&gt;true&lt;/prop--&gt;
              &lt;prop key="hibernate.format_sql"&gt;true&lt;/prop&gt;                         
          &lt;/props&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>