HHH-18675: Fix for testcase. If property is 'synthetic' then create no attribute for the jpa model.
This commit is contained in:
parent
fcba4ed25d
commit
bc4804ab09
|
@ -477,7 +477,7 @@ public class Property implements Serializable, MetaAttributable {
|
|||
}
|
||||
|
||||
public Property copy() {
|
||||
final Property property = new Property();
|
||||
final Property property = this instanceof SyntheticProperty ? new SyntheticProperty() : new Property();
|
||||
property.setName( getName() );
|
||||
property.setValue( getValue() );
|
||||
property.setCascade( getCascade() );
|
||||
|
|
|
@ -55,9 +55,9 @@ import java.util.Set;
|
|||
import java.util.function.BiFunction;
|
||||
|
||||
import static java.util.Collections.unmodifiableMap;
|
||||
import static java.util.Objects.nonNull;
|
||||
import static org.hibernate.metamodel.internal.InjectionHelper.injectField;
|
||||
|
||||
|
||||
/**
|
||||
* Defines a context for storing information during the building of the {@link MappingMetamodelImpl}.
|
||||
* <p>
|
||||
|
@ -274,9 +274,10 @@ public class MetadataContext {
|
|||
attribute = factoryFunction.apply( entityType, genericProperty );
|
||||
if ( !property.isGeneric() ) {
|
||||
final PersistentAttribute<X, ?> concreteAttribute = factoryFunction.apply( entityType, property );
|
||||
@SuppressWarnings("unchecked")
|
||||
final AttributeContainer<X> attributeContainer = (AttributeContainer<X>) entityType;
|
||||
attributeContainer.getInFlightAccess().addConcreteGenericAttribute( concreteAttribute );
|
||||
if (nonNull(concreteAttribute)) {
|
||||
@SuppressWarnings("unchecked") final AttributeContainer<X> attributeContainer = (AttributeContainer<X>) entityType;
|
||||
attributeContainer.getInFlightAccess().addConcreteGenericAttribute(concreteAttribute);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Reference in New Issue