What is Persistent Base Class in Hibernate? Give me a example of one-to-many mapping using person and address in Hibernate.

Questions by deepakvinayak   answers by deepakvinayak

Showing Answers 1 - 3 of 3 Answers

Gizp

  • Feb 26th, 2007
 

Example of many to one relationship between person and address:

<class name="Person">

  <id name="id" column="personId">

   <generator class="native"/>

  </id>

  <many-to-one name="address"

   column="addressId"

   not-null="true"/>

</class>

<class name="Address">

  <id name="id" column="addressId">

   <generator class="native"/>

  </id>

</class>

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions