code: private void ensurePKsFromHierarchy(ClassDescriptorDef classDef) throws ConstraintException
      {
          SequencedHashMap pks = new SequencedHashMap();
  
          for (Iterator it = classDef.getAllExtentClasses(); it.hasNext();)
          {
              ClassDescriptorDef subTypeDef = (ClassDescriptorDef)it.next();
  
              ArrayList subPKs = subTypeDef.getPrimaryKeys();
  
              // check against already present PKs
              for (Iterator pkIt = subPKs.iterator(); pkIt.hasNext();)
              {
                  FieldDescriptorDef fieldDef   = (FieldDescriptorDef)pkIt.next();
                  FieldDescriptorDef foundPKDef = (FieldDescriptorDef)pks.get(fieldDef.getName());
  
                  if (foundPKDef != null)
                  {
                      if (!isEqual(fieldDef, foundPKDef))
                      {
                          throw new ConstraintException("Cannot pull up the declaration of the required primary key "+fieldDef.getName()+
                                                        " because its definitions in "+fieldDef.getOwner().getName()+" and "+
                                                        foundPKDef.getOwner().getName()+" differ");
                      }
                  }
                  else
                  {
                      pks.put(fieldDef.getName(), fieldDef);
                  }
              }
          }
  
          ensureFields(classDef, pks.values());
      }
docs: Gathers the pk fields from the hierarchy of the given class, and copies them into the class.
  
  @param classDef The root of the hierarchy
  @throws ConstraintException If there is a conflict between the pk fields