title: Hibernate doesn't want to map the class in hibernate.cfg.xml
body: <p>I have a class User which is Entity. When I'm trying to map it in hibernate.cfg.xml</p>
  <pre><code>&lt;mapping class=&quot;com.igorgorbunov3333.entities.User&quot;/&gt; 
  </code></pre>
  <p>get an error:</p>
  <blockquote>
  <p>Exception in thread &quot;main&quot; org.hibernate.MappingException: Unknown
  entity: com.igorgorbunov3333.entities.User</p>
  </blockquote>
  <p>But when I map class User programmatically It's work fine.</p>
  <pre><code>configuration.addAnnotatedClass(User.class);
  </code></pre>
  <p>What is the reason?</p>
  <p>My Entity class:</p>
  <pre><code>package com.igorgorbunov3333.entities;
  
  import javax.persistence.*;
  
  
  /**
   * Created by Игорь on 01.07.2016.
   */
  
  @Entity
  @Table(name=&quot;user&quot;)
  public class User {
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private int id;
  
      private String name;
  
      private String email;
  
      private String password;
  
      public int getId() {
          return id;
      }
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
      public String getEmail() {
          return email;
      }
  
      public void setEmail(String email) {
          this.email = email;
      }
  
      public String getPassword() {
          return password;
      }
  
      public void setPassword(String password) {
          this.password = password;
      }
  }
  </code></pre>