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