title: Not able to retrieve grand children in hibernate JPA
body: <p><strong><code>Configuration</code> has <code>article type</code> as children and <code>article types</code> may have different <code>article types</code> as children.</strong><br>
  I am trying to retrieve all <code>configuration</code> and its children (all <code>article type</code> for a <code>configuration</code>).<br>
  I don't get parent and child <code>article type</code> here.<br>
  I want to retrieve all grant children by using Configuration entity.</p>
  
  <p>This is my <code>configuration</code> entity :-</p>
  
  <pre><code>@Entity
  @Table(name = "tbl_configuration")
  @XmlRootElement
  public class Configuration extends BaseEntity implements Serializable
  {
      private static final long                   serialVersionUID    = 1L;
  
      @Id
      @Basic(optional = false)
      @Column(name = "config_index")
      private Integer                             configIndex;
  
      @Column(name = "config_nom")
      private String                              configNom;
  
      @Column(name = "config_revision")
      private String                              configRevision;
  
      @JsonManagedReference(value="configuration-article-type")
      @OneToMany(mappedBy = "artTypPcIndexConfig", fetch = FetchType.EAGER)
      private Collection&lt;ArticleTypeParentChild&gt;  articleTypeParentChildCollection;
  
      public Configuration()
      {
      }
  
      public Configuration(Integer configIndex)
      {
          this.configIndex = configIndex;
      }
  
      public Integer getConfigIndex()
      {
          return configIndex;
      }
  
      public void setConfigIndex(Integer configIndex)
      {
          this.configIndex = configIndex;
      }
  
      public String getConfigNom()
      {
          return configNom;
      }
  
      public void setConfigNom(String configNom)
      {
          this.configNom = configNom;
      }
  
      public String getConfigRevision()
      {
          return configRevision;
      }
  
      public void setConfigRevision(String configRevision)
      {
          this.configRevision = configRevision;
      }
  
  
  
      public Collection&lt;ArticleTypeParentChild&gt; getArticleTypeParentChildCollection()
      {
          return articleTypeParentChildCollection;
      }
  
      public void setArticleTypeParentChildCollection(Collection&lt;ArticleTypeParentChild&gt; articleTypeParentChildCollection)
      {
          this.articleTypeParentChildCollection = articleTypeParentChildCollection;
      }
  
  }
  </code></pre>
  
  <p><strong>ArticleTypeParentChild Table Entity</strong></p>
  
  <pre><code>@Entity
  @Table(name = "tbl_article_type_parent_child")
  @XmlRootElement
  public class ArticleTypeParentChild extends BaseEntity implements Serializable
  {
      private static final long   serialVersionUID    = 1L;
  
      @Id
      @Basic(optional = false)
      @Column(name = "art_type_pc_index")
      private Integer             artTypePcIndex;
  
      @JsonBackReference(value="child-article-type")
      @JoinColumn(name = "art_typ_child_index", referencedColumnName = "art_typ_index")
      @ManyToOne(fetch = FetchType.EAGER)
      private ArticleType         artTypChildIndex;
  
      @JsonBackReference(value="parent-article-type")
      @JoinColumn(name = "art_typ_parent_index", referencedColumnName = "art_typ_index")
      @ManyToOne(fetch = FetchType.EAGER)
      private ArticleType         artTypParentIndex;
  
      @JsonBackReference(value="configuration-article-type")
      @JoinColumn(name = "art_typ_pc_index_config", referencedColumnName = "config_index")
      @ManyToOne(fetch = FetchType.EAGER)
      private Configuration       artTypPcIndexConfig;
  
      public ArticleTypeParentChild()
      {
      }
  
      public ArticleTypeParentChild(Integer artTypePcIndex)
      {
          this.artTypePcIndex = artTypePcIndex;
      }
  
      public Integer getArtTypePcIndex()
      {
          return artTypePcIndex;
      }
  
      public void setArtTypePcIndex(Integer artTypePcIndex)
      {
          this.artTypePcIndex = artTypePcIndex;
      }   
  
      public ArticleType getArtTypChildIndex()
      {
          return artTypChildIndex;
      }
  
      public void setArtTypChildIndex(ArticleType artTypChildIndex)
      {
          this.artTypChildIndex = artTypChildIndex;
      }
  
      public ArticleType getArtTypParentIndex()
      {
          return artTypParentIndex;
      }
  
      public void setArtTypParentIndex(ArticleType artTypParentIndex)
      {
          this.artTypParentIndex = artTypParentIndex;
      }
  
      public Configuration getArtTypPcIndexConfig()
      {
          return artTypPcIndexConfig;
      }
  
      public void setArtTypPcIndexConfig(Configuration artTypPcIndexConfig)
      {
          this.artTypPcIndexConfig = artTypPcIndexConfig;
      }
  }
  </code></pre>
  
  <p><strong>ArticleType Table Entity</strong>:-</p>
  
  <pre><code>public class ArticleType extends BaseEntity implements Serializable
  {
      private static final long                       serialVersionUID    = 1L;
  
      @Id
      @Basic(optional = false)
      @Column(name = "art_typ_index")
      private Integer                                 artTypIndex;
  
      @Basic(optional = false)
      @Column(name = "art_typ_index_designation")
      private int                                     artTypIndexDesignation;
  
      @Basic(optional = false)
      @Column(name = "art_typ_code")
      private String                                  artTypCode;
  
      @Basic(optional = false)
      @Column(name = "art_typ_code_effectivite")
      private String                                  artTypCodeEffectivite;
  
      @Basic(optional = false)
      @Column(name = "art_typ_numero_serie")
      private boolean                                 artTypNumeroSerie;
  
      @Basic(optional = false)
      @Column(name = "art_typ_version_materiel")
      private boolean                                 artTypVersionMateriel;
  
      @Basic(optional = false)
      @Column(name = "art_typ_version_logiciel")
      private boolean                                 artTypVersionLogiciel;
  
      @Column(name = "art_typ_index_description")
      private String                                  artTypIndexDescription;
  
      @OneToMany(cascade = CascadeType.ALL, mappedBy = "atrIndexArticleType")
      private Collection&lt;ArticleTypeReseau&gt;           articleTypeReseauCollection;
  
      @OneToMany(cascade = CascadeType.ALL, mappedBy = "atvIndexArticleType")
      private Collection&lt;ArticleTypeVariante&gt;         articleTypeVarianteCollection;
  
      @JoinColumn(name = "art_typ_index_option", referencedColumnName = "opt_art_index")
      @ManyToOne
      private OptionArticle                           artTypIndexOption;
  
      @OneToMany(cascade = CascadeType.ALL, mappedBy = "atpIndexArticleType")
      private Collection&lt;ArticleTypeProjet&gt;           articleTypeProjetCollection;
  
      @OneToMany(mappedBy = "atvoIndexArticleType")
      private Collection&lt;ArticleTypeVarianteOption&gt;   articleTypeVarianteOptionCollection;
  
      @JsonManagedReference(value="child-article-type")
      @OneToMany(mappedBy = "artTypChildIndex", fetch = FetchType.EAGER)
      private Collection&lt;ArticleTypeParentChild&gt;      articleTypeChildCollection;
  
      @JsonManagedReference(value="parent-article-type")
      @OneToMany(mappedBy = "artTypParentIndex", fetch = FetchType.EAGER)
      private Collection&lt;ArticleTypeParentChild&gt;      articleTypeParentCollection;
  
      @OneToMany(mappedBy = "atoIndexArtType")
      private Collection&lt;ArticleTypeOption&gt;           articleTypeOptionCollection;
  
      @OneToMany(cascade = CascadeType.ALL, mappedBy = "locIndexArticleType")
      private Collection&lt;Localisation&gt;                localisationCollection;
  
      @OneToMany(mappedBy = "atlIndexArticleType")
      private Collection&lt;ArticleTypeLocalisation&gt;     articleTypeLocalisationCollection;
  
      public ArticleType()
      {
      }
  
      public ArticleType(Integer artTypIndex)
      {
          this.artTypIndex = artTypIndex;
      }
  
      public ArticleType(Integer artTypIndex, int artTypIndexDesignation, String artTypCode, String artTypCodeEffectivite, boolean artTypNumeroSerie, boolean artTypVersionMateriel, boolean artTypVersionLogiciel)
      {
          this.artTypIndex = artTypIndex;
          this.artTypIndexDesignation = artTypIndexDesignation;
          this.artTypCode = artTypCode;
          this.artTypCodeEffectivite = artTypCodeEffectivite;
          this.artTypNumeroSerie = artTypNumeroSerie;
          this.artTypVersionMateriel = artTypVersionMateriel;
          this.artTypVersionLogiciel = artTypVersionLogiciel;
      }
  
      public Integer getArtTypIndex()
      {
          return artTypIndex;
      }
  
      public void setArtTypIndex(Integer artTypIndex)
      {
          this.artTypIndex = artTypIndex;
      }
  
      public int getArtTypIndexDesignation()
      {
          return artTypIndexDesignation;
      }
  
      public void setArtTypIndexDesignation(int artTypIndexDesignation)
      {
          this.artTypIndexDesignation = artTypIndexDesignation;
      }
  
      public String getArtTypCode()
      {
          return artTypCode;
      }
  
      public void setArtTypCode(String artTypCode)
      {
          this.artTypCode = artTypCode;
      }
  
      public String getArtTypCodeEffectivite()
      {
          return artTypCodeEffectivite;
      }
  
      public void setArtTypCodeEffectivite(String artTypCodeEffectivite)
      {
          this.artTypCodeEffectivite = artTypCodeEffectivite;
      }
  
      public boolean getArtTypNumeroSerie()
      {
          return artTypNumeroSerie;
      }
  
      public void setArtTypNumeroSerie(boolean artTypNumeroSerie)
      {
          this.artTypNumeroSerie = artTypNumeroSerie;
      }
  
      public boolean getArtTypVersionMateriel()
      {
          return artTypVersionMateriel;
      }
  
      public void setArtTypVersionMateriel(boolean artTypVersionMateriel)
      {
          this.artTypVersionMateriel = artTypVersionMateriel;
      }
  
      public boolean getArtTypVersionLogiciel()
      {
          return artTypVersionLogiciel;
      }
  
      public void setArtTypVersionLogiciel(boolean artTypVersionLogiciel)
      {
          this.artTypVersionLogiciel = artTypVersionLogiciel;
      }
  
      public String getArtTypIndexDescription()
      {
          return artTypIndexDescription;
      }
  
      public void setArtTypIndexDescription(String artTypIndexDescription)
      {
          this.artTypIndexDescription = artTypIndexDescription;
      }
  
      @XmlTransient
      public Collection&lt;ArticleTypeReseau&gt; getArticleTypeReseauCollection()
      {
          return articleTypeReseauCollection;
      }
  
      public void setArticleTypeReseauCollection(Collection&lt;ArticleTypeReseau&gt; articleTypeReseauCollection)
      {
          this.articleTypeReseauCollection = articleTypeReseauCollection;
      }
  
      @XmlTransient
      public Collection&lt;ArticleTypeVariante&gt; getArticleTypeVarianteCollection()
      {
          return articleTypeVarianteCollection;
      }
  
      public void setArticleTypeVarianteCollection(Collection&lt;ArticleTypeVariante&gt; articleTypeVarianteCollection)
      {
          this.articleTypeVarianteCollection = articleTypeVarianteCollection;
      }
  
      public OptionArticle getArtTypIndexOption()
      {
          return artTypIndexOption;
      }
  
      public void setArtTypIndexOption(OptionArticle artTypIndexOption)
      {
          this.artTypIndexOption = artTypIndexOption;
      }
  
      @XmlTransient
      public Collection&lt;ArticleTypeProjet&gt; getArticleTypeProjetCollection()
      {
          return articleTypeProjetCollection;
      }
  
      public void setArticleTypeProjetCollection(Collection&lt;ArticleTypeProjet&gt; articleTypeProjetCollection)
      {
          this.articleTypeProjetCollection = articleTypeProjetCollection;
      }
  
      @XmlTransient
      public Collection&lt;ArticleTypeVarianteOption&gt; getArticleTypeVarianteOptionCollection()
      {
          return articleTypeVarianteOptionCollection;
      }
  
      public void setArticleTypeVarianteOptionCollection(Collection&lt;ArticleTypeVarianteOption&gt; articleTypeVarianteOptionCollection)
      {
          this.articleTypeVarianteOptionCollection = articleTypeVarianteOptionCollection;
      }
  
  //  @XmlTransient
      public Collection&lt;ArticleTypeParentChild&gt; getArticleTypeParentChildCollection()
      {
          return articleTypeChildCollection;
      }
  
      public void setArticleTypeParentChildCollection(Collection&lt;ArticleTypeParentChild&gt; articleTypeParentChildCollection)
      {
          this.articleTypeChildCollection = articleTypeParentChildCollection;
      }
  
  //  @XmlTransient
      public Collection&lt;ArticleTypeParentChild&gt; getArticleTypeParentChildCollection1()
      {
          return articleTypeParentCollection;
      }
  
      public void setArticleTypeParentChildCollection1(Collection&lt;ArticleTypeParentChild&gt; articleTypeParentChildCollection1)
      {
          this.articleTypeParentCollection = articleTypeParentChildCollection1;
      }
  
      @XmlTransient
      public Collection&lt;ArticleTypeOption&gt; getArticleTypeOptionCollection()
      {
          return articleTypeOptionCollection;
      }
  
      public void setArticleTypeOptionCollection(Collection&lt;ArticleTypeOption&gt; articleTypeOptionCollection)
      {
          this.articleTypeOptionCollection = articleTypeOptionCollection;
      }
  
      @XmlTransient
      public Collection&lt;Localisation&gt; getLocalisationCollection()
      {
          return localisationCollection;
      }
  
      public void setLocalisationCollection(Collection&lt;Localisation&gt; localisationCollection)
      {
          this.localisationCollection = localisationCollection;
      }
  
      @XmlTransient
      public Collection&lt;ArticleTypeLocalisation&gt; getArticleTypeLocalisationCollection()
      {
          return articleTypeLocalisationCollection;
      }
  
      public void setArticleTypeLocalisationCollection(Collection&lt;ArticleTypeLocalisation&gt; articleTypeLocalisationCollection)
      {
          this.articleTypeLocalisationCollection = articleTypeLocalisationCollection;
      }
  }
  </code></pre>