use of com.jfinal.plugin.activerecord.generator.TableMeta in project jboot by yangfuhai.
the class CodeGenHelpler method createMetaBuilder.
public static MetaBuilder createMetaBuilder(DataSource dataSource, String type, boolean removeNoPrimaryKeyTable) {
MetaBuilder metaBuilder = removeNoPrimaryKeyTable ? new MetaBuilder(dataSource) : new MetaBuilder(dataSource) {
@Override
protected void removeNoPrimaryKeyTable(List<TableMeta> ret) {
// do Nothing...
}
};
metaBuilder.setGenerateRemarks(true);
switch(type) {
case DataSourceConfig.TYPE_MYSQL:
metaBuilder.setDialect(new MysqlDialect());
break;
case DataSourceConfig.TYPE_ORACLE:
metaBuilder.setDialect(new OracleDialect());
break;
case DataSourceConfig.TYPE_SQLSERVER:
metaBuilder.setDialect(new SqlServerDialect());
break;
case DataSourceConfig.TYPE_SQLITE:
metaBuilder.setDialect(new Sqlite3Dialect());
break;
case DataSourceConfig.TYPE_ANSISQL:
metaBuilder.setDialect(new AnsiSqlDialect());
break;
case DataSourceConfig.TYPE_POSTGRESQL:
metaBuilder.setDialect(new PostgreSqlDialect());
break;
default:
throw new JbootIllegalConfigException("only support datasource type : mysql、orcale、sqlserver、sqlite、ansisql and postgresql, please check your jboot.properties. ");
}
return metaBuilder;
}
Aggregations