// Establish a connection and obtain the store options...
entityManager = entityManagerFactory.createEntityManager();
// Find and update/set the root node's UUID ...
StoreOptions options = new StoreOptions(entityManager);
UUID actualUuid = options.getRootNodeUuid();
if (actualUuid != null) {
this.setRootNodeUuid(actualUuid.toString());
} else {
options.setRootNodeUuid(this.rootUuid);
}
// Find or set the type of model that will be used.
String actualModelName = options.getModelName();
if (actualModelName == null) {
// This is a new store, so set to the specified model ...
if (model == null) setModel(Models.DEFAULT.getName());
assert model != null;
options.setModelName(model);
} else {
try {
setModel(actualModelName);
} catch (Throwable e) {
// The actual model name doesn't match what's available in the software ...