What am I doing wrong here?
@javax.persistence.NamedQueries(
| {
|
@javax.persistence.NamedQuery(name="selectAllWorkOrders",query="select a from
WorkOrder"),
|
@javax.persistence.NamedQuery(name="selectWorkOrder",query="select a from
WorkOrder a where a.id=:id")
|
| })
| @Stateless public class WorkOrderSession implements IWorkOrderSession{
| @PersistenceContext EntityManager em;
| @EJB IMfgSession mfgSession;
|
| @SuppressWarnings("unchecked")
| public Collection<WorkOrder> getAllWorkorders()
| {
| return
(Collection<WorkOrder>)em.createNamedQuery("selectAllWorkOrders").getResultList();
| }
|
|
| public WorkOrder getWorkOrder(Integer id)
| {
| return
(WorkOrder)em.createNamedQuery("selectWorkOrder").setParameter("id",
id).getSingleResult();
| }
|
|
When I execute my testcase I'm getting:
| Named query not known: selectAllWorkOrders
|
If instead of using @NamedQueries I just use a single @NamedQuery it works. I
will have a bunch of Sessions with Several NamedQueries.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3948256#3948256
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3948256
-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user