Hi. I want to map table which doesnot have PRIMARY_KEY.
I have two tables
Persons , and Cars(this table doesnot have PRIM_KEY, but has foregin key which is person_id_fk).
One person can have more cars than one. That is why i want to store cars as Set.
In Persons mapping file i wrote this
Code:
<set name="person_cars">
<key column="person_id_fk"/>
<one-to-many class="objects.Persons" />
</set>
But hibernate throws exception:
Code:
Exception in thread "main" org.hibernate.exception.SQLGrammarException: could not initialize a collection: [objects.Persons.person_cars#RIC]
Can you help me?