title: Create database tables from entities
body: <p>Is in hibernate something like code first approach from Entity Framework?
  I am trying to prepare database tables from java classes (MySQL). I have already prepared java classes with JPA annotations, but I am not sure what to do now (I am using IntelliJ). What should I have in my main to create thoose tables? Or should I use some tools?</p>
  
  <p>One of my classes looks like this:</p>
  
  <pre><code>@Entity
  public class Item {
  
      @Id
      @GeneratedValue
      private long id;
  
      @Column
      private String text;
  
      @ManyToMany(mappedBy = "items")
      private Set&lt;Container&gt; containers = new HashSet&lt;Container&gt;();
  
      public long getId() {
          return id;
      }
  
      public String getText() {
          return text;
      }
      public void setText(String text) {
          this.text = text;
      }
  
      public Set&lt;Container&gt; getContainers() { return containers; }
  }
  </code></pre>