/**
   * This Function finds all the relations in i.e Many-To-Many and One-To-Many All the relations are
   * kept in HashMap where key is formed as table1@table2@table_name@attributeName and value is
   * Many-To-Many or One-To-Many
   *
   * @return Map
   */
  private static void findRelations() {
    try {
      Iterator itr1 = cfg.getCollectionMappings();

      while (itr1.hasNext()) {
        Collection col = (Collection) itr1.next();

        if (col.getElement().getClass().getName().equals("net.sf.hibernate.mapping.ManyToOne")) {
          saveRelations(col, "ManyToMany");
        } else {
          saveRelations(col, "OneToMany");
        }
      }
    } catch (Exception e) {
      Logger.out.info("Error occured in fildAllRelations Function:" + e);
    }
  }