Hi all-

I am having a problem with 1:n collection in OJB using ODMG.

Say I have a parent object, lets call it Trouble Ticket "T" with a
collection of Ticket Notes "N". Lets say that the objects retrieved in list
"N" are "n1, n2, n3". 

I perform a retrieval from the DB on Object T. Now I have T with a list of
child objects N.

When I perform an update on object T using the ODMG API, all child objects
that were brought in on the retrieval are reinserted on the update even
though there were no changes to these objects, so once update is complete I
have object T which updated list N, but now I have double the notes
associated with object T, so now I have n1, n2, n3, n1, n2, n3. 

I am using OJB 1.0.4 release. Following is code from repository_user.xml

 
<class-descriptor
        class="com.xxx.xxx.businessobjects.ServiceTicketBO"
        table="service_tickets"
        isolation-level="read-uncommitted"
>
                <field-descriptor
                        name="id"
                        column="idSERVICE_TICKET"
                        jdbc_type="INTEGER"
                        primarykey="true"
            access="readonly"
            autoincrement="true"
                />
                ...
                <!--other fields-->
                ...
                <!--reference descriptors-->
                ...
                <collection-descriptor
                        name="notes"
        
element-class-ref="com.xxx.xxx.businessobjects.ServiceTicketNoteBO"
                        proxy="false"
                        auto-retrieve="true"
                        auto-update="none"
                        auto-delete="none">
                        <inverse-foreignkey field-ref="idServiceTicket" />
                        <orderby name="dateTimeEntered" sort="DESC"/>
                </collection-descriptor>
</class-descriptor>

 



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

Reply via email to