Hey
Can anybody help on these issues related to
EJB QL in Weblogic 6.0 SP1
1. Can I use COUNT function in EJB QL. If not what is the work around. Refer Query1
2. Can I use NESTED queries in EJB QL. If not what is the work around. Refer Query1 & Query2
3. Can I use MAX function in EJBQL. If not what is the work around. Refer Query2
4. Can I use ORDER BY DESC in EJB QL. If not what is the work around. Refer Query3
Query1
select * from ClaimBeanTbl t1, ClaimSpecialistsBeanTbl t2
where t1.objId = t2.claimObjId
and t2.specialistObjId = ?
and t2.endDate = 'empty'
and (select count (*) from ClaimSpecialistsBeanTbl
where claimObjId = t1.objId) = 1
and t2.isNew = 1
Query2
select a.objid from paymentbeantbl a
where a.claimobjid = ?
and a.paymentdate =
(select max (b.paymentdate) from PaymentBeantbl b where b.claimobjid = ?)
Query3
select a.objid from paymentbeantbl a where a.claimobjid = ? order by a.paymentdate DESC
The restrictions/limitations of EJB QL are too rigid. We expected EJB 2.0 and in turn EJB QL will ease the process of development but it is indeed giving us tough times and is a REAL NIGHTMARE. I wonder whether shifting from EJB 1.1 to EJB 2.0 is the right decision in such circumstances.
Any help on this will be highly appreciated.