code: @Override
      public <Y> SingularAttribute<X, Y> getDeclaredId(Class<Y> paramClass)
      {
          if (idAttribute != null)
          {
              if (idAttribute.getJavaType().equals(paramClass) && !isIdClass)
              {
                  return (SingularAttribute<X, Y>) idAttribute;
              }
          }
  
          onError();
          return null;
      }
docs: /*
  (non-Javadoc)
  
  @see
  javax.persistence.metamodel.IdentifiableType#getDeclaredId(java.lang.
  Class)