use of io.vertigo.studio.plugins.mda.domain.sql.model.SqlMethodModel in project vertigo by KleeGroup.
the class SqlGeneratorPlugin method generateFile.
private void generateFile(final FileGeneratorConfig fileGeneratorConfig, final MdaResultBuilder mdaResultBuilder, final List<SqlDtDefinitionModel> dtDefinitionModels, final Collection<AssociationSimpleDefinition> associationSimpleDefinitions, final Collection<AssociationNNDefinition> collectionNN, final String fileName) {
final MapBuilder<String, Object> modelBuilder = new MapBuilder<String, Object>().put("sql", new SqlMethodModel()).put("dtDefinitions", dtDefinitionModels).put("simpleAssociations", associationSimpleDefinitions).put("nnAssociations", collectionNN).put("drop", generateDrop).put("basecible", baseCible).put("truncateNames", "Oracle".equals(baseCible));
tableSpaceDataOpt.ifPresent(tableSpaceData -> modelBuilder.put("tableSpaceData", tableSpaceData));
tableSpaceIndexOpt.ifPresent(tableSpaceIndex -> modelBuilder.put("tableSpaceIndex", tableSpaceIndex));
final Map<String, Object> model = modelBuilder.build();
final String templatName = isSqlServer() ? "domain/sql/template/sqlserver.ftl" : "domain/sql/template/sql.ftl";
FileGenerator.builder(fileGeneratorConfig).withModel(model).withFileName(fileName).withGenSubDir(targetSubDir).withPackageName("").withTemplateName(templatName).build().generateFile(mdaResultBuilder);
}
Aggregations