Not sure if this is really an bug, or just a 'feature', but things dont get
linked under certain curcumstances.

I have two objects: activity, and attachment.

An activity has a collection of attachments.

        /**
         * @ojb.collection element-class-ref="com.netcase.pol.bo.Attachment"
         *                 foreignkey="activityId"
         *
query-customizer="com.netcase.ojb.NotDeletedQueryCustomizer"
         *                 proxy="true" auto-retrieve="true" 
auto-update="object"
         */
        private List<Attachment> attachments;

(attachment has: @ojb.field name="activityId" jdbc-type="INTEGER")

The following works: (ie, activityId is set properly)
1. persist an attachment.
2. add it to the collection in activity.
3. persist activity.

However, if i add the following to attachment:
        /**
         * @ojb.reference foreignkey="activityId"
         */
        private Activity activity;

then the above doesnt work.  activityId ends up as 0.  I guess i should
expect this as activity is null.  But, still, as activity is being persisted
last, shouldnt it be updated for that link?

Daniel.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to