java springboot mybatisplus oracle generator 自動生成

package com.foxconn.test; import java.sql.SQLException; import com.baomidou.mybatisplus.enums.IdType; import com.baomidou.mybatisplus.generator.AutoGenerator; import com.baomidou.mybatisplus.generator.config.DataSourceConfig; import com.baomidou.mybatisplus.generator.config.GlobalConfig; import com.baomidou.mybatisplus.generator.config.PackageConfig; import com.baomidou.mybatisplus.generator.config.StrategyConfig; import com.baomidou.mybatisplus.generator.config.rules.DbType; import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; /** * @author H2410760 * @version 2019年7月26日 */ public class MyBatisPlusGenerator { public static void main(String[] args) throws SQLException { GlobalConfig config = new GlobalConfig(); config.setActiveRecord(true) .setAuthor("Y19110115") //H2410760 .setOutputDir("D:\\java\\fskTestWorkSpace\\springboot-mobileInspection\\src\\main\\java") // 生成路径 .setFileOverride(true) .setIdType(IdType.AUTO) .setServiceName("%sService") .setBaseResultMap(true) .setBaseColumnList(true); DataSourceConfig dsConfig = new DataSourceConfig(); dsConfig.setDbType(DbType.ORACLE) .setDriverName("oracle.jdbc.OracleDriver") .setUrl("jdbc:oracle:thin:@10.172.108.106:1526/tthrdb") .setUsername("FOXCONNMI") .setPassword("FOXCONNMI"); StrategyConfig stConfig = new StrategyConfig(); stConfig.setCapitalMode(true) .setDbColumnUnderline(true) .setNaming(NamingStrategy.underline_to_camel) .setInclude("XC_PATROL_SIGN_IN"); PackageConfig pkConfig = new PackageConfig(); pkConfig.setParent("com.foxconn") .setMapper("mapper") .setService("service") .setController("controller") .setEntity("entity") .setXml("mapper"); AutoGenerator ag = new AutoGenerator(); ag.setGlobalConfig(config) .setDataSource(dsConfig) .setStrategy(stConfig) .setPackageInfo(pkConfig); ag.execute(); } }

你可能感兴趣的:(java springboot mybatisplus oracle generator 自動生成)