Persistence
GigaMap seamlessly integrates with EclipseStore. All required type handlers are registered automatically.
Loading
The loading process is fully automatic, as usual. Even the lazy loading is handled internally.
Storing
After updating the contents of the GigaMap, simply call store
, just like usual.
storageManager.store(gigaMap);
or this way:
gigaMap.store();
The GigaMap monitors changes internally, ensuring that only the modified parts are written to the storage.
This applies to all internal changes of the GigaMap as well as to added and removed entities.
But when entities have been modified, not only the GigaMap has to be stored, but the entities itself as well. This is the same behavior as with normal collections.
Let’s say we update an entity where the update affects the indices, then we have to store both, the GigaMap and the entity.
gigaMap.update(person, p -> {
p.setLastName("Smith"),
p.setAddress(newAddress)
});
storageManager.storeAll(gigaMap, person);