Home » jdo2-tck-2.3-ea-src » org.apache.jdo.tck.query » [javadoc | source]
org.apache.jdo.tck.query
public class: QueryElementHolder [javadoc | source]
java.lang.Object
   org.apache.jdo.tck.query.QueryElementHolder
This class is an abstraction of a JDOQL query, which may be represented as a single string (e.g. SELECT FROM Person WHERE personid == 1) or as an API query using methods on class Query .

The class may be used as the factory of a JDO Query instance using method QueryElementHolder#getAPIQuery(PersistenceManager) or method QueryElementHolder#getSingleStringQuery(PersistenceManager) .

Instances of this class are capable to hold all elements of a JDOQL query, e.g. the candidate class, the filter, etc. These elements are passed calling the constructor. It is valid to pass null as a value for JDOQL querys elements. Such elements are not transfered into a JDO javax.jdo.Query instance. Instead, the default of JDO javax.jdo.Query instance is taken.
Constructor:
 public QueryElementHolder(Boolean unique,
    String result,
    Class resultClass,
    Class candidateClass,
    Boolean excludeSubClasses,
    String filter,
    String variables,
    String parameters,
    String imports,
    String grouping,
    String ordering,
    String from,
    String to) 
    Returns an instance of this class holding the given arguments such as the candidate class, the filter, etc. The given arguments represent JDOQL query elements. It is valid to pass null as a value for JDOQL querys elements. Such elements are not transfered into a JDO javax.jdo.Query instance. Instead, the default of JDO javax.jdo.Query instance is taken.
    Parameters:
    unique - the JDOQL unique query element
    result - the JDOQL result query element
    resultClass - the JDOQL result class query element
    candidateClass - the JDOQL candidate class query element
    excludeSubClasses - the JDOQL exclude subclasses query element
    filter - the JDOQL filter query element
    variables - the JDOQL variables query element
    parameters - the JDOQL parameters query element
    imports - the JDOQL imports query element
    grouping - the JDOQL grouping query element
    ordering - the JDOQL ordering query element
    from - the JDOQL range from query element
    to - the JDOQL range to query element
 public QueryElementHolder(Boolean unique,
    String result,
    Class resultClass,
    Class candidateClass,
    Boolean excludeSubClasses,
    String filter,
    String variables,
    String parameters,
    String imports,
    String grouping,
    String ordering,
    long from,
    long to) 
    Returns an instance of this class holding the given arguments such as the candidate class, the filter, etc. The given arguments represent JDOQL query elements. It is valid to pass null as a value for JDOQL querys elements. Such elements are not transfered into a JDO javax.jdo.Query instance. Instead, the default of JDO javax.jdo.Query instance is taken.
    Parameters:
    unique - the JDOQL unique query element
    result - the JDOQL result query element
    resultClass - the JDOQL result class query element
    candidateClass - the JDOQL candidate class query element
    excludeSubClasses - the JDOQL exclude subclasses query element
    filter - the JDOQL filter query element
    variables - the JDOQL variables query element
    parameters - the JDOQL parameters query element
    imports - the JDOQL imports query element
    grouping - the JDOQL grouping query element
    ordering - the JDOQL ordering query element
    from - the JDOQL from query element
    to - the JDOQL to query element
Method from org.apache.jdo.tck.query.QueryElementHolder Summary:
getAPIQuery,   getCandidateClass,   getSingleStringQuery,   hasOrdering,   isUnique,   toString
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.jdo.tck.query.QueryElementHolder Detail:
 public Query getAPIQuery(PersistenceManager pm) 
 public Class getCandidateClass() 
    Returns the candtidate class JDOQL query element.
 public Query getSingleStringQuery(PersistenceManager pm) 
    Creates a JDO javax.jdo.Query instance using the JDOQL query elements of this instance. The returned instance is created calling PersistenceManager#newQuery(String) . The passed String instance is the single string representation of this, e.g. SELECT FROM Person WHERE personid == 1.
 public boolean hasOrdering() 
    Returns the unique JDOQL query element.
 public boolean isUnique() 
    Returns the unique JDOQL query element.
 public String toString() 
    Returns the single string JDOQL representation.