use of org.hibernate.type.descriptor.java.spi.DynamicModelJavaType in project hibernate-orm by hibernate.
the class JpaMetamodelImpl method buildEntityType.
@SuppressWarnings("unchecked")
private EntityTypeImpl<?> buildEntityType(PersistentClass persistentClass, MetadataContext context, TypeConfiguration typeConfiguration) {
context.pushEntityWorkedOn(persistentClass);
final MappedSuperclass superMappedSuperclass = persistentClass.getSuperMappedSuperclass();
IdentifiableDomainType<?> superType = superMappedSuperclass == null ? null : locateOrBuildMappedSuperclassType(superMappedSuperclass, context, typeConfiguration);
// no mappedSuperclass, check for a super entity
if (superType == null) {
final PersistentClass superPersistentClass = persistentClass.getSuperclass();
superType = superPersistentClass == null ? null : locateOrBuildEntityType(superPersistentClass, context, typeConfiguration);
}
final Class<?> javaTypeClass = persistentClass.getMappedClass();
final JavaType<?> javaType;
if (javaTypeClass == null || Map.class.isAssignableFrom(javaTypeClass)) {
// dynamic map
javaType = new DynamicModelJavaType();
} else {
javaType = context.getTypeConfiguration().getJavaTypeRegistry().resolveEntityTypeDescriptor(javaTypeClass);
}
final EntityTypeImpl<?> entityType = new EntityTypeImpl(javaType, superType, persistentClass, this);
context.registerEntityType(persistentClass, entityType);
context.popEntityWorkedOn(persistentClass);
return entityType;
}
Aggregations