@@ -302,27 +302,31 @@ public static boolean isInstance(Object proxy, Class<?> entityClass) {
302
302
303
303
/**
304
304
* Determines if the given attribute of the given entity instance is initialized.
305
+ * This operation returns {@code true} if the field or property references an
306
+ * unfetched collection or proxy.
305
307
*
306
308
* @param entity The entity instance or proxy
307
309
* @param attribute A persistent attribute of the entity
308
310
* @return true if the named property of the object is not listed as uninitialized;
309
311
* false otherwise
310
312
*/
311
- public <E > boolean isPropertyInitialized (E entity , Attribute <? super E , ?> attribute ) {
313
+ public static <E > boolean isPropertyInitialized (E entity , Attribute <? super E , ?> attribute ) {
312
314
return isPropertyInitialized ( entity , attribute .getName () );
313
315
}
314
316
315
317
/**
316
- * Determines if the property with the given name of the given entity instance is
317
- * initialized. If the named property does not exist or is not persistent, this
318
- * method always returns {@code true}.
319
- * <p>
320
- * This operation is equivalent to {@link jakarta.persistence.PersistenceUtil#isLoaded(Object, String)} .
318
+ * Determines if the field or property with the given name of the given entity
319
+ * instance is initialized. If the named property does not exist or is not
320
+ * persistent, this method always returns {@code true}. This operation returns
321
+ * {@code true} if the field or property references an unfetched collection or
322
+ * proxy .
321
323
*
322
324
* @param proxy The entity instance or proxy
323
325
* @param attributeName the name of a persistent attribute of the object
324
326
* @return true if the named property of the object is not listed as uninitialized;
325
327
* false otherwise
328
+ *
329
+ * @see jakarta.persistence.PersistenceUtil#isLoaded(Object, String)
326
330
*/
327
331
public static boolean isPropertyInitialized (Object proxy , String attributeName ) {
328
332
final Object entity ;
@@ -348,12 +352,25 @@ && getAttributeInterceptor( entity )
348
352
}
349
353
350
354
/**
351
- * Initializes the property with the given name of the given entity instance.
352
- * <p>
353
- * This operation is equivalent to {@link jakarta.persistence.PersistenceUnitUtil#load(Object, String)}.
355
+ * Initializes the given attribute of the given entity instance. This operation
356
+ * does not fetch a collection or proxy referenced by the field or property.
357
+ *
358
+ * @param entity The entity instance or proxy
359
+ * @param attribute A persistent attribute of the entity
360
+ */
361
+ public static <E > void initializeProperty (E entity , Attribute <? super E , ?> attribute ) {
362
+ initializeProperty ( entity , attribute .getName () );
363
+ }
364
+
365
+ /**
366
+ * Initializes the field or property with the given name of the given entity
367
+ * instance. This operation does not fetch a collection or proxy referenced
368
+ * by the field or property.
354
369
*
355
370
* @param proxy The entity instance or proxy
356
371
* @param attributeName the name of a persistent attribute of the object
372
+ *
373
+ * @see jakarta.persistence.PersistenceUnitUtil#load(Object, String)
357
374
*/
358
375
public static void initializeProperty (Object proxy , String attributeName ) {
359
376
final LazyInitializer lazyInitializer = extractLazyInitializer ( proxy );
0 commit comments