GigaSpaces XAP 8.0 API

org.openspaces.jpa.openjpa.query
Class AggregationFunction

java.lang.Object
  extended by org.openspaces.jpa.openjpa.query.AggregationFunction
All Implemented Interfaces:
Serializable, org.apache.openjpa.kernel.exps.Value, ExpressionNode

public class AggregationFunction
extends Object
implements org.apache.openjpa.kernel.exps.Value, ExpressionNode

An aggregation function representation. Supports the following aggregations: Sum, Minimum, Maximum, Count & Average.

Since:
8.0
Author:
idan
See Also:
Serialized Form

Nested Class Summary
static class AggregationFunction.AggregationType
          Aggregation function type
 
Nested classes/interfaces inherited from interface org.openspaces.jpa.openjpa.query.ExpressionNode
ExpressionNode.NodeType
 
Constructor Summary
AggregationFunction(org.apache.openjpa.kernel.exps.Value path, AggregationFunction.AggregationType type)
           
 
Method Summary
 void acceptVisit(org.apache.openjpa.kernel.exps.ExpressionVisitor visitor)
          Accept a visit from a tree visitor.
 void appendSql(StringBuilder sql)
          Appends the node SQL string to the string builder.
 AggregationFunction.AggregationType getAggregationType()
           
 String getAlias()
          Return select item alias
 org.apache.openjpa.meta.ClassMetaData getMetaData()
          Return any associated persistent type.
 String getName()
           
 ExpressionNode.NodeType getNodeType()
          Gets the node type
 org.apache.openjpa.kernel.exps.Path getPath()
           
 org.apache.openjpa.kernel.exps.Value getSelectAs()
          Return 'this' concrete class if alias is set, otherwise null
 Class getType()
          Return the expected type for this value, or Object if the type is unknown.
 boolean isAggregate()
          Return true if this value is an aggregate.
 boolean isVariable()
          Return true if this value is a variable.
 boolean isXPath()
          Return true if this value is an XML Path.
 void setAlias(String alias)
          Set select item alias
 void setImplicitType(Class type)
          Set the implicit type of the value, based on how it is used in the filter.
 void setMetaData(org.apache.openjpa.meta.ClassMetaData meta)
          Associate a persistent type with this value.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AggregationFunction

public AggregationFunction(org.apache.openjpa.kernel.exps.Value path,
                           AggregationFunction.AggregationType type)
Method Detail

getType

public Class getType()
Return the expected type for this value, or Object if the type is unknown.

Specified by:
getType in interface org.apache.openjpa.kernel.exps.Value

setImplicitType

public void setImplicitType(Class type)
Set the implicit type of the value, based on how it is used in the filter. This method is only called on values who return Object from getType().

Specified by:
setImplicitType in interface org.apache.openjpa.kernel.exps.Value

isVariable

public boolean isVariable()
Return true if this value is a variable.

Specified by:
isVariable in interface org.apache.openjpa.kernel.exps.Value

isAggregate

public boolean isAggregate()
Return true if this value is an aggregate.

Specified by:
isAggregate in interface org.apache.openjpa.kernel.exps.Value

isXPath

public boolean isXPath()
Return true if this value is an XML Path.

Specified by:
isXPath in interface org.apache.openjpa.kernel.exps.Value

getMetaData

public org.apache.openjpa.meta.ClassMetaData getMetaData()
Return any associated persistent type.

Specified by:
getMetaData in interface org.apache.openjpa.kernel.exps.Value

setMetaData

public void setMetaData(org.apache.openjpa.meta.ClassMetaData meta)
Associate a persistent type with this value.

Specified by:
setMetaData in interface org.apache.openjpa.kernel.exps.Value

acceptVisit

public void acceptVisit(org.apache.openjpa.kernel.exps.ExpressionVisitor visitor)
Accept a visit from a tree visitor.

Specified by:
acceptVisit in interface org.apache.openjpa.kernel.exps.Value

getAlias

public String getAlias()
Return select item alias

Specified by:
getAlias in interface org.apache.openjpa.kernel.exps.Value

setAlias

public void setAlias(String alias)
Set select item alias

Specified by:
setAlias in interface org.apache.openjpa.kernel.exps.Value

getSelectAs

public org.apache.openjpa.kernel.exps.Value getSelectAs()
Return 'this' concrete class if alias is set, otherwise null

Specified by:
getSelectAs in interface org.apache.openjpa.kernel.exps.Value

getPath

public org.apache.openjpa.kernel.exps.Path getPath()
Specified by:
getPath in interface org.apache.openjpa.kernel.exps.Value

getName

public String getName()
Specified by:
getName in interface org.apache.openjpa.kernel.exps.Value

toString

public String toString()
Overrides:
toString in class Object

getAggregationType

public AggregationFunction.AggregationType getAggregationType()

appendSql

public void appendSql(StringBuilder sql)
Description copied from interface: ExpressionNode
Appends the node SQL string to the string builder.

Specified by:
appendSql in interface ExpressionNode
Parameters:
sql - The SQL string builder to append to.

getNodeType

public ExpressionNode.NodeType getNodeType()
Description copied from interface: ExpressionNode
Gets the node type

Specified by:
getNodeType in interface ExpressionNode
Returns:
The node type.

GigaSpaces XAP 8.0 API

Copyright © GigaSpaces.