1 Reply Latest reply on Mar 16, 2006 3:51 AM by Roberto Colmegna

    Many2Many problem

    Roberto Colmegna Newbie


      when I call and oABean.getBBeans(), on an ABean loaded from DB,
      I obtain a "null" Set [on DB exist a C-record which link loaded
      A-record with B-records]. Any Idea?

      package test.ejb.entity;

      import java.util.*;
      import javax.persistence.*;
      import javax.ejb.*;


      query="SELECT o FROM ABean o ORDER BY o.m_sInfo DESC"

      public class ABean { //extends IdEntityBean {
      @SequenceGenerator(name = "ASeq", sequenceName = "a_id_seq")
      @GeneratedValue(strategy = GenerationType.AUTO, generator = "ASeq")
      Integer id;
      public Integer getId() { return id;}

      String m_sInfo;

      public void setCreateInfo() {
      m_sInfo = "";

      public String getInfo() { return m_sInfo;}
      public void setInfo(String info) { m_sInfo = info;}

      // table "c": link A<->B
      Set BBeans;
      public Set getBBeans() { return BBeans;}
      public void setBBeans(Set BBeans) { this.BBeans=BBeans;}

      Roberto Colmegna