Package cz.cvut.kbss.jopa.utils
Class JOPALazyUtils
java.lang.Object
cz.cvut.kbss.jopa.utils.JOPALazyUtils
Utilities related to lazy loading.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Class<?>Gets the class represented by the specified lazy loading proxy.static booleanisLazyLoadingProxy(Object object) Checks if this specified object is a lazy loading proxy (instance ofLazyLoadingProxy).static booleanChecks whether the specified object has been loaded or is still a lazy loading proxy.static voidTriggers loading on the specified lazy loading proxy.
-
Method Details
-
isLazyLoadingProxy
Checks if this specified object is a lazy loading proxy (instance ofLazyLoadingProxy).- Parameters:
object- Object to investigate- Returns:
trueif argument is lazy loading proxy,falseotherwise
-
load
Triggers loading on the specified lazy loading proxy.If the specified object is not a
LazyLoadingProxyor is a proxy that is already loaded, nothing happens.- Parameters:
proxy- Proxy to load
-
isLoaded
Checks whether the specified object has been loaded or is still a lazy loading proxy.- Parameters:
proxy- Proxy to check- Returns:
trueif the object is aLazyLoadingProxyand is not loaded,falseotherwise
-
getClass
Gets the class represented by the specified lazy loading proxy.If the specified object proxies an entity, the corresponding entity class is returned. If the object proxies a collection, the corresponding interface is returned. If the specified object is not a
LazyLoadingProxy, its runtime class is returned.- Parameters:
proxy- Proxy whose class to get- Returns:
- Runtime class unwrapped from a lazy loading proxy
-