org.sql.generation.api.grammar.factories
Interface BooleanFactory


public interface BooleanFactory

A factory for creating various BooleanExpressions. This factory is obtainable from SQLVendor.

Author:
Stanislav Muhametsin
See Also:
SQLVendor

Method Summary
 Conjunction and(BooleanExpression left, BooleanExpression right)
          Creates new Conjunction.
 BetweenPredicate between(NonBooleanExpression left, NonBooleanExpression minimum, NonBooleanExpression maximum)
          Creates new BetweenPredicate.
 BooleanBuilder booleanBuilder()
          Returns new BooleanBuilder with Predicate.EmptyPredicate as initial value.
 BooleanBuilder booleanBuilder(BooleanExpression first)
          Returns new BooleanBuilder with given boolean expression as initial value.
 EqualsPredicate eq(NonBooleanExpression left, NonBooleanExpression right)
          Creates new EqualsPredicate.
 ExistsPredicate exists(QueryExpression query)
          Creates new ExistsPredicate.
 GreaterOrEqualPredicate geq(NonBooleanExpression left, NonBooleanExpression right)
          Creates new GreaterOrEqualPredicate.
 GreaterThanPredicate gt(NonBooleanExpression left, NonBooleanExpression right)
          Creates new GreaterThanPredicate.
 InPredicate in(NonBooleanExpression what, NonBooleanExpression... values)
          Creates new InPredicate.
 InBuilder inBuilder(NonBooleanExpression what)
          Returns a builder for InPredicate.
 IsNotNullPredicate isNotNull(NonBooleanExpression what)
          Creates new IsNotNullPredicate.
 IsNullPredicate isNull(NonBooleanExpression what)
          Creates new IsNullPredicate.
 LessOrEqualPredicate leq(NonBooleanExpression left, NonBooleanExpression right)
          Creates new LessOrEqualPredicate.
 LikePredicate like(NonBooleanExpression what, NonBooleanExpression pattern)
          Creates new LikePredicate.
 LessThanPredicate lt(NonBooleanExpression left, NonBooleanExpression right)
          Creates new LessThanPredicate.
 NotEqualsPredicate neq(NonBooleanExpression left, NonBooleanExpression right)
          Creates new NotEqualsPredicate.
 Negation not(BooleanExpression what)
          Creates new Negation.
 NotBetweenPredicate notBetween(NonBooleanExpression left, NonBooleanExpression minimum, NonBooleanExpression maximum)
          Creates new NotBetweenPredicate.
 NotInPredicate notIn(NonBooleanExpression what, NonBooleanExpression... values)
          Creates new NotInPredicate.
 NotLikePredicate notLike(NonBooleanExpression what, NonBooleanExpression pattern)
          Creates new NotLikePredicate.
 NotRegexpPredicate notRegexp(NonBooleanExpression what, NonBooleanExpression pattern)
          Creates new NotRegexpPredicate.
 Disjunction or(BooleanExpression left, BooleanExpression right)
          Creates new Disjunction.
 RegexpPredicate regexp(NonBooleanExpression what, NonBooleanExpression pattern)
          Creates new RegexpPredicate.
 BooleanTest test(BooleanExpression expression, BooleanTest.TestType testType, BooleanTest.TruthValue truthValue)
          Creates new BooleanTest.
 UniquePredicate unique(QueryExpression query)
          Creates new UniquePredicate.
 

Method Detail

eq

EqualsPredicate eq(NonBooleanExpression left,
                   NonBooleanExpression right)
Creates new EqualsPredicate.

Parameters:
left - The left-side expression.
right - The right-side expression.
Returns:
The new EqualsPredicate.

neq

NotEqualsPredicate neq(NonBooleanExpression left,
                       NonBooleanExpression right)
Creates new NotEqualsPredicate.

Parameters:
left - The left-side expression.
right - The right-side expression.
Returns:
The new NotEqualsPredicate.

lt

LessThanPredicate lt(NonBooleanExpression left,
                     NonBooleanExpression right)
Creates new LessThanPredicate.

Parameters:
left - The left-side expression.
right - The right-side expression.
Returns:
The new LessThanPredicate.

leq

LessOrEqualPredicate leq(NonBooleanExpression left,
                         NonBooleanExpression right)
Creates new LessOrEqualPredicate.

Parameters:
left - The left-side expression.
right - The right-side expression.
Returns:
The new LessOrEqualPredicate.

gt

GreaterThanPredicate gt(NonBooleanExpression left,
                        NonBooleanExpression right)
Creates new GreaterThanPredicate.

Parameters:
left - The left-side expression.
right - The right-side expression.
Returns:
The new GreaterThanPredicate.

geq

GreaterOrEqualPredicate geq(NonBooleanExpression left,
                            NonBooleanExpression right)
Creates new GreaterOrEqualPredicate.

Parameters:
left - The left-side expression.
right - The right-side expression.
Returns:
The new GreaterOrEqualPredicate.

isNull

IsNullPredicate isNull(NonBooleanExpression what)
Creates new IsNullPredicate.

Parameters:
what - The expression for the predicate.
Returns:
The new IsNullPredicate.

isNotNull

IsNotNullPredicate isNotNull(NonBooleanExpression what)
Creates new IsNotNullPredicate.

Parameters:
what - The expression for the predicate.
Returns:
The new IsNotNullPredicate.

not

Negation not(BooleanExpression what)
Creates new Negation.

Parameters:
what - The expression to be negated.
Returns:
The new Negation.

and

Conjunction and(BooleanExpression left,
                BooleanExpression right)
Creates new Conjunction.

Parameters:
left - The left-side expression.
right - The right-side expression.
Returns:
The new Conjunction.

or

Disjunction or(BooleanExpression left,
               BooleanExpression right)
Creates new Disjunction.

Parameters:
left - The left-side expression.
right - The right-side expression.
Returns:
The new Disjunction.

between

BetweenPredicate between(NonBooleanExpression left,
                         NonBooleanExpression minimum,
                         NonBooleanExpression maximum)
Creates new BetweenPredicate.

Parameters:
left - What to be between.
minimum - The minimum value.
maximum - The maximum value.
Returns:
The new BetweenPredicate.

notBetween

NotBetweenPredicate notBetween(NonBooleanExpression left,
                               NonBooleanExpression minimum,
                               NonBooleanExpression maximum)
Creates new NotBetweenPredicate.

Parameters:
left - What not to be between.
minimum - The minimum value
maximum - The maximum value.
Returns:
The new NotBetweenPredicate.

in

InPredicate in(NonBooleanExpression what,
               NonBooleanExpression... values)
Creates new InPredicate.

Parameters:
what - What to be in accepted values.
values - The accepted values.
Returns:
The new InPredicate.

inBuilder

InBuilder inBuilder(NonBooleanExpression what)
Returns a builder for InPredicate.

Parameters:
what - What to be in accepted values.
Returns:
The builder for InPredicate.

notIn

NotInPredicate notIn(NonBooleanExpression what,
                     NonBooleanExpression... values)
Creates new NotInPredicate.

Parameters:
what - What not to be in values.
values - The values.
Returns:
The new NotInPredicate.

like

LikePredicate like(NonBooleanExpression what,
                   NonBooleanExpression pattern)
Creates new LikePredicate.

Parameters:
what - What to be like something.
pattern - The pattern to match.
Returns:
The new LikePredicate

notLike

NotLikePredicate notLike(NonBooleanExpression what,
                         NonBooleanExpression pattern)
Creates new NotLikePredicate.

Parameters:
what - What not to be like something.
pattern - The pattern.
Returns:
The new NotLikePredicate.

regexp

RegexpPredicate regexp(NonBooleanExpression what,
                       NonBooleanExpression pattern)
Creates new RegexpPredicate.

Parameters:
what - What to match.
pattern - The pattern to match.
Returns:
The new NotRegexpPredicate.

notRegexp

NotRegexpPredicate notRegexp(NonBooleanExpression what,
                             NonBooleanExpression pattern)
Creates new NotRegexpPredicate.

Parameters:
what - What would be not matching the pattern.
pattern - The pattern to use.
Returns:
The new NotRegexpPredicate.

exists

ExistsPredicate exists(QueryExpression query)
Creates new ExistsPredicate.

Parameters:
query - A query to use.
Returns:
The new ExistsPredicate.

unique

UniquePredicate unique(QueryExpression query)
Creates new UniquePredicate.

Parameters:
query - A query to use.
Returns:
The new UniquePredicate.

test

BooleanTest test(BooleanExpression expression,
                 BooleanTest.TestType testType,
                 BooleanTest.TruthValue truthValue)
Creates new BooleanTest.

Parameters:
expression - The expresssion to test.
testType - The test type to use.
truthValue - The truth value to use.
Returns:
The new BooleanTest.

booleanBuilder

BooleanBuilder booleanBuilder()
Returns new BooleanBuilder with Predicate.EmptyPredicate as initial value.

Returns:
The new BooleanBuilder.

booleanBuilder

BooleanBuilder booleanBuilder(BooleanExpression first)
Returns new BooleanBuilder with given boolean expression as initial value.

Parameters:
first - The initial value for boolean expression.
Returns:
The new BooleanBuilder.


Copyright © 2010. All Rights Reserved.