private static void onBind ( Class clazz ) { if ( ( ( MetamodelImpl ) em . getMetamodel ( ) ) . getEntityMetadataMap ( ) . isEmpty ( ) ) { EntityMetadata metadata = new EntityMetadata ( clazz ) ; metadata . setPersistenceUnit ( getPersistenceUnit ( ) ) ; setSchemaAndPU ( clazz , metadata ) ; new TableProcessor ( em . getEntityManagerFactory ( ) . getProperties ( ) , ( ( EntityManagerFactoryImpl ) em . getEntityManagerFactory ( ) ) . getKunderaMetadataInstance ( ) ) . process ( clazz , metadata ) ; KunderaMetadata kunderaMetadata = ( ( EntityManagerFactoryImpl ) em . getEntityManagerFactory ( ) ) . getKunderaMetadataInstance ( ) ; new IndexProcessor ( kunderaMetadata ) . process ( clazz , metadata ) ; ApplicationMetadata appMetadata = kunderaMetadata . getApplicationMetadata ( ) ; ( ( MetamodelImpl ) em . getMetamodel ( ) ) . addEntityMetadata ( clazz , metadata ) ; ( ( MetamodelImpl ) em . getMetamodel ( ) ) . addEntityNameToClassMapping ( clazz . getSimpleName ( ) , clazz ) ; appMetadata . getMetamodelMap ( ) . put ( getPersistenceUnit ( ) , em . getMetamodel ( ) ) ; Map < String , List < String > > clazzToPuMap = new HashMap < String , List < String > > ( ) ; List < String > persistenceUnits = new ArrayList < String > ( ) ; persistenceUnits . add ( getPersistenceUnit ( ) ) ; clazzToPuMap . put ( clazz . getName ( ) , persistenceUnits ) ; appMetadata . setClazzToPuMap ( clazzToPuMap ) ; new SchemaConfiguration ( em . getEntityManagerFactory ( ) . getProperties ( ) , kunderaMetadata , getPersistenceUnit ( ) ) . configure ( ) ; } }
On bind .