Joined: Thu Jul 29, 2010 11:24 am Posts: 1
|
From documentation and hibernate test suite i see that it must be possible to use a composite-id key column as the column in a many-one property. For instance something like this: <class name="Order" table="CustomerOrder"> <composite-id name="id" class="Order$Id"> <key-property name="customerId" length="10"/> <key-property name="orderNumber"/> </composite-id> <many-to-one name="customer" column="customerId" insert="false" update="false" not-null="true"/> </class> <class name="Customer"> <id name="customerId" length="10"> <generator class="assigned"/> </id>
.... </class> </hibernate-mapping>
I have a legacy database with no foreign key relations defined ! Can this be the reason that i get this exception? org.hibernate.MappingException: Repeated column in mapping for entity ....(should be mapped with insert="false" update="false"). For collection mappings (i found), no foreign keys relations at the database level is no problem!
Thanks in advance
|
|