org.apache.openjpa.persistence.query
Interface PathExpression

All Superinterfaces:
Expression, OrderByItem, PredicateOperand, SelectItem
All Known Subinterfaces:
DomainObject
All Known Implementing Classes:
AbstractDomainObject, AbstractPath, EntryExpression, FetchPath, JoinPath, KeyExpression, NavigationPath, OperatorPath, RootPath, ValueExpression

public interface PathExpression
extends Expression

Interface for operations over objects reached via paths


Method Summary
 Aggregate avg()
          Specify that the avg operation is to be applied.
 Aggregate count()
          Specify that the count operation is to be applied.
 PathExpression get(String attributeName)
          Return a path expression corresponding to the referenced attribute.
 Predicate isEmpty()
          Add a restriction that the path expression must correspond to an association or element collection that is empty (has no elements).
 Aggregate max()
          Specify that the max operation is to be applied.
 Aggregate min()
          Specify that the min operation is to be applied.
 Expression size()
          Return an expression that corresponds to the number of elements association or element collection corresponding to the path expression.
 Aggregate sum()
          Specify that the sum operation is to be applied.
 Expression type()
          Return an expression that corresponds to the type of the entity.
 
Methods inherited from interface org.apache.openjpa.persistence.query.Expression
abs, concat, concat, dividedBy, dividedBy, in, in, in, in, in, in, isNull, length, locate, locate, locate, locate, locate, locate, lower, member, minus, minus, minus, mod, mod, plus, plus, sqrt, substring, substring, substring, substring, substring, substring, times, times, trim, trim, trim, trim, trim, trim, upper
 
Methods inherited from interface org.apache.openjpa.persistence.query.SelectItem
asc, desc
 
Methods inherited from interface org.apache.openjpa.persistence.query.PredicateOperand
between, between, between, between, between, between, between, between, between, between, between, between, between, equal, equal, equal, equal, equal, equal, equal, equal, greaterEqual, greaterEqual, greaterEqual, greaterEqual, greaterEqual, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, lessEqual, lessEqual, lessEqual, lessEqual, lessEqual, lessThan, lessThan, lessThan, lessThan, lessThan, like, like, like, like, like, like, notEqual, notEqual, notEqual, notEqual, notEqual, notEqual, notEqual, notEqual
 

Method Detail

get

PathExpression get(String attributeName)
Return a path expression corresponding to the referenced attribute. It is not permitted to invoke this method on a path expression that corresponds to a multi-valued association or element collection. The path expression on which this method is invoked must correspond to a class containing the referenced attribute.

Parameters:
attributeName - - name of the referenced attribute
Returns:
path expression

type

Expression type()
Return an expression that corresponds to the type of the entity. This method can only be invoked on a path expression corresponding to an entity. It is not permitted to invoke this method on a path expression that corresponds to a multi-valued association.

Returns:
expression denoting the entity's type

size

Expression size()
Return an expression that corresponds to the number of elements association or element collection corresponding to the path expression. This method can only be invoked on a path expression that corresponds to a multi-valued association or to an element collection.

Returns:
expression denoting the size

isEmpty

Predicate isEmpty()
Add a restriction that the path expression must correspond to an association or element collection that is empty (has no elements). This method can only be invoked on a path expression that corresponds to a multi-valued association or to an element collection.

Returns:
predicate corresponding to the restriction

avg

Aggregate avg()
Specify that the avg operation is to be applied. The path expression must correspond to an attribute of a numeric type. It is not permitted to invoke this method on a path expression that corresponds to a multi-valued association or element collection.

Returns:
the resulting aggregate

max

Aggregate max()
Specify that the max operation is to be applied. The path expression must correspond to an attribute of an orderable type. It is not permitted to invoke this method on a path expression that corresponds to a multi-valued association or element collection.

Returns:
the resulting aggregate

min

Aggregate min()
Specify that the min operation is to be applied. The path expression must correspond to an attribute of an orderable type. It is not permitted to invoke this method on a path expression that corresponds to a multi-valued association or element collection.

Returns:
the resulting aggregate

count

Aggregate count()
Specify that the count operation is to be applied. It is not permitted to invoke this method on a path expression that corresponds to a multi-valued association or element collection.

Returns:
the resulting aggregate

sum

Aggregate sum()
Specify that the sum operation is to be applied. The path expression must correspond to an attribute of a numeric type. It is not permitted to invoke this method on a path expression that corresponds to a multi-valued association or element collection.

Returns:
the resulting aggregate


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.