1 Reply Latest reply on Oct 20, 2005 6:43 PM by Emmanuel Bernard


    Martin Ganserer Novice


      I have a strange behaviour in my app. I created a OneToMany-Relationship: I have an article entity bean and a bom item entity bean.
      One article has many bom items.

       @JoinColumn(name="article", referencedColumnName="article_no")
       public Collection<BoMItem> getBom()
       return bom;

       * @return the article.
       public Article getArticle()
       return article;

      I created following test scenario:

      Article impArticle = articleBSI.getArticleById(article.getArticleNo());
       System.out.println(impArticle.getArticleNo() + " " + impArticle.getDescription());
       for(BoMItem bomItem : article.getBom())
       System.out.println(bomItem.getId() + " " + bomItem.getPart().getPartNo() + " " + bomItem.getQuantity());
       for(BoMItem bomItem : article.getBom())

      My addBoMItem-method looks like this:

      public void addBoMItem(BoMItem item)

      Without doing a merge of my article object the bom items will be persisted!! Can somebody please tell me the reason for that action? This behaviour is not what I expect when expecting cascades.