Top Description Fields Constructors Methods
org.eclipse.persistence.jpa.jpql.tools.model.query

public Class InputParameterStateObject

extends SimpleStateObject
Class Inheritance
Imports
org.eclipse.persistence.jpa.jpql.parser.InputParameter

Either positional or named parameters may be used. Positional and named parameters may not be mixed in a single query. Input parameters can only be used in the WHERE clause or HAVING clause of a query.
Author
Pascal Filion
Since
2.4
Version
2.4
See Also
InputParameter

Field Summary

Inherited from org.eclipse.persistence.jpa.jpql.tools.model.query.SimpleStateObject:
TEXT_PROPERTY

Constructor Summary

AccessConstructor and Description
public
InputParameterStateObject(StateObject
The parent of this state object, which cannot be null
parent
)

Creates a new InputParameterStateObject.

public
InputParameterStateObject(StateObject
The parent of this state object, which cannot be null
parent
,
String
The positional or named input parameter
parameter
)

Creates a new InputParameterStateObject.

Method Summary

Modifier and TypeMethod and Description
public void
public InputParameter
getExpression()

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.getExpression.

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.getExpression.

Returns the actual parsed object if this StateObject representation of the JPQL query was created by parsing an existing JPQL query.
public boolean

Returns:

true if the parameter type is '?'; false if it's ':'
isNamed
()

Determines whether this parameter is a positional parameter, i.e. the parameter type is '?'.

public boolean

Returns:

true if the parameter type is ':'; false if it's '?'
isPositional
()

Determines whether this parameter is a positional parameter, i.e. the parameter type is ':'.

public void
setExpression(InputParameter
The parsed object representing an input parameter
expression
)

Keeps a reference of the parsed object object, which should only be done when this object is instantiated during the conversion of a parsed JPQL query into StateObjects.

Inherited from org.eclipse.persistence.jpa.jpql.tools.model.query.SimpleStateObject:
getTexthasTextisEquivalentsetTextsetTextInternallytoTextInternal

Constructor Detail

InputParameterStateObjectback to summary
public InputParameterStateObject(StateObject parent)

Creates a new InputParameterStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

Exceptions
NullPointerException:
The given parent cannot be null
InputParameterStateObjectback to summary
public InputParameterStateObject(StateObject parent, String parameter)

Creates a new InputParameterStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

parameter:String

The positional or named input parameter

Exceptions
NullPointerException:
The given parent cannot be null

Method Detail

acceptback to summary
public void accept(StateObjectVisitor visitor)

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.accept.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.accept.

Visits this StateObject by the given visitor.

Parameters
visitor:StateObjectVisitor

The visitor to visit this object

Annotations
@Override
getExpressionback to summary
public InputParameter getExpression()

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.getExpression.

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.getExpression.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.getExpression.

Returns the actual parsed object if this StateObject representation of the JPQL query was created by parsing an existing JPQL query.

Returns:InputParameter

The parsed object when a JPQL query is parsed and converted into a StateObject or null when the JPQL query is manually created (i.e. not from a string)

Annotations
@Override
isNamedback to summary
public boolean isNamed()

Determines whether this parameter is a positional parameter, i.e. the parameter type is '?'.

Returns:boolean

true if the parameter type is '?'; false if it's ':'

isPositionalback to summary
public boolean isPositional()

Determines whether this parameter is a positional parameter, i.e. the parameter type is ':'.

Returns:boolean

true if the parameter type is ':'; false if it's '?'

setExpressionback to summary
public void setExpression(InputParameter expression)

Keeps a reference of the parsed object object, which should only be done when this object is instantiated during the conversion of a parsed JPQL query into StateObjects.

Parameters
expression:InputParameter

The parsed object representing an input parameter