Repository: typeorm/typeorm
File: src/persistence/Subject.ts (TypeScript)

Code before:
    // Accessors
    // -------------------------------------------------------------------------

    /**
     * Checks if this subject must be inserted into the database.
     * Subject can be inserted into the database if it is allowed to be inserted (explicitly persisted or by cascades)
     * and if it does not have database entity set.
     */
    get mustBeInserted() {
        return this.canBeInserted && !this.databaseEntity
    }

    /**
     * Checks if this subject must be updated into the database.
     * Subject can be updated in the database if it is allowed to be updated (explicitly persisted or by cascades)
     * and if it does have differentiated columns or relations.
     */
    get mustBeUpdated() {
        return (
            this.canBeUpdated &&
            this.identifier &&
            (this.databaseEntityLoaded === false ||
                (this.databaseEntityLoaded && this.databaseEntity)) &&
            // ((this.entity && this.databaseEntity) || (!this.entity && !this.databaseEntity)) &&
            // ignore changes for columns which are obviously not updatable
            this.changeMaps.some(
                (change) => !change.column || change.column.isUpdate,
            )
        )
    }

    /**
     * Checks if this subject must be soft-removed into the database.
     * Subject can be updated in the database if it is allowed to be soft-removed (explicitly persisted or by cascades)
     * and if it does have differentiated columns or relations.
     */
    get mustBeSoftRemoved() {
        return (
            this.canBeSoftRemoved &&
            this.identifier &&
            (this.databaseEntityLoaded === false ||
                (this.databaseEntityLoaded && this.databaseEntity))
        )
    }

    /**
     * Checks if this subject must be recovered into the database.
     * Subject can be updated in the database if it is allowed to be recovered (explicitly persisted or by cascades)
     * and if it does have differentiated columns or relations.
     */
    get mustBeRecovered() {

Review comment (suggestion):
Shouldn't this be `filter`? Some will exit as soon as true is returned, so you might ignore updatable columns as well that are after the `update: false`.
I also do not know what the conditions do tell.

Code after:
    // Accessors
    // -------------------------------------------------------------------------

    /**
     * Checks if this subject must be inserted into the database.
     * Subject can be inserted into the database if it is allowed to be inserted (explicitly persisted or by cascades)
     * and if it does not have database entity set.
     */
    get mustBeInserted() {
        return this.canBeInserted && !this.databaseEntity
    }

    /**
     * Checks if this subject must be updated into the database.
     * Subject can be updated in the database if it is allowed to be updated (explicitly persisted or by cascades)
     * and if it does have differentiated columns or relations.
     */
    get mustBeUpdated() {
        return (
            this.canBeUpdated &&
            this.identifier &&
            (this.databaseEntityLoaded === false ||
                (this.databaseEntityLoaded && this.databaseEntity)) &&
            // ((this.entity && this.databaseEntity) || (!this.entity && !this.databaseEntity)) &&
            // ensure there are one or more changes for updatable columns
            this.changeMaps.some(
                (change) => !change.column || change.column.isUpdate,
            )
        )
    }

    /**
     * Checks if this subject must be soft-removed into the database.
     * Subject can be updated in the database if it is allowed to be soft-removed (explicitly persisted or by cascades)
     * and if it does have differentiated columns or relations.
     */
    get mustBeSoftRemoved() {
        return (
            this.canBeSoftRemoved &&
            this.identifier &&
            (this.databaseEntityLoaded === false ||
                (this.databaseEntityLoaded && this.databaseEntity))
        )
    }

    /**
     * Checks if this subject must be recovered into the database.
     * Subject can be updated in the database if it is allowed to be recovered (explicitly persisted or by cascades)
     * and if it does have differentiated columns or relations.
     */
    get mustBeRecovered() {