1 Reply Latest reply on Aug 20, 2007 10:40 AM by pmuir

    Seam 2.0Beta and merge problem

    statelessbean

      Hi,
      When I moved my app from Seam 1.2.1 Ga -> 2.0.Beta1 my ejb makes wrong merges, previously this worked on 1.0, to 1.2.1 wersion, but here i get null's

      Take a look:

      I got tables mapped like 1:n, one sided

       @OrderBy("index ASC")
       @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY)
       @JoinColumn(name="Planet_idPlanet")
       public List<BuildingsProd> getBuildingsProdList() {
       if (buildingsProdList == null)
       buildingsProdList = new LinkedList<BuildingsProd>();
       return buildingsProdList;
       }
      


      first i load my "planet" object like
      Planet userPlanet = em.find...
      


      and when i do somethink like this:

      BuildingsProd newStructure = new BuildingsProd();
       userPlanet.getBuildingsProdList().add(newStructure);
      em.merge(userPlanet);
      em.flush();
      


      after that, new object is inserted into table BuildingsProd BUT without FK of my "planet" table. Don't know what is going on?

      I use Seam 2.0 Beta1, and Jboss Embedded on Tomcat 6.0 whitch Postgres 8.2
      For Tomcat i use: "postgresql-8.2-505.jdbc3.jar" driver