diff --git a/hibernate-core/src/main/java/org/hibernate/internal/EntityManagerMessageLogger.java b/hibernate-core/src/main/java/org/hibernate/internal/EntityManagerMessageLogger.java index ee4d301c7a..085299a517 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/EntityManagerMessageLogger.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/EntityManagerMessageLogger.java @@ -114,7 +114,7 @@ public interface EntityManagerMessageLogger extends CoreMessageLogger { @LogMessage(level = WARN) @Message( id = 15016, - value = "Encountered a deprecated javax.persistence.spi.PersistenceProvider [%s]; use [%s] instead." + value = "Encountered a deprecated javax.persistence.spi.PersistenceProvider [%s]; [%s] will be used instead." ) void deprecatedPersistenceProvider(String deprecated, String replacement); diff --git a/hibernate-core/src/main/java/org/hibernate/jpa/boot/spi/ProviderChecker.java b/hibernate-core/src/main/java/org/hibernate/jpa/boot/spi/ProviderChecker.java index 81aed3aa1b..a88d09bc55 100644 --- a/hibernate-core/src/main/java/org/hibernate/jpa/boot/spi/ProviderChecker.java +++ b/hibernate-core/src/main/java/org/hibernate/jpa/boot/spi/ProviderChecker.java @@ -9,6 +9,8 @@ package org.hibernate.jpa.boot.spi; import java.util.Map; import org.hibernate.cfg.AvailableSettings; +import org.hibernate.internal.EntityManagerMessageLogger; +import org.hibernate.internal.HEMLogging; import org.hibernate.jpa.HibernatePersistenceProvider; import org.jboss.logging.Logger; @@ -20,6 +22,7 @@ import org.jboss.logging.Logger; * @author Steve Ebersole */ public final class ProviderChecker { + private static final Logger log = Logger.getLogger( ProviderChecker.class ); /** @@ -49,6 +52,15 @@ public final class ProviderChecker { "Checking requested PersistenceProvider name [%s] against Hibernate provider names", requestedProviderName ); + final String deprecatedPersistenceProvider = "org.hibernate.ejb.HibernatePersistence"; + if ( deprecatedPersistenceProvider.equals( requestedProviderName) ) { + HEMLogging.messageLogger( ProviderChecker.class ) + .deprecatedPersistenceProvider( + deprecatedPersistenceProvider, + HibernatePersistenceProvider.class.getName() + ); + return true; + } return HibernatePersistenceProvider.class.getName().equals( requestedProviderName ); }