EJB3 and manual hierarchy persistence
I have a legacy database, which I am using EJB3 to model. The database is in quite a poor shape, and we have certain unusual restrictions on how we insert into the DB. Now I want to model the database in a hierarchy that fits in with the DB strucuture, but I want to be able to manually insert each entity individually without the persistence manager trying to persist the entities children. I am trying something like the following (boilerplate left out): @Entity @Table(name = "PARENT_TABLE") public class Parent { @Id @Column(name = "ID") int id; @OneToMany List<Child> children; } @Entity @Table