I have a requirement wherein I need to support both Oracle and PostgreSQL. I have following hibernate mapping -
<id name="id" type="java.lang.Integer">
<column name="id" not-null="true" />
<generator class="native">
<param name="sequence">`OneTimeAccessToken_id_seq`</param>
</generator>
</id>
<property name="resource" type="java.lang.String">
<column name="`res`" not-null="true" />
</property>
<property name="expires" type="long">
<column name="`expires`" not-null="true" />
</property>
However this does not work for Oracle, since it has that backquote. If I remove the backquote, it fails for PostgreSQL. Any inputs on how to provide support for both databases.
I am using org.hibernate.dialect.Oracle10gDialect
against Oracle 11.2 version, it that right?
My problem are the backticks and not making sequence compatible across databases. I have already achieved that. I used backticks in the hbm files to make PostgreSQL create table/columns as per the character case I specified. If I remove those backticks, PostgreSQL translates everything to lowercase. Now with backticks in place, everything works fine with PostgreSQL, however, it creates issues with Oracle saying it cannot find table or view: "OneTimeAccessToken". I am trying to identify how I should solve this problem of maintaining table/column name cases and also make it work against Oracle.