Hello,
I am having a lot of trouble making my first list query. I know hibernate is set up correctly because I can insert and get values from the db. My problems start when I use the session.find and session.createQuery. The simplest example I could find was session.find("from CLASSNAME"); where CLASSNAME is the name of my object.
It seems the SQL generated is incorect or my persister(?) is not right.
Hibernate generates the following sql
Hibernate: select mediaitem0_.mediaId as mediaId, mediaitem0_.desc as desc, mediaitem0_.label as label from media mediaitem0_
I have tried this sql in the MySQL query analyzer and it fails there too. Any ideas?
Joe
2953 [http8080-Processor1] WARN util.JDBCExceptionReporter - SQL Error: 1064, S
QLState: 42000
2953 [http8080-Processor1] ERROR util.JDBCExceptionReporter - Syntax error or a
ccess violation message from server: "You have an error in your SQL syntax. Che
ck the manual that corresponds to your MySQL server version for the right syntax
to use near 'desc, mediaitem0_.label as label from media mediaitem0_' at lin"
2953 [http8080-Processor1] WARN util.JDBCExceptionReporter - SQL Error: 1064, S
QLState: 42000
2953 [http8080-Processor1] ERROR util.JDBCExceptionReporter - Syntax error or a
ccess violation message from server: "You have an error in your SQL syntax. Che
ck the manual that corresponds to your MySQL server version for the right syntax
to use near 'desc, mediaitem0_.label as label from media mediaitem0_' at lin"
2953 [http8080-Processor1] ERROR util.JDBCExceptionReporter - Could not execute
query
java.sql.SQLException: Syntax error or access violation message from server: "Yo
u have an error in your SQL syntax. Check the manual that corresponds to your M
ySQL server version for the right syntax to use near 'desc, mediaitem0_.label as
label from media mediaitem0_' at lin"
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2746)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1532)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1622)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2278)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2204)
|