code: private void ensureReferencedKeys(ModelDef modelDef, String checkLevel) throws ConstraintException
      {
          ClassDescriptorDef      classDef;
          CollectionDescriptorDef collDef;
          ReferenceDescriptorDef  refDef;
  
          for (Iterator it = modelDef.getClasses(); it.hasNext();)
          {
              classDef = (ClassDescriptorDef)it.next();
              for (Iterator refIt = classDef.getReferences(); refIt.hasNext();)
              {
                  refDef = (ReferenceDescriptorDef)refIt.next();
                  if (!refDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_IGNORE, false))
                  {
                      ensureReferencedPKs(modelDef, refDef);
                  }
              }
              for (Iterator collIt = classDef.getCollections(); collIt.hasNext();)
              {
                  collDef = (CollectionDescriptorDef)collIt.next();
                  if (!collDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_IGNORE, false))
                  {
                      if (collDef.hasProperty(PropertyHelper.OJB_PROPERTY_INDIRECTION_TABLE))
                      {
                          ensureReferencedPKs(modelDef, collDef);
                      }
                      else
                      {
                          ensureReferencedFKs(modelDef, collDef);
                      }
                  }
              }
          }
      }
docs: Ensures that the primary/foreign keys referenced by references/collections are present
  in the target type even if generate-table-info="false", by evaluating the subtypes
  of the target type.
  
  @param modelDef   The model
  @param checkLevel The current check level (this constraint is always checked)
  @throws ConstraintException If there is an error with the keys of the subtypes or there
  ain't any subtypes