Quiz Permalink:
https://www.jobilize.com/java-persistence-api-jpa
Question Permalink:
https://www.jobilize.com/jpa-entity-class-life-cycle-example
Question 7 / 22:  Given the code snippet below, which of the following statements are true?
Choose 2
@PersistenceContext

private EntityManager entityManager;

public void updateUserProfile(Long usrId) {

User usr = entityManager.find(User.class,usrId); // Line 1

usr.setName("JavaChamp"); // Line 2

entityManager.merge(usr); // Line 3

entityManager.persist(usr); // Line 4

}

<< First < Previous Next > Last >>
Quiz Home Page
https://www.jobilize.com/java-persistence-api-jpa

Java Persistence API

Author:

Access: Public Instant Grading

Ask
Edgar Delgado
Start Test
Sarah Warren
Start Test
Copy and paste the following HTML code into your website or blog.
<iframe src="https://www.jobilize.com/embed/java-persistence-api-jpa" width="600" height="600" frameborder="0" marginwidth="0" marginheight="0" scrolling="yes" style="border:1px solid #CCC; border-width:1px 1px 0; margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen> </iframe>