We're updating the issue view to help you get more done. 

NPE in org.hibernate.jpa.internal.util.PersistenceUtilHelper.isInitialized(PersistentAttributeInterceptable)

Description

Depending upon how bytecode enhancement is set up, PersistentAttributeInterceptable.$$_hibernate_getInterceptor() may return null.
I noticed this happens with this configuration of the maven enhancer:

1 2 3 4 5 6 <configuration> <enableAssociationManagement>true</enableAssociationManagement> <enableDirtyTracking>false</enableDirtyTracking> <enableLazyInitialization>true</enableLazyInitialization> <enableExtendedEnhancement>false</enableExtendedEnhancement> </configuration>

The problem is at https://github.com/hibernate/hibernate-orm/blob/5.2.5/hibernate-core/src/main/java/org/hibernate/jpa/internal/util/PersistenceUtilHelper.java#L97 - the fix is to just add a null check. Here's a pull request:
https://github.com/hibernate/hibernate-orm/pull/1660

Environment

None

Status

Assignee

Unassigned

Reporter

Craig Andrews

Fix versions

Affects versions

5.1.3
5.2.5

Priority

Major