We have a 1-1 Relationship between GenericGroup and ClientBillingInfo.
We have the client_billing_id in the generic_group table and the
generic_grp_id in the client_billing table, because we need to traverse
this relationship in both directions.

Our problem occurs when we save a GenericGroup.  It will first save the
ClientBillingInfo object, so it puts -1 in the generic_grp_id field of
the client_billing table (We are using database generated keys).  Most
of the time this isn't that big of an issue, because we usually will
save the GenericGroup object again, and at that time the generic_grp_id
in the client_billing table gets updated to the correct value.  However,
this could cause problems in certain situations.  Is there a work around
for this problem?

Here are the relevant parts of the mapping file:

        <class-descriptor 
                class="com.lmig.pm.affinity.model.client.GenericGroup"
                table="DEXA400T"
        >
        ...
        <field-descriptor
                name="billingInfoId"
                column="CLIENT_BILLING_ID"
                jdbc-type="INTEGER"
                access="anonymous"
        />
        <reference-descriptor name="billingInfo"
class-ref="com.lmig.pm.affinity.model.client.ClientBillingInfo"
                auto-update="true"
                auto-delete="true">
                <foreignkey field-ref="billingInfoId"/>
        </reference-descriptor>
        ...
        </class-descriptor>     
        <class-descriptor
 
class="com.lmig.pm.affinity.model.client.ClientBillingInfo"
                table="DEXA500T"
        >
        ...
        <field-descriptor
                name="groupId"
                column="GENERIC_GRP_ID"
                jdbc-type="INTEGER"
                access="anonymous"
        />
        <reference-descriptor name="group"
class-ref="com.lmig.pm.affinity.model.client.GenericGroup">
                <foreignkey field-ref="groupId"/>
        </reference-descriptor>
        ...
        </class-descriptor>

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

Reply via email to