protected Joins join(Joins joins, ClassMapping elem) {
   ValueMapping vm = field.getElementMapping();
   ForeignKey fk = vm.getForeignKey(elem);
   ClassMapping owner = field.getDefiningMapping();
   while (fk.getPrimaryKeyTable() != owner.getTable()) {
     joins = owner.joinSuperclass(joins, false);
     owner = owner.getJoinablePCSuperclassMapping();
     if (owner == null) throw new InternalException();
   }
   return joins.joinRelation(field.getName(), fk, elem, vm.getSelectSubclasses(), true, true);
 }
 public Joins join(Joins joins, boolean forceOuter) {
   ValueMapping elem = field.getElementMapping();
   ClassMapping[] clss = elem.getIndependentTypeMappings();
   if (clss.length != 1) throw RelationStrategies.unjoinable(elem);
   if (forceOuter)
     return joins.outerJoinRelation(
         field.getName(),
         elem.getForeignKey(clss[0]),
         clss[0],
         elem.getSelectSubclasses(),
         true,
         true);
   return joins.joinRelation(
       field.getName(),
       elem.getForeignKey(clss[0]),
       clss[0],
       elem.getSelectSubclasses(),
       true,
       true);
 }