Module litebridge.orm
Package org.litebridge.orm.api.update
Class UpdateSetStep<DTO,US extends UpdateStep<DTO,US,SELF,WCC,WCCT,QCB>,SELF extends UpdateSetStep<DTO,US,SELF,WCC,WCCT,QCB>,WCC extends UpdateWhereConditionClause<DTO,WCC,WCCT,QCB>,WCCT extends UpdateWhereConditionClauseTerminal<DTO,WCC,WCCT,QCB>,QCB extends QueryConditionBuilder<DTO,?,?,?,QCB>>
java.lang.Object
org.litebridge.orm.api.update.UpdateSetStep<DTO,US,SELF,WCC,WCCT,QCB>
- Type Parameters:
DTO- the mapped DTO/entity type or row typeUS- the update step type returned after setting a valueWCC- the where condition clause typeWCCT- the where condition clause terminal type
- Direct Known Subclasses:
DtoUpdateSetStep,SqlUpdateSetStep
public abstract sealed class UpdateSetStep<DTO,US extends UpdateStep<DTO,US,SELF,WCC,WCCT,QCB>,SELF extends UpdateSetStep<DTO,US,SELF,WCC,WCCT,QCB>,WCC extends UpdateWhereConditionClause<DTO,WCC,WCCT,QCB>,WCCT extends UpdateWhereConditionClauseTerminal<DTO,WCC,WCCT,QCB>,QCB extends QueryConditionBuilder<DTO,?,?,?,QCB>>
extends Object
permits DtoUpdateSetStep<DTO>, SqlUpdateSetStep
Base step for specifying the value of a column or expression in a
SET clause.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a newUpdateSetStepinstance with a column or field name.protectedUpdateSetStep(ExpressionSpec expressionSpec, QueryNode node, Function<QueryNode, US> updateStepCreator) Creates a newUpdateSetStepinstance with an expression specification. -
Method Summary
Modifier and TypeMethodDescriptionAdds the specified value to the target column or field.Divides the target column or field by the specified value.Increments the target column or field by 1.Subtracts the specified value from the target column or field.Applies a modulo operation to the target column or field with the specified value.Multiplies the target column or field by the specified value.Sets the target column or field to the specified value.
-
Constructor Details
-
UpdateSetStep
Creates a newUpdateSetStepinstance with a column or field name.- Parameters:
column- the column or field name to updatenode- the current query nodeupdateStepCreator- the function to create the update step
-
UpdateSetStep
protected UpdateSetStep(ExpressionSpec expressionSpec, QueryNode node, Function<QueryNode, US> updateStepCreator) Creates a newUpdateSetStepinstance with an expression specification.- Parameters:
expressionSpec- the expression specification defining the column or targetnode- the current query nodeupdateStepCreator- the function to create the update step
-
-
Method Details
-
to
Sets the target column or field to the specified value.- Parameters:
value- the value to set- Returns:
- the next update step
-
increment
Increments the target column or field by 1.- Returns:
- the next update step
-
add
Adds the specified value to the target column or field.- Parameters:
value- the value to add- Returns:
- the next update step
-
minus
Subtracts the specified value from the target column or field.- Parameters:
value- the value to subtract- Returns:
- the next update step
-
multiply
Multiplies the target column or field by the specified value.- Parameters:
value- the value to multiply by- Returns:
- the next update step
-
divide
Divides the target column or field by the specified value.- Parameters:
value- the divisor value- Returns:
- the next update step
-
mod
Applies a modulo operation to the target column or field with the specified value.- Parameters:
value- the modulus value- Returns:
- the next update step
-