#2357 - Modify ddl-generator CurrentModel away from deprecated methods

This commit is contained in:
rbygrave committed 2021-09-07 21:45:23 +12:00
1 parent 66143280fa
commit 3ac8d6e1d3
2 files changed
+8 -8

No files matched your search

@@ -128,7 +128,7 @@ public class DefaultDbMigration implements DbMigration {
@Override
public void setServer(Database database) {
this.server = (SpiEbeanServer) database;
setServerConfig(server.getServerConfig());
setServerConfig(server.config());
}
@Override
@@ -677,7 +677,7 @@ public class DefaultDbMigration implements DbMigration {
}
if (vanillaPlatform || databasePlatform == null) {
// not explicitly set so use the platform of the server
databasePlatform = server.getDatabasePlatform();
databasePlatform = server.databasePlatform();
}
if (databaseConfig != null) {
if (strictMode != null) {
@@ -42,7 +42,7 @@ public class CurrentModel {
* Construct with a given EbeanServer instance for DDL create all generation, not migration.
*/
public CurrentModel(SpiEbeanServer server) {
this(server, server.getServerConfig().getConstraintNaming(), true);
this(server, server.config().getConstraintNaming(), true);
}
/**
@@ -58,11 +58,11 @@ public class CurrentModel {
private CurrentModel(SpiEbeanServer server, DbConstraintNaming constraintNaming, boolean platformTypes) {
this.server = server;
this.databasePlatform = server.getDatabasePlatform();
this.databasePlatform = server.databasePlatform();
this.constraintNaming = constraintNaming;
this.platformTypes = platformTypes;
this.ddlHeader = server.getServerConfig().getDdlHeader();
this.jaxbPresent = Detect.isJAXBPresent(server.getServerConfig());
this.ddlHeader = server.config().getDdlHeader();
this.jaxbPresent = Detect.isJAXBPresent(server.config());
}
public DdlOptions getDdlOptions() {
@@ -139,7 +139,7 @@ public class CurrentModel {
if (extraDdl != null) {
List<DdlScript> ddlScript = extraDdl.getDdlScript();
for (DdlScript script : ddlScript) {
if (script.isInit() && matchPlatform(server.getDatabasePlatform().getPlatform(), script.getPlatforms())) {
if (script.isInit() && matchPlatform(server.platform(), script.getPlatforms())) {
ddl.append(prefix).append(script.getName()).append('\n');
ddl.append(script.getValue());
}
@@ -181,7 +181,7 @@ public class CurrentModel {
* Return the platform specific DdlHandler (to generate DDL).
*/
private DdlHandler handler() {
return PlatformDdlBuilder.create(databasePlatform).createDdlHandler(server.getServerConfig());
return PlatformDdlBuilder.create(databasePlatform).createDdlHandler(server.config());
}
/**