diff --git a/hibernate-core/src/main/java/org/hibernate/internal/util/ReflectHelper.java b/hibernate-core/src/main/java/org/hibernate/internal/util/ReflectHelper.java index af190cb19b..95ec97f333 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/util/ReflectHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/util/ReflectHelper.java @@ -251,7 +251,7 @@ public final class ReflectHelper { } private static Getter getter(Class clazz, String name) throws MappingException { - return PropertyAccessStrategyMixedImpl.INSTANCE.buildPropertyAccess( clazz, name ).getGetter(); + return PropertyAccessStrategyMixedImpl.INSTANCE.buildPropertyAccess( clazz, name, true ).getGetter(); } public static Object getConstantValue(String name, SessionFactoryImplementor factory) { diff --git a/hibernate-core/src/main/java/org/hibernate/mapping/Component.java b/hibernate-core/src/main/java/org/hibernate/mapping/Component.java index d3f2ca9a50..435d5e6382 100644 --- a/hibernate-core/src/main/java/org/hibernate/mapping/Component.java +++ b/hibernate-core/src/main/java/org/hibernate/mapping/Component.java @@ -444,7 +444,7 @@ public class Component extends SimpleValue implements MetaAttributable { private Setter injector(Property property, Class attributeDeclarer) { return property.getPropertyAccessStrategy( attributeDeclarer ) - .buildPropertyAccess( attributeDeclarer, property.getName() ) + .buildPropertyAccess( attributeDeclarer, property.getName(), true ) .getSetter(); } diff --git a/hibernate-core/src/main/java/org/hibernate/mapping/Property.java b/hibernate-core/src/main/java/org/hibernate/mapping/Property.java index 03ca356a8b..c63bb7b26e 100644 --- a/hibernate-core/src/main/java/org/hibernate/mapping/Property.java +++ b/hibernate-core/src/main/java/org/hibernate/mapping/Property.java @@ -327,12 +327,12 @@ public class Property implements Serializable, MetaAttributable { // todo : remove public Getter getGetter(Class clazz) throws PropertyNotFoundException, MappingException { - return getPropertyAccessStrategy( clazz ).buildPropertyAccess( clazz, name ).getGetter(); + return getPropertyAccessStrategy( clazz ).buildPropertyAccess( clazz, name, true ).getGetter(); } // todo : remove public Setter getSetter(Class clazz) throws PropertyNotFoundException, MappingException { - return getPropertyAccessStrategy( clazz ).buildPropertyAccess( clazz, name ).getSetter(); + return getPropertyAccessStrategy( clazz ).buildPropertyAccess( clazz, name, true ).getSetter(); } // todo : remove diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/EmbeddableRepresentationStrategyMap.java b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/EmbeddableRepresentationStrategyMap.java index 18ceabbf53..4ce192fdcb 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/EmbeddableRepresentationStrategyMap.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/EmbeddableRepresentationStrategyMap.java @@ -58,8 +58,8 @@ public class EmbeddableRepresentationStrategyMap implements EmbeddableRepresenta public PropertyAccess resolvePropertyAccess(Property bootAttributeDescriptor) { return PropertyAccessStrategyMapImpl.INSTANCE.buildPropertyAccess( null, - bootAttributeDescriptor.getName() - ); + bootAttributeDescriptor.getName(), + true ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/EmbeddableRepresentationStrategyPojo.java b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/EmbeddableRepresentationStrategyPojo.java index a4922d119a..80cc0220fe 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/EmbeddableRepresentationStrategyPojo.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/EmbeddableRepresentationStrategyPojo.java @@ -151,7 +151,8 @@ public class EmbeddableRepresentationStrategyPojo extends AbstractEmbeddableRepr return strategy.buildPropertyAccess( getEmbeddableJavaTypeDescriptor().getJavaTypeClass(), - bootAttributeDescriptor.getName() + bootAttributeDescriptor.getName(), + instantiator instanceof StandardEmbeddableInstantiator ); } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/EntityRepresentationStrategyMap.java b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/EntityRepresentationStrategyMap.java index 4e7d8f06a3..f1f9c1801d 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/EntityRepresentationStrategyMap.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/EntityRepresentationStrategyMap.java @@ -59,8 +59,8 @@ public class EntityRepresentationStrategyMap implements EntityRepresentationStra final Property property = itr.next(); final PropertyAccess propertyAccess = PropertyAccessStrategyMapImpl.INSTANCE.buildPropertyAccess( null, - property.getName() - ); + property.getName(), + true ); propertyAccessMap.put( property.getName(), propertyAccess ); @@ -105,8 +105,8 @@ public class EntityRepresentationStrategyMap implements EntityRepresentationStra public PropertyAccess resolvePropertyAccess(Property bootAttributeDescriptor) { return PropertyAccessStrategyMapImpl.INSTANCE.buildPropertyAccess( null, - bootAttributeDescriptor.getName() - ); + bootAttributeDescriptor.getName(), + true ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/EntityRepresentationStrategyPojoStandard.java b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/EntityRepresentationStrategyPojoStandard.java index 6798be15cc..dc607acb60 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/EntityRepresentationStrategyPojoStandard.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/EntityRepresentationStrategyPojoStandard.java @@ -384,7 +384,7 @@ public class EntityRepresentationStrategyPojoStandard implements EntityRepresent ); } - return strategy.buildPropertyAccess( mappedJtd.getJavaTypeClass(), bootAttributeDescriptor.getName() ); + return strategy.buildPropertyAccess( mappedJtd.getJavaTypeClass(), bootAttributeDescriptor.getName(), true ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/EmbeddedAttributeMapping.java b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/EmbeddedAttributeMapping.java index 02c931eff1..afce61af15 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/EmbeddedAttributeMapping.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/EmbeddedAttributeMapping.java @@ -402,8 +402,8 @@ public class EmbeddedAttributeMapping if ( parentInjectionAttributeName != null ) { parentInjectionAttributePropertyAccess = PropertyAccessStrategyBasicImpl.INSTANCE.buildPropertyAccess( embeddableMappingType.getMappedJavaTypeDescriptor().getJavaTypeClass(), - parentInjectionAttributeName - ); + parentInjectionAttributeName, + true ); } else { parentInjectionAttributePropertyAccess = null; diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/EmbeddedCollectionPart.java b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/EmbeddedCollectionPart.java index f69d136775..2d232d448e 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/EmbeddedCollectionPart.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/EmbeddedCollectionPart.java @@ -82,8 +82,8 @@ public class EmbeddedCollectionPart implements CollectionPart, EmbeddableValuedF if ( parentInjectionAttributeName != null ) { parentInjectionAttributePropertyAccess = PropertyAccessStrategyBasicImpl.INSTANCE.buildPropertyAccess( embeddableMappingType.getMappedJavaTypeDescriptor().getJavaTypeClass(), - parentInjectionAttributeName - ); + parentInjectionAttributeName, + true ); } else { parentInjectionAttributePropertyAccess = null; diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/IdClassEmbeddable.java b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/IdClassEmbeddable.java index a582040207..845a96a572 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/IdClassEmbeddable.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/IdClassEmbeddable.java @@ -97,8 +97,8 @@ public class IdClassEmbeddable extends AbstractEmbeddableMapping implements Iden final PropertyAccess propertyAccess = PropertyAccessStrategyMapImpl.INSTANCE.buildPropertyAccess( null, - EntityIdentifierMapping.ROLE_LOCAL_NAME - ); + EntityIdentifierMapping.ROLE_LOCAL_NAME, + true ); final StateArrayContributorMetadataAccess attributeMetadataAccess = getStateArrayContributorMetadataAccess( propertyAccess ); diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/IdClassRepresentationStrategy.java b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/IdClassRepresentationStrategy.java index c0c0b886d8..c865c801ca 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/IdClassRepresentationStrategy.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/IdClassRepresentationStrategy.java @@ -52,7 +52,7 @@ public class IdClassRepresentationStrategy implements EmbeddableRepresentationSt public PropertyAccess resolvePropertyAccess(Property bootAttributeDescriptor) { return PropertyAccessStrategyMixedImpl.INSTANCE.buildPropertyAccess( idClassType.getJavaTypeClass(), - bootAttributeDescriptor.getName() - ); + bootAttributeDescriptor.getName(), + true ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessBasicImpl.java b/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessBasicImpl.java index 520cf71fce..35690c2304 100644 --- a/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessBasicImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessBasicImpl.java @@ -34,15 +34,24 @@ public class PropertyAccessBasicImpl implements PropertyAccess { public PropertyAccessBasicImpl( PropertyAccessStrategyBasicImpl strategy, - Class containerJavaType, - final String propertyName) { + Class containerJavaType, + final String propertyName, + boolean setterRequired) { this.strategy = strategy; final Method getterMethod = ReflectHelper.findGetterMethod( containerJavaType, propertyName ); this.getter = new GetterMethodImpl( containerJavaType, propertyName, getterMethod ); - final Method setterMethod = ReflectHelper.findSetterMethod( containerJavaType, propertyName, getterMethod.getReturnType() ); - this.setter = new SetterMethodImpl( containerJavaType, propertyName, setterMethod ); + final Method setterMethod; + if ( setterRequired ) { + setterMethod = ReflectHelper.findSetterMethod( containerJavaType, propertyName, getterMethod.getReturnType() ); + } + else { + setterMethod = ReflectHelper.setterMethodOrNull( containerJavaType, propertyName, getterMethod.getReturnType() ); + } + this.setter = setterMethod != null + ? new SetterMethodImpl( containerJavaType, propertyName, setterMethod ) + : null; } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyBackRefImpl.java b/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyBackRefImpl.java index 5829c14920..09ef39b82a 100644 --- a/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyBackRefImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyBackRefImpl.java @@ -47,7 +47,7 @@ public class PropertyAccessStrategyBackRefImpl implements PropertyAccessStrategy } @Override - public PropertyAccess buildPropertyAccess(Class containerJavaType, String propertyName) { + public PropertyAccess buildPropertyAccess(Class containerJavaType, String propertyName, boolean setterRequired) { return new PropertyAccessBackRefImpl( this ); } diff --git a/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyBasicImpl.java b/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyBasicImpl.java index c61cbc22b9..45fcff7f08 100644 --- a/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyBasicImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyBasicImpl.java @@ -23,7 +23,7 @@ public class PropertyAccessStrategyBasicImpl implements PropertyAccessStrategy { public static final PropertyAccessStrategyBasicImpl INSTANCE = new PropertyAccessStrategyBasicImpl(); @Override - public PropertyAccess buildPropertyAccess(Class containerJavaType, final String propertyName) { - return new PropertyAccessBasicImpl( this, containerJavaType, propertyName ); + public PropertyAccess buildPropertyAccess(Class containerJavaType, final String propertyName, boolean setterRequired) { + return new PropertyAccessBasicImpl( this, containerJavaType, propertyName, setterRequired ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyChainedImpl.java b/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyChainedImpl.java index acc0e55c10..01d2e0046f 100644 --- a/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyChainedImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyChainedImpl.java @@ -22,10 +22,10 @@ public class PropertyAccessStrategyChainedImpl implements PropertyAccessStrategy } @Override - public PropertyAccess buildPropertyAccess(Class containerJavaType, String propertyName) { + public PropertyAccess buildPropertyAccess(Class containerJavaType, String propertyName, boolean setterRequired) { for ( PropertyAccessStrategy candidate : chain ) { try { - return candidate.buildPropertyAccess( containerJavaType, propertyName ); + return candidate.buildPropertyAccess( containerJavaType, propertyName, true ); } catch (Exception ignore) { // ignore diff --git a/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyEmbeddedImpl.java b/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyEmbeddedImpl.java index 9fdd3ae072..8894ab0c30 100644 --- a/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyEmbeddedImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyEmbeddedImpl.java @@ -22,7 +22,7 @@ public class PropertyAccessStrategyEmbeddedImpl implements PropertyAccessStrateg public static final PropertyAccessStrategyEmbeddedImpl INSTANCE = new PropertyAccessStrategyEmbeddedImpl(); @Override - public PropertyAccess buildPropertyAccess(Class containerJavaType, String propertyName) { + public PropertyAccess buildPropertyAccess(Class containerJavaType, String propertyName, boolean setterRequired) { return new PropertyAccessEmbeddedImpl( this, containerJavaType, propertyName ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyEnhancedImpl.java b/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyEnhancedImpl.java index 72f6fe8c6d..a34a8a1572 100644 --- a/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyEnhancedImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyEnhancedImpl.java @@ -23,7 +23,7 @@ public class PropertyAccessStrategyEnhancedImpl implements PropertyAccessStrateg public static final PropertyAccessStrategyEnhancedImpl INSTANCE = new PropertyAccessStrategyEnhancedImpl(); @Override - public PropertyAccess buildPropertyAccess(Class containerJavaType, final String propertyName) { + public PropertyAccess buildPropertyAccess(Class containerJavaType, final String propertyName, boolean setterRequired) { return new PropertyAccessEnhancedImpl( this, containerJavaType, propertyName ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyFieldImpl.java b/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyFieldImpl.java index 314aa4a4cf..ae9d507ae0 100644 --- a/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyFieldImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyFieldImpl.java @@ -22,7 +22,7 @@ public class PropertyAccessStrategyFieldImpl implements PropertyAccessStrategy { public static final PropertyAccessStrategyFieldImpl INSTANCE = new PropertyAccessStrategyFieldImpl(); @Override - public PropertyAccess buildPropertyAccess(Class containerJavaType, String propertyName) { + public PropertyAccess buildPropertyAccess(Class containerJavaType, String propertyName, boolean setterRequired) { return new PropertyAccessFieldImpl( this, containerJavaType, propertyName ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyIndexBackRefImpl.java b/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyIndexBackRefImpl.java index dd7574b816..0c32ffa364 100644 --- a/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyIndexBackRefImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyIndexBackRefImpl.java @@ -31,7 +31,7 @@ public class PropertyAccessStrategyIndexBackRefImpl implements PropertyAccessStr } @Override - public PropertyAccess buildPropertyAccess(Class containerJavaType, String propertyName) { + public PropertyAccess buildPropertyAccess(Class containerJavaType, String propertyName, boolean setterRequired) { return new PropertyAccessIndexBackRefImpl( this ); } diff --git a/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyMapImpl.java b/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyMapImpl.java index 539e26a0fc..c4b8fa2b18 100644 --- a/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyMapImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyMapImpl.java @@ -21,7 +21,7 @@ public class PropertyAccessStrategyMapImpl implements PropertyAccessStrategy { public static final PropertyAccessStrategyMapImpl INSTANCE = new PropertyAccessStrategyMapImpl(); @Override - public PropertyAccess buildPropertyAccess(Class containerJavaType, String propertyName) { + public PropertyAccess buildPropertyAccess(Class containerJavaType, String propertyName, boolean setterRequired) { // Sometimes containerJavaType is null, but if it isn't, make sure it's a Map. if (containerJavaType != null && !Map.class.isAssignableFrom(containerJavaType)) { diff --git a/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyMixedImpl.java b/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyMixedImpl.java index 5d823f0a9c..2c6e176aab 100644 --- a/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyMixedImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyMixedImpl.java @@ -21,7 +21,7 @@ public class PropertyAccessStrategyMixedImpl implements PropertyAccessStrategy { public static final PropertyAccessStrategyMixedImpl INSTANCE = new PropertyAccessStrategyMixedImpl(); @Override - public PropertyAccess buildPropertyAccess(Class containerJavaType, String propertyName) { + public PropertyAccess buildPropertyAccess(Class containerJavaType, String propertyName, boolean setterRequired) { return new PropertyAccessMixedImpl( this, containerJavaType, propertyName ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyNoopImpl.java b/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyNoopImpl.java index ce663f0627..2ab911d3a8 100644 --- a/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyNoopImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/property/access/internal/PropertyAccessStrategyNoopImpl.java @@ -31,7 +31,7 @@ public class PropertyAccessStrategyNoopImpl implements PropertyAccessStrategy { public static final PropertyAccessStrategyNoopImpl INSTANCE = new PropertyAccessStrategyNoopImpl(); @Override - public PropertyAccess buildPropertyAccess(Class containerJavaType, String propertyName) { + public PropertyAccess buildPropertyAccess(Class containerJavaType, String propertyName, boolean setterRequired) { return PropertyAccessNoopImpl.INSTANCE; } diff --git a/hibernate-core/src/main/java/org/hibernate/property/access/spi/PropertyAccessStrategy.java b/hibernate-core/src/main/java/org/hibernate/property/access/spi/PropertyAccessStrategy.java index b6f0b9fb66..1704160c5d 100644 --- a/hibernate-core/src/main/java/org/hibernate/property/access/spi/PropertyAccessStrategy.java +++ b/hibernate-core/src/main/java/org/hibernate/property/access/spi/PropertyAccessStrategy.java @@ -8,9 +8,8 @@ package org.hibernate.property.access.spi; /** * Describes a strategy for persistent property access (field, JavaBean-style property, etc). - * Acts as a factory for {@link PropertyAccess} instances. * - * @author Steve Ebersole + * Acts as a factory for {@link PropertyAccess} instances. */ public interface PropertyAccessStrategy { /** @@ -18,8 +17,9 @@ public interface PropertyAccessStrategy { * * @param containerJavaType The Java type that contains the property; may be {@code null} for non-pojo cases. * @param propertyName The property name + * @param setterRequired Whether it is an error if we are unable to find a corresponding setter * * @return The appropriate PropertyAccess */ - PropertyAccess buildPropertyAccess(Class containerJavaType, String propertyName); + PropertyAccess buildPropertyAccess(Class containerJavaType, String propertyName, boolean setterRequired); } diff --git a/hibernate-core/src/main/java/org/hibernate/property/access/spi/Setter.java b/hibernate-core/src/main/java/org/hibernate/property/access/spi/Setter.java index b3b47e0764..453b679abd 100644 --- a/hibernate-core/src/main/java/org/hibernate/property/access/spi/Setter.java +++ b/hibernate-core/src/main/java/org/hibernate/property/access/spi/Setter.java @@ -9,8 +9,6 @@ package org.hibernate.property.access.spi; import java.io.Serializable; import java.lang.reflect.Method; -import org.hibernate.engine.spi.SessionFactoryImplementor; - /** * The contract for setting a persistent property value into its container/owner * diff --git a/hibernate-core/src/main/java/org/hibernate/query/spi/AbstractQuery.java b/hibernate-core/src/main/java/org/hibernate/query/spi/AbstractQuery.java index 272654538b..fca7edb67c 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/spi/AbstractQuery.java +++ b/hibernate-core/src/main/java/org/hibernate/query/spi/AbstractQuery.java @@ -1366,8 +1366,8 @@ public abstract class AbstractQuery implements QueryImplementor { try { final PropertyAccess propertyAccess = BuiltInPropertyAccessStrategies.BASIC.getStrategy().buildPropertyAccess( clazz, - paramName - ); + paramName, + true ); final Getter getter = propertyAccess.getGetter(); final Class retType = getter.getReturnTypeClass(); final Object object = getter.get( bean ); diff --git a/hibernate-core/src/main/java/org/hibernate/sql/results/graph/embeddable/AbstractEmbeddableInitializer.java b/hibernate-core/src/main/java/org/hibernate/sql/results/graph/embeddable/AbstractEmbeddableInitializer.java index c50ee71191..f9f88f7d87 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/results/graph/embeddable/AbstractEmbeddableInitializer.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/results/graph/embeddable/AbstractEmbeddableInitializer.java @@ -140,13 +140,11 @@ public abstract class AbstractEmbeddableInitializer extends AbstractFetchParentA @Override public void resolveKey(RowProcessingState processingState) { // nothing to do - EmbeddableLoadingLogger.INSTANCE.debugf( "EmbeddableInitializer#resolveKey : %s", navigablePath.getFullPath() ); } @Override public void resolveInstance(RowProcessingState processingState) { // nothing to do - EmbeddableLoadingLogger.INSTANCE.debugf( "EmbeddableInitializer#resolveInstance : %s", navigablePath.getFullPath() ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/sql/results/internal/StandardRowReader.java b/hibernate-core/src/main/java/org/hibernate/sql/results/internal/StandardRowReader.java index 75e86cc76a..3017111af3 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/results/internal/StandardRowReader.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/results/internal/StandardRowReader.java @@ -108,14 +108,9 @@ public class StandardRowReader implements RowReader { private void afterRow(RowProcessingState rowProcessingState, JdbcValuesSourceProcessingOptions options) { LoadingLogger.LOGGER.trace( "StandardRowReader#afterRow" ); - // todo (6.0) : add AfterLoadActions handling here via Callback - // - // maybe : - // initializer.finishUpRow( rowProcessingState, callback ); - - for ( Initializer initializer : initializers ) { + initializers.forEach( (initializer) -> { initializer.finishUpRow( rowProcessingState ); - } + } ); } @SuppressWarnings("ForLoopReplaceableByForEach") diff --git a/hibernate-core/src/main/java/org/hibernate/transform/AliasToBeanResultTransformer.java b/hibernate-core/src/main/java/org/hibernate/transform/AliasToBeanResultTransformer.java index f4dd3dde6d..7b47cef930 100644 --- a/hibernate-core/src/main/java/org/hibernate/transform/AliasToBeanResultTransformer.java +++ b/hibernate-core/src/main/java/org/hibernate/transform/AliasToBeanResultTransformer.java @@ -98,7 +98,7 @@ public class AliasToBeanResultTransformer extends AliasedTupleSubsetResultTransf String alias = aliases[ i ]; if ( alias != null ) { this.aliases[ i ] = alias; - setters[ i ] = propertyAccessStrategy.buildPropertyAccess( resultClass, alias ).getSetter(); + setters[ i ] = propertyAccessStrategy.buildPropertyAccess( resultClass, alias, true ).getSetter(); } } isInitialized = true; diff --git a/hibernate-core/src/main/java/org/hibernate/tuple/PropertyFactory.java b/hibernate-core/src/main/java/org/hibernate/tuple/PropertyFactory.java index 274151304e..a70b9490bf 100644 --- a/hibernate-core/src/main/java/org/hibernate/tuple/PropertyFactory.java +++ b/hibernate-core/src/main/java/org/hibernate/tuple/PropertyFactory.java @@ -319,8 +319,8 @@ public final class PropertyFactory { final PropertyAccess propertyAccess = propertyAccessStrategy.buildPropertyAccess( mappingProperty.getPersistentClass().getMappedClass(), - mappingProperty.getName() - ); + mappingProperty.getName(), + true ); return propertyAccess.getGetter(); } diff --git a/hibernate-core/src/main/java/org/hibernate/tuple/entity/DynamicMapEntityTuplizer.java b/hibernate-core/src/main/java/org/hibernate/tuple/entity/DynamicMapEntityTuplizer.java index c9281d11b1..b5bc1140d5 100644 --- a/hibernate-core/src/main/java/org/hibernate/tuple/entity/DynamicMapEntityTuplizer.java +++ b/hibernate-core/src/main/java/org/hibernate/tuple/entity/DynamicMapEntityTuplizer.java @@ -38,10 +38,10 @@ public class DynamicMapEntityTuplizer extends AbstractEntityTuplizer { private PropertyAccess buildPropertyAccess(Property mappedProperty) { if ( mappedProperty.isBackRef() ) { - return mappedProperty.getPropertyAccessStrategy( null ).buildPropertyAccess( null, mappedProperty.getName() ); + return mappedProperty.getPropertyAccessStrategy( null ).buildPropertyAccess( null, mappedProperty.getName(), true ); } else { - return PropertyAccessStrategyMapImpl.INSTANCE.buildPropertyAccess( null, mappedProperty.getName() ); + return PropertyAccessStrategyMapImpl.INSTANCE.buildPropertyAccess( null, mappedProperty.getName(), true ); } } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/access/AttributeAccessorTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/access/AttributeAccessorTest.java index c16a4cb327..1985a07c76 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/access/AttributeAccessorTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/access/AttributeAccessorTest.java @@ -95,8 +95,8 @@ public class AttributeAccessorTest { public static class BasicAttributeAccessor extends PropertyAccessStrategyBasicImpl { @Override - public PropertyAccess buildPropertyAccess(Class containerJavaType, String propertyName) { - return super.buildPropertyAccess( containerJavaType, propertyName ); + public PropertyAccess buildPropertyAccess(Class containerJavaType, String propertyName, boolean setterRequired) { + return super.buildPropertyAccess( containerJavaType, propertyName, setterRequired ); } } } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/bytecode/BeanReflectionHelper.java b/hibernate-core/src/test/java/org/hibernate/orm/test/bytecode/BeanReflectionHelper.java index 887d5b6d08..bb2a293173 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/bytecode/BeanReflectionHelper.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/bytecode/BeanReflectionHelper.java @@ -28,49 +28,49 @@ public class BeanReflectionHelper { static { final PropertyAccessStrategyBasicImpl propertyAccessStrategy = new PropertyAccessStrategyBasicImpl(); - PropertyAccess propertyAccess = propertyAccessStrategy.buildPropertyAccess( Bean.class, "someString" ); + PropertyAccess propertyAccess = propertyAccessStrategy.buildPropertyAccess( Bean.class, "someString", true ); Getter getter = propertyAccess.getGetter(); Setter setter = propertyAccess.getSetter(); getterNames[0] = getter.getMethodName(); types[0] = getter.getReturnTypeClass(); setterNames[0] = setter.getMethodName(); - propertyAccess = propertyAccessStrategy.buildPropertyAccess( Bean.class, "someLong" ); + propertyAccess = propertyAccessStrategy.buildPropertyAccess( Bean.class, "someLong", true ); getter = propertyAccess.getGetter(); setter = propertyAccess.getSetter(); getterNames[1] = getter.getMethodName(); types[1] = getter.getReturnTypeClass(); setterNames[1] = setter.getMethodName(); - propertyAccess = propertyAccessStrategy.buildPropertyAccess( Bean.class, "someInteger" ); + propertyAccess = propertyAccessStrategy.buildPropertyAccess( Bean.class, "someInteger", true ); getter = propertyAccess.getGetter(); setter = propertyAccess.getSetter(); getterNames[2] = getter.getMethodName(); types[2] = getter.getReturnTypeClass(); setterNames[2] = setter.getMethodName(); - propertyAccess = propertyAccessStrategy.buildPropertyAccess( Bean.class, "someDate" ); + propertyAccess = propertyAccessStrategy.buildPropertyAccess( Bean.class, "someDate", true ); getter = propertyAccess.getGetter(); setter = propertyAccess.getSetter(); getterNames[3] = getter.getMethodName(); types[3] = getter.getReturnTypeClass(); setterNames[3] = setter.getMethodName(); - propertyAccess = propertyAccessStrategy.buildPropertyAccess( Bean.class, "somelong" ); + propertyAccess = propertyAccessStrategy.buildPropertyAccess( Bean.class, "somelong", true ); getter = propertyAccess.getGetter(); setter = propertyAccess.getSetter(); getterNames[4] = getter.getMethodName(); types[4] = getter.getReturnTypeClass(); setterNames[4] = setter.getMethodName(); - propertyAccess = propertyAccessStrategy.buildPropertyAccess( Bean.class, "someint" ); + propertyAccess = propertyAccessStrategy.buildPropertyAccess( Bean.class, "someint", true ); getter = propertyAccess.getGetter(); setter = propertyAccess.getSetter(); getterNames[5] = getter.getMethodName(); types[5] = getter.getReturnTypeClass(); setterNames[5] = setter.getMethodName(); - propertyAccess = propertyAccessStrategy.buildPropertyAccess( Bean.class, "someObject" ); + propertyAccess = propertyAccessStrategy.buildPropertyAccess( Bean.class, "someObject", true ); getter = propertyAccess.getGetter(); setter = propertyAccess.getSetter(); getterNames[6] = getter.getMethodName(); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/embeddable/strategy/instantiator/intf/InstantiationTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/embeddable/strategy/instantiator/intf/InstantiationTests.java index efb2ecb8d5..76c7abfe87 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/embeddable/strategy/instantiator/intf/InstantiationTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/embeddable/strategy/instantiator/intf/InstantiationTests.java @@ -9,6 +9,13 @@ package org.hibernate.orm.test.mapping.embeddable.strategy.instantiator.intf; import org.hibernate.mapping.Collection; import org.hibernate.mapping.Component; import org.hibernate.mapping.Property; +import org.hibernate.metamodel.EmbeddableRepresentationStrategy; +import org.hibernate.metamodel.MappingMetamodel; +import org.hibernate.metamodel.RepresentationMode; +import org.hibernate.metamodel.RuntimeMetamodels; +import org.hibernate.metamodel.mapping.EmbeddableMappingType; +import org.hibernate.metamodel.mapping.internal.EmbeddedAttributeMapping; +import org.hibernate.persister.entity.EntityPersister; import org.hibernate.testing.orm.junit.DomainModel; import org.hibernate.testing.orm.junit.DomainModelScope; @@ -31,7 +38,7 @@ import static org.assertj.core.api.Assertions.assertThat; @JiraKey( "HHH-14950" ) public class InstantiationTests { @Test - public void modelTest(DomainModelScope scope) { + public void bootModelTest(DomainModelScope scope) { scope.withHierarchy( Person.class, (personMapping) -> { final Property name = personMapping.getProperty( "name" ); final Component nameMapping = (Component) name.getValue(); @@ -44,7 +51,23 @@ public class InstantiationTests { } @Test - @FailureExpected( jiraKey = "HHH-14950", reason = "Model has no setters, which is not supported" ) + public void runtimeModelTest(SessionFactoryScope scope) { + final RuntimeMetamodels runtimeMetamodels = scope.getSessionFactory().getRuntimeMetamodels(); + final MappingMetamodel mappingMetamodel = runtimeMetamodels.getMappingMetamodel(); + final EntityPersister entityDescriptor = mappingMetamodel.findEntityDescriptor( Person.class ); + + final EmbeddedAttributeMapping nameEmbedded = (EmbeddedAttributeMapping) entityDescriptor.findAttributeMapping( "name" ); + final EmbeddableMappingType nameEmbeddable = nameEmbedded.getEmbeddableTypeDescriptor(); + final EmbeddableRepresentationStrategy nameRepStrategy = nameEmbeddable.getRepresentationStrategy(); + assertThat( nameRepStrategy.getMode() ).isEqualTo( RepresentationMode.POJO ); + assertThat( nameRepStrategy.getInstantiator() ).isInstanceOf( NameInstantiator.class ); + nameEmbeddable.forEachAttributeMapping( (position, attribute) -> { + assertThat( attribute.getPropertyAccess().getSetter() ).isNull(); + } ); + } + + @Test + @FailureExpected( jiraKey = "HHH-14964", reason = "EmbeddableInitializer is called twice, causing problems" ) public void basicTest(SessionFactoryScope scope) { scope.inTransaction( (session) -> { final Person mick = new Person( 1, new NameImpl( "Mick", "Jagger" ) ); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/embeddable/strategy/instantiator/intf2/InstantiationTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/embeddable/strategy/instantiator/intf2/InstantiationTests.java index a77964e0f3..3ac203da22 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/embeddable/strategy/instantiator/intf2/InstantiationTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/embeddable/strategy/instantiator/intf2/InstantiationTests.java @@ -9,6 +9,13 @@ package org.hibernate.orm.test.mapping.embeddable.strategy.instantiator.intf2; import org.hibernate.mapping.Collection; import org.hibernate.mapping.Component; import org.hibernate.mapping.Property; +import org.hibernate.metamodel.EmbeddableRepresentationStrategy; +import org.hibernate.metamodel.MappingMetamodel; +import org.hibernate.metamodel.RepresentationMode; +import org.hibernate.metamodel.RuntimeMetamodels; +import org.hibernate.metamodel.mapping.EmbeddableMappingType; +import org.hibernate.metamodel.mapping.internal.EmbeddedAttributeMapping; +import org.hibernate.persister.entity.EntityPersister; import org.hibernate.testing.orm.junit.DomainModel; import org.hibernate.testing.orm.junit.DomainModelScope; @@ -34,7 +41,7 @@ import static org.assertj.core.api.Assertions.assertThat; @JiraKey( "HHH-14950" ) public class InstantiationTests { @Test - public void modelTest(DomainModelScope scope) { + public void bootModelTest(DomainModelScope scope) { scope.withHierarchy( Person.class, (personMapping) -> { final Property name = personMapping.getProperty( "name" ); final Component nameMapping = (Component) name.getValue(); @@ -47,7 +54,23 @@ public class InstantiationTests { } @Test - @FailureExpected( jiraKey = "HHH-14950", reason = "Model has no setters, which is not supported" ) + public void runtimeModelTest(SessionFactoryScope scope) { + final RuntimeMetamodels runtimeMetamodels = scope.getSessionFactory().getRuntimeMetamodels(); + final MappingMetamodel mappingMetamodel = runtimeMetamodels.getMappingMetamodel(); + final EntityPersister entityDescriptor = mappingMetamodel.findEntityDescriptor( Person.class ); + + final EmbeddedAttributeMapping nameEmbedded = (EmbeddedAttributeMapping) entityDescriptor.findAttributeMapping( "name" ); + final EmbeddableMappingType nameEmbeddable = nameEmbedded.getEmbeddableTypeDescriptor(); + final EmbeddableRepresentationStrategy nameRepStrategy = nameEmbeddable.getRepresentationStrategy(); + assertThat( nameRepStrategy.getMode() ).isEqualTo( RepresentationMode.POJO ); + assertThat( nameRepStrategy.getInstantiator() ).isInstanceOf( NameInstantiator.class ); + nameEmbeddable.forEachAttributeMapping( (position, attribute) -> { + assertThat( attribute.getPropertyAccess().getSetter() ).isNull(); + } ); + } + + @Test + @FailureExpected( jiraKey = "HHH-14964", reason = "EmbeddableInitializer is called twice, causing problems" ) public void basicTest(SessionFactoryScope scope) { scope.inTransaction( (session) -> { final Person mick = new Person( 1, Name.make( "Mick", "Jagger" ) ); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/embeddable/strategy/instantiator/intf2/Name.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/embeddable/strategy/instantiator/intf2/Name.java index 99e14eb7f0..a5e69200c6 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/embeddable/strategy/instantiator/intf2/Name.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/embeddable/strategy/instantiator/intf2/Name.java @@ -23,10 +23,10 @@ public class Name { } String getFirstName() { - return "John"; + return first; } String getLastName() { - return "Doe"; + return last; } } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/embeddable/strategy/instantiator/intf2/NameInstantiator.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/embeddable/strategy/instantiator/intf2/NameInstantiator.java index 70cc7da583..7c4256d6a6 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/embeddable/strategy/instantiator/intf2/NameInstantiator.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/embeddable/strategy/instantiator/intf2/NameInstantiator.java @@ -15,8 +15,11 @@ import org.hibernate.metamodel.EmbeddableInstantiator; * @author Steve Ebersole */ public class NameInstantiator implements EmbeddableInstantiator { + public static int callCount = 0; + @Override public Object instantiate(Supplier valuesAccess, SessionFactoryImplementor sessionFactory) { + callCount++; final Object[] values = valuesAccess.get(); return Name.make( (String) values[0], (String) values[1] ); } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/property/BasicPropertyAccessorTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/property/BasicPropertyAccessorTest.java index eed3ff8545..84821fea34 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/property/BasicPropertyAccessorTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/property/BasicPropertyAccessorTest.java @@ -73,13 +73,13 @@ public class BasicPropertyAccessorTest extends BaseUnitTestCase { PropertyAccessStrategyBasicImpl accessStrategy = PropertyAccessStrategyBasicImpl.INSTANCE; { - final PropertyAccess access = accessStrategy.buildPropertyAccess( Duper.class, "it" ); + final PropertyAccess access = accessStrategy.buildPropertyAccess( Duper.class, "it", true ); assertEquals( String.class, access.getGetter().getReturnTypeClass() ); assertEquals( Object.class, access.getSetter().getMethod().getParameterTypes()[0] ); } { - final PropertyAccess access = accessStrategy.buildPropertyAccess( Duper2.class, "it" ); + final PropertyAccess access = accessStrategy.buildPropertyAccess( Duper2.class, "it", true ); assertEquals( String.class, access.getGetter().getReturnTypeClass() ); assertEquals( String.class, access.getSetter().getMethod().getParameterTypes()[0] ); } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/property/PropertyAccessStrategyMapTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/property/PropertyAccessStrategyMapTest.java index 4af533011f..cd09027a12 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/property/PropertyAccessStrategyMapTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/property/PropertyAccessStrategyMapTest.java @@ -36,7 +36,7 @@ public class PropertyAccessStrategyMapTest extends BaseUnitTestCase { final PropertyAccessStrategyMapImpl accessStrategy = PropertyAccessStrategyMapImpl.INSTANCE; try { - accessStrategy.buildPropertyAccess( Date.class, "time" ); + accessStrategy.buildPropertyAccess( Date.class, "time", true ); fail("Should throw IllegalArgumentException"); } @@ -54,7 +54,7 @@ public class PropertyAccessStrategyMapTest extends BaseUnitTestCase { final String value = "testValue"; final PropertyAccessStrategyMapImpl accessStrategy = PropertyAccessStrategyMapImpl.INSTANCE; - final PropertyAccess access = accessStrategy.buildPropertyAccess( clazz, key ); + final PropertyAccess access = accessStrategy.buildPropertyAccess( clazz, key, true ); final HashMap map = new HashMap<>(); diff --git a/hibernate-core/src/test/resources/log4j2.properties b/hibernate-core/src/test/resources/log4j2.properties index b6ffb8b759..c7433345bc 100644 --- a/hibernate-core/src/test/resources/log4j2.properties +++ b/hibernate-core/src/test/resources/log4j2.properties @@ -54,7 +54,7 @@ logger.tooling-schema-script-graph.appenderRef.subsystem.ref=subsystem # Logging related to the creation of DomainResult/Fetch graphs logger.sql-result-graph.name=org.hibernate.orm.sql.results logger.sql-result-graph.appenderRef.subsystem.ref=subsystem -#logger.sql-result-graph.level=debug +logger.sql-result-graph.level=debug # Logs generated DomainResult/Fetch AST graph logger.sql-result-ast.name=org.hibernate.orm.sql.results.graph.AST diff --git a/hibernate-envers/src/main/java/org/hibernate/envers/internal/tools/ReflectionTools.java b/hibernate-envers/src/main/java/org/hibernate/envers/internal/tools/ReflectionTools.java index 08e0c2cd61..67cdf47644 100644 --- a/hibernate-envers/src/main/java/org/hibernate/envers/internal/tools/ReflectionTools.java +++ b/hibernate-envers/src/main/java/org/hibernate/envers/internal/tools/ReflectionTools.java @@ -54,7 +54,7 @@ public abstract class ReflectionTools { final Pair key = Pair.make( cls, propertyName ); Getter value = GETTER_CACHE.get( key ); if ( value == null ) { - value = getAccessStrategy( cls, serviceRegistry, accessorType ).buildPropertyAccess( cls, propertyName ).getGetter(); + value = getAccessStrategy( cls, serviceRegistry, accessorType ).buildPropertyAccess( cls, propertyName, true ).getGetter(); // It's ok if two getters are generated concurrently GETTER_CACHE.put( key, value ); } @@ -70,7 +70,7 @@ public abstract class ReflectionTools { final Pair key = Pair.make( cls, propertyName ); Setter value = SETTER_CACHE.get( key ); if ( value == null ) { - value = getAccessStrategy( cls, serviceRegistry, accessorType ).buildPropertyAccess( cls, propertyName ).getSetter(); + value = getAccessStrategy( cls, serviceRegistry, accessorType ).buildPropertyAccess( cls, propertyName, true ).getSetter(); // It's ok if two setters are generated concurrently SETTER_CACHE.put( key, value ); } diff --git a/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/integration/accesstype/AttributeAccessorTest.java b/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/integration/accesstype/AttributeAccessorTest.java index b9f53e482b..2089f6d254 100644 --- a/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/integration/accesstype/AttributeAccessorTest.java +++ b/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/integration/accesstype/AttributeAccessorTest.java @@ -91,9 +91,9 @@ public class AttributeAccessorTest extends BaseEnversJPAFunctionalTestCase { public static class BasicAttributeAccessor extends PropertyAccessStrategyBasicImpl { static boolean invoked; @Override - public PropertyAccess buildPropertyAccess(Class containerJavaType, String propertyName) { + public PropertyAccess buildPropertyAccess(Class containerJavaType, String propertyName, boolean setterRequired) { invoked = true; - return super.buildPropertyAccess( containerJavaType, propertyName ); + return super.buildPropertyAccess( containerJavaType, propertyName, setterRequired ); } } }