public ModelDef [ ] correct ( ) { for ( ModelDef m : modelList ) { this . model = m ; correct1to1Detail ( ) ; } for ( ModelDef m : modelList ) { this . model = m ; removeUnnecessaryHasOneToSelf ( ) ; } for ( ModelDef m : modelList ) { this . model = m ; removeUnnecessaryHasManyToSelf ( ) ; } for ( ModelDef m : modelList ) { this . model = m ; crossOutLinkerTables ( ) ; } for ( ModelDef m : modelList ) { this . model = m ; removeHasOneToBothPrimaryAndForeignKey ( ) ; } return modelList ; }
Run each one at a time for all models in such a way that it won t disturb the other