> Are you sure there is a column in the table named "user_id"??

This was the problem - it's named "userid".  Thanks for putting an eye on
this baby and giving me a hand!

Matt

-----Original Message-----
From: Gavin King [mailto:[EMAIL PROTECTED]
Sent: Friday, December 20, 2002 5:57 PM
To: Raible, Matt
Cc: [EMAIL PROTECTED]
Subject: RE: [Hibernate] Oracle error



> 
> 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".

Nope! Look carefully at the generated SQL. It is correct! It
defines an alias "user" for the table user_sys_access. That
SQL would execute perfectly on Oracle, except for the fact
that "user" is a reserved word. So you need to use a different
alias in the HQL. eg:

from u in class User where u.username = ?

("u" is not a reserved word)


> 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 = ?

I don't understand how this could possibly not execute on Orace!
Are you sure there is a column in the table named "user_id"??

Is User0 a reserved word for some bizzare reason???


********** 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

Reply via email to