Jakarta Persistence (JPA) Method

void load(
  Object entity,
  String attributeName
)


Load the persistent value of a given persistent attribute of an entity belonging to the persistence unit and to an open persistence context. After this method returns, PersistenceUnitUtil.isLoaded must return true with the given entity instance and attribute.
Parameters:
attributeName - the name of the attribute to be loaded
entity - entity instance
Throws:
IllegalArgumentException - if the given object is not an instance of an entity class belonging to the persistence unit.
PersistenceException - if the entity is not associated with an open persistence context or cannot be loaded from the database.
Since:
Jakarta Persistence (JPA) 3.2