Skip to content
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

add Selector#where(Function<C, C>) #408

Merged
merged 3 commits into from
May 23, 2017

Conversation

k-kagurazaka
Copy link
Member

I added Selector#conditionGroup() to build complex condition like:

db.selectFromBook()
        .conditionGroup(it -> it.titleEq("Hoge").or().titleEq("Huga"))
        .and()
        .publisherEq(publisher)
        .toList();

The result SQL is SELECT * FROM Book WHERE (title = "Hoge" OR title = "Huga") AND publisherId = 1.

@gfx
Copy link
Member

gfx commented May 22, 2017

Looks good, but why not where(C conditionGroup)?

IMO both where(Function<C, C> conditionGroupFunction) and where(C conditiongGroup) are useful.

@gfx
Copy link
Member

gfx commented May 22, 2017

(memo: I'll release a new version soon after this PR is merged)

@k-kagurazaka
Copy link
Member Author

I agree with you.
I'll try it.

@k-kagurazaka
Copy link
Member Author

I renamed conditionGroup to where and add tests 👍

@gfx gfx changed the title add Selector#conditionGroup() add Selector#where(C) May 22, 2017
@gfx
Copy link
Member

gfx commented May 23, 2017

LGTM

@gfx gfx merged commit f173b99 into maskarade:master May 23, 2017
@k-kagurazaka k-kagurazaka deleted the condition-group branch May 23, 2017 01:08
@gfx gfx changed the title add Selector#where(C) add Selector#where(Function<C, C>) May 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants