title: Hibernate mapping using xml
body: <p>It may be a very silly question As I am new to hibernate. 
  I am using <code>hibernate.cfg.xml</code> and <code>Event.hbm.xml</code> but while starting it is giving this error.</p>
  
  <blockquote>
    <p>org hibernate Mapping Exception: Unknown entity</p>
  </blockquote>
  
  <p><code>hibernate.cfg.xml</code> and <code>Event.hbm.xml</code> are in the same folder.</p>
  
  <pre><code>&lt;hibernate-configuration&gt;
  &lt;sessionfactory&gt;
   &lt;propertyname="connection.driver_class"&gt;oracle.jdbc.driver.OracleDriver&lt;/property&gt;
  &lt;propertyname="connection.url"&gt;jdbc:oracle:thin:@localhost:1521:XE&lt;/property&gt;
  &lt;property name="connection.username"&gt;system&lt;/property&gt;
   &lt;property name="connection.password"&gt;bharat&lt;/property&gt;
   &lt;property name="connection.pool_size"&gt;1&lt;/property&gt;
  &lt;property name="dialect"&gt;org.hibernate.dialect.Oracle10gDialect&lt;/property&gt;
  
  &lt;property name="current_session_context_class"&gt;thread&lt;/property&gt;&lt;propertyname="cache.provider_class"&gt;org.hibernate.cache.internal.NoCacheProvider&lt;/property&gt;
  &lt;property name="show_sql"&gt;true&lt;/property&gt;
  &lt;property name="hbm2ddl.auto"&gt;create&lt;/property&gt;
  &lt;mapping resource="Event.hbm.xml"/&gt;
  
  &lt;/session-factory&gt;
  </code></pre>
  
  <p>This is my <code>Event.hbm.xml</code> code:</p>
  
  <pre><code>    &lt;hibernate-mapping&gt;
          &lt;class name="bharat.bisht.domain.Event" table="EVENTS"&gt;
              &lt;id name="id" column="EVENT_ID"&gt;
                  &lt;generator class="native"&gt;&lt;/generator&gt;
              &lt;/id&gt;
              &lt;property name="date" type="timestamp" column="EVENT_DATE"&gt;        &lt;/property&gt;
              &lt;property name="title" column="EVENT_TITLE"&gt;&lt;/property&gt;
          &lt;/class&gt;
  </code></pre>
  
  <p>Event.java</p>
  
  <pre><code>package bharat.bisht.domain;
  
  import java.io.Serializable;
  import java.util.Date;
  
  
  public class Event {
  private Long id;
  private String title;
  private Date date;
  
  public Event() {}
  
  public Long getId() {
      return id;
  }
  
  private void setId(Long id) {
      this.id = id;
  }
  
  public Date getDate() {
      return date;
  }
  
  public void setDate(Date date) {
      this.date = date;
  }
  
  public String getTitle() {
      return title;
  }
  public void setTitle(String title) {
      this.title = title;
  }}
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/URnRH.png" alt="stack"></p>