finally {
LOG.trace("Completed entity [" + safeMapping.getEntityName() + "]");
}
}
else if ( MappedSuperclass.class.isAssignableFrom( mapping.getClass() ) ) {
@SuppressWarnings( "unchecked" )
final MappedSuperclass safeMapping = (MappedSuperclass) mapping;
LOG.trace("Starting mapped superclass [" + safeMapping.getMappedClass().getName() + "]");
try {
final MappedSuperclassTypeImpl<?> jpa2Mapping = mappedSuperclassByMappedSuperclassMapping.get(
safeMapping
);
applyIdMetadata( safeMapping, jpa2Mapping );
applyVersionAttribute( safeMapping, jpa2Mapping );
Iterator<Property> properties = safeMapping.getDeclaredPropertyIterator();
while ( properties.hasNext() ) {
final Property property = properties.next();
if ( safeMapping.isVersioned() && property == safeMapping.getVersion() ) {
// skip the version property, it was already handled previously.
continue;
}
final Attribute attribute = attributeFactory.buildAttribute( jpa2Mapping, property );
if ( attribute != null ) {
jpa2Mapping.getBuilder().addAttribute( attribute );
}
}
jpa2Mapping.lock();
populateStaticMetamodel( jpa2Mapping );
}
finally {
LOG.trace("Completed mapped superclass [" + safeMapping.getMappedClass().getName() + "]");
}
}
else {
throw new AssertionFailure( "Unexpected mapping type: " + mapping.getClass() );
}