void update(@NonNull final MeshNetwork network,
                @NonNull final MeshNetworkDao networkDao,
                @NonNull final NetworkKeysDao netKeyDao,
                @NonNull final ApplicationKeysDao appKeyDao,
                @NonNull final ProvisionersDao provisionersDao,
                @NonNull final ProvisionedMeshNodesDao nodesDao,
                @NonNull final GroupsDao groupsDao,
                @NonNull final ScenesDao sceneDao) {
        databaseWriteExecutor.execute(() -> {
            networkDao.update(network.meshUUID, network.meshName, network.timestamp,
                    network.partial, MeshTypeConverters.ivIndexToJson(network.ivIndex),
                    network.lastSelected,
                    MeshTypeConverters.networkExclusionsToJson(new HashMap<>(network.getNetworkExclusions())));
            netKeyDao.update(new ArrayList<>(network.netKeys));
            appKeyDao.update(new ArrayList<>(network.appKeys));
            provisionersDao.update(new ArrayList<>(network.provisioners));
            nodesDao.update(new ArrayList<>(network.nodes));
            groupsDao.update(new ArrayList<>(network.groups));
            sceneDao.update(new ArrayList<>(network.scenes));
        });
    }
Override the onOpen method to populate the database.
For this sample, we clear the database every time it is created or opened.
<p>
If you want to populate the database only when the database is created for the 1st time,
override RoomDatabase.Callback()#onCreate
mesh/src/main/java/no/nordicsemi/android/mesh/MeshNetworkDb.java