Source:
<code>public synchronized Optional<ModelType> insertBlocking(@NonNull ModelType modelType, @NonNull DatabaseOperationMetadata databaseOperationMetadata) { final ContentValues values = databaseAdapter.write(modelType, databaseOperationMetadata); if (!values.containsKey(COLUMN_UUID) || UUID.fromString(values.getAsString(COLUMN_UUID)).equals(Keyed.Companion.getMISSING_UUID())) { <START> values.put(COLUMN_UUID, UUID.randomUUID().toString()); <END> } UUID uuid = UUID.fromString(values.getAsString(COLUMN_UUID)); if (getWritableDatabase().insertOrThrow(getTableName(), null, values) != -1) { if (Integer.class.equals(primaryKey.getPrimaryKeyClass())) { Cursor cursor = null; try { cursor = getReadableDatabase().rawQuery("SELECT last_insert_rowid()", null); final Integer id; if (cursor != null && cursor.moveToFirst() && cursor.getColumnCount() > 0) { id = cursor.getInt(0); } else { id = -1; } final PrimaryKey<ModelType, PrimaryKeyType> autoIncrementPrimaryKey = (PrimaryKey<ModelType, PrimaryKeyType>) new AutoIncrementIdPrimaryKey<>((PrimaryKey<ModelType, Integer>) primaryKey, id); final ModelType insertedItem = databaseAdapter.build(modelType, autoIncrementPrimaryKey, uuid, databaseOperationMetadata); if (cachedResults != null) { cachedResults.add(insertedItem); if (insertedItem instanceof Comparable<?>) { Collections.sort((List<? extends Comparable>) cachedResults); } } return Optional.of(insertedItem); } finally { if (cursor != null) { cursor.close(); } } } else { final ModelType insertedItem = databaseAdapter.build(modelType, primaryKey, uuid, databaseOperationMetadata); if (cachedResults != null) { cachedResults.add(insertedItem); if (insertedItem instanceof Comparable<?>) { Collections.sort((List<? extends Comparable>) cachedResults); } } return Optional.of(insertedItem); } } else { return Optional.absent(); } }</code><technical_language>update this add a Logger.warn statement if do this? I want work updating flows. Thanks</technical_language>

Target:
public synchronized Optional<ModelType> insertBlocking(@NonNull ModelType modelType, @NonNull DatabaseOperationMetadata databaseOperationMetadata) { final ContentValues values = databaseAdapter.write(modelType, databaseOperationMetadata); if (!values.containsKey(COLUMN_UUID) || UUID.fromString(values.getAsString(COLUMN_UUID)).equals(Keyed.Companion.getMISSING_UUID())) { Logger.warn(this, "Assigning random UUID to new model before inserting"); values.put(COLUMN_UUID, UUID.randomUUID().toString()); } UUID uuid = UUID.fromString(values.getAsString(COLUMN_UUID)); if (getWritableDatabase().insertOrThrow(getTableName(), null, values) != -1) { if (Integer.class.equals(primaryKey.getPrimaryKeyClass())) { Cursor cursor = null; try { cursor = getReadableDatabase().rawQuery("SELECT last_insert_rowid()", null); final Integer id; if (cursor != null && cursor.moveToFirst() && cursor.getColumnCount() > 0) { id = cursor.getInt(0); } else { id = -1; } final PrimaryKey<ModelType, PrimaryKeyType> autoIncrementPrimaryKey = (PrimaryKey<ModelType, PrimaryKeyType>) new AutoIncrementIdPrimaryKey<>((PrimaryKey<ModelType, Integer>) primaryKey, id); final ModelType insertedItem = databaseAdapter.build(modelType, autoIncrementPrimaryKey, uuid, databaseOperationMetadata); if (cachedResults != null) { cachedResults.add(insertedItem); if (insertedItem instanceof Comparable<?>) { Collections.sort((List<? extends Comparable>) cachedResults); } } return Optional.of(insertedItem); } finally { if (cursor != null) { cursor.close(); } } } else { final ModelType insertedItem = databaseAdapter.build(modelType, primaryKey, uuid, databaseOperationMetadata); if (cachedResults != null) { cachedResults.add(insertedItem); if (insertedItem instanceof Comparable<?>) { Collections.sort((List<? extends Comparable>) cachedResults); } } return Optional.of(insertedItem); } } else { return Optional.absent(); } }