Escolar Documentos
Profissional Documentos
Cultura Documentos
+91-9990449935
Development | Training | SEO | Consultancy
JavaTpoint 0120-4256464
Subscribe
Home Core Java Servlet JSP Struts2 Mail API Hibernate Spring Android Design Pattern Quiz Projects Interview Q Comment Forum
Basics of Hibernate
HB Introduction
HB Architecture
Understanding First HB
application ► Hibernate Java ► Hibernate Mapping ► Hibernate SQL ► Hibernate 3.0
Hibernate with IDE
<<prev next>>
HB in Eclipse
HB in MyEclipse
Many to Many Mapping in hibernate by map
Hibernate Application Example (using xml file)
HB with annotation
HB Web application We can map many to many relation either using set,
HB Generator classes bag, map etc. Here, we are going to use map for many Many to Many Mapping
HB Dialects -to-many mapping. In such case, three tables will be Example of Many to Many Mapping
Hibernate Logging created.
HB with Log4j 1
HB with Log4j 2 Example of Many to Many Mapping
Inheritance Mapping
Table Per Hierarchy You need to create following pages for mapping map elements.
TPH using Annotation
• Question.java
Table Per Concrete
• User.java
TPC using Annotation
• question.hbm.xml
Table Per Subclass
• user.hbm.xml
TPS using Annotation
• hibernate.cfg.xml
Collection Mapping
• StoreTest.java
Mapping List
• FetchTest.java
One-to-many by List
OTM Annotation
Question.java
Mapping Bag
package
One-to-many by Bag com.javatpoint;
Mapping Set
One-to-many by Set User.java
Mapping Map package
Many-to-many by Map com.javatpoint;
Bidirectional
Lazy Collection question.hbm.xml
<<prev next>>
Tweet
http://www.javatpoint.com/many-to-many-mapping-in-hibernate-by-map-example 4/16/2014
Example of Many to Many Mapping in Hibernate by Map using xml file - javatpoint Page 2 of 2
CONTACT US
Tel. : 0120-4256464
Mob. : +91 9990449935
Email : enquiry@sssit.org
© 2011-2013 Javatpoint.
All Rights Reserved.
http://www.javatpoint.com/many-to-many-mapping-in-hibernate-by-map-example 4/16/2014