code: private static Criteria addCriteriaForOjbConcreteClasses(ClassDescriptor cld, Criteria crit)
      {
          /**
           * 1. check if this class has a ojbConcreteClass attribute
           */
          Criteria concreteClassDiscriminator = null;
          Collection classes = getExtentClasses(cld);
  
          /**
           * 1. create a new Criteria for objConcreteClass
           */
          if (!classes.isEmpty())
          {
              concreteClassDiscriminator = new Criteria();
              if (classes.size() > 1)
              {
                  concreteClassDiscriminator = new Criteria();
                  concreteClassDiscriminator.addIn(ClassDescriptor.OJB_CONCRETE_CLASS, classes);
              }
              else
              {
                  concreteClassDiscriminator.addEqualTo(ClassDescriptor.OJB_CONCRETE_CLASS, classes.toArray()[0]);
              }
          }
  
          /**
           * 2. only add the AND (objConcreteClass = "some.class" OR....) if we've actually found concrete
           * classes.
           */
          if (concreteClassDiscriminator != null)
          {
              /**
               * it's possible there is no criteria attached to the query, and in this
               * case we still have to add the IN/EqualTo criteria for the concrete class type
               * so check if the crit is null and then create a blank one if needed.
               */
              if (crit == null)
              {
                  crit = new Criteria();
              }
   
              crit.addAndCriteria(concreteClassDiscriminator);
          }
          /**
           * will just return the passed in criteria if no OJB concrete class is attribute is found.
           */
          return crit;
      }
docs: Searches the class descriptor for the ojbConcrete class attribute
  if it finds the concrete class attribute, append a where clause which
  specifies we can load all classes that are this type or extents of this type.
  @param cld
  @param crit
  @return the passed in Criteria object + optionally and'ed criteria with OR'd class
  type discriminators.