title: Cant get basic JPA working in a dropwizard application
body: <p>I am trying to persist an object into the database using Dropwizard's JPA annotation.</p>
  
  <p>The object to be persisted </p>
  
  <p>TheObject.java</p>
  
  <pre><code>    @JsonIgnoreProperties(ignoreUnknown = true)
      @Entity
      @Table(name = "TheObject")
      @NamedQuery(name = "com.comany.TheObject.findAll", query = "SELECT o FROM TheObject o")
      public classTheObjectimplements  Serializable{
  
          /**
           * 
           */
          private static final long serialVersionUID = 1L;
          @Id
          @GeneratedValue(strategy = GenerationType.IDENTITY)
          @JsonProperty
          String name;
  
          @OneToMany(cascade = CascadeType.ALL, mappedBy = "TheObject", fetch = FetchType.EAGER)
  
          public void setName(String name) {
              this.name = name;
          }
  
          public String getName(Long id) {
              return this.name;
          }
  
          public TheObject (String name) {
              this.name = name;
          }
  
      The data access object 
  
  public TheObjectDAO(SessionFactory factory) {
          super(factory);
      }
  
      public List&lt;TheObject&gt; findAll() {
  
          return list(namedQuery("com.comapny.TheObject.findAll"));
      }
  
      public TheObject create(TheObject o) {
          return persist(o);
  
      }
  }
  
  The Application class 
  
      public class TheApplication extends Application&lt;AppConfiguration&gt; {
      private final static Logger log = Logger.getLogger(DeployerApplication.class.getName()); 
  
      private final HibernateBundle&lt;AppConfiguration&gt; hibernate = new HibernateBundle&lt;AppConfiguration&gt;(
          TheObject.class) {
  
          public DataSourceFactory getDataSourceFactory(
                  AppConfiguration configuration) {
              return configuration.getDataSourceFactory();
          }
  
      };
      @Override
      public void run(AppConfiguration configuration, Environment environment) throws SQLException {
  
  
  
          final TheObjectDAO dao = new   TheObjectDAO(hibernate.getSessionFactory());
      environment.jersey().register(new TheObjectResource(dao));
  
  
   And finally the resource class
  
      public ObjectResource(TheObjectDAO edao) {
          this.dao = dao;
      }
  
      @GET
      @Timed
      @UnitOfWork
      public List&lt;TheObject&gt; getAllObjss() {
          return dao.findAll();
  
      }
  </code></pre>
  
  <p>When I tru to get this resource I always get the error "Named Query not known". What have I missed</p>