I am trying to use Hibernate to connect to Oracle. I was using MySQL - where everything worked. All I've changed (so far) was the tablename from "user" to "cct_user". Now I'm getting the following error:
[junit] Testcase: testGetUser(com.cable.comcast.dmc.itd.cct.persistence.ApplicationDAOHibernat eTest): Caused an ERROR [junit] java.sql.SQLException: ORA-00923: FROM keyword not found where expected
[junit] com.cable.comcast.dmc.itd.cct.persistence.DAOException: java.sql.SQLException: ORA-00923: FROM keyword not found where expected
I'm guessing there's something wrong with this code:
List users = (List) ses.find("from user in class
com.cable.comcast.dmc.itd.cct.persistence.User where username=?",
name, Hibernate.STRING);
I believe it will work if you change that statement to "from usr in class c.c.c.d.i.c.p.User where usr.username=?".
The first problem is "user" is a keyword in Oracle. The second problem is that you need to specify where username is coming from.
Gavin, perhaps this should be a FAQ? I think I've seen this question a couple times before in the forums.
-Mark
------------------------------------------------------- This SF.NET email is sponsored by: Order your Holiday Geek Presents Now! Green Lasers, Hip Geek T-Shirts, Remote Control Tanks, Caffeinated Soap, MP3 Players, XBox Games, Flying Saucers, WebCams, Smart Putty. T H I N K G E E K . C O M http://www.thinkgeek.com/sf/ _______________________________________________ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel