Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jeffgbutler opened this issue Jul 2, 2019 · 0 comments · Fixed by #108
Closed

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

jeffgbutler opened this issue Jul 2, 2019 · 0 comments · Fixed by #108
Milestone

Comments

@jeffgbutler
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant