Package com.github.eikecochu.sqlbuilder
Class ConditionPart<T extends Conditionable<T>>
- java.lang.Object
-
- com.github.eikecochu.sqlbuilder.ConditionPart<T>
-
- Type Parameters:
T- the type of the conditionable to return to
- All Implemented Interfaces:
QueryPart
public class ConditionPart<T extends Conditionable<T>> extends java.lang.Object implements QueryPart
The ConditionPart is a part of the conditionable expression. It marks the start of a new condition and provides methods to configure it and return to the conditionable in a fluid style.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedConditionPart(Conditionable<T> conditionable, java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConditionBiValue<T>between()The BETWEEN operatorTbetween(java.lang.Object value1, java.lang.Object value2)The BETWEEN operatorprotected Tcondition(CompareOperator operator, ConditionValueType type, java.lang.Object value)protected Tcondition(CompareOperator operator, ConditionValueType type, java.lang.Object[] values)ConditionValue<T>eq()The EQUALS operatorTeq(java.lang.Object value)The EQUALS operator.TeqCol(java.lang.String column)Set a column to be constrainedTeqExpr(Expression expression)Set an expression to be used as conditionTeqExpr(java.lang.String expr, java.lang.Object... values)Set an expression to be used as conditionConditionValue<T>ge()The GREATER EQUALS operatorTge(java.lang.Object value)The GREATER EQUALS operator.ConditionValue<T>gt()The GREATER THAN operatorTgt(java.lang.Object value)The GREATER THAN operator.ConditionValue<T>in()The IN operatorTin(java.lang.Iterable<java.lang.Object> values)The IN operator.Tin(java.lang.Object... values)The IN operator.TisNull()The IS NULL operatorConditionValue<T>le()The LESSER EQUALS operatorTle(java.lang.Object value)The LESSER EQUALS operator.ConditionValue<T>like()The LIKE operatorTlike(java.lang.Object value)The LIKE operator.ConditionValue<T>lt()The LESSER THAN operatorTlt(java.lang.Object value)The LESSER THAN operator.ConditionPart<T>not()The NOT operatorConditionValue<T>notEq()The NOT EQUALS operatorTnotEq(java.lang.Object value)The NOT EQUALS operator.java.lang.Stringstring(QueryOptions options)Transforms this statement into an SQL string
-
-
-
Constructor Detail
-
ConditionPart
protected ConditionPart(Conditionable<T> conditionable, java.lang.String name)
-
-
Method Detail
-
not
public ConditionPart<T> not()
The NOT operator- Returns:
- The value instance to set the compare value
-
eq
public ConditionValue<T> eq()
The EQUALS operator- Returns:
- The value instance to set the compare value
-
eq
public T eq(java.lang.Object value)
The EQUALS operator. Only accepts values- Parameters:
value- The value to compare to- Returns:
- The previous instance
-
eqCol
public T eqCol(java.lang.String column)
Set a column to be constrained- Parameters:
column- The column name- Returns:
- This instance
-
eqExpr
public T eqExpr(java.lang.String expr, java.lang.Object... values)
Set an expression to be used as condition- Parameters:
expr- The condition expressionvalues- Additional values that are passed to the PreparedStatement. These values are ignored if the target is not a PreparedQuery.- Returns:
- This instance
-
eqExpr
public T eqExpr(Expression expression)
Set an expression to be used as condition- Parameters:
expression- The condition expression- Returns:
- This instance
-
notEq
public ConditionValue<T> notEq()
The NOT EQUALS operator- Returns:
- The value instance to set the compare value
-
notEq
public T notEq(java.lang.Object value)
The NOT EQUALS operator. Only accepts values- Parameters:
value- The value to compare to- Returns:
- The previous instance
-
ge
public ConditionValue<T> ge()
The GREATER EQUALS operator- Returns:
- The value instance to set the compare value
-
ge
public T ge(java.lang.Object value)
The GREATER EQUALS operator. Only accepts values- Parameters:
value- The value to compare to- Returns:
- The previous instance
-
gt
public ConditionValue<T> gt()
The GREATER THAN operator- Returns:
- The value instance to set the compare value
-
gt
public T gt(java.lang.Object value)
The GREATER THAN operator. Only accepts values- Parameters:
value- The value to compare to- Returns:
- The previous instance
-
le
public ConditionValue<T> le()
The LESSER EQUALS operator- Returns:
- The value instance to set the compare value
-
le
public T le(java.lang.Object value)
The LESSER EQUALS operator. Only accepts values- Parameters:
value- The value to compare to- Returns:
- The previous instance
-
lt
public ConditionValue<T> lt()
The LESSER THAN operator- Returns:
- The value instance to set the compare value
-
lt
public T lt(java.lang.Object value)
The LESSER THAN operator. Only accepts values- Parameters:
value- The value to compare to- Returns:
- The previous instance
-
like
public ConditionValue<T> like()
The LIKE operator- Returns:
- The value instance to set the compare value
-
like
public T like(java.lang.Object value)
The LIKE operator. Only accepts values- Parameters:
value- The value to compare to- Returns:
- The previous instance
-
in
public ConditionValue<T> in()
The IN operator- Returns:
- The value instance to set the compare values
-
in
public T in(java.lang.Object... values)
The IN operator. Only accepts values- Parameters:
values- The values to compare to- Returns:
- The previous instance
-
in
public T in(java.lang.Iterable<java.lang.Object> values)
The IN operator. Only accepts values- Parameters:
values- The values to compare to- Returns:
- The previous instance
-
between
public ConditionBiValue<T> between()
The BETWEEN operator- Returns:
- The value instance to set the compare values
-
between
public T between(java.lang.Object value1, java.lang.Object value2)
The BETWEEN operator- Parameters:
value1- The first valuevalue2- The second value- Returns:
- The previous instance
-
isNull
public T isNull()
The IS NULL operator- Returns:
- The previous instance
-
condition
protected T condition(CompareOperator operator, ConditionValueType type, java.lang.Object value)
-
condition
protected T condition(CompareOperator operator, ConditionValueType type, java.lang.Object[] values)
-
string
public java.lang.String string(QueryOptions options)
Description copied from interface:QueryPartTransforms this statement into an SQL string
-
-