void insertNetwork(@NonNull final MeshNetworkDao meshNetworkDao,
                       @NonNull final NetworkKeysDao netKeysDao,
                       @NonNull final ApplicationKeysDao appKeysDao,
                       @NonNull final ProvisionersDao provisionersDao,
                       @NonNull final ProvisionedMeshNodesDao nodesDao,
                       @NonNull final GroupsDao groupsDao,
                       @NonNull final ScenesDao scenesDao,
                       @NonNull final MeshNetwork meshNetwork) {
        databaseWriteExecutor.execute(() -> {

            meshNetworkDao.insert(meshNetwork);
            netKeysDao.insert(new ArrayList<>(meshNetwork.netKeys));
            appKeysDao.insert(new ArrayList<>(meshNetwork.appKeys));
            provisionersDao.insert(new ArrayList<>(meshNetwork.provisioners));
            if (!meshNetwork.nodes.isEmpty()) {
                nodesDao.insert(new ArrayList<>(meshNetwork.nodes));
            }
            if (meshNetwork.groups != null) {
                groupsDao.insert(new ArrayList<>(meshNetwork.groups));
            }
            if (meshNetwork.scenes != null) {
                scenesDao.insert(new ArrayList<>(meshNetwork.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