Skip to content

IF_NOT_EXISTS mapper option for SAVE queries.#677

Closed
raggzy wants to merge 1 commit into
apache:3.0from
raggzy:3.0
Closed

IF_NOT_EXISTS mapper option for SAVE queries.#677
raggzy wants to merge 1 commit into
apache:3.0from
raggzy:3.0

Conversation

@raggzy
Copy link
Copy Markdown

@raggzy raggzy commented May 22, 2016

Added IF_NOT_EXISTS mapper option for save operations.

Useful in cases when you want to insert something atomically, but you are not sure it exists or not. And your app logic actually depends on whether it was inserted or not.

You still can build Insert by hands, but this way looks much much prettier.

For example, user registration process, your User table has PrimaryKey username. You try to register user, but if 'it exists', e.g. wasApplied returned false - you tell about that on UI with error/warning "User already exists". Until try to insert, you'd never know that.

@datastax-bot
Copy link
Copy Markdown

Hi @raggzy, thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes.

Sincerely,
DataStax Bot.

@adutra
Copy link
Copy Markdown
Contributor

adutra commented May 23, 2016

This looks very similar to #626. Also already logged as JAVA-1174.

@raggzy
Copy link
Copy Markdown
Author

raggzy commented May 24, 2016

Yeah, it is the same. Sorry, missed it out. I'd love to see any of those in next release :)

@olim7t
Copy link
Copy Markdown
Contributor

olim7t commented Sep 14, 2016

Closing in favor of #626 then.

@olim7t olim7t closed this Sep 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants