Do not expose id class embeddables through getManagedTypes
This commit is contained in:
parent
7f4a4afd64
commit
955e8265dc
|
@ -375,10 +375,13 @@ public class MetadataContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
( ( AttributeContainer<?>) embeddable ).getInFlightAccess().finishUp();
|
( ( AttributeContainer<?>) embeddable ).getInFlightAccess().finishUp();
|
||||||
embeddables.put( embeddable.getJavaType(), embeddable );
|
// Do not process embeddables for entity types i.e. id-classes
|
||||||
|
if ( !( embeddable.getExpressibleJavaType() instanceof EntityJavaType<?> ) ) {
|
||||||
|
embeddables.put( embeddable.getJavaType(), embeddable );
|
||||||
|
|
||||||
if ( staticMetamodelScanEnabled ) {
|
if ( staticMetamodelScanEnabled ) {
|
||||||
populateStaticMetamodel( embeddable );
|
populateStaticMetamodel( embeddable );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -509,6 +509,10 @@ public class JpaMetamodelImpl implements JpaMetamodelImplementor, Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( EmbeddableDomainType<?> embeddable : context.getEmbeddableTypeSet() ) {
|
for ( EmbeddableDomainType<?> embeddable : context.getEmbeddableTypeSet() ) {
|
||||||
|
// Do not register the embeddable types for id classes
|
||||||
|
if ( embeddable.getExpressibleJavaType() instanceof EntityJavaType<?> ) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
switch ( jpaMetaModelPopulationSetting ) {
|
switch ( jpaMetaModelPopulationSetting ) {
|
||||||
case IGNORE_UNSUPPORTED:
|
case IGNORE_UNSUPPORTED:
|
||||||
if ( embeddable.getJavaType() != null && embeddable.getJavaType() != Map.class ) {
|
if ( embeddable.getJavaType() != null && embeddable.getJavaType() != Map.class ) {
|
||||||
|
|
Loading…
Reference in New Issue