Package org.eclipse.mat.snapshot
Class OQL
- java.lang.Object
-
- org.eclipse.mat.snapshot.OQL
-
public final class OQL extends java.lang.Object
Factory for often-used OQL queries.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
classesByClassLoaderId(int classLoaderId)
Returns an OQL query string to select all classes loaded by the given class loader.static java.lang.String
classesByPattern(java.util.regex.Pattern pattern, boolean includeSubclasses)
Returns all classes matching a given regular expression.static java.lang.String
forAddress(long address)
Select object by its address.static java.lang.String
forObjectId(int objectId)
Select object by its object id.static java.lang.String
forObjectIds(int[] objectIds)
Select objects by its ids.static java.lang.String
forObjectsOfClass(int classId)
All objects of a class identified by its id.static java.lang.String
forObjectsOfClass(IClass clasz)
All objects of a given class.static java.lang.String
instancesByClassLoaderId(int classLoaderId)
Returns an OQL query string to select all objects loaded by the given class loader.static java.lang.String
instancesByPattern(java.util.regex.Pattern pattern, boolean includeSubclasses)
Return all instances of classes matching a given regular expression.static java.lang.String
retainedBy(int objectId)
Select the retained set of a given object.static java.lang.String
retainedBy(java.lang.String oqlQuery)
Select the retained set of a given OQL query.static void
union(java.lang.StringBuilder query, java.lang.String other)
Create a OQL union statement and append it to the query.
-
-
-
Method Detail
-
forAddress
public static final java.lang.String forAddress(long address)
Select object by its address.
-
forObjectId
public static final java.lang.String forObjectId(int objectId)
Select object by its object id.
-
forObjectIds
public static java.lang.String forObjectIds(int[] objectIds)
Select objects by its ids.
-
retainedBy
public static final java.lang.String retainedBy(java.lang.String oqlQuery)
Select the retained set of a given OQL query.
-
retainedBy
public static java.lang.String retainedBy(int objectId)
Select the retained set of a given object.
-
forObjectsOfClass
public static final java.lang.String forObjectsOfClass(IClass clasz)
All objects of a given class.
-
forObjectsOfClass
public static final java.lang.String forObjectsOfClass(int classId)
All objects of a class identified by its id.
-
union
public static void union(java.lang.StringBuilder query, java.lang.String other)
Create a OQL union statement and append it to the query. Possibly optimize a common prefix. select s.a,s.b,s.c from 1,173 s select s.a,s.b,s.c from 123 s combine to select s.a,s.b,s.c from 1,173,123 s Also split off UNION clauses to see if the new clause can be merged into an existing UNION clause.
-
instancesByPattern
public static java.lang.String instancesByPattern(java.util.regex.Pattern pattern, boolean includeSubclasses)
Return all instances of classes matching a given regular expression.
-
classesByPattern
public static java.lang.String classesByPattern(java.util.regex.Pattern pattern, boolean includeSubclasses)
Returns all classes matching a given regular expression.
-
instancesByClassLoaderId
public static java.lang.String instancesByClassLoaderId(int classLoaderId)
Returns an OQL query string to select all objects loaded by the given class loader.select * from ( select * from java.lang.Class c where c implements org.eclipse.mat.snapshot.model.IClass and c.@classLoaderId = {0} )
- Parameters:
classLoaderId
- the object id of the class loader- Returns:
- an OQL query selecting all objects loaded by the class loader
-
classesByClassLoaderId
public static java.lang.String classesByClassLoaderId(int classLoaderId)
Returns an OQL query string to select all classes loaded by the given class loader.select * from java.lang.Class c where c implements org.eclipse.mat.snapshot.model.IClass and c.@classLoaderId = {0}
- Parameters:
classLoaderId
- the object id of the class loader- Returns:
- an OQL query selecting all classes loaded by the class loader
-
-