Sorry about that. I'm afraid I don't have the ambition to write a small test app
so that I can get the query right, but if you're stuck for ideas you may want to tweak
it to get the RIGHT JOIN working (I know that part is legal, anyway). I suspect it is
because of the use of IN() instead of INNER JOIN syntax, but I'm not sure. Maybe
something like
| SELECT OBJECT(o) FROM ChargingPoint AS o JOIN o.history AS h RIGHT JOIN SubNetwork n
| WHERE h.isActive = true
| AND h.beginDate <= ?2 AND (h.endDate IS NULL OR h.endDate > ?2)
| AND (h.downstreamSubNetwork = n OR h.upstreamSubNetwork = n)
| AND (n = ?1)
| ORDER BY o.identifier
|
Again, though, I don't have a whole lot of hope that the right join will fix the
problem anyway, so you may not want to spend too much time on it. Perhaps just issuing
two queries won't be too much of a performance problem.
Good luck.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3966967#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...