my dog learned polymorphism*
The moose likes Object Relational Mapping and the fly likes 'survey.hibernate_unique_key' doesn't exist Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark " Watch " New topic
Author

'survey.hibernate_unique_key' doesn't exist"

Tim McGuire
Ranch Hand

Joined: Apr 30, 2003
Posts: 820

I am using mySQL and hibernate. I am using auto_imcrement on a column in mySQL (the column is the primary key) and I'm trying to tell hibernate to point the generator at column as the unique ID and I'm not sure how to write the generator.

Should I use class = "native" or class = "sequence" or "identity" or "hilo" or something else?

From the documentation, it seems I should use "identity" but when using identity I get the error:
Dialect does not support identity key generation. What am I missing?
thanks!



thanks!

[ August 20, 2004: Message edited by: Tim McGuire ]

[ August 20, 2004: Message edited by: Tim McGuire ]
[ August 20, 2004: Message edited by: Tim McGuire ]
Tim McGuire
Ranch Hand

Joined: Apr 30, 2003
Posts: 820

HA! I just needed to add a line to my hibernate.properties file:

hibernate.dialect net.sf.hibernate.dialect.MySQLDialect

and it worked.

for some reason, creating hibernate.cfg.xml and trying to set the dialect there did not work.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: 'survey.hibernate_unique_key' doesn't exist"