[ http://jira.nhibernate.org/browse/NH-514?page=all ]
Sergey Koshcheyev updated NH-514:
---------------------------------
Fix Version: LATER
> Allow expansion of the "on" clause in joins.
> --------------------------------------------
>
> Key: NH-514
> URL: http://jira.nhibernate.org/browse/NH-514
> Project: NHibernate
> Type: Improvement
> Components: Core
> Versions: 1.0
> Reporter: Dave McMullan
> Priority: Critical
> Fix For: LATER
>
> In english, I want a list of trades in a portfolio, whether tradeprices exist or not... but if they exist, they should be dated at least 7/1/2005.
> In oracle, it looks like:
> from trade t, tradeprice tp where t.portfolio=53 and tp.tradeid(+)=t.tradeid and tp.effdate(+) >= '1-Jul-2005'
> In ansi, it looks like:
> from trade t left outer join tradeprice tp on t.tradeid=tp.tradeid and tp.effdate >= '1-Jul-2005' where t.portfolio=53
> In HQL, the closest I can get is:
> from trade t left join fetch t.tradeprices tp where t.portfolio=53 and tp.effdate >= '1-Jul-2005'
> But that HQL generates this incorrect SQL:
> from trade t left outer join tradeprice tp on t.tradeid=tp.tradeid where t.portfolio=53 and tp.effdate >= '1-Jul-2005'
> This SQL is not correct because the effdate condition needs to be in the "on" clause, not the "where" clause. But the "on" clause is generated internally by NHibernate, and I haven't found a way to alter it. Is there a way?
> btw... tradeprice is a lazy init bag on trade object
> related forum topic: http://forum.hibernate.org/viewtopic.php?t=952606&highlight=outer+join
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.nhibernate.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
|