1

Hibernate tools Pojo Generation uses java.util.Set by default. I want to generate POJO's with java.util.List instead of java.util.Set. Is there any way ?

Zeeshan
  • 1,173
  • 5
  • 19
  • 26

2 Answers2

0

If you're using HBM files, you can use <bag> or <list> instead of <set>

Check Hibernate documentation at : http://docs.jboss.org/hibernate/core/3.5/reference/en/html/collections.html#collections-mapping

Julien
  • 1,087
  • 7
  • 15
0

Actually, Hibernate creates mapping on your database structure. I have one to many mapping without index column so it generates 'Set' which is correct for non indexed one to many mapping.

Zeeshan
  • 1,173
  • 5
  • 19
  • 26