/** * Set default server and platform if necessary. */ protected void setDefaults() { if (server == null) { setServer(Ebean.getDefaultServer()); } if (databasePlatform == null && platforms.isEmpty()) { // not explicitly set not set a list of platforms so // default to the platform of the default server databasePlatform = server.getDatabasePlatform(); logger.debug("set platform to {}", databasePlatform.getName()); } }
/** * Set the DatabasePlatform if it has not already been set. */ private void setDatabasePlatform(ServerConfig config) { DatabasePlatform dbPlatform = config.getDatabasePlatform(); if (dbPlatform == null) { DatabasePlatformFactory factory = new DatabasePlatformFactory(); DatabasePlatform db = factory.create(config); config.setDatabasePlatform(db); logger.info("DatabasePlatform name:" + config.getName() + " platform:" + db.getName()); } }
/** * Set the DatabasePlatform if it has not already been set. */ private void setDatabasePlatform(ServerConfig config) { DatabasePlatform dbPlatform = config.getDatabasePlatform(); if (dbPlatform == null) { DatabasePlatformFactory factory = new DatabasePlatformFactory(); DatabasePlatform db = factory.create(config); config.setDatabasePlatform(db); logger.info("DatabasePlatform name:" + config.getName() + " platform:" + db.getName()); } }
protected void runCreateSql() throws IOException { if (createAllContent == null) { createAllContent = readFile(getCreateFileName()); } runScript(false, createAllContent, getCreateFileName()); String ignoreExtraDdl = System.getProperty("ebean.ignoreExtraDdl"); if (!"true".equalsIgnoreCase(ignoreExtraDdl)) { String extraApply = ExtraDdlXmlReader.buildExtra(server.getDatabasePlatform().getName()); if (extraApply != null) { runScript(false, extraApply, "extra-dll"); } } }
/** * Set the DatabasePlatform if it has not already been set. */ private void setDatabasePlatform(ServerConfig config) { DatabasePlatform dbPlatform = config.getDatabasePlatform(); if (dbPlatform == null) { if (config.getTenantMode().isDynamicDataSource()) { throw new IllegalStateException("DatabasePlatform must be explicitly set on ServerConfig for TenantMode "+config.getTenantMode()); } DatabasePlatformFactory factory = new DatabasePlatformFactory(); DatabasePlatform db = factory.create(config); db.configure(config.getDbTypeConfig()); config.setDatabasePlatform(db); logger.info("DatabasePlatform name:{} platform:{}", config.getName(), db.getName()); } }
/** * Generate "repeatable" migration scripts. * <p> * These take scrips from extra-dll.xml (typically views) and outputs "repeatable" * migration scripts (starting with "R__") to be run by FlywayDb or Ebean's own * migration runner. * </p> */ private void generateExtraDdl(File migrationDir, DatabasePlatform dbPlatform) throws IOException { if (dbPlatform != null) { ExtraDdl extraDdl = ExtraDdlXmlReader.read("/extra-ddl.xml"); if (extraDdl != null) { List<DdlScript> ddlScript = extraDdl.getDdlScript(); for (DdlScript script : ddlScript) { if (ExtraDdlXmlReader.matchPlatform(dbPlatform.getName(), script.getPlatforms())) { writeExtraDdl(migrationDir, script); } } } } }
if (dbPlatform.getName().startsWith("oracle")) { PstmtDelegate pstmtDelegate = serverConfig.getPstmtDelegate(); if (pstmtDelegate == null) {
if (dbPlatform.getName().startsWith("oracle")) { PstmtDelegate pstmtDelegate = serverConfig.getPstmtDelegate(); if (pstmtDelegate == null) {