Yep. "id" has a special interpretation in queries. I Recommend against using it as the name of a regular Property. (Fortunately it's the only special case.)
-----Original Message----- From: Alejandro Revilla [mailto:[EMAIL PROTECTED] Sent: Thursday, 16 January 2003 4:15 PM To: [EMAIL PROTECTED] Subject: [Hibernate] Id name other than "id" and queries Hi All, First off, congratulations for your great project! I'm experiencing a problem, I'm trying the following query: select merchant from merchant in class my.project.Merchant, store in class my.project.Store where merchant.id = ? and store.id = ? and store.merchant = merchant Interesting enough, the generated query looks like this: SELECT merchant.oid as x0_0_ FROM store store, merchant merchant WHERE (merchant.oid=? )and(store.oid=? ) and(store.merchant_oid=merchant.oid ) (please note it says merchant.oid and store.oid instead of merchant.id and store.id). If I use a property other than "id", i.e: select merchant from merchant in class my.project.Merchant, store in class my.project.Store where merchant.name = ? and store.name = ? and store.merchant = merchant then the generated query looks fine. I guess the literal "id" is handled in an special way. BTW, in this case, Hibernate's ids are named "oid", "id" is just a regular property. --Alejandro PS.- I'm using Hibernate-1.2.2 ------------------------------------------------------- This SF.NET email is sponsored by: A Thawte Code Signing Certificate is essential in establishing user confidence by providing assurance of authenticity and code integrity. Download our Free Code Signing guide: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0028en _______________________________________________ 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: A Thawte Code Signing Certificate is essential in establishing user confidence by providing assurance of authenticity and code integrity. Download our Free Code Signing guide: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0028en _______________________________________________ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel