0 Replies Latest reply on Feb 10, 2009 11:13 AM by elenctic87

    SELECT NEW: unable to locate POJO class

    elenctic87

      I am executing a query as follows. It results in a compiler error because the POJO class is not found.

      Query q = entityManager.createQuery("SELECT NEW org.domain.b1.ui.NonMappedClass(b.prop1, b.prop2) ...
      


      The compiler in eclipse finds an HQL Syntax Error: unable to locate class [org.domain.b1.ui.NonMappedClass]. The class exists and may be instantiated normally outside of a query. It's a POJO class that's not in the same package as the Hibernate entities that were created from the database tables. From within the HQL Editor, this query works fine. It just won't compile in my code! I think I need to somehow notify Hibernate of this POJO class so that it is visible during compile. Any ideas how to do that? Is it a certain @ Annotation I need, or do I need to create a hibernate config xml file? Or maybe there is a completely different solution. Regardless, thank you for helping.