title: org.hibernate.hql.ast.QuerySyntaxException: table not mapped
body: <p>I know many people have asked this question but I just started Java so I couldn't figure out still.</p>
  
  <p>So here is my problem:
  I am writing RESTful webservices using <code>Javarestlet</code>. Here is the snippet of my <code>DAO</code> file.</p>
  
  <pre><code>try {
  
              session.beginTransaction();
  
              String query = "select number from   blockedcli";
              @SuppressWarnings("rawtypes")
              List list = session.createQuery(query).list(); //.setString("sId", businessId)
  
  
              logger.error("*******************list*****************************************");
              logger.error(list);
              logger.error("*******************listend*****************************************");
  
  
              @SuppressWarnings("rawtypes")
              Iterator iterator = list.iterator();
  
              while (iterator.hasNext()) {
  
                  blockedcli = (BlockedCli) iterator.next();
              }
              session.getTransaction().commit();
          } 
  </code></pre>
  
  <p>Correspondingly my entity class looks like .</p>
  
  <pre><code>@Entity
  @Table(name = "blockedcli")
  public class BlockedCli implements Serializable{
  
      private static final long serialVersionUID = 1L;
  
      @Id
      @GeneratedValue(strategy=GenerationType.AUTO)
      @Column(name="idBlockedCLI", nullable = false, unique=true)
      private Integer idBlockedCLI;
  
      @Column(name = "number",nullable = false, length=45)
      private String number;
  
      @Column(name = "type", nullable = false)
      private Integer type;
      .
  </code></pre>
  
  <p>I have placed a <code>BlackListedN.hbm.xml</code> file in my config directory with following text .</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;!DOCTYPE hibernate-mapping PUBLIC
  "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
  "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"&gt;
  &lt;hibernate-mapping&gt;
      &lt;class name="tecd.persistence.entity.BlockedCli" table="blockedcli"&gt;    
      &lt;id name="idBlockedCLI" type="long" unsaved-value="null"&gt;
          &lt;column name="idBlockedCLI" not-null="true"/&gt;
          &lt;generator class="identity"/&gt;
      &lt;/id&gt;
          &lt;property name="number"&gt;
              &lt;column name="number" not-null="true" /&gt;
          &lt;/property&gt;
      &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>As I want to display only number .</p>
  
  <p>And Here is the DB table .</p>
  
  <pre><code>+--------------+--------------+--------+------+---------------------+---------------------+---------------------------------------+
  | idBlockedCLI | number       | status | type | createdDT           | updatedDT           | BusinessDirectory_idBusinessDirectory |
  +--------------+--------------+--------+------+---------------------+---------------------+---------------------------------------+
  |            1 | 919845611234 |      1 |    1 | 2014-03-24 13:31:20 | 2014-03-24 13:31:20 | 1                                     |
  +--------------+--------------+--------+------+---------------------+---------------------+---------------------------------------+
  </code></pre>
  
  <p>But when  I ran this Everytime it says </p>
  
  <pre><code>org.hibernate.hql.ast.QuerySyntaxException: blockedcli is not mapped [select number from   blockedcli]
  </code></pre>
  
  <p>Please help me out to rectify this issue .</p>
  
  <p>This is my first Java program so I am not sure what else is required to elaborate this however do let me know if anything else required.</p>