I have this jaqu query,

            long okCount = db.from(msli)
           
 .innerJoin(ms).on(ms.maintenanceStatusId).is(msli.maintenanceStatusId)
            .innerJoin(sp).on(ms.samplePointId).is(sp.samplePointId)
            .whereTrue(Function.and(ms.latest, msli.itemStatus))
            .and(msli.maintenanceStatusItemId).is(i.maintenanceStatusItemId)
            .and(sp.siteId).is(site.siteId)
            .selectCount();

I've tried different variations of this query, but the issue is that 
when there is more than 1 boolean (ms.latest and msli.itemStatus in this 
case) they are both resolved to the same one, so the sql is incorrect.

The above query resolves to:

SELECT COUNT(*) FROM MaintenanceStatusLineItem AS T269 INNER JOIN 
MaintenanceStatus AS T270 ON T270.maintenanceStatusId 
=T269.maintenanceStatusId  INNER JOIN SamplePoint AS T271 ON 
T270.samplePointId =T271.samplePointId  WHERE (T270.latest AND 
T270.latest) AND T269.maintenanceStatusItemId =? AND T271.siteId =?

This is from H2 version 1.1.116 (I think!, That is the H2 version, but I 
may have built JaQu from an earlier version)

I'm a bit strapped for time at the moment so I haven't got a standalone 
example, but I just wanted to inform of this bug. At the moment when I 
hit bugs I just replace it with SQL. JaQu is very nice when it works :)

Cheers,

Ryan


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "H2 
Database" 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/h2-database?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to