title: What are best practices for using Hibernate's hbm2java?
body: <p>I am using Hibernate, Maven, and Eclipse (STS build) to build a project.  I'm using hbm.xml files to specify my schema.  I want to use Hibernate's hbm2java to generate my model classes.  I have it working well and generating the kind of code I want.</p>
  
  <p>It runs perfectly from the command line, generating the model code and then building and testing as expected.</p>
  
  <p>However, Eclipse seems unable to handle it.  It will periodically "lose its mind" and be unable to resolve very simple imports and classes referenced in my DAO classes, which are hand-coded.  The things it can't find are classes like HibernateUtil.  Ironically, it appears to not have any trouble finding the model classes.</p>
  
  <p>The unresolved classes are in target/classes/blah-blah folder at the end of the run.  So they're apparently getting copied to the right place.</p>
  
  <p>In a "continuous integration" environment, is it best to generate the sources once, commit them to my version control, and then disable code gen?  Or is it possible to have the code generated each time, thus ensuring I pick up any database changes without human intervention?</p>