private void addTableGenerator ( ApplicationMetadata appMetadata , String persistenceUnit , List < TableInfo > tableInfos , EntityMetadata entityMetadata ) { Metamodel metamodel = appMetadata . getMetamodel ( persistenceUnit ) ; IdDiscriptor keyValue = ( ( MetamodelImpl ) metamodel ) . getKeyValue ( entityMetadata . getEntityClazz ( ) . getName ( ) ) ; if ( keyValue != null && keyValue . getTableDiscriptor ( ) != null ) { TableInfo tableGeneratorDiscriptor = new TableInfo ( keyValue . getTableDiscriptor ( ) . getTable ( ) , "CounterColumnType" , String . class , keyValue . getTableDiscriptor ( ) . getPkColumnName ( ) ) ; if ( ! tableInfos . contains ( tableGeneratorDiscriptor ) ) { tableGeneratorDiscriptor . addColumnInfo ( getJoinColumn ( tableGeneratorDiscriptor , keyValue . getTableDiscriptor ( ) . getValueColumnName ( ) , Long . class ) ) ; tableInfos . add ( tableGeneratorDiscriptor ) ; } } }
Add tableGenerator to table info .