NHibernate puts Quotes around table name with Oracle.

233 views
Skip to first unread message

Mas

unread,
Oct 29, 2009, 11:14:32 AM10/29/09
to nhusers
I'm trying to use NHibernate to connect talk to an Oracle 10g XE
database. I'm using Fluent to do my mappings.

The problem I'm running into is the SQL being sent to Oracle has
quotes around the table names. Since Oracle puts all table names to
upper case, it fails to find the table. I would like to have casing in
my mappings, just to improve readability.

I've tried to use the configuration <property
name="hbm2ddl.keywords">none</property>, suggested by the following
blog post:
http://nhforge.org/blogs/nhibernate/archive/2009/06/24/auto-quote-table-column-names.aspx

Is there a way to tell NHibernate not to put quotes around the table
name? On the flip side of that, is there a way to tell NHibernate to
put quotes around all identifiers (tables, columns, sequences)?

I'm using the driver OracleDataClientDriver, dialect Oracle10gDialect,
and Oracle 10g XE.

Thanks.

Fabio Maulo

unread,
Oct 31, 2009, 9:15:55 AM10/31/09
to nhu...@googlegroups.com
NHibernate does not quote tablename nor columns names by default.

2009/10/29 Mas <mshi...@gmail.com>



--
Fabio Maulo

Mas

unread,
Nov 2, 2009, 5:44:47 AM11/2/09
to nhusers
I solved the issue, and I'm kind of embarrassed because it was just a
stupid mistake.

It turns out that Fluent NHibernate was putting quotes on the table
name automatically, because I didn't explicitly specify the table
name.

I solved this problem by setting the table name explicitly in the
NHibernate mappings.

On Oct 31, 2:15 pm, Fabio Maulo <fabioma...@gmail.com> wrote:
> NHibernate does not quote tablename nor columns names by default.
>
> 2009/10/29 Mas <mshim...@gmail.com>
>
>
>
>
>
> > I'm trying to use NHibernate to connect talk to an Oracle 10g XE
> > database. I'm using Fluent to do my mappings.
>
> > The problem I'm running into is the SQL being sent to Oracle has
> > quotes around the table names. Since Oracle puts all table names  to
> > upper case, it fails to find the table. I would like to have casing in
> > my mappings, just to improve readability.
>
> > I've tried to use the configuration <property
> > name="hbm2ddl.keywords">none</property>, suggested by the following
> > blog post:
>
> >http://nhforge.org/blogs/nhibernate/archive/2009/06/24/auto-quote-tab...
Reply all
Reply to author
Forward
0 new messages