HHH-13027 : org.hibernate.ejb.HibernatePersistence can no longer be used as a persistence provider name
This commit is contained in:
parent
15924cb466
commit
83a9adbdb8
|
@ -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);
|
||||
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue