Tidy internal MTable only for test only constructor (remove @Deprecated)

This commit is contained in:
Rob Bygrave committed 2022-04-20 21:22:23 +12:00
1 parent 846afba724
commit 356af08f68
1 file changed
+11 -36
@@ -1,36 +1,12 @@
package io.ebeaninternal.dbmigration.model; package io.ebeaninternal.dbmigration.model;
import io.ebeaninternal.dbmigration.ddlgeneration.platform.DdlHelp; import io.ebeaninternal.dbmigration.ddlgeneration.platform.DdlHelp;
import io.ebeaninternal.dbmigration.migration.AddColumn; import io.ebeaninternal.dbmigration.migration.*;
import io.ebeaninternal.dbmigration.migration.AddHistoryTable; import io.ebeaninternal.server.deploy.*;
import io.ebeaninternal.dbmigration.migration.AddTableComment;
import io.ebeaninternal.dbmigration.migration.AlterColumn;
import io.ebeaninternal.dbmigration.migration.AlterTable;
import io.ebeaninternal.dbmigration.migration.Column;
import io.ebeaninternal.dbmigration.migration.CreateTable;
import io.ebeaninternal.dbmigration.migration.DropColumn;
import io.ebeaninternal.dbmigration.migration.DropHistoryTable;
import io.ebeaninternal.dbmigration.migration.DropTable;
import io.ebeaninternal.dbmigration.migration.ForeignKey;
import io.ebeaninternal.dbmigration.migration.RenameColumn;
import io.ebeaninternal.dbmigration.migration.UniqueConstraint;
import io.ebeaninternal.server.deploy.BeanDescriptor;
import io.ebeaninternal.server.deploy.BeanProperty;
import io.ebeaninternal.server.deploy.IdentityMode;
import io.ebeaninternal.server.deploy.PartitionMeta;
import io.ebeaninternal.server.deploy.TablespaceMeta;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.util.ArrayList; import java.util.*;
import java.util.Collection;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import static io.ebeaninternal.dbmigration.ddlgeneration.platform.SplitColumns.split; import static io.ebeaninternal.dbmigration.ddlgeneration.platform.SplitColumns.split;
import static io.ebeaninternal.dbmigration.model.MTableIdentity.fromCreateTable; import static io.ebeaninternal.dbmigration.model.MTableIdentity.fromCreateTable;
@@ -110,8 +86,7 @@ public class MTable {
/** /**
* Constructor for test cases only! * Constructor for test cases only!
*/ */
@Deprecated MTable(String name) {
public MTable(String name) {
this(name, null, null); this(name, null, null);
} }
@@ -121,7 +96,7 @@ public class MTable {
public MTable(String name, BeanDescriptor<?> descriptor) { public MTable(String name, BeanDescriptor<?> descriptor) {
this(name, descriptor.tablespaceMeta(), descriptor.storageEngine()); this(name, descriptor.tablespaceMeta(), descriptor.storageEngine());
} }
/** /**
* Constructor for dependant tables (draft/element collection or intersection). * Constructor for dependant tables (draft/element collection or intersection).
*/ */
@@ -161,8 +136,8 @@ public class MTable {
this.storageEngine = createTable.getStorageEngine(); this.storageEngine = createTable.getStorageEngine();
if (createTable.getTablespace() != null) { if (createTable.getTablespace() != null) {
this.tablespaceMeta = new TablespaceMeta(createTable.getTablespace(), this.tablespaceMeta = new TablespaceMeta(createTable.getTablespace(),
createTable.getIndexTablespace() != null ? createTable.getIndexTablespace() : createTable.getTablespace(), createTable.getIndexTablespace() != null ? createTable.getIndexTablespace() : createTable.getTablespace(),
createTable.getLobTablespace() != null ? createTable.getLobTablespace() : createTable.getTablespace()); createTable.getLobTablespace() != null ? createTable.getLobTablespace() : createTable.getTablespace());
} else { } else {
this.tablespaceMeta = null; this.tablespaceMeta = null;
} }
@@ -296,7 +271,7 @@ public class MTable {
compareCompoundKeys(modelDiff, newTable); compareCompoundKeys(modelDiff, newTable);
compareUniqueKeys(modelDiff, newTable); compareUniqueKeys(modelDiff, newTable);
compareTableAttrs(modelDiff, newTable); compareTableAttrs(modelDiff, newTable);
} }
private void compareColumns(ModelDiff modelDiff, MTable newTable) { private void compareColumns(ModelDiff modelDiff, MTable newTable) {
@@ -366,7 +341,7 @@ public class MTable {
modelDiff.addUniqueConstraint(newKey.addUniqueConstraint(name)); modelDiff.addUniqueConstraint(newKey.addUniqueConstraint(name));
} }
} }
private void compareTableAttrs(ModelDiff modelDiff, MTable newTable) { private void compareTableAttrs(ModelDiff modelDiff, MTable newTable) {
AlterTable alterTable = new AlterTable(); AlterTable alterTable = new AlterTable();
alterTable.setName(newTable.getName()); alterTable.setName(newTable.getName());
@@ -478,11 +453,11 @@ public class MTable {
public void setComment(String comment) { public void setComment(String comment) {
this.comment = comment; this.comment = comment;
} }
public void setTablespaceMeta(TablespaceMeta tablespaceMeta) { public void setTablespaceMeta(TablespaceMeta tablespaceMeta) {
this.tablespaceMeta = tablespaceMeta; this.tablespaceMeta = tablespaceMeta;
} }
public TablespaceMeta getTablespaceMeta() { public TablespaceMeta getTablespaceMeta() {
return tablespaceMeta; return tablespaceMeta;
} }