docs: private void ensureElementClassRef(CollectionDescriptorDef collDef, String checkLevel) throws ConstraintException
      {
          if (CHECKLEVEL_NONE.equals(checkLevel))
          {
              return;
          }
  
          String arrayElementClassName = collDef.getProperty(PropertyHelper.OJB_PROPERTY_ARRAY_ELEMENT_CLASS_REF);
  
          if (!collDef.hasProperty(PropertyHelper.OJB_PROPERTY_ELEMENT_CLASS_REF))
          {
              if (arrayElementClassName != null)
              {
                  // we use the array element type
                  collDef.setProperty(PropertyHelper.OJB_PROPERTY_ELEMENT_CLASS_REF, arrayElementClassName);
              }
              else
              {
                  throw new ConstraintException("Collection "+collDef.getName()+" in class "+collDef.getOwner().getName()+" does not specify its element class");
              }
          }
  
          // now checking the element type
          ModelDef           model            = (ModelDef)collDef.getOwner().getOwner();
          String             elementClassName = collDef.getProperty(PropertyHelper.OJB_PROPERTY_ELEMENT_CLASS_REF);
          ClassDescriptorDef elementClassDef  = model.getClass(elementClassName);
  
          if (elementClassDef == null)
          {
              throw new ConstraintException("Collection "+collDef.getName()+" in class "+collDef.getOwner().getName()+" references an unknown class "+elementClassName);
          }
          if (!elementClassDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_OJB_PERSISTENT, false))
          {
              throw new ConstraintException("The element class "+elementClassName+" of the collection "+collDef.getName()+" in class "+collDef.getOwner().getName()+" is not persistent");
          }
          if (CHECKLEVEL_STRICT.equals(checkLevel) && (arrayElementClassName != null))
          {
              // specified element class must be a subtype of the element type
              try
              {
                  InheritanceHelper helper = new InheritanceHelper();
  
                  if (!helper.isSameOrSubTypeOf(elementClassDef, arrayElementClassName, true))
                  {
                      throw new ConstraintException("The element class "+elementClassName+" of the collection "+collDef.getName()+" in class "+collDef.getOwner().getName()+" is not the same or a subtype of the array base type "+arrayElementClassName);
                  }
              }
              catch (ClassNotFoundException ex)
              {
                  throw new ConstraintException("Could not find the class "+ex.getMessage()+" on the classpath while checking the collection "+collDef.getName()+" in class "+collDef.getOwner().getName());
              }
          }
          // we're adjusting the property to use the classloader-compatible form
          collDef.setProperty(PropertyHelper.OJB_PROPERTY_ELEMENT_CLASS_REF, elementClassDef.getName());
      }