Skip to content

Combined AND and OR predicate in Criteria Builder #267

Closed
@IvanKonevJr

Description

@IvanKonevJr

For example:
Criteria.where(column1).is(value1).and(column2).is(value2).or(column3).is(value3)

return SQL: where column1=value1 and column2=value2 or column3=value3

Needed grouping Criteria:
where column1=value1 and (column2=value2 or column3=value3)

may be this way?:
val orCriteria = Criteria.groupStep(column2).is(value2).or(column3).is(value3) Criteria.where(column1).is(value1).and(orCriteria)`

then OR and AND overloaded by CriteriaGroup type

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions