Please excuse my bad english.
Our legacy Database use a lot of composite keys for joining tables. Now I have problems with defining ManyToOne relationships that uses the same columns for different associations to other entitys.
For example we have an Order Entity with the mapping to customer (cust_id), standard shipping-adress of the customer (cust_id, shipAdr_id) and customer-contact (cust_id, contact_id). If I declare all three relationsships as @ManyToOne with the cust_id, I get a "Repeated column in mapping for entity" Exception. If I declare the standard shipping-adress and customer-contact with updatable/insertable as false, shipAdr_id and contact_id will not be updated because declaring cust_id with updatable/insertable to false and shipAdr_id and contact_id with true is not possible.
Is it not possible to use updatable composite keys that shares the same columns in Hibernate?
|