MybatisPlusGeneratorTest.java 1.1 KB

1234567891011121314151617181920212223242526
  1. package com.nokia.finance.tasks;
  2. import com.baomidou.mybatisplus.generator.FastAutoGenerator;
  3. import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
  4. import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
  5. public class MybatisPlusGeneratorTest {
  6. public static void main(String[] args) {
  7. FastAutoGenerator.create(
  8. new DataSourceConfig.Builder("jdbc:postgresql://172.16.107.5:5432/financialdb",
  9. "finance",
  10. "Finance@unicom23").schema("common"))
  11. .globalConfig(builder -> {
  12. builder.outputDir("z:/").disableOpenDir();
  13. })
  14. .strategyConfig(builder -> {
  15. builder.addInclude("data_log")
  16. .entityBuilder()
  17. .disableSerialVersionUID()
  18. .enableFileOverride()
  19. .enableLombok();
  20. })
  21. .templateEngine(new FreemarkerTemplateEngine())
  22. .execute();
  23. }
  24. }