Java Python Node.JS
Article For
1.0 2.0 2.5 3.0 3.5 4.0 4.1 4.2 5.1 5.2 5.3

Session: Storing Entities

To store entities inside the session object, use one of the three Store methods.


First overload: Stores the entity in a session, then extracts the ID from the entity or generates a new one if it's not available.

void Store(object entity);

Second overload: Stores the entity in a session with given ID.

void Store(object entity, string id);

Third overload: Stores the entity in a session with given ID, forces concurrency check with given change vector.

void Store(object entity, string changeVector, string id);
entity object Entity that will be stored
changeVector string Entity changeVector, used for concurrency checks (null to skip check)
id string Entity will be stored under this ID, (null to generate automatically)


// generate Id automatically
session.Store(new Employee
    FirstName = "John",
    LastName = "Doe"

// send all pending operations to server, in this case only `Put` operation