Ok this is really weird. I'm not so sure that this is a problem with composite-id's now.
Here is the query that it fails on:
SELECT Posting FROM Posting IN CLASS com.xxx.tex.dao.posting.PostingImpl ,
Attr1 IN CLASS com.xxx.tex.dao.posting.PostingAttributeImpl ,
Attr2 IN CLASS com.xxx.tex.dao.posting.PostingAttributeImpl ,
Attr3 IN CLASS com.xxx.tex.dao.posting.PostingAttributeImpl ,
Attr4 IN CLASS com.xxx.tex.dao.posting.PostingAttributeImpl
WHERE Attr1.postingAttributeId.attributeId = 'product'
AND Posting.postingId = Attr1.postingAttributeId.postingId
AND Attr1.stringValue = ?
AND Posting.postingId = Attr2.postingAttributeId.postingId
AND Attr2.postingAttributeId.attributeId = 'medium'
AND Attr2.stringValue = ?
AND Posting.postingId = Attr3.postingAttributeId.postingId
AND Attr3.postingAttributeId.attributeId = 'product_type'
AND Attr3.stringValue = ?
AND Posting.postingId = Attr4.postingAttributeId.postingId
AND Attr4.postingAttributeId.attributeId = 'grade'
AND Attr4.stringValue = ?
AND Posting.postingId = Attr1.postingAttributeId.postingId
AND Posting.postingType.postingTypeId IN (0,1)
The error that it gives is:
cirrus.hibernate.QueryException: unresolved property: postingAttributeId
The weird thing is that in the exception, it says the query that it is parsing was:
SELECT Posting FROM Posting IN CLASS com.xxx.tex.dao.posting.PostingHistoryImpl ,
Attr1 IN CLASS com.xxx.tex.dao.posting.PostingAttributeHistoryImpl ,
Attr2 IN CLASS com.xxx.tex.dao.posting.PostingAttributeHistoryImpl ,
Attr3 IN CLASS com.xxx.tex.dao.posting.PostingAttributeHistoryImpl ,
Attr4 IN CLASS com.xxx.tex.dao.posting.PostingAttributeHistoryImpl
WHERE Attr1.postingAttributeId.attributeId = 'product'
AND Posting.postingId = Attr1.postingAttributeId.postingId
AND Attr1.stringValue = ?
AND Posting.postingId = Attr2.postingAttributeId.postingId
AND Attr2.postingAttributeId.attributeId = 'medium'
AND Attr2.stringValue = ?
AND Posting.postingId = Attr3.postingAttributeId.postingId
AND Attr3.postingAttributeId.attributeId = 'product_type'
AND Attr3.stringValue = ?
AND Posting.postingId = Attr4.postingAttributeId.postingId
AND Attr4.postingAttributeId.attributeId = 'grade'
AND Attr4.stringValue = ? A
ND Posting.postingId = Attr1.postingAttributeId.postingId
AND Posting.postingType.postingTypeId IN (0,1)
If you notice the "PostingImpl" has been changes to "PostingHistoryImpl" and the "PostingAttributeImpl" has been changed to "PostingAttributeHistoryImpl".
I'm not quite sure why this is happening.
I do have mapping entries for "PostingHistoryImpl" and "PostingAttributeHistoryImpl" classes. They are similar to the non history Impl classes in that they implement the same interfaces. The datamodel that I am programming to has the "history" tables seperated from the "current" tables, so that is why I have something like this.
Since "postingAttributeId" is a composite id that led me to believe that this is the problem, since that is similar to the error that I was getting a few months ago before we added support for composite-id queries. However, now that I have looked at it a little closer, I think something else may be happinging? Any ideas?
Jon...
-----Original Message-----
From: One Ovthafew [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 09, 2003 12:38 PM
To: [EMAIL PROTECTED]
Subject: Re: [Hibernate] Queries with composite id's
>> I recently upgraded one of our applications from Hibernate 1.0 (or
one of the release around there) to Hibernate 1.2. My queries that depend on the properties of a composite id no longer work. <<
Yick!! I'm very surprised.....I paid special attention to this in the test suite, because I knew it was something that could easily break....
Yes, please go digging. (This is very bad.)
What exactly does the query look like?
Gavin
---------------------------------------------------------------------
Never lose a fax again, receive faxes to your personal email account! Visit http://www.mbox.com.au/fax
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com _______________________________________________
hibernate-devel mailing list [EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel