mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-13 06:42:57 +00:00
#2357 - Modify ddl-generator CurrentModel away from deprecated methods
This commit is contained in:
1 parent
66143280fa
commit
3ac8d6e1d3
2 files changed
+8
-8
No files matched your search
+2
-2
@@ -128,7 +128,7 @@ public class DefaultDbMigration implements DbMigration {
|
|||||||
@Override
|
@Override
|
||||||
public void setServer(Database database) {
|
public void setServer(Database database) {
|
||||||
this.server = (SpiEbeanServer) database;
|
this.server = (SpiEbeanServer) database;
|
||||||
setServerConfig(server.getServerConfig());
|
setServerConfig(server.config());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -677,7 +677,7 @@ public class DefaultDbMigration implements DbMigration {
|
|||||||
}
|
}
|
||||||
if (vanillaPlatform || databasePlatform == null) {
|
if (vanillaPlatform || databasePlatform == null) {
|
||||||
// not explicitly set so use the platform of the server
|
// not explicitly set so use the platform of the server
|
||||||
databasePlatform = server.getDatabasePlatform();
|
databasePlatform = server.databasePlatform();
|
||||||
}
|
}
|
||||||
if (databaseConfig != null) {
|
if (databaseConfig != null) {
|
||||||
if (strictMode != null) {
|
if (strictMode != null) {
|
||||||
|
|||||||
+6
-6
@@ -42,7 +42,7 @@ public class CurrentModel {
|
|||||||
* Construct with a given EbeanServer instance for DDL create all generation, not migration.
|
* Construct with a given EbeanServer instance for DDL create all generation, not migration.
|
||||||
*/
|
*/
|
||||||
public CurrentModel(SpiEbeanServer server) {
|
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) {
|
private CurrentModel(SpiEbeanServer server, DbConstraintNaming constraintNaming, boolean platformTypes) {
|
||||||
this.server = server;
|
this.server = server;
|
||||||
this.databasePlatform = server.getDatabasePlatform();
|
this.databasePlatform = server.databasePlatform();
|
||||||
this.constraintNaming = constraintNaming;
|
this.constraintNaming = constraintNaming;
|
||||||
this.platformTypes = platformTypes;
|
this.platformTypes = platformTypes;
|
||||||
this.ddlHeader = server.getServerConfig().getDdlHeader();
|
this.ddlHeader = server.config().getDdlHeader();
|
||||||
this.jaxbPresent = Detect.isJAXBPresent(server.getServerConfig());
|
this.jaxbPresent = Detect.isJAXBPresent(server.config());
|
||||||
}
|
}
|
||||||
|
|
||||||
public DdlOptions getDdlOptions() {
|
public DdlOptions getDdlOptions() {
|
||||||
@@ -139,7 +139,7 @@ public class CurrentModel {
|
|||||||
if (extraDdl != null) {
|
if (extraDdl != null) {
|
||||||
List<DdlScript> ddlScript = extraDdl.getDdlScript();
|
List<DdlScript> ddlScript = extraDdl.getDdlScript();
|
||||||
for (DdlScript script : ddlScript) {
|
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(prefix).append(script.getName()).append('\n');
|
||||||
ddl.append(script.getValue());
|
ddl.append(script.getValue());
|
||||||
}
|
}
|
||||||
@@ -181,7 +181,7 @@ public class CurrentModel {
|
|||||||
* Return the platform specific DdlHandler (to generate DDL).
|
* Return the platform specific DdlHandler (to generate DDL).
|
||||||
*/
|
*/
|
||||||
private DdlHandler handler() {
|
private DdlHandler handler() {
|
||||||
return PlatformDdlBuilder.create(databasePlatform).createDdlHandler(server.getServerConfig());
|
return PlatformDdlBuilder.create(databasePlatform).createDdlHandler(server.config());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in new issue
Block a user