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

feat(flux-dsl): supports empty logic operator #213

Merged
merged 2 commits into from
Apr 7, 2021

Conversation

bednar
Copy link
Contributor

@bednar bednar commented Apr 6, 2021

Closes #212

Proposed Changes

The FluxDSL supports empty logic operator. It is useful for something like:

String classCode = search.getClassCode();
restriction = Restrictions.and(
        Restrictions.tag("containerId").equal(search.getContainerId()),
        classCode != null ? Restrictions.tag("classCode").equal(classCode) : Restrictions.or(),
        Restrictions.measurement().equal("data")
);

Checklist

  • CHANGELOG.md updated
  • Rebased/mergeable
  • A test has been added if appropriate
  • mvn test completes successfully
  • Commit messages are in semantic format
  • Sign CLA (if not already signed)

@bednar bednar marked this pull request as ready for review April 6, 2021 07:20
@bednar bednar requested a review from rhajek April 6, 2021 07:20
@codecov-io
Copy link

codecov-io commented Apr 6, 2021

Codecov Report

Merging #213 (b9af9a6) into master (3f5b8b8) will decrease coverage by 0.01%.
The diff coverage is 75.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #213      +/-   ##
============================================
- Coverage     88.40%   88.39%   -0.02%     
  Complexity      447      447              
============================================
  Files           139      139              
  Lines          5513     5516       +3     
  Branches        226      227       +1     
============================================
+ Hits           4874     4876       +2     
  Misses          561      561              
- Partials         78       79       +1     
Impacted Files Coverage Δ Complexity Δ
.../query/dsl/functions/restriction/Restrictions.java 95.45% <75.00%> (-4.55%) 11.00 <0.00> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3f5b8b8...b9af9a6. Read the comment docs.

@bednar bednar merged commit 5be7b5f into master Apr 7, 2021
@bednar bednar deleted the feat/supports-empty-logic-operator branch April 7, 2021 05:13
@bednar bednar added this to the 2.2.0 milestone Apr 7, 2021
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.

How to make dynamic query
3 participants