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.
For example my app had a query like this:
select U.ID from usuarios U
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:
select U.ID from "ROOT"."usuarios" U
So now how should I configure hibernate so it creates queries like my second query instead of my first query??
Here is my hibernate configuration:
<bean id="DataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<property name="driverClass" value="oracle.jdbc.driver.OracleDriver" />
<property name="jdbcUrl" value="jdbc:oracle:thin:@127.0.0.1:1521:xe" />
<property name="user" value="user" />
<property name="password" value="pass" />
<property name="maxPoolSize" value="50" />
<property name="maxStatements" value="0" />
<property name="minPoolSize" value="5" />
</bean>
<bean id="SessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="annotatedClasses">
<list>
<value>com.proximate.model.Usuarios</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>
<prop key="hibernate.show_sql">true</prop>
<!--prop key="hibernate.use_sql_comments">true</prop-->
<prop key="hibernate.format_sql">true</prop>
</props>
</property>
</bean>