auto « Relationship « JPA Q&A





1. Master/Detail relationship with auto increment. Is it possible to persist them at once?    stackoverflow.com

I have this scenario :

tbl_master(
  master_field_pk int(11) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`master_field_pk`)
)
and
tbl_detail(
  `detail_field_pk` int(11) NOT NULL AUTO_INCREMENT,
  `master_field_pk` int(11) DEFAULT NULL,
  CONSTRAINT `child_fk1` FOREIGN KEY ...

2. Is it possible to fill in derived auto-incremented id for many to one relationship?    stackoverflow.com

I have two table A and B with one to many relationship. Both tables have a id field, which is auto-incremented. Table B also has a foreign key field references table ...

3. One-2-Many relationship transitive persistence with Auto-key    forum.hibernate.org

Simply question: I have a one-to-many set-up between two tables. My parent table has its primary key generated through an Oracle sequence. However, when Hibernate tries to populate the child table, it complains the foreign key is null which is the PK from the parent. I am presuming this is because it hasn't been generated. I was hoping to push both ...