code: private void onIdAttribute(final MetaModelBuilder builder, EntityMetadata entityMetadata, final Class clazz, Field f)
      {
          EntityType entity = (EntityType) builder.getManagedTypes().get(clazz);
  
          Attribute attrib = entity.getAttribute(f.getName());
          if (!attrib.isCollection() && ((SingularAttribute) attrib).isId())
          {
              entityMetadata.setIdAttribute((SingularAttribute) attrib);
              populateIdAccessorMethods(entityMetadata, clazz, f);
          }
      }
docs: On id attribute.
  
  @param builder
  the builder
  @param entityMetadata
  the entity metadata
  @param clazz
  the clazz
  @param f
  the f