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)


Employee employee = new Employee();

// generate Id automatically;

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