Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate and a Table called [group] - problem

 
Alana Sparx
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all

I need to model a table called group which, being an SQL keyword is giving me some problems.

My Group.hbm.xml file is defined as:


When I try and query the database, the following sql is produced



which falls over with the exception message


If I run the sql against the database, it works fine!!

I've tried replacing the [] with backticks (``), the same eception is thrown.

There is also the problem that the query returns everything despite being given a QBE object with the composite keys filled in, but one thing at a time, eh?
 
Shailesh Kini
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Alana,

Can you please check if the database userid used by hibernate has access to this table?
 
Alana Sparx
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Shailesh

Oh, it's much more serious than that. It would help if the test database I was using had a [group] table in the first place!

Sometimes my own stupidity amazes even me!

Many thanks
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!