Javatpoint Logo

91-9990449935

 0120-4256464

Mapping Map in collection mapping using xml file

Hibernate allows you to map Map elements with the RDBMS. As we know, list and map are index-based collections. In case of map, index column works as the key and element column works as the value.

Example of Mapping Map in collection mapping using xml file

You need to create following pages for mapping map elements.

  • Question.java
  • question.hbm.xml
  • hibernate.cfg.xml
  • StoreTest.java
  • FetchTest.java

Question.java

question.hbm.xml
hibernate.cfg.xml
StoreTest.java

FetchTest.java