code: private void updateReadonly(EntityType entityType, Attribute attr, Attribute updatedAttr) {
      Map<String, Attribute> readonlyTableAttrs =
          getTableAttributesReadonly(entityType)
              .collect(toLinkedMap(Attribute::getName, Function.identity()));
      if (!readonlyTableAttrs.isEmpty()) {
        dropTableTriggers(entityType);
      }
  
      if (attr.isReadOnly() && !updatedAttr.isReadOnly()) {
        readonlyTableAttrs.remove(attr.getName());
      } else if (!attr.isReadOnly() && updatedAttr.isReadOnly()) {
        readonlyTableAttrs.put(updatedAttr.getName(), updatedAttr);
      }
  
      if (!readonlyTableAttrs.isEmpty()) {
        createTableTriggers(entityType, readonlyTableAttrs.values());
      }
    }
docs: Updates triggers and functions based on attribute readonly changes.
  
  @param entityType entity meta data
  @param attr current attribute
  @param updatedAttr updated attribute