2.17.2: 2011-06-17

net.sf.basedb.core.query
Interface Expression

All Superinterfaces:
QueryElement
All Known Implementing Classes:
AbsExpression, AddExpression, CaseExpression, CountExpression, DivideExpression, ExpExpression, ExtraValueExpression, FloatExpression, GeometricMeanExpression, HqlElementsExpression, HqlEntityExpression, HqlEntityParameterExpression, HqlExpression, HqlIndexExpression, HqlPropertyExpression, HqlSizeExpression, IntegerExpression, LogExpression, MaxExpression, MeanExpression, MeanRawDataPropertyExpression, MinExpression, MultiplyExpression, NegateExpression, ParameterExpression, PowerExpression, QuadraticMeanExpression, RawDataPropertyExpression, ReporterListExpression, ReporterPropertyExpression, SelectedExpression, SqlColumnExpression, SqrtExpression, SubqueryExpression, SubtractExpression, SumExpression, ToDateExpression, VirtualColumnExpression, VirtualColumnExpression.WrappedExpression

public interface Expression
extends QueryElement

An expression query element. This is a query element that can appear almost anywhere in a query. For example a Select is usually an expression together with an alias, a Restriction is a comparison of two or more expressions, etc.

There are many types of expressions. The simplest ones just insert a constant value: Expressions.integer(int) or Expressions.aFloat(float).

Other expressions create a reference to a property or database column: Hql.property(String, String).

Expressions can also be combined to form other expressions: Expressions.add(Expression, Expression) or Expressions.divide(Expression, Expression)

Thus it is possible to form a complex tree of expressions:

// The log ratio of foreground intensities: LOG(ch1fg) / LOG(ch2fg)
Expression logRatio = Expressions.divide(
  Expressions.log(Hql.property("ch1fg")),
  Expressions.log(Hql.property("ch2fg"))
);

The expressions can then be used to create restrictions:

// Return only data with log ratio greater than 2.0 
Restrictions.gt(logRatio, Expressions.aFloat(2.0));

The Expressions, Hql, Annotations and Annotations are factory classes that create expressions.

Version:
2.0
Author:
Nicklas
Last modified
$Date: 2009-04-06 14:52:39 +0200 (Mon, 06 Apr 2009) $

Method Summary
 
Methods inherited from interface net.sf.basedb.core.query.QueryElement
getChildren, toQl
 


2.17.2: 2011-06-17