How in the mapping file can I specify a foreign key
? In the following mapping file id
is the foreign key. How can I specify that ?
<hibernate-mapping>
<class name="org.suhail.pojo.Scheduled" table="scheduled">
<id name="sid" column="sid" type="integer">
<generator class="increment" />
</id>
<property name="id" column="id" type="integer" />
<property name="sdate" column="sdate" type="date"/>
<property name="stime" column="stime" type="time" />
<property name="tweet" column="tweet" type="string" />
</class>
</hibernate-mapping>
There are more then one way to specify foreign relationships like one-to-many, many-to-one or many-to-many.
You can go through this link to better understand about Associations