From: Mark W. <mor...@SM...> - 2002-12-22 01:32:43
|
Matt Raible wrote: >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 |