title: Can Hibernate Tools reverse-engineer DB entities with annotations instead of cfg.xml files?
body: <p>I have a number of database tables I need to reverse-engineer POJOs for.   I've gotten as far as getting the bare POJOs created as well as the  cfg.xml files:</p>
  
  <p>Simple POJO:</p>
  
  <pre><code>public class AddressType implements java.io.Serializable {
      private long addressId;
      private char addressType;
      private String addressDescription;
  }        
  </code></pre>
  
  <p>Simple cfg.xml:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
  "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"&gt;
  &lt;hibernate-mapping&gt;
      &lt;class name="com.mycompany.model.Addytyp" table="ADDYTYP" schema="XX" catalog="BANANA"&gt;
          &lt;comment&gt;Address Types&lt;/comment&gt;
          &lt;id name="addressType" type="char"&gt;
              &lt;column name="ADDRESS_TYPE" length="1" /&gt;
              &lt;generator class="assigned" /&gt;
          &lt;/id&gt;
          &lt;property name="addressId" type="long"&gt;
              &lt;column name="ADDRESS_ID" precision="10" scale="0" not-null="true"&gt;
                  &lt;comment&gt;Address ID&lt;/comment&gt;
              &lt;/column&gt;
          &lt;/property&gt;
          &lt;property name="addressDescription" type="string"&gt;
              &lt;column name="ADDRESS_DESCRIPTION" length="25" not-null="true"&gt;
                  &lt;comment&gt;Address Decription&lt;/comment&gt;
              &lt;/column&gt;
          &lt;/property&gt;
      &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>What I was wondering is, is there a setting or a tool that will reverse-engineer the POJOs with the column and ID information as annotations in the POJO instead of in a separate file?  For example:</p>
  
  <p>Simple POJO with Annotations:</p>
  
  <pre><code>@Table(name="ADDYTYP")
  public class AddressType implements java.io.Serializable {
  
      @Id
      @Column( name="ADDRESS_ID", precision=10, scale=0, nullable=true)
      private long addressId;
  
      @Column(name="ADDRESS_TYPE", length=1)
      private char addressType;
  
      @Column( name="ADDRESS_DESCRIPTION", length=25 nullable=true)
      private String addresDescription;
  }        
  </code></pre>
  
  <p>Anyone know of a setting or a tool that will do this?</p>