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

public Class NullIfExpressionStateObject

extends AbstractDoubleEncapsulatedExpressionStateObject
Class Inheritance
Imports
org.eclipse.persistence.jpa.jpql.parser.NullIfExpression, .ScalarExpressionBNF

NULLIF returns the first expression if the two expressions are not equal. If the expressions are equal, NULLIF returns a null value of the type of the first expression.

NULLIF is equivalent to a searched CASE expression in which the two expressions are equal and the resulting expression is NULL.

Returns the same type as the first expression.

BNF: nullif_expression::= NULLIF(scalar_expression, scalar_expression)

Author
Pascal Filion
Since
2.4
Version
2.4
See Also
NullIfExpression

Field Summary

Inherited from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractDoubleEncapsulatedExpressionStateObject:
FIRST_STATE_OBJECT_PROPERTYSECOND_STATE_OBJECT_PROPERTY

Constructor Summary

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

Creates a new NullIfExpressionStateObject.

public
NullIfExpressionStateObject(StateObject
The parent of this state object, which cannot be null
parent
,
StateObject
The StateObject representing the first expression
firstStateObject
,
StateObject
The StateObject representing the second expression
secondStateObject
)

Creates a new NullIfExpressionStateObject.

public
NullIfExpressionStateObject(StateObject
The parent of this state object, which cannot be null
parent
,
String
The string representation of the first encapsulated expression to parse and to convert into a StateObject representation
firstJpqlFragment
,
String
The string representation of the second encapsulated expression to parse and to convert into a StateObject representation
secondJpqlFragment
)

Creates a new NullIfExpressionStateObject.

Method Summary

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

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractDoubleEncapsulatedExpressionStateObject.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.
protected String
getFirstQueryBNFId()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractDoubleEncapsulatedExpressionStateObject.getFirstQueryBNFId.

Returns the unique identifier of the BNF that will be used to parse a JPQL fragment as the first encapsulated expression.
public String
protected String
getSecondQueryBNFId()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractDoubleEncapsulatedExpressionStateObject.getSecondQueryBNFId.

Returns the unique identifier of the BNF that will be used to parse a JPQL fragment as the second encapsulated expression.
public void
setExpression(NullIfExpression
The parsed object representing a NULLIF expression
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.AbstractDoubleEncapsulatedExpressionStateObject:
addChildrengetFirstgetSecondhasFirsthasSecondisEquivalentparseFirstparseSecondsetFirstsetSecondtoTextEncapsulatedExpression

Constructor Detail

NullIfExpressionStateObjectback to summary
public NullIfExpressionStateObject(StateObject parent)

Creates a new NullIfExpressionStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

Exceptions
NullPointerException:
The given parent cannot be null
NullIfExpressionStateObjectback to summary
public NullIfExpressionStateObject(StateObject parent, StateObject firstStateObject, StateObject secondStateObject)

Creates a new NullIfExpressionStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

firstStateObject:StateObject

The StateObject representing the first expression

secondStateObject:StateObject

The StateObject representing the second expression

Exceptions
NullPointerException:
The given parent cannot be null
NullIfExpressionStateObjectback to summary
public NullIfExpressionStateObject(StateObject parent, String firstJpqlFragment, String secondJpqlFragment)

Creates a new NullIfExpressionStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

firstJpqlFragment:String

The string representation of the first encapsulated expression to parse and to convert into a StateObject representation

secondJpqlFragment:String

The string representation of the second encapsulated expression to parse and to convert into a StateObject representation

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 NullIfExpression getExpression()

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractDoubleEncapsulatedExpressionStateObject.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:NullIfExpression

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
getFirstQueryBNFIdback to summary
protected String getFirstQueryBNFId()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractDoubleEncapsulatedExpressionStateObject.getFirstQueryBNFId.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractDoubleEncapsulatedExpressionStateObject.getFirstQueryBNFId.

Returns the unique identifier of the BNF that will be used to parse a JPQL fragment as the first encapsulated expression.

Returns:String

The query BNF ID for the first encapsulated expression

Annotations
@Override
getIdentifierback to summary
public String getIdentifier()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractEncapsulatedExpressionStateObject.getIdentifier.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractEncapsulatedExpressionStateObject.getIdentifier.

Returns the JPQL identifier of the expression represented by this AbstractSingleEncapsulatedExpressionStateObject.

Returns:String

The JPQL identifier that is shown before the left parenthesis

Annotations
@Override
getSecondQueryBNFIdback to summary
protected String getSecondQueryBNFId()

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractDoubleEncapsulatedExpressionStateObject.getSecondQueryBNFId.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractDoubleEncapsulatedExpressionStateObject.getSecondQueryBNFId.

Returns the unique identifier of the BNF that will be used to parse a JPQL fragment as the second encapsulated expression.

Returns:String

The query BNF ID for the second encapsulated expression

Annotations
@Override
setExpressionback to summary
public void setExpression(NullIfExpression 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:NullIfExpression

The parsed object representing a NULLIF expression