Dear everyone,
i have problem with my hibernate query. This is the code ;
String sql = "SELECT message.MESSAGE_TEXT, message.MESSAGE_ID FROM MESSAGES message ORDER BY message.MESSAGE_TEXT Asc where {message.MESSAGE_ID} = :messId"; List messages = sess.createSQLQuery(sql, "message", Message.class) .setLong("messId", 3) .list(); trans.commit();
it produce this error in the Jboss console :
WARN - SQL Error: 0, SQLState: null
ERROR - No such column MESSAGE_ID0_
WARN - SQL Error: 0, SQLState: null
ERROR - No such column MESSAGE_ID0_
ERROR - SQLException occurred
java.sql.SQLException: No such column MESSAGE_ID0_
at net.sourceforge.jtds.jdbc.AbstractResultSet.findColumn(AbstractResult
Set.java:442)
at net.sourceforge.jtds.jdbc.AbstractResultSet.getLong(AbstractResultSet
.java:116)
in my SQLSERVER i have a table called MESSAGES (MESSAGE_ID, MESSAGE_TEXT)
Please give me some enlightment.
Thanks
|