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 |
From: Gavin_King/Cirrus%<CI...@ci...> - 2002-05-15 12:56:42
|
Cool. Looking forward to it. Peace >> It might take a few days to implement this since I'm in the middle of another project, but since I need this in quite a few places I am motivated to implement this. |
From: Jon L. <jon...@xe...> - 2002-05-18 01:13:49
|
Hi... I just wanted to give you a quick update... I have the query by composite keys working now. I will do some more testing throughout the weekend and early next week to make sure that everything else still works. If it everything checks out with no problems, I'll post the patches the middle of next week. Cheers, Jon... ----- Original Message ----- From: <Gavin_King/Cirrus%CI...@ci...> To: <hib...@li...> Sent: Wednesday, May 15, 2002 2:42 PM Subject: Re: [Hibernate-devel] Queries on objects with composite keys... > > Cool. Looking forward to it. > > Peace > > >> It might take a few days to implement this since I'm in the middle of > another project, but since I need this in quite a few places I am motivated > to implement this. > > > _______________________________________________________________ > > Have big pipes? SourceForge.net is looking for download mirrors. We supply > the hardware. You get the recognition. Email Us: ban...@so... > _______________________________________________ > Hibernate-devel mailing list > Hib...@li... > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > |
From: Jon L. <jon...@xe...> - 2002-05-15 10:10:27
|
I had the same idea for the syntax, but I wanted to make sure you agreed with that before I dove in and started working on it. As a quick hack just to get my app up and running I patched Hibernate to allow me to queries like: from foo in class eg.Foo where foo.subid = 69 However I didn't feel like this was an accurate representation of the object relationships so I now I'd like to do it right. It might take a few days to implement this since I'm in the middle of another project, but since I need this in quite a few places I am motivated to implement this. Cheers, Jon... ----- Original Message ----- From: <Gavin_King/Cirrus%CI...@ci...> To: "Jon Lipsky" <jon...@xe...> Cc: <hib...@li...> Sent: Wednesday, May 15, 2002 11:46 AM Subject: Re: [Hibernate-devel] Queries on objects with composite keys... > > > >> 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 > |