jhat OQL AND in where clause

763 views Asked by At

How to do a conjunction [AND] in jhat OQL where clause?

I want do this:

select s from sun.security.x509.X500Name s where  s.canonicalDn !=null and    
/tiberium/(s.canonicalDn.toString())

That is- I want to find all X500Names containing appTrust in their canonicaldn. I need the null check as some of canonicaldn can be null [and jhat throws a null pointer exception in that case at toString].

But literal "and" doesn't work.

BTW, I got around this for my purpose using filter function:

select filter(heap.objects("sun.security.x509.X500Name"), isTiberium);

function isTiberium(s) {  
    return s.canonicalDn !=null && /tiberium/(s.canonicalDn.toString());  
}
1

There are 1 answers

0
Fakrudeen On BEST ANSWER

I found out "and" is && as that is the javascript and operator. That is the correct expression is simply:

select s from sun.security.x509.X500Name s where  s.canonicalDn !=null &&    
/tiberium/(s.canonicalDn.toString())