Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

'survey.hibernate_unique_key' doesn't exist"

 
Tim McGuire
Ranch Hand
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic