Hi Mike
Thnkas fou your input. Yes, we've been playing around with configurations such as
Code:
<hibernate-mapping>
<class name="net.umbrella.data.model.PaymentInvoiceMapModel" table="PAYMENT_INVOICE_MAP">
<composite-id name="id" class="net.umbrella.data.model.PaymentInvoiceMapIdModel">
<key-property name="paymentid" type="int">
<column name="PAYMENTID" />
</key-property>
<key-property name="invoiceid" type="int">
<column name="INVOICEID" />
</key-property>
</composite-id>
<many-to-one name="bookings" class="net.umbrella.data.model.BookingModel" update="false" insert="false" fetch="select">
<column name="PAYMENTID" not-null="true" />
</many-to-one>
<many-to-one name="invoices" class="net.umbrella.data.model.InvoiceModel" update="false" insert="false" fetch="select">
<column name="INVOICEID" not-null="true" />
</many-to-one>
<property name="amount" type="java.lang.Double">
<column name="AMOUNT" scale="4" not-null="true" />
</property>
</class>
</hibernate-mapping>
The problem we most often encountered was: deleting an invoice deletes the map entry from the invoice side, but not from the payment side. Result: Hibernate exception along the line of "deleted object would be re-saved"
Cheers
Simon