Which of the following statements is guaranteed to accomplish this?

A developer wants to ensure that an entity’s data is up-to-date with regard to the database.
Which of the following statements is guaranteed to accomplish this?

A developer wants to ensure that an entity’s data is up-to-date with regard to the database.
Which of the following statements is guaranteed to accomplish this?

A.
Call EntityManager.refresh on the entity.

B.
Add acacheable (false) annotation on the entity class.

C.
Call EntityManager.find on the entity.

D.
Use a named query to retrieve the entity.



Leave a Reply 4

Your email address will not be published. Required fields are marked *


Amine Hakouna

Amine Hakouna

Answer A

T find(java.lang.Class entityClass,
java.lang.Object primaryKey)

Find by primary key. Search for an entity of the specified class and primary key. If the entity instance is contained in the persistence context, it is returned from there.