There is a simple named query defined in the following way: @NamedQuery(name=etCustomer? query=elect c from Customer c?@NamedQuery(name=?etCustomer? query=?elect c from Customer c? Which Entity Manager (em) method must be used to access this defined named query?
A. Query q = em.createNamedQuery(etCustomer?;Query q = em.createNamedQuery(?etCustomer?;
B. Query q = em.createQueryByName(etCustomer?;Query q = em.createQueryByName(?etCustomer?;
C. Query q = em.findNamedQuery(etCustomer?;Query q = em.findNamedQuery(?etCustomer?;
D. Query q = em.getNamedQuery(etCustomer?;Query q = em.getNamedQuery(?etCustomer?;
Answer:A
There is a simple named query defined in the following way: @NamedQuery(name=etCustomer? query=elect c from Customer c?@NamedQuery(name=?etCustomer? query=?elect c from Customer c? Which Entity Manager (em) method must be used to access this defined named query?
A. Query q = em.createNamedQuery(etCustomer?;Query q = em.createNamedQuery(?etCustomer?; B. Query q = em.createQueryByName(etCustomer?;Query q = em.createQueryByName(?etCustomer?; C. Query q = em.findNamedQuery(etCustomer?;Query q = em.findNamedQuery(?etCustomer?; D. Query q = em.getNamedQuery(etCustomer?;Query q = em.getNamedQuery(?etCustomer?;