Hi Frank,
I upgraded from ojb0.9.5 to 1.0 rc4.
Some of my unit tests fail because sometimes foreign key values (1 - N
relationship) are not stored :
Example :
-------------------------
// Create productgroup
ProductGroup pg = new ProductGroupBean();
pg.setGroupName("TESTPRODUCTGROUP");
pg.setGroupDescription("DESCRIPTION");
broker.store(pg);
// Create 2 articles for this productgroup
for (int j = 1; j <= 2; j++) {
Article ar = new ArticleBean();
ar.setArticleName("ARTICLE " + j);
ar.setProductGroupId(pg.getGroupId()); -------> NOT
stored in the database
broker.store(ar);
}
Is this a bug ?
No, this isn't a bug. You have to either set the reference (i.e.
ar.setProductGroup(pg)) or set the ID and resolve the reference (i.e.
ar.setProductGroupId(pg.getGroupId()); broker.resolveAllReferences(ar);
broker.store(ar); )
Hope this helps,
Wally Gelhar
UW - Eau Claire
Facilities Planning & Management
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]