Beispiel #1
0
  public static void bindCollectionSecondPass(
      Collection collection,
      java.util.Map persistentClasses,
      Mappings mappings,
      java.util.Map inheritedMetas)
      throws MappingException {

    if (collection.isOneToMany()) {
      OneToMany oneToMany = (OneToMany) collection.getElement();
      PersistentClass persistentClass = mappings.getClass(oneToMany.getReferencedEntityName());

      if (persistentClass == null)
        throw new MappingException(
            "Association "
                + collection.getRole()
                + " references unmapped class: "
                + oneToMany.getReferencedEntityName());

      oneToMany.setAssociatedClass(persistentClass); // Child
    }
  }