HHH-4202 : Fix to only build an EntityType for PersistentClasses with a mapped class

git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@17870 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Gail Badner 2009-10-28 18:03:10 +00:00
parent 6d5de2b0af
commit 5cc638576f
1 changed files with 4 additions and 1 deletions

View File

@ -57,7 +57,10 @@ public class MetamodelImpl implements Metamodel, Serializable {
SessionFactoryImplementor sessionFactory) { SessionFactoryImplementor sessionFactory) {
MetadataContext context = new MetadataContext( sessionFactory ); MetadataContext context = new MetadataContext( sessionFactory );
while ( persistentClasses.hasNext() ) { while ( persistentClasses.hasNext() ) {
locateOrBuildEntityType( persistentClasses.next(), context ); PersistentClass pc = persistentClasses.next();
if ( pc.getMappedClass() != null ) {
locateOrBuildEntityType( pc, context );
}
} }
context.wrapUp(); context.wrapUp();
return new MetamodelImpl( context.getEntityTypeMap(), context.getEmbeddableTypeMap() ); return new MetamodelImpl( context.getEntityTypeMap(), context.getEmbeddableTypeMap() );