This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Dragging an Oracle database table name from services to a jcomboBox generates an entityManager, a query and a list. It also generates the following line of code: providerQuery = java.beans.Beans.isDesignTime() ? null : entityManager.createQuery("SELECT t FROM table_name t"); This will run, but the addition of a where clause causes it to crash with the error "An exception occured while creating a query in EntityManager" The correct code should use entityManager.createNativeQuery. Because this is IDE generated code, it is uneditable from within Netbeans and any fiddling with the Query component causes the loss of the corrected code.
Reassigning to "db" for evaluation.
Reassigning to persistence - sorry I didn't do this sooner, I was not paying attention to my unevaluated list :(
The code is not directly generated from persistence module. Send to form/binding for evaluation.
It is not > entityManager.createQuery("SELECT t FROM table_name t"); but entityManager.createQuery("SELECT t FROM entity_name t"); e.g. the argument is not SQL query, but JPA query. Hence, it is correct to use createQuery, not createNativeQuery. I don't know why is your application failing in query creation, but an incorrect selection of createQuery method is not the reason.