You are here: Configuration > File Configuration > Generate UUIDs

Generate UUIDs

db4o can generate UUIDs for each stored object. These UUIDs are mainly used for replication together with commit timestamps. Of course it can be used also for other purposes.

Enable UUIDs for all objects.

You can enable UUIDs for all objects. Set the global scope on the UUID setting.

EmbeddedConfiguration configuration = Db4oEmbedded.newConfiguration();
configuration.file().generateUUIDs(ConfigScope.GLOBALLY);
FileConfiguration.java: Enable db4o uuids globally

Enable UUIDs for certain classes

You can also enable uuids only for certain classes:

EmbeddedConfiguration configuration = Db4oEmbedded.newConfiguration();
configuration.file().generateUUIDs(ConfigScope.INDIVIDUALLY);
configuration.common().objectClass(SpecialClass.class).generateUUIDs(true);
FileConfiguration.java: Enable db4o uuids for certain classes