Skip to content

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

@nhibernate-bot

Description

@nhibernate-bot

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions