Event testEvent = new Event(); java.util.Set forList = new java.util.HashSet(); testEvent.setFid(65); forList.add(new foreign1("test",1, 65, testEvent)); testEvent.setListValue(forList); session.save(); tx.commit(); It is genearting two SQL statements
Hibernate: insert into abc (name, ID) values (?, ?) Hibernate: update xyz set ADDRESS=?, fid=? where id=? fid is a foreign key
i want that it should genrate two sql insert statements for both table when it is saving record. but it is not doing so it is trying to update table xyz. please resolve it.