title: Hibernate get data .list() depricated and table not mapped. what to do?
body: <p>I saw nearly all questions and answers for this on stackoverflow, but all answers are the same. That you should use something like this  <code>Query query = session.createQuery("from theme").list();</code>
  but .list() is depricated and I can´t use it anymore.</p>
  
  <p>So the first Question is, what should I use instead of <code>.list()</code>and why I get this exeption <code>java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: theme is not mapped [from theme]</code></p>
  
  <blockquote>
    <p>Query Method</p>
  </blockquote>
  
  <pre><code>public ObservableList&lt;String&gt; getThemes(){
      ObservableList&lt;String&gt; obsList = FXCollections.observableArrayList();
      SessionFactory factory = new Configuration()
                              .configure("hibernate.cfg.xml")
                              .buildSessionFactory();
      Session session = factory.getCurrentSession();
      try {
          session.beginTransaction();
          Query query = session.createQuery("from theme"); // why not mapped 
                                                           //cant use .list()?
          session.getTransaction().commit();
          System.out.println("query " + query);
      } catch (Exception e) {
          e.printStackTrace();
      }finally{
          session.close();
      }
      return obsList;      // nothing at the moment
  </code></pre>
  
  <blockquote>
    <p>hibernate.cfg.xml</p>
  </blockquote>
  
  <pre><code>&lt;!DOCTYPE hibernate-configuration PUBLIC
      "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
      "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"&gt;
      &lt;hibernate-configuration&gt;
      &lt;session-factory&gt;
      &lt;property name="connection.driver_class"&gt;org.sqlite.JDBC&lt;/property&gt;
      &lt;!-- I know sqlite with an mysql dialect isnt the best, in the future it     
  will be mySql--&gt; &lt;property
  name="connection.url"&gt;jdbc:sqlite:C:\\DokiDB\\database.db&lt;/property&gt;
      &lt;property name="connection.username"&gt;progdm&lt;/property&gt;
      &lt;property name="connection.password"&gt;release&lt;/property&gt;
      &lt;property name="dialect"&gt;org.hibernate.dialect.MySQLDialect&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="current_session_context_class"&gt;thread&lt;/property&gt;
  &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <blockquote>
    <p>mapped class</p>
  </blockquote>
  
  <pre><code>@Entity
  @Table(name="theme")
  
  public class mapTheme {
  @Id
  @GeneratedValue(strategy=GenerationType.IDENTITY)
  @Column(name="theme_id")
  
  private int theme_id;
  @Column(name="theme_name")
  
  private String theme_name;
  public int getTheme_id() {
      return theme_id;
  }
  
  public void setTheme_id(int theme_id) {
      this.theme_id = theme_id;
  }
  
  public String getTheme_name() {
      return theme_name;
  }
  
  public void setTheme_name(String theme_name) {
      this.theme_name = theme_name;
  }
  
  public mapTheme(String theme_name) {
      super();
      this.theme_name = theme_name;
  }
  
  public mapTheme(){  
  }
  }
  </code></pre>
  
  <p>what can I do?</p>