Hi,
when I write an HQL statement like this
"from Product p where p = :product and ( p.Bar is null or
( p.Category is not null and p.Category.Baz is not null and
p.Category.Baz > 0 ) )"
it is translated to something like this:
select ...
from PRODUCT p, CATEGORY c
where ( p.ID = :p0 )
and
(
( p.BAR is null )
or
(
( p.CATEGORY_ID is not null )
and
( c.Baz is not null and p.CATEGORY_ID=c.ID )
and
( c.Baz > 0 and p.CATEGORY_ID=c.ID )
)
)
I know that the HQL statement is crap as I shouldn't check for
"p.Category is not null" and that "p.Category.Baz > 0" implies
"p.Category.Baz is not null".
But apart from that, the generated SQL is still weird - how can I make
NHibernate put the join first?
And make sure that the join will only be contained once?
Thanks,
Marvin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"nhusers" 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/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---