@Override
    public Object extract(Object instance) {
      throw new UnsupportedOperationException(String.format("Entity %s does not have a key defined. " +
              " extract() method is not supposed to be called on %s using this class (%s). " +
              "Did you check for metadata().isKeyDefined() ?", entityType.getName(),
              NoKey.class.getSimpleName(),
              instance == null ? null : instance.getClass().getSimpleName()));
    }
Empty extractor which always throws exceptions
criteria/common/src/org/immutables/criteria/backend/KeyExtractors.java