mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
* 1476 - Query plan capture, initial wip capturing bind params * No effective change - Reset test default db to H2 * #1476 - Query plan capture, initial wip capturing bind params #1477 Update with consumer * #1476 - Query plan capture, initial wip capturing bind params #1477 Update with query plan request * #1476 - Query plan capture, initial wip capturing bind params #1477 Extract interface * #1476 - Query plan capture, initial wip capturing bind params #1477 Extract interface
37 lines
871 B
Java
37 lines
871 B
Java
package io.ebeaninternal.server.query;
|
|
|
|
import io.ebean.annotation.Platform;
|
|
|
|
public final class PlatformQueryPlan {
|
|
|
|
private static QueryPlanLogger explainLogger = new QueryPlanLoggerExplain();
|
|
|
|
private static QueryPlanLogger postgresLogger = new QueryPlanLoggerPostgres();
|
|
|
|
private static QueryPlanLogger sqlServerLogger = new QueryPlanLoggerSqlServer();
|
|
|
|
private static QueryPlanLogger oracleLogger = new QueryPlanLoggerOracle();
|
|
|
|
/**
|
|
* Returns the logger to log query plans for the given platform.
|
|
*/
|
|
public static QueryPlanLogger getLogger(Platform platform) {
|
|
|
|
switch (platform) {
|
|
case POSTGRES:
|
|
return postgresLogger;
|
|
|
|
case SQLSERVER:
|
|
case SQLSERVER16:
|
|
case SQLSERVER17:
|
|
return sqlServerLogger;
|
|
|
|
case ORACLE:
|
|
return oracleLogger;
|
|
|
|
default:
|
|
return explainLogger;
|
|
}
|
|
}
|
|
}
|