title: How to generate domain objects with annotations using hibernate tools
body: <p>I use Eclipse Hibernate Tools to create domain classes starting from my database and need to add JPA annotations.</p>
  
  <p>Is there a way to add annotations? Possibly with reveng.xml and Reverse Engineering? How should this be done?</p>
  
  <p>Generated domain code:</p>
  
  <pre><code>public class Country implements java.io.Serializable {
  
      private long id;
      private String description;
      private String identifier;
      private String futureuse;
      private Set accounts = new HashSet(0);
  
      public Country() {
      }
  
      public Country(long id, String description, String identifier) {
          this.id = id;
          this.description = description;
          this.identifier = identifier;
      }
      ...
  </code></pre>
  
  <p>Needed code:</p>
  
  <pre><code>@Entity
  @Table(name = "COUNTRY")
  public class Country implements java.io.Serializable {
  
      @Id
      @Column(name="CNTR_ID")
      private Long id;
      @Column(name="CNTR_FUTUREUSE")
      private String futureUse;
      @Column(name="CNTR_IDENTIFIER")
      private String identifier;
      @Column(name="CNTR_DESCRIPTION")
      private String description;
      private Set accounts = new HashSet(0);
  
      public Country() {
      }
  
      public Country(long id, String description, String identifier) {
          this.id = id;
          this.description = description;
          this.identifier = identifier;
      }
          ...
  </code></pre>