Mantis - Resin
|
|||||
Viewing Issue Advanced Details | |||||
|
|||||
ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
2599 | minor | always | 04-14-08 06:09 | 04-14-08 13:30 | |
|
|||||
Reporter: | tsv | Platform: | |||
Assigned To: | ferg | OS: | |||
Priority: | normal | OS Version: | |||
Status: | closed | Product Version: | 3.1.5 | ||
Product Build: | Resolution: | fixed | |||
Projection: | none | ||||
ETA: | none | Fixed in Version: | 3.1.6 | ||
|
|||||
Summary: | 0002599: Amber not persisting child enties properly | ||||
Description: |
My setup is resin 3.1.5 with mysql database for persistence. I have a parent entity containing unidirectional child entity. When i persist the parent, the child does get persisted aswell, but the parent never gets the child ID and thus it is lost. private void test() { Parent p = new Parent(); Child c = new Child(); c.setName("Elizabeth"); p.setChild(c); EntityTransaction tx = _manager.getTransaction(); try { tx.begin(); _manager.persist(p); tx.commit(); } finally { if (tx.isActive()) { tx.rollback(); } } System.out.println("Parent: " + p.getId()); System.out.println("Child : " + p.getChild().getId()); } Running the above test yields: Parent: 1 Child : 1 But in the parent table in the database: ID Child 1 0 |
||||
Steps To Reproduce: | |||||
Additional Information: | Source attached | ||||
Relationships | |||||
Attached Files: |
Parent.java [^] (654 bytes) 04-14-08 06:09 Child.java [^] (442 bytes) 04-14-08 06:09 |
Notes | |||||
|
|||||
|
|