title: Class not mapped in hibernate
body: <p>The problem is fairly simple it seems but i am unable to pin point exactly what is the issue. So here goes the issue:</p>
  
  <p>What i want is my DTO class be mapped to a table which is in <code>ORACLE DB</code>.</p>
  
  <p>Below is one snap of my class</p>
  
  <p><strong>P.S: My table has only one column which is as per requirement and is primary key which will any time contain <code>sysdate</code>. Bizarre but it is what it is</strong></p>
  
  <p><code>myDTOClass.java</code></p>
  
  <pre><code>package com.cisco.dto;
  
  import java.util.Date;
  
  import javax.persistence.Column;
  import javax.persistence.Id;
  import javax.persistence.Entity;
  import javax.persistence.Table;
  
  @Entity
  @Table(name = "my_table_in_oracle_db")
  public class myDTOClass{
  
      @Id
      @Column(name ="LASTRUNDATE")
      private Date lastRunDate;
  
      public Date getLastRunDate() {
          return lastRunDate;
      }
  
      public void setLastRunDate(Date lastRunDate) {
          this.lastRunDate = lastRunDate;
      }
  }
  </code></pre>
  
  <p>As you can see i have used hibernate annotations with <code>@entity</code> and i also have <code>@Id</code>, so this is not an issue.</p>
  
  <p>Rest assured my database has the mentioned table with the table name spelled in absolute correctness in my class.</p>
  
  <p>Now i thought my <code>hibernate.cfg.xml</code> might have issues with connection. But my all other tables and their respectiv <code>DTO</code> classes are running as smooth as butter.</p>
  
  <p>Below is the <code>hibernate.cfg.xml</code> :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;!DOCTYPE hibernate-configuration SYSTEM 
  "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"&gt;
  
  &lt;hibernate-configuration&gt;
      &lt;session-factory&gt;
          &lt;property name="hibernate.dialect"&gt;
              org.hibernate.dialect.Oracle10gDialect
          &lt;/property&gt;
          &lt;property name="hibernate.connection.driver_class"&gt;
              oracle.jdbc.OracleDriver
          &lt;/property&gt;
  
          &lt;!-- Assume test is the database name --&gt;
          &lt;property name="hibernate.connection.url"&gt;
              jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=&lt;host_name&gt;)(PORT=1234))(CONNECT_DATA=(SID=*SID*)(Server=Dedicated)))
          &lt;/property&gt;
          &lt;property name="hibernate.connection.username"&gt;
              *my_user_name*
          &lt;/property&gt;
          &lt;property name="hibernate.connection.password"&gt;
              *my_password*
          &lt;/property&gt;
          &lt;property name="connection.pool_size"&gt;
              1
          &lt;/property&gt;
  
          &lt;property name="show_sql"&gt;
              true
          &lt;/property&gt;
          &lt;property name="cache.provider_class"&gt;
              true
          &lt;/property&gt;
          &lt;property name="hbm2ddl.auto"&gt;
              update
          &lt;/property&gt;
  
          &lt;!-- List of XML mapping files --&gt;
          &lt;!--&lt;mapping class="com.cisco.learnhibernate.dto.UserDetails" /&gt;--&gt;
  
      &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>The error i am getting is :
   <code>org.hibernate.hql.internal.ast.QuerySyntaxException: myDTOClass is not mapped</code> when i try to call the below block:</p>
  
  <pre><code>Session session = getSessionFactory().openSession();
  session.beginTransaction();
  session.createQuery("delete from myDTOClass").executeUpdate();
  
  session.getTransaction().commit();
  session.close();
  </code></pre>