HHH-12871 - Fix metamodel to properly exclude dynamic-map based types when using ignoreUnsupported.

(cherry picked from commit b9e0449602)
This commit is contained in:
Chris Cranford 2018-08-07 09:29:00 -04:00
parent 9f3b1cfb5b
commit dc49ef6ef4
2 changed files with 9 additions and 2 deletions

View File

@ -116,16 +116,23 @@ class MetadataContext {
}
/*package*/ void registerEntityType(PersistentClass persistentClass, EntityTypeImpl<?> entityType) {
if ( ignoreUnsupported && entityType.getBindableJavaType() == null ) {
return;
}
if ( entityType.getBindableJavaType() != null ) {
entityTypes.put( entityType.getBindableJavaType(), entityType );
}
entityTypesByEntityName.put( persistentClass.getEntityName(), entityType );
entityTypesByPersistentClass.put( persistentClass, entityType );
orderedMappings.add( persistentClass );
}
/*package*/ void registerEmbeddedableType(EmbeddableTypeImpl<?> embeddableType) {
embeddables.add( embeddableType );
if ( !( ignoreUnsupported && embeddableType.getParent().getJavaType() == null ) ) {
embeddables.add( embeddableType );
}
}
/*package*/ void registerMappedSuperclassType(

View File

@ -570,7 +570,7 @@ public class MetamodelImpl implements MetamodelImplementor, Serializable {
jpaEntityTypeMap.size() + jpaMappedSuperclassTypeMap.size() + jpaEmbeddableTypes.size()
);
final Set<ManagedType<?>> managedTypes = new HashSet<ManagedType<?>>( setSize );
managedTypes.addAll( jpaEntityTypeMap.values() );
managedTypes.addAll( jpaEntityTypesByEntityName.values() );
managedTypes.addAll( jpaMappedSuperclassTypeMap.values() );
managedTypes.addAll( jpaEmbeddableTypes );
return managedTypes;