Fix EnhancedProxy with Embeddable and Lazy BasicAttribute
- added log message when this condition occurs - tried adding a `LoggerInspectionRule` based assertion to the test, but found that that rule is unfortunately very dependent on the message actually being logged
This commit is contained in:
parent
9f155a95ab
commit
8203da2de1
|
@ -61,6 +61,7 @@ import org.hibernate.metamodel.mapping.ForeignKeyDescriptor;
|
|||
import org.hibernate.metamodel.mapping.GeneratedValueResolver;
|
||||
import org.hibernate.metamodel.mapping.JdbcMapping;
|
||||
import org.hibernate.metamodel.mapping.ManagedMappingType;
|
||||
import org.hibernate.metamodel.mapping.MappingModelCreationLogger;
|
||||
import org.hibernate.metamodel.mapping.ModelPart;
|
||||
import org.hibernate.metamodel.mapping.ModelPartContainer;
|
||||
import org.hibernate.metamodel.mapping.NonTransientException;
|
||||
|
@ -97,6 +98,8 @@ import org.hibernate.type.descriptor.java.MutabilityPlan;
|
|||
import org.hibernate.type.descriptor.java.spi.JavaTypeRegistry;
|
||||
import org.hibernate.type.spi.TypeConfiguration;
|
||||
|
||||
import static org.hibernate.metamodel.mapping.MappingModelCreationLogger.LOGGER;
|
||||
|
||||
/**
|
||||
* @author Steve Ebersole
|
||||
*/
|
||||
|
@ -236,6 +239,13 @@ public class MappingModelCreationHelper {
|
|||
final FetchTiming fetchTiming;
|
||||
final FetchStyle fetchStyle;
|
||||
if ( declaringType instanceof EmbeddableMappingType ) {
|
||||
if ( bootProperty.isLazy() ) {
|
||||
LOGGER.debugf(
|
||||
"Attribute was declared lazy, but is part of an embeddable - `%s#%s` - LAZY will be ignored",
|
||||
declaringType.getNavigableRole().getFullPath(),
|
||||
bootProperty.getName()
|
||||
);
|
||||
}
|
||||
fetchTiming = FetchTiming.IMMEDIATE;
|
||||
fetchStyle = FetchStyle.JOIN;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue