Discussion:
[Middlegen-user] Middlegen Hibernate Firebird quotes problem
Adrian Allende
2005-01-12 10:07:12 UTC
Permalink
Hello all

I'm trying Middlegen Hibernate in my Firebird DB, and have heavy problems with quotes.
The example database works well in all the tools, but a dialect 3
database with non-all-uppercase identifiers is a nightmare.
XML (.hbm.xml) can handle quotes within single quotes (e.g.
property='"identifier"') but xdoclet tags in Java classes needs
special hibernate sintax (e.g. @hibernate ... table="`Table Name`").

Middlegen has no comment in how to handle quoted identifiers.
In a middlegen ant buils file one can do

<taskdef name="middlegen" ...
<middlegen ...
<table name="An_Anims"/>

wich does not found a table called, obiously AN_ANIMS

using
<table name="&quot;An_Anims&quot;"/>

should fix the problem, but middlegen gets an exception trying to
create a file called "anAnims".hbm.xml
The problem is that a file name can not contains quotes!

Changing the table name to all-upper works well, but if the table has
a column with no-all-upper, have the same problem.

The problem is that middlegen does not handle well quoted identifiers.

Change all DB identifiers (tables, columns, exceptios, etc.) is not
an
option because the DB has a lot of identifiers and SPs, triggers ...

Somebody are using middlegen / firebird (to create hibernate .hbm.xml files)?
Somebody use that in a non-all-uppercase identifiers DB?

Thanks in advance

Adrian Allende

Loading...