Hi Jose,
I reviewed your example and now I'm confused. You define the relation
between A and B as 1:n, but in metadata descriptor you set the PK of B
as FK in 1:n relation
<collection-descriptor name="items" element-class-ref="pruojb.B"
auto-retrieve="true" auto-update="false" auto-delete="false">
<inverse-foreignkey field-ref="id"/>
</collection-descriptor>
In this case you can always add exactly one B to each A object. Wouldn't
it be better to use a 1:1 relation between A and B or did you post a
wrong mapping?
regards,
Armin
Jose Maria wrote:
Armin Waibel escribió:
Hi Jose,
since version 1.0.2 the mandatory auto-update/delete settings are 'none'
<snip release-notes 1.0.2>
- odmg-api: ** All relations (1:1, 1:n and m:n) need
auto-update/delete setting 'none' to proper work.**
</snip>
In 1.0.4 we introduce cascading delete for auto-delete, please see
documentation:
http://db.apache.org/ojb/docu/guides/odmg-guide.html#Specific+Metadata+Settings
If this doesn't solve your problem, please let me know (then I will
try to reproduce your problem with a test-case).
I've done that. Setting auto-update/delete to 'none'. But it still fails.
By the way, in the example below the data will never be written to
database, because you delete a and b before the first commit. Further
it's recommended to use Database.makePersistent(...) to persist new
objects.
http://db.apache.org/ojb/docu/tutorials/odmg-tutorial.html#Persisting+New+Objects
Yes, I know. This is only a test that I'm doing to try to solve the
problem. Why I make a new object and then delete it? We have some
applications in which users can create objects but can also delete them
if they want. After some operations they save the changes.
Thank you for the help.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]