[jboss-user] [JBoss Seam] - Strange behaviour on seam 2 and tomcat 6

Stateless Bean do-not-reply at jboss.com
Sat Oct 27 11:51:31 EDT 2007


Hi,
Can anyone explain me what is going one?
I got collection mapped (one directional) from planet->buildingsProd class like this
	

  | @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;
  | 

and when I load my planet

  | Planet planet = em.find(Planet.class, idPlanet);
  | 
and add new object to collection		
		
		
  | BuildingsProd b = new BuildingsProd();
  | planet.getBuildingsProdList().add(b);
  | em.merge(planet);
  | 

new object should me inserted into db with my planet key and here is my question. 
This works fine on JBoss 4.0.5 but on tomcat with jboss embedded new object is inserted into db but withoud planet FK key!!!
Why, and what is wrong here?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4099598#4099598

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4099598



More information about the jboss-user mailing list