hibernate: foreign key is primary key -
I have 2 tables related to each other: ** message ** (id, name, content) ** schedule_reference ** (message_id, start_time, stop_time) I use message_id for the primary scheduled_message table. My domain class: public class messages {private integer ID; The name of the private string; Private string content; ...} public class scheduled messages {private message messages; Private date start time; Private date stoptime; } I try to type Hibernate XML config for mapping 2 sections, but still error in message_id: ( & lt; Class name = "Message" table = "message"> gt; & lt; / id & Property name = "name" column = "name" / "property name =" content "column =" content "/> gt; & lt; / class & gt; class name =" scheduled message " Table = "Scheduled Meas" & gt; & lt; id name = "message" column = "message_id" & gt; provider name = ...