I found quite interesting thing to (probably) solve my problems with identifier names for Oracle DB -> http://code.google.com/p/hibernate-naming-strategy-for-oracle/
But I have hard times making it work withing my project with Spring MVC.
Although I added in every single place it was possible, somehow spring is not setting the naming strategy for my Hibernate.
Part of my servlet-context.xml
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<property name="driverClass" value="oracle.jdbc.OracleDriver"/>
<property name="jdbcUrl" value="jdbc:oracle:thin:@127.0.0.1:1521:orcl"/>
<property name="user" value="xxx"/>
<property name="password" value="xxx"/>
<property name="maxPoolSize" value="10"/>
<property name="maxStatements" value="0"/>
<property name="minPoolSize" value="5"/>
</bean>
<bean id="namingStrategy" class="com.execon.OracleNamingStrategy"/>
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="namingStrategy" ref="namingStrategy"/>
<property name="dataSource" ref="dataSource"/>
<property name="configLocation" value="classpath:hibernate.cfg.xml"/>
<property name="packagesToScan" value="com.execon.models"/>
</bean>
<tx:annotation-driven transaction-manager="txManager"/>
<bean id="txManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
and hibernate.cfg.xml
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>
<property name="show_sql">true</property>
<property name="format_sql">true</property>
<property name="hibernate.current_session_context_class">thread</property>
<property name="hibernate.ejb.naming_strategy">com.execon.OracleNamingStrategy</property>
</session-factory>
</hibernate-configuration>
What seems to be the problem?
After checking the documentation that you did everything as intended, get the source code of Spring and Hibernate, put break points in the places where the SessionFactory and its naming strategy gets configured and debug through the code.