Criteria builder
The CriteriaBuilder is a utility class designed to build objects used in creating query criteria in a Groovy expression format. These criteria can be used in requests to back-end services.
Methods
info
The examples for these methods use a simple expression that checks that TRADE_ID equals a certain value.
const tradeIdEqualsExpression = new ExpressionBuilder()
.withField('TRADE_ID')
.withValue('TR1234')
.withSerialiser(Serialisers.EQ)
.build()
| Method | Description | Params | Return value | Example |
|---|---|---|---|---|
| withExpression | Sets an expression in the criteria | ValidExpressionType, ExpressionOptions, Join (default Join.And) | CriteriaBuilder | |
| And | Sets an expression with an And clause | ValidExpressionType, ExpressionOptions | CriteriaBuilder | |
| Or | Sets an expression with an Or clause | ValidExpressionType, ExpressionOptions | CriteriaBuilder | |
| Not | Sets an expression with a Not clause | ValidExpressionType, ExpressionOptions | CriteriaBuilder | |
| Build | Creates a string representation of based on the set expressions in the object | none | string | |