Hello,
I do not know about your model,
but I suppose Aricle has a reference field
productGroup of type ProduktGroup and an Integer
(or String) field of type productGroupId, which is
mapped to a foreign key column.
Let me ask a question: Why is there a setter for
the latter field? Why is that field modified
by your application code?
As I understand it, OJB is supposed to treat that
field correctly. In our application, that field
is private and has no getters and setters.
> -----Original Message-----
>
> 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
If I am write with my assumptions, you should have
ar.setProductGroup(pg) here.
> broker.store(ar);
> }
HTH,
Olli
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]