The Id is 12345?

Given the code fragment: And Which two steps, when performed independently, enable the index.xhtml page to print the followingtext: The Id is 12345? (Choose two.) A. Replace line 2 with: @Inject public void setAcc(Account acc) B. Replace line 3 with: @Inject public Account getAcc() C. Replace line 1 with: @Inject private Account acc; D. Replace […]

Read More

What code should you add to the body of the updateEmployee method in order to save pending changes

Given the code fragments: What code should you add to the body of the updateEmployee method in order to save pending changesto the database? A. entityManager.merge(emp); B. Context. Ctx = new InitialContext(); UserTransaction utx = (UserTransaction)ctx.lookup(“java:comp/UserTransaction”);utx.begin();entityManager.merge(emp);utx.commit(); C. entityManager.lock(emp); EntityManager.merge(emp); D. entityManager.getTransaction().begin(); entityManager.merge(emp);entityManager.getTransaction().commit(); Explanation: Show Answer

Read More

Which action completes this composite primary key implementation?

Given the code fragments: Which action completes this composite primary key implementation? A. Add @IdClass annotation at line 1. B. Add @Embeddable annotation at line 1 and replace both @Id annotations with @EmbeddedId annotations. C. Add @IdClass(ContactId.class) annotation at line 2. D. Add @Embeddable annotation at line 1 and @EmbeddedId(ContactId.class) at line 2. Explanation: Show […]

Read More

How can you apply DateConverter to the birthday field?

Given the code fragment: How can you apply DateConverter to the birthday field? A. by adding @Convert(to=Date.class) at line 3 B. by invoking the setConverter(DateConverter.class) method on the EntityManager object C. by adding @Converter(autoApply=true) at line 1 D. by adding @Convert((DateConverter.class)) at line 2 Explanation: Show Answer

Read More