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 support for isNull and isNotNull conditions #529

Merged
merged 2 commits into from
Mar 25, 2022

Conversation

brfrn169
Copy link
Collaborator

This PR adds a support for isNull and isNotNull conditions for conditional mutations.

We can specify isNull and isNotNull conditions as follows:

PutIf putIf =
    ConditionBuilder.putIf(ConditionBuilder.column("c1").isNullInt())
        .and(ConditionBuilder.column("c2").isNullText())
        .build();

Please take a look!

@brfrn169 brfrn169 added the enhancement New feature or request label Mar 22, 2022
@brfrn169 brfrn169 requested a review from feeblefakie March 22, 2022 01:39
@brfrn169 brfrn169 self-assigned this Mar 22, 2022
Comment on lines +343 to +344
IS_NULL,
IS_NOT_NULL
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the new operators, IS_NULL and IS_NOT_NULL.

Comment on lines +84 to +85
.compareTrueFirst(hasNullValue(), o.hasNullValue())
.compare(getBigIntValue(), o.getBigIntValue())
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made small changes for the compareTo methods of XXXColumn in this PR.

Copy link
Contributor

@feeblefakie feeblefakie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you!
Left one comment about the seemingly unrelated changes in the PR.

*
* @author Yuji Ito
*/
@NotThreadSafe
public final class ValueBinder implements ValueVisitor {
public final class ValueBinder implements ColumnVisitor {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these intended changes for this PR? (looks like coming from a previous PR or it's left unchanged in the previous PR?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for taking at this PR!

In the previous PR, I didn't remove all the usages of ValueVisitor, and I thought I was going to do that in another PR. But the changes were needed for this isNull and isNotNull conditions support, so I did it in this PR. I will remove the rest of the usages of ValueVisitor in another PR. Thanks.

@brfrn169 brfrn169 merged commit a44f6b2 into master Mar 25, 2022
@brfrn169 brfrn169 deleted the add-support-for-isNull-and-isNotNull-conditions branch March 25, 2022 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants