aspose file tools*
The moose likes Object Relational Mapping and the fly likes hibernate usage--sql syntax error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "hibernate usage--sql syntax error" Watch "hibernate usage--sql syntax error" New topic
Author

hibernate usage--sql syntax error

suresh mandalapu
Ranch Hand

Joined: Sep 14, 2008
Posts: 32
hi, i am newbee to hibernate and mysql.
when i try to run a sample hibernate is giving me the following error
Unsuccessful: create table EVENTS (EVENT_ID bigint generated by default as identity (start with 1), EVENT_DATE timestamp, title varchar(255), primary key (EVENT_ID))
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'generated by default as identity (start with 1), EVENT_DATE timestamp, title var' at line 1
schema export complete....
and when i try to run the query ...
create table EVENTS (EVENT_ID bigint generated by default as identity (start with 1), EVENT_DATE timestamp, title varchar(255), primary key (EVENT_ID))
mysql also giving the same error..
with out that generated by default as identity (start with 1) mysql is successfully executing the query..
whats wrong with generated by default as identity (start with 1)
why hibernate is generating the extra words generated by default as identity (start with 1)

thannks suresh
Leandro Coutinho
Ranch Hand

Joined: Mar 04, 2009
Posts: 417
I don't know, but I use this for my ids.



How do you identify your ids?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: hibernate usage--sql syntax error