Table using back-tick not passing validation on Oracle

Description

I have a table mapping that looks similar to the following:
<class name="User" table="`User`">
<!-- etc. -->

Notice the back-ticks around the table name.

When I use Hibernate to create the schema for me, it correctly generates a table name called "User" (including the quote marks). But when I validate the schema, it cannot find the table and so validation fails.

I am thinking the problem is somewhere in org/hibernate/tool/hbm2ddl/DatabaseMetadata.getTableMetadata(). It tries to look for "USER", because OracleDatabaseMetaData.storesUpperCaseIdentifiers() returns true. But the code doesn't realize that quoted tables are a special case and it has to look for "User" instead.

Another symptom of the same problem is that if I generate a schema update script, it will attempt to re-create the existing table.

Activity

Steve EbersoleMarch 21, 2011 at 7:04 PM

Bulk closing stale resolved issues

Matt SolnitJune 18, 2007 at 11:58 PM

It turns out this is a duplicate of HHH-1629. The upgrade to Hibernate 3.2.3 fixed the problem 🙂.

Matt SolnitJune 18, 2007 at 10:44 PM

The same issue exists with PostgreSQL, except that Jdbc3DatabaseMetaData.storesLowerCaseIdentifiers() returns true instead of storesUpperCaseIdentifiers().

I am using version 8.2.4 for Mac OS X, and JDBC driver version 8.2 Build 505.

Matt SolnitJuly 26, 2006 at 9:21 PM

P.S. Using version 10gR2 of the Oracle JDBC driver.

Duplicate

Details

Assignee

Reporter

Affects versions

Priority

Created July 26, 2006 at 8:42 PM
Updated March 21, 2011 at 7:04 PM
Resolved September 23, 2007 at 9:31 PM

Flag notifications