001package io.ebeaninternal.dbmigration.ddlgeneration; 002 003import io.ebean.config.dbplatform.DatabasePlatform; 004import io.ebeaninternal.dbmigration.ddlgeneration.platform.*; 005 006/** 007 * Builds platform specific DDL handler. 008 */ 009public class PlatformDdlBuilder { 010 011 /** 012 * Return platform specific DDL handler. 013 */ 014 public static PlatformDdl create(DatabasePlatform platform) { 015 016 switch (platform.getPlatform()) { 017 case H2: 018 return new H2Ddl(platform); 019 case DB2: 020 case DB2LUW: 021 case DB2FORI: 022 case DB2ZOS: 023 return new DB2Ddl(platform); 024 case MARIADB: 025 return new MariaDbDdl(platform); 026 case MYSQL55: 027 case MYSQL: 028 return new MySqlDdl(platform); 029 case HSQLDB: 030 return new HsqldbDdl(platform); 031 case NUODB: 032 return new NuoDbDdl(platform); 033 case ORACLE: 034 case ORACLE11: 035 return new OracleDdl(platform); 036 case SQLITE: 037 return new SQLiteDdl(platform); 038 case POSTGRES9: 039 return new Postgres9Ddl(platform); 040 case POSTGRES: 041 return new PostgresDdl(platform); 042 case YUGABYTE: 043 return new YugabyteDdl(platform); 044 case COCKROACH: 045 return new CockroachDdl(platform); 046 case SQLSERVER16: 047 case SQLSERVER17: 048 case SQLSERVER: 049 return new SqlServerDdl(platform); 050 case HANA: 051 return new HanaColumnStoreDdl(platform); 052 case CLICKHOUSE: 053 return new ClickHouseDdl(platform); 054 default: 055 return new PlatformDdl(platform); 056 } 057 } 058}