title: Basic Hibernate Select all Syntax
body: <p>I am trying to retrieve data from my database with hibernate but it keeps throwing an exception</p>
  
  <blockquote>
    <p>2012-11-11 11:35:45,943 [main] ERROR
    com.storage.hibernate.DatabaseAccessRequestsImpl - there was an error
    javax.persistence.PersistenceException:
    org.hibernate.exception.SQLGrammarException: could not execute query</p>
  </blockquote>
  
  <pre><code>@Override
  public List&lt;Trade&gt; requestPeriod() {
      List&lt;Trade&gt; trades = null;
      EntityManager manager = emf.createEntityManager();
      Query query = manager.createQuery("from trade"); 
      try{
          trades = query.getResultList();
      }
      catch(PersistenceException e){
          logger.error("there was an error " + e);
      }
      catch(SQLGrammarException e){
          logger.error("there was an error " + e);
      }
      return trades;
  }
  </code></pre>
  
  <p>I am guessing the syntax I am using for <code>select all</code> is incorrect but after looking around I can not see an alternative?</p>
  
  <p>Thanks</p>