FileDocCategorySizeDatePackage
JDOQLElements.javaAPI DocGlassfish v2 API9454Fri May 04 22:34:50 BST 2007com.sun.jdo.spi.persistence.support.ejb.ejbqlc

JDOQLElements

public class JDOQLElements extends Object
An JDOQLElements instance represents the result of the EJBQLC compile step.
author
Michael Bouschen
author
Shing Wai Chan

Fields Summary
private String
candidateClassName
The name of the candidate class
private String
parameters
The parameter declarations string.
private String
variables
The variable declarations string.
private String
filter
The filter expression string.
private String
ordering
The ordering expression string.
private String
result
The result expression.
private String
resultType
The result type.
private boolean
isPCResult
Flag indicating whether the result element is of a pc class.
private boolean
isAggregate
Flag indicating whether the result element is associated to an aggregate function.
private String[]
parameterEjbNames
String array contains ejb names corresponding to parameters
Constructors Summary
public JDOQLElements(String candidateClassName, String parameters, String variables, String filter, String ordering, String result, String resultType, boolean isPCResult, boolean isAggregate, String[] parameterEjbNames)
Constructor taking JDOQL elements.

        setCandidateClassName(candidateClassName);
        setParameters(parameters);
        setVariables(variables);
        setFilter(filter);
        setOrdering(ordering);
        setResult(result);
        setResultType(resultType);
        setPCResult(isPCResult);
        setAggregate(isAggregate);
        setParameterEjbNames(parameterEjbNames);
    
Methods Summary
public java.lang.StringgetCandidateClassName()
Returns the fully qulified name of the candidate class.

        return this.candidateClassName;
    
public java.lang.StringgetFilter()
Returns the filter expression.

        return filter;
    
public java.lang.StringgetOrdering()
Returns the ordering expression.

        return ordering;
    
public java.lang.String[]getParameterEjbNames()
Returns parameterEjbNames array

        return parameterEjbNames;
    
public java.lang.StringgetParameters()
Returns the parameter declaration string.

        return parameters;
    
public java.lang.StringgetResult()
Returns the result expression.

        return result;
    
public java.lang.StringgetResultType()
Returns the result type. The result type is the name of the element type of the JDO query result set.

        return resultType;
    
public java.lang.StringgetVariables()
Returns the variable declarations string.

        return variables;
    
public booleanisAggregate()
Returns whether the result of the JDOQL query is associated to an aggregate function.

        return isAggregate;
    
public booleanisPCResult()
Returns whether the result of the JDOQL query is a collection of pc instances or not.

        return isPCResult;
    
public voidsetAggregate(boolean isAggregate)
Sets whether the result of the JDOQL query is a associated to an aggregate function.

        this.isAggregate = isAggregate;
    
public voidsetCandidateClassName(java.lang.String candidateClassName)
Sets the fully qulified name of the candidate class.

        // TBD: check non empty candidateClassName
        this.candidateClassName = candidateClassName;
    
public voidsetFilter(java.lang.String filter)
Sets the filter expression.

        this.filter = (filter == null) ? "" : filter; //NOI18N
    
public voidsetOrdering(java.lang.String ordering)
Sets the ordering expression.

        this.ordering = (ordering == null) ? "" : ordering; //NOI18N
    
public voidsetPCResult(boolean isPCResult)
Sets whether the result of the JDOQL query is a collection of pc instances or not.

        this.isPCResult = isPCResult;
    
public voidsetParameterEjbNames(java.lang.String[] parameterEjbNames)
set parameterEjbNames array

        this.parameterEjbNames = parameterEjbNames;
    
public voidsetParameters(java.lang.String parameters)
Sets the parameter declarations string.

        this.parameters = (parameters == null) ? "" : parameters; //NOI18N
    
public voidsetResult(java.lang.String result)
Sets the result expression.

        this.result = (result == null) ? "" : result; //NOI18N
    
public voidsetResultType(java.lang.String resultType)
Sets the result type. The result type is the name of the element type of the JDO query result set.

        this.resultType = resultType;
    
public voidsetVariables(java.lang.String variables)
Sets the variable declarations string.

        this.variables = (variables == null) ? "" : variables; //NOI18N
    
public java.lang.StringtoString()
Returns a string representation of this JDOQLElements instance.

        StringBuffer repr = new StringBuffer();
        repr.append("JDOQLElements("); //NOI18N
        repr.append("candidateClass: "); //NOI18N
        repr.append(candidateClassName);
        if (parameters != null && parameters.length() > 0) {
            repr.append(", parameters: "); //NOI18N 
            repr.append(parameters);
        }
        if (variables != null && variables.length() > 0) {
            repr.append(", variables: "); //NOI18N 
            repr.append(variables);
        }
        if (filter != null && filter.length() > 0) {
            repr.append(", filter: "); //NOI18N 
            repr.append(filter);
        }
        if (ordering != null && ordering.length() > 0) {
            repr.append(", ordering: "); //NOI18N 
            repr.append(ordering);
        }
        if (result != null && result.length() > 0) {
            repr.append(", result: "); //NOI18N 
            repr.append(result);
            repr.append(", resultType: "); //NOI18N 
            repr.append(resultType);
            repr.append(", isPCResult: "); //NOI18N 
            repr.append(isPCResult);
        }
        repr.append(", isAggregate: ");
        repr.append(isAggregate);
        if (parameterEjbNames != null && parameterEjbNames.length > 0) {
            repr.append(", parameterEjbNames: "); //NOI18N
            for (int i = 0; i < parameterEjbNames.length; i++) {
                repr.append(i);
                repr.append(": ");
                repr.append(parameterEjbNames[i]);
                repr.append(", ");
            }
        }
        repr.append(")"); //NOI18N
        return repr.toString();