get rid of hangovers from HEM merge
make a rough start on cleaning up EntityManagerFactoryBuilderImpl Signed-off-by: Gavin King <gavin@hibernate.org>
This commit is contained in:
parent
049610b90d
commit
1f48e8c41d
|
@ -143,7 +143,7 @@ import static org.hibernate.jpa.internal.util.FlushModeTypeHelper.getFlushModeTy
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractSharedSessionContract implements SharedSessionContractImplementor {
|
public abstract class AbstractSharedSessionContract implements SharedSessionContractImplementor {
|
||||||
private static final EntityManagerMessageLogger log = HEMLogging.messageLogger( SessionImpl.class );
|
private static final CoreMessageLogger log = CoreLogging.messageLogger( SessionImpl.class );
|
||||||
|
|
||||||
private transient SessionFactoryImpl factory;
|
private transient SessionFactoryImpl factory;
|
||||||
protected transient FastSessionServices fastSessionServices;
|
protected transient FastSessionServices fastSessionServices;
|
||||||
|
|
|
@ -48,7 +48,7 @@ import static org.jboss.logging.Logger.Level.WARN;
|
||||||
* New messages must be added after the last message defined to ensure message codes are unique.
|
* New messages must be added after the last message defined to ensure message codes are unique.
|
||||||
*/
|
*/
|
||||||
@MessageLogger(projectCode = "HHH")
|
@MessageLogger(projectCode = "HHH")
|
||||||
@ValidIdRange(min=2,max = 10000)
|
@ValidIdRange(min=2,max = 20000)
|
||||||
public interface CoreMessageLogger extends BasicLogger {
|
public interface CoreMessageLogger extends BasicLogger {
|
||||||
|
|
||||||
@LogMessage(level = WARN)
|
@LogMessage(level = WARN)
|
||||||
|
@ -937,4 +937,37 @@ public interface CoreMessageLogger extends BasicLogger {
|
||||||
@Message(value = "Flushing and evicting managed instance of type [%s] before removing detached instance with same id",
|
@Message(value = "Flushing and evicting managed instance of type [%s] before removing detached instance with same id",
|
||||||
id = 530)
|
id = 530)
|
||||||
void flushAndEvictOnRemove(String entityName);
|
void flushAndEvictOnRemove(String entityName);
|
||||||
|
|
||||||
|
@LogMessage(level = ERROR)
|
||||||
|
@Message(value = "Illegal argument on static metamodel field injection : %s#%s; expected type : %s; encountered type : %s", id = 15007)
|
||||||
|
void illegalArgumentOnStaticMetamodelFieldInjection(
|
||||||
|
String name,
|
||||||
|
String name2,
|
||||||
|
String name3,
|
||||||
|
String name4);
|
||||||
|
|
||||||
|
@LogMessage(level = WARN)
|
||||||
|
@Message(value = "Unable to locate static metamodel field : %s#%s; this may or may not indicate a problem with the static metamodel", id = 15011)
|
||||||
|
void unableToLocateStaticMetamodelField(
|
||||||
|
String name,
|
||||||
|
String name2);
|
||||||
|
|
||||||
|
@LogMessage(level = DEBUG)
|
||||||
|
@Message(value = "Returning null (as required by JPA spec) rather than throwing EntityNotFoundException, " +
|
||||||
|
"as the entity (type=%s, id=%s) does not exist", id = 15013)
|
||||||
|
void ignoringEntityNotFound(String entityName, String identifier);
|
||||||
|
|
||||||
|
@LogMessage(level = DEBUG)
|
||||||
|
@Message(
|
||||||
|
id = 15015,
|
||||||
|
value = "Encountered a MappedSuperclass [%s] not used in any entity hierarchy"
|
||||||
|
)
|
||||||
|
void unusedMappedSuperclass(String name);
|
||||||
|
|
||||||
|
@LogMessage(level = WARN)
|
||||||
|
@Message(
|
||||||
|
id = 15018,
|
||||||
|
value = "Encountered multiple persistence-unit stanzas defining same name [%s]; persistence-unit names must be unique"
|
||||||
|
)
|
||||||
|
void duplicatedPersistenceUnitName(String name);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,73 +0,0 @@
|
||||||
/*
|
|
||||||
* Hibernate, Relational Persistence for Idiomatic Java
|
|
||||||
*
|
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
|
||||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
|
||||||
*/
|
|
||||||
package org.hibernate.internal;
|
|
||||||
|
|
||||||
import org.jboss.logging.annotations.LogMessage;
|
|
||||||
import org.jboss.logging.annotations.Message;
|
|
||||||
import org.jboss.logging.annotations.MessageLogger;
|
|
||||||
import org.jboss.logging.annotations.ValidIdRange;
|
|
||||||
|
|
||||||
import static org.jboss.logging.Logger.Level.DEBUG;
|
|
||||||
import static org.jboss.logging.Logger.Level.ERROR;
|
|
||||||
import static org.jboss.logging.Logger.Level.WARN;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@link MessageLogger} originally for the no-longer existing hibernate-entitymanager module.
|
|
||||||
*/
|
|
||||||
@MessageLogger(projectCode = "HHH")
|
|
||||||
@ValidIdRange( min = 15001, max = 20000 )
|
|
||||||
public interface EntityManagerMessageLogger extends CoreMessageLogger {
|
|
||||||
|
|
||||||
@LogMessage(level = ERROR)
|
|
||||||
@Message(value = "Illegal argument on static metamodel field injection : %s#%s; expected type : %s; encountered type : %s", id = 15007)
|
|
||||||
void illegalArgumentOnStaticMetamodelFieldInjection(
|
|
||||||
String name,
|
|
||||||
String name2,
|
|
||||||
String name3,
|
|
||||||
String name4);
|
|
||||||
|
|
||||||
@LogMessage(level = WARN)
|
|
||||||
@Message(value = "Unable to locate static metamodel field : %s#%s; this may or may not indicate a problem with the static metamodel", id = 15011)
|
|
||||||
void unableToLocateStaticMetamodelField(
|
|
||||||
String name,
|
|
||||||
String name2);
|
|
||||||
|
|
||||||
@LogMessage(level = DEBUG)
|
|
||||||
@Message(value = "Returning null (as required by JPA spec) rather than throwing EntityNotFoundException, " +
|
|
||||||
"as the entity (type=%s, id=%s) does not exist", id = 15013)
|
|
||||||
void ignoringEntityNotFound(String entityName, String identifier);
|
|
||||||
|
|
||||||
@LogMessage(level = DEBUG)
|
|
||||||
@Message(
|
|
||||||
id = 15015,
|
|
||||||
value = "Encountered a MappedSuperclass [%s] not used in any entity hierarchy"
|
|
||||||
)
|
|
||||||
void unusedMappedSuperclass(String name);
|
|
||||||
|
|
||||||
@LogMessage(level = WARN)
|
|
||||||
@Message(
|
|
||||||
id = 15016,
|
|
||||||
value = "Encountered a deprecated jakarta.persistence.spi.PersistenceProvider [%s]; [%s] will be used instead."
|
|
||||||
)
|
|
||||||
void deprecatedPersistenceProvider(String deprecated, String replacement);
|
|
||||||
|
|
||||||
@LogMessage(level = WARN)
|
|
||||||
@Message(
|
|
||||||
id = 15017,
|
|
||||||
value = "'hibernate.ejb.use_class_enhancer' property is deprecated. " +
|
|
||||||
"Use 'hibernate.enhance.enable[...]' properties instead to enable each individual feature."
|
|
||||||
)
|
|
||||||
void deprecatedInstrumentationProperty();
|
|
||||||
|
|
||||||
@LogMessage(level = WARN)
|
|
||||||
@Message(
|
|
||||||
id = 15018,
|
|
||||||
value = "Encountered multiple persistence-unit stanzas defining same name [%s]; persistence-unit names must be unique"
|
|
||||||
)
|
|
||||||
void duplicatedPersistenceUnitName(String name);
|
|
||||||
|
|
||||||
}
|
|
|
@ -44,7 +44,7 @@ import jakarta.persistence.RollbackException;
|
||||||
* @author Andrea Boriero
|
* @author Andrea Boriero
|
||||||
*/
|
*/
|
||||||
public class ExceptionConverterImpl implements ExceptionConverter {
|
public class ExceptionConverterImpl implements ExceptionConverter {
|
||||||
private static final EntityManagerMessageLogger log = HEMLogging.messageLogger( ExceptionConverterImpl.class );
|
private static final CoreMessageLogger log = CoreLogging.messageLogger( ExceptionConverterImpl.class );
|
||||||
|
|
||||||
private final SharedSessionContractImplementor session;
|
private final SharedSessionContractImplementor session;
|
||||||
private final boolean isJpaBootstrap;
|
private final boolean isJpaBootstrap;
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
/*
|
|
||||||
* Hibernate, Relational Persistence for Idiomatic Java
|
|
||||||
*
|
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
|
||||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
|
||||||
*/
|
|
||||||
package org.hibernate.internal;
|
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
|
||||||
|
|
||||||
import java.lang.invoke.MethodHandles;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Steve Ebersole
|
|
||||||
*/
|
|
||||||
public class HEMLogging {
|
|
||||||
/**
|
|
||||||
* Disallow instantiation
|
|
||||||
*/
|
|
||||||
private HEMLogging() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public static EntityManagerMessageLogger messageLogger(Class<?> classNeedingLogging) {
|
|
||||||
return messageLogger( classNeedingLogging.getName() );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static EntityManagerMessageLogger messageLogger(String loggerName) {
|
|
||||||
return Logger.getMessageLogger( MethodHandles.lookup(), EntityManagerMessageLogger .class, loggerName );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Logger logger(Class<?> classNeedingLogging) {
|
|
||||||
return Logger.getLogger( classNeedingLogging );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Logger logger(String loggerName) {
|
|
||||||
return Logger.getLogger( loggerName );
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -218,7 +218,7 @@ public class SessionImpl
|
||||||
extends AbstractSharedSessionContract
|
extends AbstractSharedSessionContract
|
||||||
implements Serializable, SharedSessionContractImplementor, JdbcSessionOwner, SessionImplementor, EventSource,
|
implements Serializable, SharedSessionContractImplementor, JdbcSessionOwner, SessionImplementor, EventSource,
|
||||||
TransactionCoordinatorBuilder.Options, WrapperOptions, LoadAccessContext {
|
TransactionCoordinatorBuilder.Options, WrapperOptions, LoadAccessContext {
|
||||||
private static final EntityManagerMessageLogger log = HEMLogging.messageLogger( SessionImpl.class );
|
private static final CoreMessageLogger log = CoreLogging.messageLogger( SessionImpl.class );
|
||||||
|
|
||||||
// Defaults to null which means the properties are the default
|
// Defaults to null which means the properties are the default
|
||||||
// as defined in FastSessionServices#defaultSessionProperties
|
// as defined in FastSessionServices#defaultSessionProperties
|
||||||
|
|
|
@ -6,8 +6,6 @@
|
||||||
*/
|
*/
|
||||||
package org.hibernate.jpa;
|
package org.hibernate.jpa;
|
||||||
|
|
||||||
import static org.hibernate.internal.HEMLogging.messageLogger;
|
|
||||||
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
@ -22,7 +20,8 @@ import jakarta.persistence.spi.PersistenceUnitInfo;
|
||||||
import jakarta.persistence.spi.ProviderUtil;
|
import jakarta.persistence.spi.ProviderUtil;
|
||||||
|
|
||||||
import org.hibernate.boot.registry.classloading.spi.ClassLoaderService;
|
import org.hibernate.boot.registry.classloading.spi.ClassLoaderService;
|
||||||
import org.hibernate.internal.EntityManagerMessageLogger;
|
import org.hibernate.internal.CoreLogging;
|
||||||
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.jpa.boot.spi.PersistenceConfigurationDescriptor;
|
import org.hibernate.jpa.boot.spi.PersistenceConfigurationDescriptor;
|
||||||
import org.hibernate.jpa.boot.spi.PersistenceXmlParser;
|
import org.hibernate.jpa.boot.spi.PersistenceXmlParser;
|
||||||
import org.hibernate.jpa.boot.spi.Bootstrap;
|
import org.hibernate.jpa.boot.spi.Bootstrap;
|
||||||
|
@ -39,7 +38,7 @@ import org.hibernate.jpa.internal.util.PersistenceUtilHelper;
|
||||||
* @author Brett Meyer
|
* @author Brett Meyer
|
||||||
*/
|
*/
|
||||||
public class HibernatePersistenceProvider implements PersistenceProvider {
|
public class HibernatePersistenceProvider implements PersistenceProvider {
|
||||||
private static final EntityManagerMessageLogger log = messageLogger( HibernatePersistenceProvider.class );
|
private static final CoreMessageLogger log = CoreLogging.messageLogger( HibernatePersistenceProvider.class );
|
||||||
|
|
||||||
private final PersistenceUtilHelper.MetadataCache cache = new PersistenceUtilHelper.MetadataCache();
|
private final PersistenceUtilHelper.MetadataCache cache = new PersistenceUtilHelper.MetadataCache();
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -30,7 +30,8 @@ import org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl;
|
||||||
import org.hibernate.boot.registry.classloading.internal.TcclLookupPrecedence;
|
import org.hibernate.boot.registry.classloading.internal.TcclLookupPrecedence;
|
||||||
import org.hibernate.boot.registry.classloading.spi.ClassLoaderService;
|
import org.hibernate.boot.registry.classloading.spi.ClassLoaderService;
|
||||||
import org.hibernate.cfg.AvailableSettings;
|
import org.hibernate.cfg.AvailableSettings;
|
||||||
import org.hibernate.internal.EntityManagerMessageLogger;
|
import org.hibernate.internal.CoreLogging;
|
||||||
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.internal.log.DeprecationLogger;
|
import org.hibernate.internal.log.DeprecationLogger;
|
||||||
import org.hibernate.internal.util.StringHelper;
|
import org.hibernate.internal.util.StringHelper;
|
||||||
import org.hibernate.jpa.boot.internal.ParsedPersistenceXmlDescriptor;
|
import org.hibernate.jpa.boot.internal.ParsedPersistenceXmlDescriptor;
|
||||||
|
@ -39,8 +40,6 @@ import org.hibernate.jpa.internal.util.ConfigurationHelper;
|
||||||
import jakarta.persistence.PersistenceException;
|
import jakarta.persistence.PersistenceException;
|
||||||
import jakarta.persistence.spi.PersistenceUnitTransactionType;
|
import jakarta.persistence.spi.PersistenceUnitTransactionType;
|
||||||
|
|
||||||
import static org.hibernate.internal.HEMLogging.messageLogger;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used by Hibernate to parse {@code persistence.xml} files in SE environments.
|
* Used by Hibernate to parse {@code persistence.xml} files in SE environments.
|
||||||
*
|
*
|
||||||
|
@ -48,7 +47,7 @@ import static org.hibernate.internal.HEMLogging.messageLogger;
|
||||||
*/
|
*/
|
||||||
public final class PersistenceXmlParser {
|
public final class PersistenceXmlParser {
|
||||||
|
|
||||||
private static final EntityManagerMessageLogger LOG = messageLogger( PersistenceXmlParser.class );
|
private static final CoreMessageLogger log = CoreLogging.messageLogger( PersistenceXmlParser.class );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return A {@link PersistenceXmlParser} using no settings at all.
|
* @return A {@link PersistenceXmlParser} using no settings at all.
|
||||||
|
@ -160,10 +159,10 @@ public final class PersistenceXmlParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("removal")
|
@SuppressWarnings("removal")
|
||||||
protected void parsePersistenceXml(Map<String, PersistenceUnitDescriptor> persistenceUnits,
|
private void parsePersistenceXml(Map<String, PersistenceUnitDescriptor> persistenceUnits,
|
||||||
URL xmlUrl, PersistenceUnitTransactionType defaultTransactionType) {
|
URL xmlUrl, PersistenceUnitTransactionType defaultTransactionType) {
|
||||||
if ( LOG.isTraceEnabled() ) {
|
if ( log.isTraceEnabled() ) {
|
||||||
LOG.tracef( "Attempting to parse persistence.xml file : %s", xmlUrl.toExternalForm() );
|
log.tracef( "Attempting to parse persistence.xml file : %s", xmlUrl.toExternalForm() );
|
||||||
}
|
}
|
||||||
|
|
||||||
final URL persistenceUnitRootUrl = ArchiveHelper.getJarURLFromURLEntry( xmlUrl, "/META-INF/persistence.xml" );
|
final URL persistenceUnitRootUrl = ArchiveHelper.getJarURLFromURLEntry( xmlUrl, "/META-INF/persistence.xml" );
|
||||||
|
@ -175,12 +174,12 @@ public final class PersistenceXmlParser {
|
||||||
final JaxbPersistenceImpl.JaxbPersistenceUnitImpl jaxbPersistenceUnit = jaxbPersistenceUnits.get( i );
|
final JaxbPersistenceImpl.JaxbPersistenceUnitImpl jaxbPersistenceUnit = jaxbPersistenceUnits.get( i );
|
||||||
|
|
||||||
if ( persistenceUnits.containsKey( jaxbPersistenceUnit.getName() ) ) {
|
if ( persistenceUnits.containsKey( jaxbPersistenceUnit.getName() ) ) {
|
||||||
LOG.duplicatedPersistenceUnitName( jaxbPersistenceUnit.getName() );
|
log.duplicatedPersistenceUnitName( jaxbPersistenceUnit.getName() );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
final ParsedPersistenceXmlDescriptor persistenceUnitDescriptor = new ParsedPersistenceXmlDescriptor(
|
final ParsedPersistenceXmlDescriptor persistenceUnitDescriptor =
|
||||||
persistenceUnitRootUrl );
|
new ParsedPersistenceXmlDescriptor( persistenceUnitRootUrl );
|
||||||
bindPersistenceUnit( jaxbPersistenceUnit, persistenceUnitDescriptor );
|
bindPersistenceUnit( jaxbPersistenceUnit, persistenceUnitDescriptor );
|
||||||
|
|
||||||
// per JPA spec, any settings passed in to PersistenceProvider bootstrap methods should override
|
// per JPA spec, any settings passed in to PersistenceProvider bootstrap methods should override
|
||||||
|
@ -196,7 +195,7 @@ public final class PersistenceXmlParser {
|
||||||
ParsedPersistenceXmlDescriptor persistenceUnitDescriptor) {
|
ParsedPersistenceXmlDescriptor persistenceUnitDescriptor) {
|
||||||
final String name = jaxbPersistenceUnit.getName();
|
final String name = jaxbPersistenceUnit.getName();
|
||||||
if ( StringHelper.isNotEmpty( name ) ) {
|
if ( StringHelper.isNotEmpty( name ) ) {
|
||||||
LOG.tracef( "Persistence unit name from persistence.xml : %s", name );
|
log.tracef( "Persistence unit name from persistence.xml : %s", name );
|
||||||
persistenceUnitDescriptor.setName( name );
|
persistenceUnitDescriptor.setName( name );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,8 +12,8 @@ import java.util.Enumeration;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.jpa.boot.spi.PersistenceUnitDescriptor;
|
import org.hibernate.jpa.boot.spi.PersistenceUnitDescriptor;
|
||||||
import org.hibernate.internal.EntityManagerMessageLogger;
|
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ import org.jboss.logging.Logger;
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
*/
|
*/
|
||||||
public final class LogHelper {
|
public final class LogHelper {
|
||||||
private static final EntityManagerMessageLogger log = Logger.getMessageLogger( MethodHandles.lookup(), EntityManagerMessageLogger.class, LogHelper.class.getName() );
|
private static final CoreMessageLogger log = Logger.getMessageLogger( MethodHandles.lookup(), CoreMessageLogger.class, LogHelper.class.getName() );
|
||||||
|
|
||||||
private LogHelper() {
|
private LogHelper() {
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,8 +16,8 @@ import org.hibernate.AssertionFailure;
|
||||||
import org.hibernate.PropertyNotFoundException;
|
import org.hibernate.PropertyNotFoundException;
|
||||||
import org.hibernate.boot.model.convert.spi.ConverterDescriptor;
|
import org.hibernate.boot.model.convert.spi.ConverterDescriptor;
|
||||||
import org.hibernate.boot.registry.classloading.spi.ClassLoaderService;
|
import org.hibernate.boot.registry.classloading.spi.ClassLoaderService;
|
||||||
import org.hibernate.internal.EntityManagerMessageLogger;
|
import org.hibernate.internal.CoreLogging;
|
||||||
import org.hibernate.internal.HEMLogging;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.mapping.AggregateColumn;
|
import org.hibernate.mapping.AggregateColumn;
|
||||||
import org.hibernate.mapping.Any;
|
import org.hibernate.mapping.Any;
|
||||||
import org.hibernate.mapping.Collection;
|
import org.hibernate.mapping.Collection;
|
||||||
|
@ -86,7 +86,7 @@ import jakarta.persistence.metamodel.Type;
|
||||||
* @author Emmanuel Bernard
|
* @author Emmanuel Bernard
|
||||||
*/
|
*/
|
||||||
public class AttributeFactory {
|
public class AttributeFactory {
|
||||||
private static final EntityManagerMessageLogger LOG = HEMLogging.messageLogger( AttributeFactory.class );
|
private static final CoreMessageLogger log = CoreLogging.messageLogger( AttributeFactory.class );
|
||||||
|
|
||||||
private final MetadataContext context;
|
private final MetadataContext context;
|
||||||
|
|
||||||
|
@ -114,10 +114,10 @@ public class AttributeFactory {
|
||||||
MetadataContext metadataContext) {
|
MetadataContext metadataContext) {
|
||||||
if ( property.isSynthetic() ) {
|
if ( property.isSynthetic() ) {
|
||||||
// hide synthetic/virtual properties (fabricated by Hibernate) from the JPA metamodel.
|
// hide synthetic/virtual properties (fabricated by Hibernate) from the JPA metamodel.
|
||||||
LOG.tracef( "Skipping synthetic property %s(%s)", ownerType.getTypeName(), property.getName() );
|
log.tracef( "Skipping synthetic property %s(%s)", ownerType.getTypeName(), property.getName() );
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
LOG.tracef( "Building attribute [%s.%s]", ownerType.getTypeName(), property.getName() );
|
log.tracef( "Building attribute [%s.%s]", ownerType.getTypeName(), property.getName() );
|
||||||
final AttributeContext<X> attributeContext = wrap( ownerType, property );
|
final AttributeContext<X> attributeContext = wrap( ownerType, property );
|
||||||
final AttributeMetadata<X, Y> attributeMetadata = determineAttributeMetadata(
|
final AttributeMetadata<X, Y> attributeMetadata = determineAttributeMetadata(
|
||||||
attributeContext,
|
attributeContext,
|
||||||
|
@ -180,7 +180,7 @@ public class AttributeFactory {
|
||||||
public <X, Y> SingularPersistentAttribute<X, Y> buildIdAttribute(
|
public <X, Y> SingularPersistentAttribute<X, Y> buildIdAttribute(
|
||||||
IdentifiableDomainType<X> ownerType,
|
IdentifiableDomainType<X> ownerType,
|
||||||
Property property) {
|
Property property) {
|
||||||
LOG.tracef( "Building identifier attribute [%s.%s]", ownerType.getTypeName(), property.getName() );
|
log.tracef( "Building identifier attribute [%s.%s]", ownerType.getTypeName(), property.getName() );
|
||||||
|
|
||||||
final AttributeMetadata<X, Y> attributeMetadata =
|
final AttributeMetadata<X, Y> attributeMetadata =
|
||||||
determineAttributeMetadata( wrap( ownerType, property ), identifierMemberResolver );
|
determineAttributeMetadata( wrap( ownerType, property ), identifierMemberResolver );
|
||||||
|
@ -211,7 +211,7 @@ public class AttributeFactory {
|
||||||
public <X, Y> SingularAttributeImpl<X, Y> buildVersionAttribute(
|
public <X, Y> SingularAttributeImpl<X, Y> buildVersionAttribute(
|
||||||
IdentifiableDomainType<X> ownerType,
|
IdentifiableDomainType<X> ownerType,
|
||||||
Property property) {
|
Property property) {
|
||||||
LOG.tracef( "Building version attribute [%s.%s]", ownerType.getTypeName(), property.getName() );
|
log.tracef( "Building version attribute [%s.%s]", ownerType.getTypeName(), property.getName() );
|
||||||
|
|
||||||
final AttributeMetadata<X, Y> attributeMetadata =
|
final AttributeMetadata<X, Y> attributeMetadata =
|
||||||
determineAttributeMetadata( wrap( ownerType, property ), versionMemberResolver );
|
determineAttributeMetadata( wrap( ownerType, property ), versionMemberResolver );
|
||||||
|
@ -455,14 +455,14 @@ public class AttributeFactory {
|
||||||
final Property propertyMapping = attributeContext.getPropertyMapping();
|
final Property propertyMapping = attributeContext.getPropertyMapping();
|
||||||
final String propertyName = propertyMapping.getName();
|
final String propertyName = propertyMapping.getName();
|
||||||
|
|
||||||
LOG.tracef( "Starting attribute metadata determination [%s]", propertyName );
|
log.tracef( "Starting attribute metadata determination [%s]", propertyName );
|
||||||
|
|
||||||
final Member member = memberResolver.resolveMember( attributeContext, context );
|
final Member member = memberResolver.resolveMember( attributeContext, context );
|
||||||
LOG.tracef( " Determined member [%s]", member );
|
log.tracef( " Determined member [%s]", member );
|
||||||
|
|
||||||
final Value value = propertyMapping.getValue();
|
final Value value = propertyMapping.getValue();
|
||||||
final org.hibernate.type.Type type = value.getType();
|
final org.hibernate.type.Type type = value.getType();
|
||||||
LOG.tracef( " Determined type [name=%s, class=%s]", type.getName(), type.getClass().getName() );
|
log.tracef( " Determined type [name=%s, class=%s]", type.getName(), type.getClass().getName() );
|
||||||
|
|
||||||
if ( type instanceof AnyType ) {
|
if ( type instanceof AnyType ) {
|
||||||
return new SingularAttributeMetadataImpl<>(
|
return new SingularAttributeMetadataImpl<>(
|
||||||
|
|
|
@ -22,8 +22,8 @@ import org.hibernate.MappingException;
|
||||||
import org.hibernate.boot.registry.classloading.spi.ClassLoaderService;
|
import org.hibernate.boot.registry.classloading.spi.ClassLoaderService;
|
||||||
import org.hibernate.boot.registry.classloading.spi.ClassLoadingException;
|
import org.hibernate.boot.registry.classloading.spi.ClassLoadingException;
|
||||||
import org.hibernate.boot.spi.MetadataImplementor;
|
import org.hibernate.boot.spi.MetadataImplementor;
|
||||||
import org.hibernate.internal.EntityManagerMessageLogger;
|
import org.hibernate.internal.CoreLogging;
|
||||||
import org.hibernate.internal.HEMLogging;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.internal.util.ReflectHelper;
|
import org.hibernate.internal.util.ReflectHelper;
|
||||||
import org.hibernate.internal.util.collections.CollectionHelper;
|
import org.hibernate.internal.util.collections.CollectionHelper;
|
||||||
import org.hibernate.mapping.Component;
|
import org.hibernate.mapping.Component;
|
||||||
|
@ -75,7 +75,7 @@ import jakarta.persistence.metamodel.Type;
|
||||||
*/
|
*/
|
||||||
@Internal
|
@Internal
|
||||||
public class MetadataContext {
|
public class MetadataContext {
|
||||||
private static final EntityManagerMessageLogger LOG = HEMLogging.messageLogger( MetadataContext.class );
|
private static final CoreMessageLogger log = CoreLogging.messageLogger( MetadataContext.class );
|
||||||
|
|
||||||
private final JpaMetamodelImplementor jpaMetamodel;
|
private final JpaMetamodelImplementor jpaMetamodel;
|
||||||
private final RuntimeModelCreationContext runtimeModelCreationContext;
|
private final RuntimeModelCreationContext runtimeModelCreationContext;
|
||||||
|
@ -288,8 +288,8 @@ public class MetadataContext {
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void wrapUp() {
|
public void wrapUp() {
|
||||||
if ( LOG.isTraceEnabled() ) {
|
if ( log.isTraceEnabled() ) {
|
||||||
LOG.trace( "Wrapping up metadata context..." );
|
log.trace( "Wrapping up metadata context..." );
|
||||||
}
|
}
|
||||||
|
|
||||||
final boolean staticMetamodelScanEnabled =
|
final boolean staticMetamodelScanEnabled =
|
||||||
|
@ -300,8 +300,8 @@ public class MetadataContext {
|
||||||
for ( Object mapping : orderedMappings ) {
|
for ( Object mapping : orderedMappings ) {
|
||||||
if ( PersistentClass.class.isAssignableFrom( mapping.getClass() ) ) {
|
if ( PersistentClass.class.isAssignableFrom( mapping.getClass() ) ) {
|
||||||
final PersistentClass safeMapping = (PersistentClass) mapping;
|
final PersistentClass safeMapping = (PersistentClass) mapping;
|
||||||
if ( LOG.isTraceEnabled() ) {
|
if ( log.isTraceEnabled() ) {
|
||||||
LOG.trace( "Starting entity [" + safeMapping.getEntityName() + ']' );
|
log.trace( "Starting entity [" + safeMapping.getEntityName() + ']' );
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
final EntityDomainType<Object> jpaMapping = (EntityDomainType<Object>)
|
final EntityDomainType<Object> jpaMapping = (EntityDomainType<Object>)
|
||||||
|
@ -343,15 +343,15 @@ public class MetadataContext {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
if ( LOG.isTraceEnabled() ) {
|
if ( log.isTraceEnabled() ) {
|
||||||
LOG.trace( "Completed entity [" + safeMapping.getEntityName() + ']' );
|
log.trace( "Completed entity [" + safeMapping.getEntityName() + ']' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( MappedSuperclass.class.isAssignableFrom( mapping.getClass() ) ) {
|
else if ( MappedSuperclass.class.isAssignableFrom( mapping.getClass() ) ) {
|
||||||
final MappedSuperclass safeMapping = (MappedSuperclass) mapping;
|
final MappedSuperclass safeMapping = (MappedSuperclass) mapping;
|
||||||
if ( LOG.isTraceEnabled() ) {
|
if ( log.isTraceEnabled() ) {
|
||||||
LOG.trace( "Starting mapped superclass [" + safeMapping.getMappedClass().getName() + ']' );
|
log.trace( "Starting mapped superclass [" + safeMapping.getMappedClass().getName() + ']' );
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
final MappedSuperclassDomainType<Object> jpaType = (MappedSuperclassDomainType<Object>)
|
final MappedSuperclassDomainType<Object> jpaType = (MappedSuperclassDomainType<Object>)
|
||||||
|
@ -387,8 +387,8 @@ public class MetadataContext {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
if ( LOG.isTraceEnabled() ) {
|
if ( log.isTraceEnabled() ) {
|
||||||
LOG.trace( "Completed mapped superclass [" + safeMapping.getMappedClass().getName() + ']' );
|
log.trace( "Completed mapped superclass [" + safeMapping.getMappedClass().getName() + ']' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -646,8 +646,8 @@ public class MetadataContext {
|
||||||
private <X> Set<SingularPersistentAttribute<? super X, ?>> buildIdClassAttributes(
|
private <X> Set<SingularPersistentAttribute<? super X, ?>> buildIdClassAttributes(
|
||||||
IdentifiableDomainType<X> ownerType,
|
IdentifiableDomainType<X> ownerType,
|
||||||
List<Property> properties) {
|
List<Property> properties) {
|
||||||
if ( LOG.isTraceEnabled() ) {
|
if ( log.isTraceEnabled() ) {
|
||||||
LOG.trace( "Building old-school composite identifier [" + ownerType.getJavaType().getName() + ']' );
|
log.trace( "Building old-school composite identifier [" + ownerType.getJavaType().getName() + ']' );
|
||||||
}
|
}
|
||||||
Set<SingularPersistentAttribute<? super X, ?>> attributes = new HashSet<>();
|
Set<SingularPersistentAttribute<? super X, ?>> attributes = new HashSet<>();
|
||||||
for ( Property property : properties ) {
|
for ( Property property : properties ) {
|
||||||
|
@ -732,14 +732,14 @@ public class MetadataContext {
|
||||||
injectField( metamodelClass, name, attribute, allowNonDeclaredFieldReference );
|
injectField( metamodelClass, name, attribute, allowNonDeclaredFieldReference );
|
||||||
}
|
}
|
||||||
catch (NoSuchFieldException e) {
|
catch (NoSuchFieldException e) {
|
||||||
LOG.unableToLocateStaticMetamodelField( metamodelClass.getName(), name );
|
log.unableToLocateStaticMetamodelField( metamodelClass.getName(), name );
|
||||||
// throw new AssertionFailure(
|
// throw new AssertionFailure(
|
||||||
// "Unable to locate static metamodel field : " + metamodelClass.getName() + '#' + name
|
// "Unable to locate static metamodel field : " + metamodelClass.getName() + '#' + name
|
||||||
// );
|
// );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static <X> void injectField(
|
private static void injectField(
|
||||||
Class<?> metamodelClass, String name, Object model,
|
Class<?> metamodelClass, String name, Object model,
|
||||||
boolean allowNonDeclaredFieldReference)
|
boolean allowNonDeclaredFieldReference)
|
||||||
throws NoSuchFieldException {
|
throws NoSuchFieldException {
|
||||||
|
@ -770,7 +770,7 @@ public class MetadataContext {
|
||||||
// + "; expected type : " + attribute.getClass().getName()
|
// + "; expected type : " + attribute.getClass().getName()
|
||||||
// + "; encountered type : " + field.getType().getName()
|
// + "; encountered type : " + field.getType().getName()
|
||||||
// );
|
// );
|
||||||
LOG.illegalArgumentOnStaticMetamodelFieldInjection(
|
log.illegalArgumentOnStaticMetamodelFieldInjection(
|
||||||
metamodelClass.getName(),
|
metamodelClass.getName(),
|
||||||
name,
|
name,
|
||||||
model.getClass().getName(),
|
model.getClass().getName(),
|
||||||
|
|
|
@ -33,8 +33,8 @@ import org.hibernate.graph.spi.AttributeNodeImplementor;
|
||||||
import org.hibernate.graph.spi.GraphImplementor;
|
import org.hibernate.graph.spi.GraphImplementor;
|
||||||
import org.hibernate.graph.spi.RootGraphImplementor;
|
import org.hibernate.graph.spi.RootGraphImplementor;
|
||||||
import org.hibernate.graph.spi.SubGraphImplementor;
|
import org.hibernate.graph.spi.SubGraphImplementor;
|
||||||
import org.hibernate.internal.EntityManagerMessageLogger;
|
import org.hibernate.internal.CoreLogging;
|
||||||
import org.hibernate.internal.HEMLogging;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.internal.util.StringHelper;
|
import org.hibernate.internal.util.StringHelper;
|
||||||
import org.hibernate.jpa.spi.JpaCompliance;
|
import org.hibernate.jpa.spi.JpaCompliance;
|
||||||
import org.hibernate.mapping.MappedSuperclass;
|
import org.hibernate.mapping.MappedSuperclass;
|
||||||
|
@ -43,7 +43,6 @@ import org.hibernate.metamodel.MappingMetamodel;
|
||||||
import org.hibernate.metamodel.internal.JpaMetaModelPopulationSetting;
|
import org.hibernate.metamodel.internal.JpaMetaModelPopulationSetting;
|
||||||
import org.hibernate.metamodel.internal.JpaStaticMetaModelPopulationSetting;
|
import org.hibernate.metamodel.internal.JpaStaticMetaModelPopulationSetting;
|
||||||
import org.hibernate.metamodel.internal.MetadataContext;
|
import org.hibernate.metamodel.internal.MetadataContext;
|
||||||
import org.hibernate.metamodel.mapping.EntityMappingType;
|
|
||||||
import org.hibernate.metamodel.model.domain.EmbeddableDomainType;
|
import org.hibernate.metamodel.model.domain.EmbeddableDomainType;
|
||||||
import org.hibernate.metamodel.model.domain.EntityDomainType;
|
import org.hibernate.metamodel.model.domain.EntityDomainType;
|
||||||
import org.hibernate.metamodel.model.domain.IdentifiableDomainType;
|
import org.hibernate.metamodel.model.domain.IdentifiableDomainType;
|
||||||
|
@ -76,7 +75,7 @@ import jakarta.persistence.metamodel.Type;
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
*/
|
*/
|
||||||
public class JpaMetamodelImpl implements JpaMetamodelImplementor, Serializable {
|
public class JpaMetamodelImpl implements JpaMetamodelImplementor, Serializable {
|
||||||
private static final EntityManagerMessageLogger log = HEMLogging.messageLogger( JpaMetamodel.class );
|
private static final CoreMessageLogger log = CoreLogging.messageLogger( JpaMetamodel.class );
|
||||||
|
|
||||||
private static class ImportInfo<T> {
|
private static class ImportInfo<T> {
|
||||||
final String importedName;
|
final String importedName;
|
||||||
|
|
|
@ -32,8 +32,8 @@ import org.hibernate.cache.spi.access.EntityDataAccess;
|
||||||
import org.hibernate.cache.spi.access.NaturalIdDataAccess;
|
import org.hibernate.cache.spi.access.NaturalIdDataAccess;
|
||||||
import org.hibernate.graph.RootGraph;
|
import org.hibernate.graph.RootGraph;
|
||||||
import org.hibernate.graph.spi.RootGraphImplementor;
|
import org.hibernate.graph.spi.RootGraphImplementor;
|
||||||
import org.hibernate.internal.EntityManagerMessageLogger;
|
import org.hibernate.internal.CoreLogging;
|
||||||
import org.hibernate.internal.HEMLogging;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.internal.QueryParameterBindingTypeResolverImpl;
|
import org.hibernate.internal.QueryParameterBindingTypeResolverImpl;
|
||||||
import org.hibernate.internal.util.collections.ArrayHelper;
|
import org.hibernate.internal.util.collections.ArrayHelper;
|
||||||
import org.hibernate.jpa.spi.JpaCompliance;
|
import org.hibernate.jpa.spi.JpaCompliance;
|
||||||
|
@ -99,7 +99,7 @@ import static org.hibernate.metamodel.internal.JpaStaticMetaModelPopulationSetti
|
||||||
public class MappingMetamodelImpl extends QueryParameterBindingTypeResolverImpl
|
public class MappingMetamodelImpl extends QueryParameterBindingTypeResolverImpl
|
||||||
implements MappingMetamodelImplementor, MetamodelImplementor, Serializable {
|
implements MappingMetamodelImplementor, MetamodelImplementor, Serializable {
|
||||||
// todo : Integrate EntityManagerLogger into CoreMessageLogger
|
// todo : Integrate EntityManagerLogger into CoreMessageLogger
|
||||||
private static final EntityManagerMessageLogger log = HEMLogging.messageLogger( MappingMetamodelImpl.class );
|
private static final CoreMessageLogger log = CoreLogging.messageLogger( MappingMetamodelImpl.class );
|
||||||
|
|
||||||
//NOTE: we suppress deprecation warnings because at the moment we
|
//NOTE: we suppress deprecation warnings because at the moment we
|
||||||
//implement a deprecated API so have to override deprecated things
|
//implement a deprecated API so have to override deprecated things
|
||||||
|
|
|
@ -32,8 +32,8 @@ import org.hibernate.LockMode;
|
||||||
import org.hibernate.LockOptions;
|
import org.hibernate.LockOptions;
|
||||||
import org.hibernate.engine.spi.SharedSessionContractImplementor;
|
import org.hibernate.engine.spi.SharedSessionContractImplementor;
|
||||||
import org.hibernate.graph.GraphSemantic;
|
import org.hibernate.graph.GraphSemantic;
|
||||||
import org.hibernate.internal.EntityManagerMessageLogger;
|
import org.hibernate.internal.CoreLogging;
|
||||||
import org.hibernate.internal.HEMLogging;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.jpa.AvailableHints;
|
import org.hibernate.jpa.AvailableHints;
|
||||||
import org.hibernate.jpa.internal.util.FlushModeTypeHelper;
|
import org.hibernate.jpa.internal.util.FlushModeTypeHelper;
|
||||||
import org.hibernate.jpa.internal.util.LockModeTypeHelper;
|
import org.hibernate.jpa.internal.util.LockModeTypeHelper;
|
||||||
|
@ -75,7 +75,7 @@ import static org.hibernate.jpa.SpecHints.HINT_SPEC_QUERY_TIMEOUT;
|
||||||
public abstract class AbstractQuery<R>
|
public abstract class AbstractQuery<R>
|
||||||
extends AbstractSelectionQuery<R>
|
extends AbstractSelectionQuery<R>
|
||||||
implements QueryImplementor<R> {
|
implements QueryImplementor<R> {
|
||||||
protected static final EntityManagerMessageLogger log = HEMLogging.messageLogger( AbstractQuery.class );
|
protected static final CoreMessageLogger log = CoreLogging.messageLogger( AbstractQuery.class );
|
||||||
|
|
||||||
public AbstractQuery(SharedSessionContractImplementor session) {
|
public AbstractQuery(SharedSessionContractImplementor session) {
|
||||||
super( session );
|
super( session );
|
||||||
|
|
|
@ -8,7 +8,7 @@ package org.hibernate.orm.test.jpa.transaction.batch;
|
||||||
|
|
||||||
import org.hibernate.annotations.GenericGenerator;
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
import org.hibernate.annotations.Parameter;
|
import org.hibernate.annotations.Parameter;
|
||||||
import org.hibernate.internal.HEMLogging;
|
import org.hibernate.internal.CoreLogging;
|
||||||
import org.hibernate.jpa.boot.spi.ProviderChecker;
|
import org.hibernate.jpa.boot.spi.ProviderChecker;
|
||||||
|
|
||||||
import org.hibernate.testing.jta.JtaAwareConnectionProviderImpl;
|
import org.hibernate.testing.jta.JtaAwareConnectionProviderImpl;
|
||||||
|
@ -34,7 +34,7 @@ public abstract class AbstractJtaBatchTest extends AbstractBatchingTest {
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
public LoggerInspectionExtension logger = LoggerInspectionExtension.builder()
|
public LoggerInspectionExtension logger = LoggerInspectionExtension.builder()
|
||||||
.setLogger( HEMLogging.messageLogger( ProviderChecker.class.getName() ) )
|
.setLogger( CoreLogging.messageLogger( ProviderChecker.class.getName() ) )
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
|
|
Loading…
Reference in New Issue