Skip to content

Add Ability to Call "where()" with no Parameters #107

Closed
@jeffgbutler

Description

@jeffgbutler

This will be useful for cases when there is complex logic associated with a where clause. A good example is seen in #100 where there is complex logic associated with creating a search and the where clause could be generated many different ways. We should support a usage like this:

QueryExpressionDSL<SelectModel>.QueryExpressionWhereBuilder builder = select(person.allColumns())
    .from(person)
    .where();

if (someCondition) {
  builder.and(id, isEqualto(3));
}

if (anotherCondition) {
  builder.and(firstName, isNull());
}

SelectStatementProvider selectStatement = builder.build().render(RenderingStrategy.MYBATIS3);

This should render properly regardless of whether all conditions, or none, are satisfied.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions