jhat OQL AND in where 子句
如何在 jhat OQL where 子句中执行连词 [AND]?
我想这样做:
select s from sun.security.x509.X500Name s where s.canonicalDn !=null and
/tiberium/(s.canonicalDn.toString())
也就是说,我想在其 canonicaldn 中找到所有包含 appTrust 的 X500Name。我需要空检查,因为某些 canonicaldn 可能为空 [并且 jhat 在这种情况下会在 toString 处引发空指针异常]。
但字面上的“和”不起作用。
顺便说一句,我使用过滤功能解决了这个问题:
select filter(heap.objects("sun.security.x509.X500Name"), isTiberium);
function isTiberium(s) {
return s.canonicalDn !=null && /tiberium/(s.canonicalDn.toString());
}
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());
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现“and”是&&因为那是 javascript 和运算符。正确的表达方式很简单:
I found out "and" is && as that is the javascript and operator. That is the correct expression is simply: