IntelliJ Java IDE
The moose likes Object Relational Mapping and the fly likes Hibernate and a Table called [group] - problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Object Relational Mapping
Reply Bookmark "Hibernate and a Table called [group] - problem" Watch "Hibernate and a Table called [group] - problem" New topic
Author

Hibernate and a Table called [group] - problem

Alana Sparx
Ranch Hand

Joined: Feb 14, 2006
Posts: 121
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

Joined: Oct 17, 2001
Posts: 153
Hi Alana,

Can you please check if the database userid used by hibernate has access to this table?


Shailesh Kini.
Alana Sparx
Ranch Hand

Joined: Feb 14, 2006
Posts: 121
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
 
 
subject: Hibernate and a Table called [group] - problem
 
Threads others viewed
Hibernate one-to-many weirdness...
Hibernate generating queries with duplicate columns
Incorrect joins on composite ID
Many-to-one mapping issue
hibernate mapping
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com