[Hibernate] Re: Polymorphic queries, where and order by

2004-09-29 Thread Andrei Sereda
Why don't you make "from B b order by b.field2" ? > > Let's say we have the following (simplified) mapping : > > > > > > > > > > Now we can execute any HQL query on the class A using the field1, for > example > "from A a where a.field1 like 'anything%'" or "from A a orde

Re: [Hibernate] Re: Polymorphic queries, where and order by

2004-09-29 Thread William Draï
This is the second option I mentioned. By doing this I won't get elements of class A (assuming these elements are considered having field2 = null). It would probably be clearer with a UI example : The user gets this table : Class      field1              field2 A            Paris A           

RE: [Hibernate] Polymorphic queries, where and order by

2004-09-29 Thread March, Andres
I'm sorry if I expand the subject a little. We pulled a patch off the forums some where that allows us to order by any association. I was wondering why this patch never got applied. It seems it would be useful in this situation as well. I am really uncomfortable using a patched hibernate be

Re: [Hibernate] Polymorphic queries, where and order by

2004-09-29 Thread Emmanuel Bernard
Speaking from memory, Gavin did implement something on the (now dead 2.2 branch). It now has been reporded on H3. Did you test it? I can remembe, he'd implemented the transparent subclassing (no special keyword). March, Andres wrote: I'm sorry if I expand the subject a little. We pulled a

RE: [Hibernate] Polymorphic queries, where and order by

2004-09-29 Thread March, Andres
Found the JIRA issues where we got the patch (see: http://opensource.atlassian.com/projects/hibernate/browse/HB-132 and http://opensource.atlassian.com/projects/hibernate/browse/HB-822).  We have been testing and using this patch for about a month.  We will be going live with this if we can

RE: [Hibernate] Polymorphic queries, where and order by

2004-09-29 Thread March, Andres
Let me know if these are enough to get you going (see: http://opensource.atlassian.com/projects/hibernate/browse/HB-132 and http://opensource.atlassian.com/projects/hibernate/browse/HB-822 ). I am working on creating a more recent unified patch file. It would help to know if this will be well

Re: [Hibernate] Polymorphic queries, where and order by

2004-09-29 Thread William Draï
I haven't yet tested with H3. I think there were no change logs related to this. I will try as soon as I have enough time. We can live without this "feature" for a few more weeks. Thank you for your anwser. Speaking from memory, Gavin did implement something on the (now dead 2.2 branc

RE: [Hibernate] Polymorphic queries, where and order by

2004-09-29 Thread March, Andres
We can’t use H3 unfortunately because we do not have enough time to add H3 support to Spring.  Is there any way this patch can be applied to H2?   From: William Draï [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 29, 2004 11:22 AM To: Emmanuel Bernard Cc: March, Andres; [

Re: [Hibernate] Polymorphic queries, where and order by

2004-09-29 Thread Emmanuel Bernard
Sorry, no new feature will be added to the 2.1 branch. March, Andres wrote: We can’t use H3 unfortunately because we do not have enough time to add H3 support to Spring. Is there any way this patch can be applied to H2? *Fr

Re: [Hibernate] Polymorphic queries, where and order by

2004-09-29 Thread Emmanuel Bernard
This is not a bug. HQL is an OO query language. You've queried the superclass, not the subclass. It seems pretty natural to me that you can't order by a subclass attribute. What you want and the patch provided does work only in particular cases. "from java.lang.Object o order by o.publicPrice"

RE: [Hibernate] Polymorphic queries, where and order by

2004-09-29 Thread March, Andres
Well, couldn't it be reclassified as a bug fix? Not being able to navigate associations because of a hard coded "this" in the construction of the order by seems like something many people would face. I could be wrong. Anyway this patch has been around a long time and as far as I can tell was s