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

NHMA-29 - Add a "try" possibility to unsaved-value for SaveOrUpdate with assigned Guid #8

Open
nhibernate-bot opened this issue May 18, 2017 · 0 comments

Comments

@nhibernate-bot
Copy link

Michel Van Hoof created issue - 13/Nov/09 9:46 PM

I know the question has been asked many times but it seems to make sense:

We often have to replicate data between different systems where we want to keep the original guids of the data. when wanting to do so using Nhibernate, we cannot use the SaveOrUpdate possibility since there is only the option of:

always save
Always update
save when id = null
save when id = null or "value"

So basically, if you want to use SaveOrUpdate, you cannot assign your own guid's as primary keys.

In data replication situations (for example receiving data from another application using a messagequeue) you have to first check if an object is already present and then decide to save or update.

It would be nice to have an option saying "try" which would do this for you (so query the database/persistence to see if an object with the given id already exists, if not= save, else = update)

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

No branches or pull requests

1 participant