Anonymous | Login | Signup for a new account | 12-17-2024 10:55 PST |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Advanced Details [ Jump to Notes ] | [ View Simple ] [ Issue History ] [ Print ] | ||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
0002599 | [Resin] | minor | always | 04-14-08 06:09 | 04-14-08 13:30 | ||||
Reporter | tsv | View Status | public | ||||||
Assigned To | ferg | ||||||||
Priority | normal | Resolution | fixed | Platform | |||||
Status | closed | OS | |||||||
Projection | none | OS Version | |||||||
ETA | none | Fixed in Version | 3.1.6 | Product Version | 3.1.5 | ||||
Product Build | |||||||||
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 | ||||||||
Attached Files |
Parent.java [^] (654 bytes) 04-14-08 06:09 Child.java [^] (442 bytes) 04-14-08 06:09 |
||||||||
|
Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
31 total queries executed. 26 unique queries executed. |