java.lang.IllegalStateException - in case of no EntityManagerFactory set
Since:
5.0
setPersistenceUnitName
public void setPersistenceUnitName(@Nullable
java.lang.String persistenceUnitName)
Set the name of the persistence unit to access the EntityManagerFactory for.
This is an alternative to specifying the EntityManagerFactory by direct reference,
resolving it by its persistence unit name instead. If no EntityManagerFactory and
no persistence unit name have been specified, a default EntityManagerFactory will
be retrieved through finding a single unique bean of type EntityManagerFactory.
Retrieves an EntityManagerFactory by persistence unit name, if none set explicitly.
Falls back to a default EntityManagerFactory bean if no persistence unit specified.