Here's the SQL that Hibernate is generating for me:

    [junit] Hibernate: SELECT user.user_id as user_id, user.changed_by as
changed_by, user.created_by as created_by, user.dt_changed as dt_changed,
user.dt_created as dt_created, user.headend_id as headend_id, user.mso_id as
mso_id FROM user_sys_access user WHERE (user.user_id=? )

And it should be using "user_sys_access" rather than "user".

I tried changing it to just load the record based on the Id (no OQL):

user = (User) ses.load(User.class, userId);

And I get an invalid column name error on User0.user_id.  Is it possible to
get rid of the User0 prefix that's causing these problems?  Attached is my
User.hbm.xml.

    [junit] Hibernate: SELECT User0.user_id AS user_id, User0.changed_by as
changed_by, User0.created_by as created_by, User0.dt_changed as dt_changed,
User0.dt_created as dt_created, User0.headend_id as headend_id, User0.mso_id
as mso_id FROM user_sys_access User0 WHERE User0.user_id = ?

Thanks,

Matt

On 12/20/02 4:49 PM, "Gavin King" <[EMAIL PROTECTED]> wrote:

> set 
> 
> hiberante.show_sql=true
> 
> or put log4j.properties in the classpath
> 
>> -----Original Message-----
>> From: Raible, Matt [mailto:[EMAIL PROTECTED]
>> Sent: Saturday, 21 December 2002 10:34 AM
>> To: [EMAIL PROTECTED]
>> Subject: RE: [Hibernate] Oracle error
>> 
>> 
>> I changed it to use this error and I'm still getting the same
>> error.  I'm guessing that my table name is irrelevant as long
>> as it's in the User.hbm.xml file.
>> 
>> Is there anyway to turn on debugging so I can see the SQL being sent?
>> 
>> Thanks,
>> 
>> Matt
>> 
>> -----Original Message-----
>> From: Gavin King [mailto:[EMAIL PROTECTED]
>> Sent: Friday, December 20, 2002 3:57 PM
>> To: Raible, Matt
>> Cc: [EMAIL PROTECTED]
>> Subject: RE: [Hibernate] Oracle error
>> 
>> 
>> Correct QL syntax is:
>> 
>> from user in class
>> com.cable.comcast.dmc.itd.cct.persistence.User
>> where user.username=?
>> 
>> :)
>> 
>>> -----Original Message-----
>>> From: Matt Raible [mailto:[EMAIL PROTECTED]
>>> Sent: Saturday, 21 December 2002 6:21 AM
>>> To: [EMAIL PROTECTED]
>>> Subject: [Hibernate] Oracle error
>>> 
>>> 
>>> 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.Applicat
>>> ionDAOHibernat
>>> 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);
>>> 
>>> Thanks,
>>> 
>>> Matt
>>> 
>>> 
>>> 
>>> -------------------------------------------------------
>>> This SF.NET email is sponsored by:  The Best Geek Holiday
>>> Gifts! Time is running out!  Thinkgeek.com has the coolest gifts for
>>> your favorite geek.   Let your fingers do the typing.   Visit Now.
>>> 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
>>> 
>> 
>> 
>> ********** CAUTION - Disclaimer **********
>> This message may contain privileged and confidential
>> information. If you are not the intended recipient of this
>> message (or responsible for delivery of the message to
>> such person) you are hereby notified that any use,
>> dissemination, distribution or reproduction of this message
>> is prohibited. If you have received this message in error,
>> you should destroy it and kindly notify the sender by reply
>> e-mail. Please advise immediately if you or your employer
>> do not consent to Internet e-mail for messages of this kind.
>> Opinions, conclusions and other information in this
>> message that do not relate to the official business of
>> Expert Information Services Pty Ltd ("The Company")
>> shall be understood as neither given nor endorsed by it.
>> 
>> The Company advises that this e-mail and any attached
>> files should be scanned to detect viruses. The Company
>> accepts no liability for loss or damage (whether caused
>> by negligence or not) resulting from the use of any
>> attached files.
>> **EIS******** End of Disclaimer **********
>> 
>> 
>> 
>> -------------------------------------------------------
>> This SF.NET email is sponsored by:  The Best Geek Holiday Gifts!
>> Time is running out!  Thinkgeek.com has the coolest gifts for
>> your favorite geek.   Let your fingers do the typing.   Visit Now.
>> 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
>> 
> 


Attachment: User.hbm.xml
Description: Binary data

Reply via email to