Changing the Hibernate 3 settings

Posted by Bogdanel on Stack Overflow See other posts from Stack Overflow or by Bogdanel
Published on 2010-05-09T20:30:51Z Indexed on 2010/05/09 21:08 UTC
Read the original article Hit count: 208

I use Hibernate3 and Hibernate Tools 3.2.4 to generate hbm.xml and java files and I want to use List instead of HashSet(...). I've tried to modify the hbm.xml files, putting list instead of set. Is there any way to specify to hibernate tools that I want to generate automatically a list not a HashSet? This is an exemple:

Java class

public class Test implements java.io.Serializable {  

     private Long testId;  
     private Course course;  
     private String testName;  
     private Set<Question> questions = new HashSet<Question>( 0 );  
}

Test.hbm.xml:

<set name="questions" inverse="true" lazy="true" table="questions" fetch="select">  
  <key>  
    <column name="test_id" not-null="true" />  
  </key>  
  <one-to-many class="com.app.objects.Question" />
  ...
</set>

I thought that I could find a clue in the "reveng.xml" file, but I failed.

© Stack Overflow or respective owner

Related posts about hibernate

Related posts about settings