From: Gavin_King/Cirrus%<CI...@ci...> - 2002-05-15 10:00:44
|
>> I am correct in my findings that you cannot currently do queries based on composite keys where you only want to select using only 1 of the composite key properties? The only way currently supported is to do a "find" for the object using the composite key object, right? Yeah, thats about right. Nor can you frame queries that would require a table join on the composite key. >> I ended up patching Hibernate so you can do a select based on the composite key, however I think the way I did it is only valid as a temporary solution. I would be willing to work on adding complete query support for composite keys if anyone else thinks there is demand for this. Sounds great! Any work you could do in this area is _much_ appreciated!Exactly what are you proposing? I'm thinking a syntax something like: from foo in class eg.Foo where foo.id.subid = 69 where id is the composite identifier of eg.Foo. I apologise for all the hand-written parsing code for the query language. I knew zero about lexing + parsing at the time so I ended up doing by hand what I should have used ANTLR for. It was my intention to reimplement the query language using an antlr grammar I wrote later. (Yeah, I educated myself since.) However, since this is the very first feature request to do with queries, I'm now inclined to leave alone a feature that seems to be serving everyone quite well :) Thanks for the offer of help peace Gavin |