jhat OQL AND in where clause

你离开我真会死。 提交于 2019-12-25 05:16:22

问题


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:


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())


来源:https://stackoverflow.com/questions/8833353/jhat-oql-and-in-where-clause

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!