public interface PersistenceUnitUtil extends PersistenceUtil
The methods of this interface should only be invoked on entity instances obtained from or managed by entity managers for this persistence unit or on new entity instances.
Modifier and Type | Method and Description |
---|---|
Object |
getIdentifier(Object entity)
Return the id of the entity.
|
boolean |
isLoaded(Object entity)
Determine the load state of an entity belonging to the
persistence unit.
|
boolean |
isLoaded(Object entity,
String attributeName)
Determine the load state of a given persistent attribute
of an entity belonging to the persistence unit.
|
boolean isLoaded(Object entity, String attributeName)
isLoaded
in interface PersistenceUtil
entity
- entity instance containing the attributeattributeName
- name of attribute whose load state is
to be determinedboolean isLoaded(Object entity)
FetchType.EAGER
has been specified have been
loaded.
The isLoaded(Object, String)
method
should be used to determine the load state of an attribute.
Not doing so might lead to unintended loading of state.
isLoaded
in interface PersistenceUtil
entity
- entity instance whose load state is to be determinedObject getIdentifier(Object entity)
entity
- entity instanceIllegalArgumentException
- if the object is found not
to be an entityCopyright © 2019 Eclipse Foundation.
Use is subject to license terms.