on the way of programaticaly constructing (2) - actualy like (4) is 
done internaly, it looks to me maybe Property.get_join( parent) can 
be hinted somehow.. e.g. in case of only-table_inheritance, using the 
base table would be enough. Maybe i can just change the parent mapper 
to the simple non-polymorphic one... 

Definitely Won't work in general case.
if the referenced polym-union has any concrete-table (other than base 
one), then... no way, use the polym-union. 
awwwful.

> > taking a look, i think what you should do is use an alias of the
> > table_Employee in your queries.  since the engineer mapper is
> > using joined table inheritance, the default table_Employee is
> > already going to be involved in the query, so your external join
> > condition needs to be off a distinct alias of it to prevent
> > mixups.
>
> ok, aliasing table_employee (the base of Engineer) everywhere
> works.
>
> Then another question. The (2) is a sort of hand-made, (3,4)
> are "programatical". The queries they produce are quite different -
> (2) joins .helper against tableEmployee while the other two join it
> against the whole polymorphic_union - which isn't needed (ehm,
> thats 2 pages sql for 10 classes).
> Is there a way to hint these not to do it, e.g. some mapper/query
> option or specify different mapper or something?
>
> i will probably generate clauses using (2) anyway, but just in case
> i want to have a door open...
>
> > On Feb 13, 11:17 am, svilen <[EMAIL PROTECTED]> wrote:
> > > hi.
> > >
> > > Here is a simple case which does not work - or i cannot figure
> > > out how to make it work.
> > > 'give all engineers which have helper employee of age >=20';
> > > where Engineer inherits Employee via table-inheritance.
> > >
> > > i've tried multiple ways to achieve the result - neither works,
> > > in different ways.
> > >
> > > Some give empty result (2 & 3). IMO in these the FROM is
> > > missing a second table.
> > >
> > > (4) raises Exception about some column missing - but only if
> > > neither of other ways is tried before it; if some of the other
> > > ways is tried, this one does not raise and returns a result.
> > >
> > > (1) is for reference only;
> > >
> > > bye
> > >
> > >  t-query.py
> > > 3KDownload
>
> 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to