@Override public boolean isLoaded(Object entity) { return (PersistenceUtilHelper.isLoaded(entity) != LoadState.NOT_LOADED); }
@Override public boolean isLoaded(Object entity) { return (PersistenceUtilHelper.isLoaded(entity) != LoadState.NOT_LOADED); }
/** * If the provider determines that the entity has been provided by itself * and that the state of all attributes for which FetchType EAGER has been * specified have been loaded, this method returns LoadState.LOADED. If the * provider determines that the entity has been provided by itself and that * not all attributes with FetchType EAGER have been loaded, this method * returns LoadState.NOT_LOADED. If the provider cannot determine if the * entity has been provided by itself, this method returns * LoadState.UNKNOWN. The provider's implementation of this method must not * obtain a reference to any attribute value, as this could trigger the * loading of entity state if the entity has been provided by a different * provider. * * @param entity * whose loaded status is to be determined * @return load status of the entity */ @Override public LoadState isLoaded(Object paramObject) { return PersistenceUtilHelper.isLoaded(paramObject); }
public static LoadState isLoadedWithReference(Object proxy, String property, MetadataCache cache) { return proxy == null? LoadState.NOT_LOADED:isLoaded(get(proxy, property, cache)); }
@Test public void testisLoadedWAsKunderaProxy() throws NoSuchMethodException, SecurityException { CglibLazyInitializerFactory factory = new CglibLazyInitializerFactory(); KunderaProxy proxy = factory.getProxy("Person", Person.class, Person.class.getDeclaredMethod("getPersonId", null), Person.class.getDeclaredMethod("setPersonId", String.class), "personId", null); LoadState state = PersistenceUtilHelper.isLoaded(proxy); Assert.assertNotNull(state); Assert.assertEquals(LoadState.NOT_LOADED, state); // factory. }