views:

100

answers:

2

Hi,

I have a table called Items. When I tried to do 'Hibernate Reverse Enginering' in MyEclipse and run the program, I got this error:

com.mysql.jdbc.exceptions.MySQLSyntaxErrorException:
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 '?tems0_.ItemID as ItemID8_, ?tems0_.ItemGroupID as ItemGrou2_8_, ?tems0_.ItemEnt' at line 1

I wrote show_sql = true on my hibernate.cfg.xml . Now I get the sql but I don't know where the problem is? Can someone help me?

And this is my sql from the console:

Hibernate:

select ıtems0_.ItemID as ItemID8_, ıtems0_.ItemGroupID as ItemGrou2_8_,
  ıtems0_.ItemEnterDate as ItemEnte3_8_, ıtems0_.ItemAuthor as ItemAuthor8_,
  ıtems0_.ItemTitle as ItemTitle8_, ıtems0_.ItemDetail as ItemDetail8_,
  ıtems0_.ItemPic as ItemPic8_, ıtems0_.ItemMainNews as ItemMain8_8_,
  ıtems0_.ItemGroup5 as ItemGroup9_8_, ıtems0_.ItemGroup10 as ItemGroup10_8_,
  ıtems0_.ItemFrontpage as ItemFro11_8_, ıtems0_.ItemVisited as ItemVis12_8_,
  ıtems0_.ItemProposed as ItemPro13_8_, ıtems0_.ItemVoted as ItemVoted8_, 
  ıtems0_.ItemScored as ItemScored8_, ıtems0_.ItemDisabled as ItemDis16_8_,
  ıtems0_.ItemNewsGroup as ItemNew17_8_ from news.items ıtems0_.

I think there is a problem with the character 'ı'.

Thanks.

A: 
 ...from news.items ıtems0_.

This problem is the full stop at the very end. Is this actually the sql that hibernate produces?

mR_fr0g
A: 

Yes, it's the sql that hibernate produces.

And I think I found my answer to this question. My PC's language setting is different than English. I changed language settings to English, then after I created my classes from my tables using Hibernate Reverse Enginering. Everything became ok.