code: public <E> List<E> updateWithOptimisticLock(List<E> entities) {
      if (entities == null || entities.isEmpty()) {
        return new ArrayList<>();
      }
      Class<?> entityClass = entities.get(0).getClass();
      PropertyMetadata versionMetadata = EntityIntrospector.getVersionMetadata(entityClass);
      if (versionMetadata == null) {
        return update(entities);
      } else {
        return updateWithOptimisticLockInternal(entities, versionMetadata);
      }
    }
docs: Updates the given list of entities using optimistic locking feature, if the entities are set up
  to support optimistic locking. Otherwise, a normal update is performed.
  
  @param entities
  the entities to update
  @return the updated entities