| <?xml version="1.0" encoding="UTF-8"?> | |
| <!-- | |
| Copyright (c) 2008, 2010 SAP AG. | |
| All rights reserved. This program and the accompanying materials | |
| are made available under the terms of the Eclipse Public License v1.0 | |
| which accompanies this distribution, and is available at | |
| http://www.eclipse.org/legal/epl-v10.html | |
| Contributors: | |
| SAP AG - initial API and implementation | |
| --> | |
| <!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd" > | |
| <reference id="ref_oqlsyntaxwhere" xml:lang="en-us"> | |
| <title>WHERE Clause</title> | |
| <shortdesc /> | |
| <prolog> | |
| <copyright> | |
| <copyryear year=""></copyryear> | |
| <copyrholder> | |
| Copyright (c) 2008, 2010 SAP AG and others. | |
| All rights reserved. This program and the accompanying materials | |
| are made available under the terms of the Eclipse Public License v1.0 | |
| which accompanies this distribution, and is available at | |
| http://www.eclipse.org/legal/epl-v10.html | |
| </copyrholder> | |
| </copyright> | |
| </prolog> | |
| <refbody> | |
| <section> | |
| <p> | |
| The WHERE clause specifies search conditions, that | |
| remove unwanted data from the query result. The | |
| following operators, are in order of precedence. The | |
| operators are evaluated in the specified order: | |
| </p> | |
| <title> | |
| >=, <=, >, <, [ NOT ] LIKE, [ NOT ] IN, IMPLEMENTS | |
| (relational operations) | |
| </title> | |
| <codeblock>SELECT * FROM java.lang.String s WHERE s.count >= 100</codeblock> | |
| <codeblock>SELECT * FROM java.lang.String s WHERE toString(s) LIKE ".*day"</codeblock> | |
| <codeblock>SELECT * FROM java.lang.String s WHERE s.value NOT IN dominators(s)</codeblock> | |
| <codeblock>SELECT * FROM java.lang.Class c WHERE c IMPLEMENTS org.eclipse.mat.snapshot.model.IClass</codeblock> | |
| </section> | |
| <section> | |
| <title>=, != (equality operations)</title> | |
| <codeblock>SELECT * FROM java.lang.String s WHERE toString(s) = "monday"</codeblock> | |
| </section> | |
| <section> | |
| <title>AND (conditional AND operation)</title> | |
| <codeblock>SELECT * FROM java.lang.String s WHERE s.count > 100 AND s.@retainedHeapSize > s.@usedHeapSize</codeblock> | |
| </section> | |
| <section> | |
| <title>OR (conditional OR operation)</title> | |
| <codeblock>SELECT * FROM java.lang.String s WHERE s.count > 1000 OR s.value.@length > 1000</codeblock> | |
| <p> | |
| Operators can be applied to expressions, constant | |
| literals and sub queries. Valid expressions are | |
| explained in the next sections. | |
| </p> | |
| </section> | |
| <section> | |
| <title>Literal Expression</title> | |
| <p>Boolean, String, Integer, Long, Character and null literals:</p> | |
| <codeblock>SELECT * FROM java.lang.String s | |
| WHERE ( s.count > 1000 ) = true | |
| WHERE toString(s) = "monday" | |
| WHERE dominators(s).size() = 0 | |
| WHERE s.@retainedHeapSize > 1024L | |
| WHERE s.value != null AND s.value.@valueArray.@length >= 1 AND s.value.@valueArray.get(0) = 'j' | |
| WHERE s.@GCRootInfo != null | |
| </codeblock> | |
| </section> | |
| </refbody> | |
| </reference> |