Loading
many to one relation

Java Quick Notes

Refresh Your Java - Before Java Interview

We are Agile, believe in less Documentation - Only Quick notes (Java Interview Questions) of Java/J2ee Read more....


Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet

Go to SiteMap

Q)  Sample one-to-many / many-to-one relation (Bidirectional ) ?


Ans)

<class name="Person">
<id name="id" column="personId">
<generator class="native"/>
</id>
 <set name="addresses" table="PersonAddress">
<key column="personId"/>
<many-to-many column="addressId" unique="true" class="Address"/>
</set>

</class>

<class name="Address">
<id name="id" column="addressId">
 <generator class="native"/>
 </id>
 <join table="PersonAddress" inverse="true" optional="true">
  <key column="addressId"/>
  <many-to-one name="person" column="personId" not-null="true"/>
 </join>

 </class>



Back to top

------------------------- We hope you got necessary Info On -----------------------------------------

many to one relation


many to one relation

-------------------------------------------------------------------------------------------------------



Face Book
Request for a Mock Interview/Training

Get a PDF

Face Book
Same look (Read) on any device, this is Ads free