code: private static <T> void fillGeneratedId(final T target,
                                             final Introspected introspected,
                                             final PreparedStatement stmt,
                                             final boolean checkExistingId) throws SQLException {
        if (!introspected.hasGeneratedId()) {
           return;
        }
  
        final FieldColumnInfo fcInfo = introspected.getGeneratedIdFcInfo();
        if (checkExistingId) {
           final Object idExisting = introspected.get(target, fcInfo);
           if (idExisting != null && (!(idExisting instanceof Integer) || (Integer) idExisting > 0)) {
              // a bit tied to implementation but let's assume that integer id <= 0 means that it was not generated yet
              return;
           }
        }
        try (final ResultSet generatedKeys = stmt.getGeneratedKeys()) {
           if (generatedKeys.next()) {
              introspected.set(target, fcInfo, generatedKeys.getObject(1));
           }
        }
     }
docs: Sets auto-generated ID if not set yet