java.lang.Object
org.litebridge.orm.api.select.model.ConditionSpec
Specification for a condition in a database query.
This is used in a SQL query WHERE clause, JOIN clause, etc.
A condition consists of a column, an operator, and an optional value. The operator dictates how the column will be compared to the provided value.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetLhs()Gets the left-hand side expression of the condition.Gets the operator used in the condition.@Nullable ObjectgetValue()Gets the right-hand side value of the condition.voidSets the left-hand side expression of the condition to a specific column.voidsetLhs(ExpressionSpec lhs) Sets the left-hand side expression of the condition.voidsetOperator(Operator operator) Sets the operator for the condition.voidSets the right-hand side value for the condition.toCondition(SelectExpressionMapper selectExpressionMapper, Collection<Table> selectedTables) Converts this specification into aCondition.toString()
-
Constructor Details
-
ConditionSpec
public ConditionSpec()
-
-
Method Details
-
getLhs
Gets the left-hand side expression of the condition.- Returns:
- the LHS expression
-
setLhs
Sets the left-hand side expression of the condition.- Parameters:
lhs- the LHS expression to set
-
setLhs
Sets the left-hand side expression of the condition to a specific column.- Parameters:
column- the column to set as LHS
-
getOperator
Gets the operator used in the condition.- Returns:
- the operator
-
setOperator
Sets the operator for the condition.- Parameters:
operator- the operator to set
-
getValue
Gets the right-hand side value of the condition.- Returns:
- the RHS value, or
null
-
setValue
Sets the right-hand side value for the condition.- Parameters:
value- the RHS value to set
-
toCondition
public Condition toCondition(SelectExpressionMapper selectExpressionMapper, Collection<Table> selectedTables) Converts this specification into aCondition.- Parameters:
selectExpressionMapper- the mapper to use for expressionsselectedTables- the collection of tables included in the query- Returns:
- the resulting
Condition
-
toString
-