From 71b7aa5946119c8f34ee1fa6f2ae7e2059e50815 Mon Sep 17 00:00:00 2001 From: Rob Bygrave Date: Mon, 16 May 2022 21:17:41 +1200 Subject: [PATCH] DDL - Add support for creating schema via database migrations (and create all ddl) Initially for H2 and Postgres, with commented out DDL for other platforms. --- .../ddlgeneration/BaseDdlHandler.java | 55 +- .../dbmigration/ddlgeneration/DdlHandler.java | 19 +- .../dbmigration/ddlgeneration/TableDdl.java | 21 +- .../ddlgeneration/platform/BaseTableDdl.java | 23 +- .../ddlgeneration/platform/H2Ddl.java | 3 +- .../ddlgeneration/platform/PlatformDdl.java | 17 +- .../ddlgeneration/platform/PostgresDdl.java | 1 + .../dbmigration/migration/AddColumn.java | 31 +- .../migration/AddHistoryTable.java | 20 +- .../migration/AddTableComment.java | 22 +- .../migration/AddUniqueConstraint.java | 30 +- .../dbmigration/migration/AlterColumn.java | 78 +- .../migration/AlterForeignKey.java | 34 +- .../migration/AlterHistoryTable.java | 20 +- .../dbmigration/migration/AlterTable.java | 863 ++++++++---------- .../dbmigration/migration/Application.java | 6 +- .../dbmigration/migration/Apply.java | 18 +- .../dbmigration/migration/ChangeSet.java | 69 +- .../dbmigration/migration/ChangeSetType.java | 17 +- .../dbmigration/migration/Column.java | 64 +- .../dbmigration/migration/Configuration.java | 24 +- .../dbmigration/migration/CreateIndex.java | 32 +- .../dbmigration/migration/CreateSchema.java | 49 + .../dbmigration/migration/CreateTable.java | 70 +- .../dbmigration/migration/DdlScript.java | 28 +- .../migration/DefaultTablespace.java | 24 +- .../dbmigration/migration/DropColumn.java | 24 +- .../migration/DropHistoryTable.java | 20 +- .../dbmigration/migration/DropIndex.java | 26 +- .../dbmigration/migration/DropTable.java | 24 +- .../dbmigration/migration/ForeignKey.java | 32 +- .../dbmigration/migration/IdentityType.java | 19 +- .../dbmigration/migration/Migration.java | 26 +- .../dbmigration/migration/ObjectFactory.java | 177 ++-- .../dbmigration/migration/RenameColumn.java | 26 +- .../dbmigration/migration/RenameTable.java | 22 +- .../dbmigration/migration/Rollback.java | 18 +- .../dbmigration/migration/Sql.java | 26 +- .../migration/UniqueConstraint.java | 28 +- .../dbmigration/model/ModelDiff.java | 32 +- .../main/resources/ebean-dbmigration-1.0.xsd | 12 +- .../platform/BaseTableDdlTest.java | 71 +- .../dbmigration/model/ModelContainerTest.java | 41 +- .../dbmigration/model/ModelDiffTest.java | 34 +- 44 files changed, 1098 insertions(+), 1198 deletions(-) create mode 100644 ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/CreateSchema.java diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/BaseDdlHandler.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/BaseDdlHandler.java index afa3e0a89..b997689e6 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/BaseDdlHandler.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/BaseDdlHandler.java @@ -3,25 +3,12 @@ package io.ebeaninternal.dbmigration.ddlgeneration; import io.ebean.config.DatabaseConfig; import io.ebeaninternal.dbmigration.ddlgeneration.platform.BaseTableDdl; import io.ebeaninternal.dbmigration.ddlgeneration.platform.PlatformDdl; -import io.ebeaninternal.dbmigration.migration.AddColumn; -import io.ebeaninternal.dbmigration.migration.AddHistoryTable; -import io.ebeaninternal.dbmigration.migration.AddTableComment; -import io.ebeaninternal.dbmigration.migration.AddUniqueConstraint; -import io.ebeaninternal.dbmigration.migration.AlterColumn; -import io.ebeaninternal.dbmigration.migration.AlterForeignKey; -import io.ebeaninternal.dbmigration.migration.AlterTable; -import io.ebeaninternal.dbmigration.migration.ChangeSet; -import io.ebeaninternal.dbmigration.migration.CreateIndex; -import io.ebeaninternal.dbmigration.migration.CreateTable; -import io.ebeaninternal.dbmigration.migration.DropColumn; -import io.ebeaninternal.dbmigration.migration.DropHistoryTable; -import io.ebeaninternal.dbmigration.migration.DropIndex; -import io.ebeaninternal.dbmigration.migration.DropTable; +import io.ebeaninternal.dbmigration.migration.*; import java.util.List; /** - * + * Base DDL handler. */ public class BaseDdlHandler implements DdlHandler { @@ -37,16 +24,12 @@ public class BaseDdlHandler implements DdlHandler { @Override public void generate(DdlWrite writer, ChangeSet changeSet) { - List changeSetChildren = changeSet.getChangeSetChildren(); + createSchemas(writer, changeSetChildren); + createTables(writer, changeSetChildren); for (Object change : changeSetChildren) { - if (change instanceof CreateTable) { - generate(writer, (CreateTable) change); - } - } - for (Object change : changeSetChildren) { - if (change instanceof CreateTable) { - // ignore + if (change instanceof CreateTable || change instanceof CreateSchema) { + // ignore, CreateSchema and CreateTable always done first } else if (change instanceof DropTable) { generate(writer, (DropTable) change); } else if (change instanceof AlterTable) { @@ -77,6 +60,27 @@ public class BaseDdlHandler implements DdlHandler { } } + private void createTables(DdlWrite writer, List changeSetChildren) { + for (Object change : changeSetChildren) { + if (change instanceof CreateTable) { + generate(writer, (CreateTable) change); + } + } + } + + private void createSchemas(DdlWrite writer, List changeSetChildren) { + boolean createdSchemas = false; + for (Object change : changeSetChildren) { + if (change instanceof CreateSchema) { + generate(writer, (CreateSchema) change); + createdSchemas = true; + } + } + if (createdSchemas) { + writer.apply().newLine(); + } + } + @Override public void generateProlog(DdlWrite writer) { tableDdl.generateProlog(writer); @@ -87,6 +91,11 @@ public class BaseDdlHandler implements DdlHandler { tableDdl.generateEpilog(writer); } + @Override + public void generate(DdlWrite writer, CreateSchema createSchema) { + tableDdl.generate(writer, createSchema); + } + @Override public void generate(DdlWrite writer, CreateTable createTable) { tableDdl.generate(writer, createTable); diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/DdlHandler.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/DdlHandler.java index 1090a8a24..5b6706e91 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/DdlHandler.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/DdlHandler.java @@ -1,19 +1,6 @@ package io.ebeaninternal.dbmigration.ddlgeneration; -import io.ebeaninternal.dbmigration.migration.AddColumn; -import io.ebeaninternal.dbmigration.migration.AddHistoryTable; -import io.ebeaninternal.dbmigration.migration.AddTableComment; -import io.ebeaninternal.dbmigration.migration.AddUniqueConstraint; -import io.ebeaninternal.dbmigration.migration.AlterColumn; -import io.ebeaninternal.dbmigration.migration.AlterForeignKey; -import io.ebeaninternal.dbmigration.migration.AlterTable; -import io.ebeaninternal.dbmigration.migration.ChangeSet; -import io.ebeaninternal.dbmigration.migration.CreateIndex; -import io.ebeaninternal.dbmigration.migration.CreateTable; -import io.ebeaninternal.dbmigration.migration.DropColumn; -import io.ebeaninternal.dbmigration.migration.DropHistoryTable; -import io.ebeaninternal.dbmigration.migration.DropIndex; -import io.ebeaninternal.dbmigration.migration.DropTable; +import io.ebeaninternal.dbmigration.migration.*; /** * DDL generation interface. @@ -22,10 +9,12 @@ public interface DdlHandler { void generate(DdlWrite writer, ChangeSet changeSet); + void generate(DdlWrite writer, CreateSchema createSchema); + void generate(DdlWrite writer, CreateTable createTable); void generate(DdlWrite writer, DropTable dropTable); - + void generate(DdlWrite writer, AlterTable dropTable); void generate(DdlWrite writer, AddTableComment addTableComment); diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/TableDdl.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/TableDdl.java index 48143afe6..4be154f95 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/TableDdl.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/TableDdl.java @@ -1,24 +1,17 @@ package io.ebeaninternal.dbmigration.ddlgeneration; -import io.ebeaninternal.dbmigration.migration.AddColumn; -import io.ebeaninternal.dbmigration.migration.AddHistoryTable; -import io.ebeaninternal.dbmigration.migration.AddTableComment; -import io.ebeaninternal.dbmigration.migration.AddUniqueConstraint; -import io.ebeaninternal.dbmigration.migration.AlterColumn; -import io.ebeaninternal.dbmigration.migration.AlterForeignKey; -import io.ebeaninternal.dbmigration.migration.AlterTable; -import io.ebeaninternal.dbmigration.migration.CreateIndex; -import io.ebeaninternal.dbmigration.migration.CreateTable; -import io.ebeaninternal.dbmigration.migration.DropColumn; -import io.ebeaninternal.dbmigration.migration.DropHistoryTable; -import io.ebeaninternal.dbmigration.migration.DropIndex; -import io.ebeaninternal.dbmigration.migration.DropTable; +import io.ebeaninternal.dbmigration.migration.*; /** * Write table DDL. */ public interface TableDdl { + /** + * Generate the create schema change. + */ + void generate(DdlWrite writer, CreateSchema createSchema); + /** * Generate the create table change. */ @@ -28,7 +21,7 @@ public interface TableDdl { * Write the drop column change. */ void generate(DdlWrite writer, DropTable dropTable); - + /** * Write alter table changes. */ diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/BaseTableDdl.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/BaseTableDdl.java index c44795191..d19096210 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/BaseTableDdl.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/BaseTableDdl.java @@ -10,23 +10,7 @@ import io.ebeaninternal.dbmigration.ddlgeneration.DdlBuffer; import io.ebeaninternal.dbmigration.ddlgeneration.DdlOptions; import io.ebeaninternal.dbmigration.ddlgeneration.DdlWrite; import io.ebeaninternal.dbmigration.ddlgeneration.TableDdl; -import io.ebeaninternal.dbmigration.migration.AddColumn; -import io.ebeaninternal.dbmigration.migration.AddHistoryTable; -import io.ebeaninternal.dbmigration.migration.AddTableComment; -import io.ebeaninternal.dbmigration.migration.AddUniqueConstraint; -import io.ebeaninternal.dbmigration.migration.AlterColumn; -import io.ebeaninternal.dbmigration.migration.AlterForeignKey; -import io.ebeaninternal.dbmigration.migration.AlterTable; -import io.ebeaninternal.dbmigration.migration.Column; -import io.ebeaninternal.dbmigration.migration.CreateIndex; -import io.ebeaninternal.dbmigration.migration.CreateTable; -import io.ebeaninternal.dbmigration.migration.DdlScript; -import io.ebeaninternal.dbmigration.migration.DropColumn; -import io.ebeaninternal.dbmigration.migration.DropHistoryTable; -import io.ebeaninternal.dbmigration.migration.DropIndex; -import io.ebeaninternal.dbmigration.migration.DropTable; -import io.ebeaninternal.dbmigration.migration.ForeignKey; -import io.ebeaninternal.dbmigration.migration.UniqueConstraint; +import io.ebeaninternal.dbmigration.migration.*; import io.ebeaninternal.dbmigration.model.MTable; import io.ebeaninternal.dbmigration.model.MTableIdentity; import io.ebeaninternal.server.deploy.IdentityMode; @@ -195,6 +179,11 @@ public class BaseTableDdl implements TableDdl { externalCompoundUnique.clear(); } + @Override + public void generate(DdlWrite writer, CreateSchema createSchema) { + platformDdl.createSchema(writer, createSchema); + } + /** * Generate the appropriate 'create table' and matching 'drop table' statements * and add them to the appropriate 'apply' and 'rollback' buffers. diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/H2Ddl.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/H2Ddl.java index 952fa9858..4043dc2e2 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/H2Ddl.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/H2Ddl.java @@ -8,10 +8,11 @@ import io.ebean.config.dbplatform.DatabasePlatform; public class H2Ddl extends PlatformDdl { private static boolean useV1Syntax = Boolean.getBoolean("ebean.h2.useV1Syntax"); - + public H2Ddl(DatabasePlatform platform) { super(platform); this.historyDdl = new H2HistoryDdl(); + this.createSchemaSupport = true; } /** diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/PlatformDdl.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/PlatformDdl.java index 5ade5a09a..c742e32ad 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/PlatformDdl.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/PlatformDdl.java @@ -12,10 +12,7 @@ import io.ebean.util.StringHelper; import io.ebeaninternal.dbmigration.ddlgeneration.*; import io.ebeaninternal.dbmigration.ddlgeneration.platform.util.PlatformTypeConverter; import io.ebeaninternal.dbmigration.ddlgeneration.platform.util.VowelRemover; -import io.ebeaninternal.dbmigration.migration.AddHistoryTable; -import io.ebeaninternal.dbmigration.migration.AlterColumn; -import io.ebeaninternal.dbmigration.migration.Column; -import io.ebeaninternal.dbmigration.migration.DropHistoryTable; +import io.ebeaninternal.dbmigration.migration.*; import io.ebeaninternal.dbmigration.model.MTable; import java.util.List; @@ -101,6 +98,9 @@ public class PlatformDdl { protected String updateNullWithDefault = "update ${table} set ${column} = ${default} where ${column} is null"; + protected boolean createSchemaSupport; + protected String createSchema = "create schema if not exists"; + protected String createTable = "create table"; protected String dropColumn = "drop column"; @@ -786,7 +786,7 @@ public class PlatformDdl { public void addTablePartition(DdlBuffer apply, String partitionMode, String partitionColumn) { // only supported by postgres initially } - + /** * Adds tablespace declaration. Now only supported for db2. */ @@ -816,4 +816,11 @@ public class PlatformDdl { return checkConstraint; } + public void createSchema(DdlWrite writer, CreateSchema request) { + DdlBuffer apply = writer.apply(); + if (!createSchemaSupport) { + apply.append("-- "); + } + apply.append(createSchema).append(" ").append(quote(request.getName())).endOfStatement(); + } } diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/PostgresDdl.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/PostgresDdl.java index 1618cfd9e..2e97f5c0f 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/PostgresDdl.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/PostgresDdl.java @@ -15,6 +15,7 @@ public class PostgresDdl extends PlatformDdl { public PostgresDdl(DatabasePlatform platform) { super(platform); this.historyDdl = new PostgresHistoryDdl(); + this.createSchemaSupport = true; this.dropTableCascade = " cascade"; this.columnSetType = "type "; this.alterTableIfExists = "if exists "; diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/AddColumn.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/AddColumn.java index 3de2c81ec..2586acf89 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/AddColumn.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/AddColumn.java @@ -1,11 +1,6 @@ package io.ebeaninternal.dbmigration.migration; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.*; import java.util.ArrayList; import java.util.List; @@ -16,17 +11,17 @@ import java.util.List; *

The following schema fragment specifies the expected content contained within this class. * *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}column" maxOccurs="unbounded"/>
- *       </sequence>
- *       <attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="withHistory" type="{http://www.w3.org/2001/XMLSchema}boolean" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}column" maxOccurs="unbounded"/>
+ *       </sequence>
+ *       <attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="withHistory" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
*/ @XmlAccessorType(XmlAccessType.FIELD) @@ -49,7 +44,7 @@ public class AddColumn { *

* This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. + * returned list will be present inside the Jakarta XML Binding object. * This is why there is not a set method for the column property. * *

diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/AddHistoryTable.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/AddHistoryTable.java index 5ea02ada8..e8e6b9420 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/AddHistoryTable.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/AddHistoryTable.java @@ -1,10 +1,6 @@ package io.ebeaninternal.dbmigration.migration; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.*; /** @@ -13,13 +9,13 @@ import javax.xml.bind.annotation.XmlType; *

The following schema fragment specifies the expected content contained within this class. * *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="baseTable" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="baseTable" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
*/ @XmlAccessorType(XmlAccessType.FIELD) diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/AddTableComment.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/AddTableComment.java index e8564fa0a..630ccbce9 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/AddTableComment.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/AddTableComment.java @@ -1,10 +1,6 @@ package io.ebeaninternal.dbmigration.migration; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.*; /** @@ -13,14 +9,14 @@ import javax.xml.bind.annotation.XmlType; *

The following schema fragment specifies the expected content contained within this class. * *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="comment" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="comment" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
*/ @XmlAccessorType(XmlAccessType.FIELD) diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/AddUniqueConstraint.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/AddUniqueConstraint.java index 5041a194e..a53b6cb65 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/AddUniqueConstraint.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/AddUniqueConstraint.java @@ -1,10 +1,6 @@ package io.ebeaninternal.dbmigration.migration; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.*; /** @@ -13,18 +9,18 @@ import javax.xml.bind.annotation.XmlType; *

The following schema fragment specifies the expected content contained within this class. * *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="constraintName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="columnNames" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="oneToOne" type="{http://www.w3.org/2001/XMLSchema}boolean" />
- *       <attribute name="nullableColumns" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="platforms" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="constraintName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="columnNames" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="oneToOne" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       <attribute name="nullableColumns" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="platforms" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
*/ @XmlAccessorType(XmlAccessType.FIELD) diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/AlterColumn.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/AlterColumn.java index 1723abc50..7082c03e2 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/AlterColumn.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/AlterColumn.java @@ -1,10 +1,6 @@ package io.ebeaninternal.dbmigration.migration; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.*; import java.util.ArrayList; import java.util.List; @@ -15,40 +11,40 @@ import java.util.List; *

The following schema fragment specifies the expected content contained within this class. * *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="before" type="{http://ebean-orm.github.io/xml/ns/dbmigration}ddl-script" maxOccurs="unbounded" minOccurs="0"/>
- *         <element name="after" type="{http://ebean-orm.github.io/xml/ns/dbmigration}ddl-script" maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <attribute name="columnName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="withHistory" type="{http://www.w3.org/2001/XMLSchema}boolean" />
- *       <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="currentType" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="defaultValue" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="currentDefaultValue" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="notnull" type="{http://www.w3.org/2001/XMLSchema}boolean" />
- *       <attribute name="currentNotnull" type="{http://www.w3.org/2001/XMLSchema}boolean" />
- *       <attribute name="comment" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="historyExclude" type="{http://www.w3.org/2001/XMLSchema}boolean" />
- *       <attribute name="checkConstraint" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="checkConstraintName" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="dropCheckConstraint" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="unique" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="uniqueOneToOne" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="dropUnique" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="references" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="foreignKeyName" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="foreignKeyIndex" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="foreignKeyOnDelete" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="foreignKeyOnUpdate" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="dropForeignKey" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="dropForeignKeyIndex" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="before" type="{http://ebean-orm.github.io/xml/ns/dbmigration}ddl-script" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="after" type="{http://ebean-orm.github.io/xml/ns/dbmigration}ddl-script" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="columnName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="withHistory" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="currentType" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="defaultValue" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="currentDefaultValue" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="notnull" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       <attribute name="currentNotnull" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       <attribute name="comment" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="historyExclude" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       <attribute name="checkConstraint" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="checkConstraintName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="dropCheckConstraint" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="unique" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="uniqueOneToOne" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="dropUnique" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="references" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="foreignKeyName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="foreignKeyIndex" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="foreignKeyOnDelete" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="foreignKeyOnUpdate" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="dropForeignKey" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="dropForeignKeyIndex" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
*/ @XmlAccessorType(XmlAccessType.FIELD) @@ -116,7 +112,7 @@ public class AlterColumn { *

* This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. + * returned list will be present inside the Jakarta XML Binding object. * This is why there is not a set method for the before property. * *

@@ -143,7 +139,7 @@ public class AlterColumn { *

* This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. + * returned list will be present inside the Jakarta XML Binding object. * This is why there is not a set method for the after property. * *

diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/AlterForeignKey.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/AlterForeignKey.java index deb5e812f..95996d71c 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/AlterForeignKey.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/AlterForeignKey.java @@ -1,10 +1,6 @@ package io.ebeaninternal.dbmigration.migration; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.*; /** @@ -13,20 +9,20 @@ import javax.xml.bind.annotation.XmlType; *

The following schema fragment specifies the expected content contained within this class. * *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="columnNames" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="refColumnNames" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="refTableName" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="indexName" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="onDelete" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="onUpdate" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="columnNames" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="refColumnNames" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="refTableName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="indexName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="onDelete" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="onUpdate" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
*/ @XmlAccessorType(XmlAccessType.FIELD) diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/AlterHistoryTable.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/AlterHistoryTable.java index f77e1d8f2..0f6d43dc0 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/AlterHistoryTable.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/AlterHistoryTable.java @@ -1,10 +1,6 @@ package io.ebeaninternal.dbmigration.migration; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.*; /** @@ -13,13 +9,13 @@ import javax.xml.bind.annotation.XmlType; *

The following schema fragment specifies the expected content contained within this class. * *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="baseTable" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="baseTable" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
*/ @XmlAccessorType(XmlAccessType.FIELD) diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/AlterTable.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/AlterTable.java index 9e697196c..fc37c8e63 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/AlterTable.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/AlterTable.java @@ -1,526 +1,443 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2022.02.01 at 12:03:38 PM CET -// - - package io.ebeaninternal.dbmigration.migration; +import javax.xml.bind.annotation.*; import java.math.BigInteger; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; /** *

Java class for anonymous complex type. - * + * *

The following schema fragment specifies the expected content contained within this class. - * + * *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attGroup ref="{http://ebean-orm.github.io/xml/ns/dbmigration}tablespaceAttributes"/>
- *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="newName" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="partitionMode" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="partitionColumn" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="identityType" type="{http://ebean-orm.github.io/xml/ns/dbmigration}identityType" />
- *       <attribute name="identityStart" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
- *       <attribute name="identityIncrement" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
- *       <attribute name="identityCache" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
- *       <attribute name="identityGenerated" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="sequenceName" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="sequenceInitial" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
- *       <attribute name="sequenceAllocate" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
- *       <attribute name="pkName" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="storageEngine" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attGroup ref="{http://ebean-orm.github.io/xml/ns/dbmigration}tablespaceAttributes"/>
+ *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="newName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="partitionMode" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="partitionColumn" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="identityType" type="{http://ebean-orm.github.io/xml/ns/dbmigration}identityType" />
+ *       <attribute name="identityStart" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *       <attribute name="identityIncrement" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *       <attribute name="identityCache" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *       <attribute name="identityGenerated" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="sequenceName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="sequenceInitial" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *       <attribute name="sequenceAllocate" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *       <attribute name="pkName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="storageEngine" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
- * - * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") @XmlRootElement(name = "alterTable") public class AlterTable { - @XmlAttribute(name = "name", required = true) - protected String name; - @XmlAttribute(name = "newName") - protected String newName; - @XmlAttribute(name = "partitionMode") - protected String partitionMode; - @XmlAttribute(name = "partitionColumn") - protected String partitionColumn; - @XmlAttribute(name = "identityType") - protected IdentityType identityType; - @XmlAttribute(name = "identityStart") - @XmlSchemaType(name = "positiveInteger") - protected BigInteger identityStart; - @XmlAttribute(name = "identityIncrement") - @XmlSchemaType(name = "positiveInteger") - protected BigInteger identityIncrement; - @XmlAttribute(name = "identityCache") - @XmlSchemaType(name = "positiveInteger") - protected BigInteger identityCache; - @XmlAttribute(name = "identityGenerated") - protected String identityGenerated; - @XmlAttribute(name = "sequenceName") - protected String sequenceName; - @XmlAttribute(name = "sequenceInitial") - @XmlSchemaType(name = "positiveInteger") - protected BigInteger sequenceInitial; - @XmlAttribute(name = "sequenceAllocate") - @XmlSchemaType(name = "positiveInteger") - protected BigInteger sequenceAllocate; - @XmlAttribute(name = "pkName") - protected String pkName; - @XmlAttribute(name = "storageEngine") - protected String storageEngine; - @XmlAttribute(name = "tablespace") - protected String tablespace; - @XmlAttribute(name = "indexTablespace") - protected String indexTablespace; - @XmlAttribute(name = "lobTablespace") - protected String lobTablespace; - @XmlAttribute(name = "comment") - protected String comment; + @XmlAttribute(name = "name", required = true) + protected String name; + @XmlAttribute(name = "newName") + protected String newName; + @XmlAttribute(name = "partitionMode") + protected String partitionMode; + @XmlAttribute(name = "partitionColumn") + protected String partitionColumn; + @XmlAttribute(name = "identityType") + protected IdentityType identityType; + @XmlAttribute(name = "identityStart") + @XmlSchemaType(name = "positiveInteger") + protected BigInteger identityStart; + @XmlAttribute(name = "identityIncrement") + @XmlSchemaType(name = "positiveInteger") + protected BigInteger identityIncrement; + @XmlAttribute(name = "identityCache") + @XmlSchemaType(name = "positiveInteger") + protected BigInteger identityCache; + @XmlAttribute(name = "identityGenerated") + protected String identityGenerated; + @XmlAttribute(name = "sequenceName") + protected String sequenceName; + @XmlAttribute(name = "sequenceInitial") + @XmlSchemaType(name = "positiveInteger") + protected BigInteger sequenceInitial; + @XmlAttribute(name = "sequenceAllocate") + @XmlSchemaType(name = "positiveInteger") + protected BigInteger sequenceAllocate; + @XmlAttribute(name = "pkName") + protected String pkName; + @XmlAttribute(name = "storageEngine") + protected String storageEngine; + @XmlAttribute(name = "tablespace") + protected String tablespace; + @XmlAttribute(name = "indexTablespace") + protected String indexTablespace; + @XmlAttribute(name = "lobTablespace") + protected String lobTablespace; + @XmlAttribute(name = "comment") + protected String comment; - /** - * Gets the value of the name property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getName() { - return name; - } + /** + * Gets the value of the name property. + * + * @return possible object is + * {@link String } + */ + public String getName() { + return name; + } - /** - * Sets the value of the name property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setName(String value) { - this.name = value; - } + /** + * Sets the value of the name property. + * + * @param value allowed object is + * {@link String } + */ + public void setName(String value) { + this.name = value; + } - /** - * Gets the value of the newName property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getNewName() { - return newName; - } + /** + * Gets the value of the newName property. + * + * @return possible object is + * {@link String } + */ + public String getNewName() { + return newName; + } - /** - * Sets the value of the newName property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setNewName(String value) { - this.newName = value; - } + /** + * Sets the value of the newName property. + * + * @param value allowed object is + * {@link String } + */ + public void setNewName(String value) { + this.newName = value; + } - /** - * Gets the value of the partitionMode property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getPartitionMode() { - return partitionMode; - } + /** + * Gets the value of the partitionMode property. + * + * @return possible object is + * {@link String } + */ + public String getPartitionMode() { + return partitionMode; + } - /** - * Sets the value of the partitionMode property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setPartitionMode(String value) { - this.partitionMode = value; - } + /** + * Sets the value of the partitionMode property. + * + * @param value allowed object is + * {@link String } + */ + public void setPartitionMode(String value) { + this.partitionMode = value; + } - /** - * Gets the value of the partitionColumn property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getPartitionColumn() { - return partitionColumn; - } + /** + * Gets the value of the partitionColumn property. + * + * @return possible object is + * {@link String } + */ + public String getPartitionColumn() { + return partitionColumn; + } - /** - * Sets the value of the partitionColumn property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setPartitionColumn(String value) { - this.partitionColumn = value; - } + /** + * Sets the value of the partitionColumn property. + * + * @param value allowed object is + * {@link String } + */ + public void setPartitionColumn(String value) { + this.partitionColumn = value; + } - /** - * Gets the value of the identityType property. - * - * @return - * possible object is - * {@link IdentityType } - * - */ - public IdentityType getIdentityType() { - return identityType; - } + /** + * Gets the value of the identityType property. + * + * @return possible object is + * {@link IdentityType } + */ + public IdentityType getIdentityType() { + return identityType; + } - /** - * Sets the value of the identityType property. - * - * @param value - * allowed object is - * {@link IdentityType } - * - */ - public void setIdentityType(IdentityType value) { - this.identityType = value; - } + /** + * Sets the value of the identityType property. + * + * @param value allowed object is + * {@link IdentityType } + */ + public void setIdentityType(IdentityType value) { + this.identityType = value; + } - /** - * Gets the value of the identityStart property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - public BigInteger getIdentityStart() { - return identityStart; - } + /** + * Gets the value of the identityStart property. + * + * @return possible object is + * {@link BigInteger } + */ + public BigInteger getIdentityStart() { + return identityStart; + } - /** - * Sets the value of the identityStart property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setIdentityStart(BigInteger value) { - this.identityStart = value; - } + /** + * Sets the value of the identityStart property. + * + * @param value allowed object is + * {@link BigInteger } + */ + public void setIdentityStart(BigInteger value) { + this.identityStart = value; + } - /** - * Gets the value of the identityIncrement property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - public BigInteger getIdentityIncrement() { - return identityIncrement; - } + /** + * Gets the value of the identityIncrement property. + * + * @return possible object is + * {@link BigInteger } + */ + public BigInteger getIdentityIncrement() { + return identityIncrement; + } - /** - * Sets the value of the identityIncrement property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setIdentityIncrement(BigInteger value) { - this.identityIncrement = value; - } + /** + * Sets the value of the identityIncrement property. + * + * @param value allowed object is + * {@link BigInteger } + */ + public void setIdentityIncrement(BigInteger value) { + this.identityIncrement = value; + } - /** - * Gets the value of the identityCache property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - public BigInteger getIdentityCache() { - return identityCache; - } + /** + * Gets the value of the identityCache property. + * + * @return possible object is + * {@link BigInteger } + */ + public BigInteger getIdentityCache() { + return identityCache; + } - /** - * Sets the value of the identityCache property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setIdentityCache(BigInteger value) { - this.identityCache = value; - } + /** + * Sets the value of the identityCache property. + * + * @param value allowed object is + * {@link BigInteger } + */ + public void setIdentityCache(BigInteger value) { + this.identityCache = value; + } - /** - * Gets the value of the identityGenerated property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getIdentityGenerated() { - return identityGenerated; - } + /** + * Gets the value of the identityGenerated property. + * + * @return possible object is + * {@link String } + */ + public String getIdentityGenerated() { + return identityGenerated; + } - /** - * Sets the value of the identityGenerated property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setIdentityGenerated(String value) { - this.identityGenerated = value; - } + /** + * Sets the value of the identityGenerated property. + * + * @param value allowed object is + * {@link String } + */ + public void setIdentityGenerated(String value) { + this.identityGenerated = value; + } - /** - * Gets the value of the sequenceName property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getSequenceName() { - return sequenceName; - } + /** + * Gets the value of the sequenceName property. + * + * @return possible object is + * {@link String } + */ + public String getSequenceName() { + return sequenceName; + } - /** - * Sets the value of the sequenceName property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setSequenceName(String value) { - this.sequenceName = value; - } + /** + * Sets the value of the sequenceName property. + * + * @param value allowed object is + * {@link String } + */ + public void setSequenceName(String value) { + this.sequenceName = value; + } - /** - * Gets the value of the sequenceInitial property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - public BigInteger getSequenceInitial() { - return sequenceInitial; - } + /** + * Gets the value of the sequenceInitial property. + * + * @return possible object is + * {@link BigInteger } + */ + public BigInteger getSequenceInitial() { + return sequenceInitial; + } - /** - * Sets the value of the sequenceInitial property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setSequenceInitial(BigInteger value) { - this.sequenceInitial = value; - } + /** + * Sets the value of the sequenceInitial property. + * + * @param value allowed object is + * {@link BigInteger } + */ + public void setSequenceInitial(BigInteger value) { + this.sequenceInitial = value; + } - /** - * Gets the value of the sequenceAllocate property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - public BigInteger getSequenceAllocate() { - return sequenceAllocate; - } + /** + * Gets the value of the sequenceAllocate property. + * + * @return possible object is + * {@link BigInteger } + */ + public BigInteger getSequenceAllocate() { + return sequenceAllocate; + } - /** - * Sets the value of the sequenceAllocate property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setSequenceAllocate(BigInteger value) { - this.sequenceAllocate = value; - } + /** + * Sets the value of the sequenceAllocate property. + * + * @param value allowed object is + * {@link BigInteger } + */ + public void setSequenceAllocate(BigInteger value) { + this.sequenceAllocate = value; + } - /** - * Gets the value of the pkName property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getPkName() { - return pkName; - } + /** + * Gets the value of the pkName property. + * + * @return possible object is + * {@link String } + */ + public String getPkName() { + return pkName; + } - /** - * Sets the value of the pkName property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setPkName(String value) { - this.pkName = value; - } + /** + * Sets the value of the pkName property. + * + * @param value allowed object is + * {@link String } + */ + public void setPkName(String value) { + this.pkName = value; + } - /** - * Gets the value of the storageEngine property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getStorageEngine() { - return storageEngine; - } + /** + * Gets the value of the storageEngine property. + * + * @return possible object is + * {@link String } + */ + public String getStorageEngine() { + return storageEngine; + } - /** - * Sets the value of the storageEngine property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setStorageEngine(String value) { - this.storageEngine = value; - } + /** + * Sets the value of the storageEngine property. + * + * @param value allowed object is + * {@link String } + */ + public void setStorageEngine(String value) { + this.storageEngine = value; + } - /** - * Gets the value of the tablespace property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getTablespace() { - return tablespace; - } + /** + * Gets the value of the tablespace property. + * + * @return possible object is + * {@link String } + */ + public String getTablespace() { + return tablespace; + } - /** - * Sets the value of the tablespace property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setTablespace(String value) { - this.tablespace = value; - } + /** + * Sets the value of the tablespace property. + * + * @param value allowed object is + * {@link String } + */ + public void setTablespace(String value) { + this.tablespace = value; + } - /** - * Gets the value of the indexTablespace property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getIndexTablespace() { - return indexTablespace; - } + /** + * Gets the value of the indexTablespace property. + * + * @return possible object is + * {@link String } + */ + public String getIndexTablespace() { + return indexTablespace; + } - /** - * Sets the value of the indexTablespace property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setIndexTablespace(String value) { - this.indexTablespace = value; - } - - /** - * Gets the value of the lobTablespace property. - * - * @return possible object is - * {@link String } - */ - public String getLobTablespace() { - return lobTablespace; - } + /** + * Sets the value of the indexTablespace property. + * + * @param value allowed object is + * {@link String } + */ + public void setIndexTablespace(String value) { + this.indexTablespace = value; + } - /** - * Sets the value of the lobTablespace property. - * - * @param value allowed object is - * {@link String } - */ - public void setLobTablespace(String value) { - this.lobTablespace = value; - } + /** + * Gets the value of the lobTablespace property. + * + * @return possible object is + * {@link String } + */ + public String getLobTablespace() { + return lobTablespace; + } - /** - * Gets the value of the comment property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getComment() { - return comment; - } + /** + * Sets the value of the lobTablespace property. + * + * @param value allowed object is + * {@link String } + */ + public void setLobTablespace(String value) { + this.lobTablespace = value; + } - /** - * Sets the value of the comment property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setComment(String value) { - this.comment = value; - } + /** + * Gets the value of the comment property. + * + * @return possible object is + * {@link String } + */ + public String getComment() { + return comment; + } + + /** + * Sets the value of the comment property. + * + * @param value allowed object is + * {@link String } + */ + public void setComment(String value) { + this.comment = value; + } } diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/Application.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/Application.java index 4ca4ee9fe..424c48a16 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/Application.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/Application.java @@ -1,10 +1,6 @@ package io.ebeaninternal.dbmigration.migration; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.*; /** diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/Apply.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/Apply.java index 8b9a3913d..a469e331a 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/Apply.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/Apply.java @@ -1,10 +1,6 @@ package io.ebeaninternal.dbmigration.migration; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; +import javax.xml.bind.annotation.*; /** @@ -13,12 +9,12 @@ import javax.xml.bind.annotation.XmlValue; *

The following schema fragment specifies the expected content contained within this class. * *

- * <complexType>
- *   <simpleContent>
- *     <extension base="<http://www.w3.org/2001/XMLSchema>string">
- *     </extension>
- *   </simpleContent>
- * </complexType>
+ * <complexType>
+ *   <simpleContent>
+ *     <extension base="<http://www.w3.org/2001/XMLSchema>string">
+ *     </extension>
+ *   </simpleContent>
+ * </complexType>
  * 
*/ @XmlAccessorType(XmlAccessType.FIELD) diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/ChangeSet.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/ChangeSet.java index 68d971f37..edc22f380 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/ChangeSet.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/ChangeSet.java @@ -1,12 +1,6 @@ package io.ebeaninternal.dbmigration.migration; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElements; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.*; import java.util.ArrayList; import java.util.List; @@ -17,23 +11,23 @@ import java.util.List; *

The following schema fragment specifies the expected content contained within this class. * *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <choice>
- *           <group ref="{http://ebean-orm.github.io/xml/ns/dbmigration}changeSetChildren" maxOccurs="unbounded" minOccurs="0"/>
- *         </choice>
- *       </sequence>
- *       <attribute name="type" use="required" type="{http://ebean-orm.github.io/xml/ns/dbmigration}changeSetType" />
- *       <attribute name="dropsFor" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="suppressDropsForever" type="{http://www.w3.org/2001/XMLSchema}boolean" />
- *       <attribute name="generated" type="{http://www.w3.org/2001/XMLSchema}boolean" />
- *       <attribute name="author" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="comment" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <choice>
+ *           <group ref="{http://ebean-orm.github.io/xml/ns/dbmigration}changeSetChildren" maxOccurs="unbounded" minOccurs="0"/>
+ *         </choice>
+ *       </sequence>
+ *       <attribute name="type" use="required" type="{http://ebean-orm.github.io/xml/ns/dbmigration}changeSetType" />
+ *       <attribute name="dropsFor" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="suppressDropsForever" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       <attribute name="generated" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       <attribute name="author" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="comment" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
*/ @XmlAccessorType(XmlAccessType.FIELD) @@ -46,6 +40,7 @@ public class ChangeSet { @XmlElements({ @XmlElement(name = "configuration", type = Configuration.class), @XmlElement(name = "sql", type = Sql.class), + @XmlElement(name = "createSchema", type = CreateSchema.class), @XmlElement(name = "createTable", type = CreateTable.class), @XmlElement(name = "alterTable", type = AlterTable.class), @XmlElement(name = "dropTable", type = DropTable.class), @@ -82,7 +77,7 @@ public class ChangeSet { *

* This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. + * returned list will be present inside the Jakarta XML Binding object. * This is why there is not a set method for the changeSetChildren property. * *

@@ -94,22 +89,24 @@ public class ChangeSet { * *

* Objects of the following type(s) are allowed in the list - * {@link Configuration } - * {@link Sql } - * {@link CreateTable } - * {@link DropTable } - * {@link RenameTable } + * {@link AddColumn } + * {@link AddHistoryTable } * {@link AddTableComment } * {@link AddUniqueConstraint } - * {@link AddHistoryTable } - * {@link DropHistoryTable } - * {@link AlterForeignKey } - * {@link AddColumn } - * {@link DropColumn } * {@link AlterColumn } - * {@link RenameColumn } + * {@link AlterForeignKey } + * {@link AlterTable } + * {@link Configuration } * {@link CreateIndex } + * {@link CreateSchema } + * {@link CreateTable } + * {@link DropColumn } + * {@link DropHistoryTable } * {@link DropIndex } + * {@link DropTable } + * {@link RenameColumn } + * {@link RenameTable } + * {@link Sql } */ public List getChangeSetChildren() { if (changeSetChildren == null) { diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/ChangeSetType.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/ChangeSetType.java index c3e8c80ed..8f15e8496 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/ChangeSetType.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/ChangeSetType.java @@ -9,16 +9,15 @@ import javax.xml.bind.annotation.XmlType; *

Java class for changeSetType. * *

The following schema fragment specifies the expected content contained within this class. - *

*

- * <simpleType name="changeSetType">
- *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
- *     <enumeration value="apply"/>
- *     <enumeration value="pendingDrops"/>
- *     <enumeration value="baseline"/>
- *     <enumeration value="drop"/>
- *   </restriction>
- * </simpleType>
+ * <simpleType name="changeSetType">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *     <enumeration value="apply"/>
+ *     <enumeration value="pendingDrops"/>
+ *     <enumeration value="baseline"/>
+ *     <enumeration value="drop"/>
+ *   </restriction>
+ * </simpleType>
  * 
*/ @XmlType(name = "changeSetType") diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/Column.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/Column.java index b393e1936..995c01fb9 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/Column.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/Column.java @@ -1,10 +1,6 @@ package io.ebeaninternal.dbmigration.migration; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.*; import java.util.ArrayList; import java.util.List; @@ -15,33 +11,33 @@ import java.util.List; *

The following schema fragment specifies the expected content contained within this class. * *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="before" type="{http://ebean-orm.github.io/xml/ns/dbmigration}ddl-script" maxOccurs="unbounded" minOccurs="0"/>
- *         <element name="after" type="{http://ebean-orm.github.io/xml/ns/dbmigration}ddl-script" maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="defaultValue" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="notnull" type="{http://www.w3.org/2001/XMLSchema}boolean" />
- *       <attribute name="historyExclude" type="{http://www.w3.org/2001/XMLSchema}boolean" />
- *       <attribute name="primaryKey" type="{http://www.w3.org/2001/XMLSchema}boolean" />
- *       <attribute name="identity" type="{http://www.w3.org/2001/XMLSchema}boolean" />
- *       <attribute name="checkConstraint" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="checkConstraintName" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="unique" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="uniqueOneToOne" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="references" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="foreignKeyName" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="foreignKeyIndex" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="foreignKeyOnDelete" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="foreignKeyOnUpdate" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="comment" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="before" type="{http://ebean-orm.github.io/xml/ns/dbmigration}ddl-script" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="after" type="{http://ebean-orm.github.io/xml/ns/dbmigration}ddl-script" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="defaultValue" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="notnull" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       <attribute name="historyExclude" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       <attribute name="primaryKey" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       <attribute name="identity" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       <attribute name="checkConstraint" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="checkConstraintName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="unique" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="uniqueOneToOne" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="references" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="foreignKeyName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="foreignKeyIndex" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="foreignKeyOnDelete" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="foreignKeyOnUpdate" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="comment" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
*/ @XmlAccessorType(XmlAccessType.FIELD) @@ -95,7 +91,7 @@ public class Column { *

* This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. + * returned list will be present inside the Jakarta XML Binding object. * This is why there is not a set method for the before property. * *

@@ -122,7 +118,7 @@ public class Column { *

* This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. + * returned list will be present inside the Jakarta XML Binding object. * This is why there is not a set method for the after property. * *

diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/Configuration.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/Configuration.java index dad4879b8..62c0deb46 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/Configuration.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/Configuration.java @@ -1,10 +1,6 @@ package io.ebeaninternal.dbmigration.migration; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.*; /** @@ -13,15 +9,15 @@ import javax.xml.bind.annotation.XmlType; *

The following schema fragment specifies the expected content contained within this class. * *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}defaultTablespace"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}defaultTablespace"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
*/ @XmlAccessorType(XmlAccessType.FIELD) diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/CreateIndex.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/CreateIndex.java index d3c796c8c..f0ec659d7 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/CreateIndex.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/CreateIndex.java @@ -1,10 +1,6 @@ package io.ebeaninternal.dbmigration.migration; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.*; /** @@ -13,19 +9,19 @@ import javax.xml.bind.annotation.XmlType; *

The following schema fragment specifies the expected content contained within this class. * *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="indexName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="columns" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="unique" type="{http://www.w3.org/2001/XMLSchema}boolean" />
- *       <attribute name="concurrent" type="{http://www.w3.org/2001/XMLSchema}boolean" />
- *       <attribute name="definition" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="platforms" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="indexName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="columns" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="unique" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       <attribute name="concurrent" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       <attribute name="definition" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="platforms" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
*/ @XmlAccessorType(XmlAccessType.FIELD) diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/CreateSchema.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/CreateSchema.java new file mode 100644 index 000000000..cc45c3b44 --- /dev/null +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/CreateSchema.java @@ -0,0 +1,49 @@ +package io.ebeaninternal.dbmigration.migration; + +import javax.xml.bind.annotation.*; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +@XmlRootElement(name = "createSchema") +public class CreateSchema { + + @XmlAttribute(name = "name") + protected String name; + + /** + * Gets the value of the name property. + * + * @return possible object is + * {@link String } + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value allowed object is + * {@link String } + */ + public void setName(String value) { + this.name = value; + } + +} diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/CreateTable.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/CreateTable.java index da87ee195..4c303d97d 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/CreateTable.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/CreateTable.java @@ -1,12 +1,6 @@ package io.ebeaninternal.dbmigration.migration; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.*; import java.math.BigInteger; import java.util.ArrayList; import java.util.List; @@ -18,33 +12,33 @@ import java.util.List; *

The following schema fragment specifies the expected content contained within this class. * *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}column" maxOccurs="unbounded"/>
- *         <element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}uniqueConstraint" maxOccurs="unbounded" minOccurs="0"/>
- *         <element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}foreignKey" maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <attGroup ref="{http://ebean-orm.github.io/xml/ns/dbmigration}tablespaceAttributes"/>
- *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="partitionMode" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="partitionColumn" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="withHistory" type="{http://www.w3.org/2001/XMLSchema}boolean" />
- *       <attribute name="draft" type="{http://www.w3.org/2001/XMLSchema}boolean" />
- *       <attribute name="identityType" type="{http://ebean-orm.github.io/xml/ns/dbmigration}identityType" />
- *       <attribute name="identityStart" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
- *       <attribute name="identityIncrement" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
- *       <attribute name="identityCache" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
- *       <attribute name="identityGenerated" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="sequenceName" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="sequenceInitial" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
- *       <attribute name="sequenceAllocate" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
- *       <attribute name="pkName" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="storageEngine" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}column" maxOccurs="unbounded"/>
+ *         <element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}uniqueConstraint" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}foreignKey" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *       <attGroup ref="{http://ebean-orm.github.io/xml/ns/dbmigration}tablespaceAttributes"/>
+ *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="partitionMode" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="partitionColumn" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="withHistory" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       <attribute name="draft" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       <attribute name="identityType" type="{http://ebean-orm.github.io/xml/ns/dbmigration}identityType" />
+ *       <attribute name="identityStart" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *       <attribute name="identityIncrement" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *       <attribute name="identityCache" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *       <attribute name="identityGenerated" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="sequenceName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="sequenceInitial" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *       <attribute name="sequenceAllocate" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *       <attribute name="pkName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="storageEngine" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
*/ @XmlAccessorType(XmlAccessType.FIELD) @@ -110,7 +104,7 @@ public class CreateTable { *

* This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. + * returned list will be present inside the Jakarta XML Binding object. * This is why there is not a set method for the column property. * *

@@ -137,7 +131,7 @@ public class CreateTable { *

* This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. + * returned list will be present inside the Jakarta XML Binding object. * This is why there is not a set method for the uniqueConstraint property. * *

@@ -164,7 +158,7 @@ public class CreateTable { *

* This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. + * returned list will be present inside the Jakarta XML Binding object. * This is why there is not a set method for the foreignKey property. * *

@@ -524,7 +518,7 @@ public class CreateTable { public void setIndexTablespace(String value) { this.indexTablespace = value; } - + /** * Gets the value of the lobTablespace property. * diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/DdlScript.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/DdlScript.java index 515073d68..e85add7c2 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/DdlScript.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/DdlScript.java @@ -1,10 +1,6 @@ package io.ebeaninternal.dbmigration.migration; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.*; import java.util.ArrayList; import java.util.List; @@ -15,16 +11,16 @@ import java.util.List; *

The following schema fragment specifies the expected content contained within this class. * *

- * <complexType name="ddl-script">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="ddl" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
- *       </sequence>
- *       <attribute name="platforms" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType name="ddl-script">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="ddl" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
+ *       </sequence>
+ *       <attribute name="platforms" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
*/ @XmlAccessorType(XmlAccessType.FIELD) @@ -44,7 +40,7 @@ public class DdlScript { *

* This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. + * returned list will be present inside the Jakarta XML Binding object. * This is why there is not a set method for the ddl property. * *

diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/DefaultTablespace.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/DefaultTablespace.java index 92fa6d744..25b63ad80 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/DefaultTablespace.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/DefaultTablespace.java @@ -1,10 +1,6 @@ package io.ebeaninternal.dbmigration.migration; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.*; /** @@ -13,15 +9,15 @@ import javax.xml.bind.annotation.XmlType; *

The following schema fragment specifies the expected content contained within this class. * *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="tables" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="indexes" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="history" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="tables" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="indexes" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="history" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
*/ @XmlAccessorType(XmlAccessType.FIELD) diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/DropColumn.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/DropColumn.java index 03062cff2..7c9906d83 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/DropColumn.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/DropColumn.java @@ -1,10 +1,6 @@ package io.ebeaninternal.dbmigration.migration; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.*; /** @@ -13,15 +9,15 @@ import javax.xml.bind.annotation.XmlType; *

The following schema fragment specifies the expected content contained within this class. * *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="columnName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="withHistory" type="{http://www.w3.org/2001/XMLSchema}boolean" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="columnName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="withHistory" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
*/ @XmlAccessorType(XmlAccessType.FIELD) diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/DropHistoryTable.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/DropHistoryTable.java index 608b2bc23..65b15e979 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/DropHistoryTable.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/DropHistoryTable.java @@ -1,10 +1,6 @@ package io.ebeaninternal.dbmigration.migration; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.*; /** @@ -13,13 +9,13 @@ import javax.xml.bind.annotation.XmlType; *

The following schema fragment specifies the expected content contained within this class. * *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="baseTable" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="baseTable" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
*/ @XmlAccessorType(XmlAccessType.FIELD) diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/DropIndex.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/DropIndex.java index 201634741..1104b31d1 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/DropIndex.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/DropIndex.java @@ -1,10 +1,6 @@ package io.ebeaninternal.dbmigration.migration; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.*; /** @@ -13,16 +9,16 @@ import javax.xml.bind.annotation.XmlType; *

The following schema fragment specifies the expected content contained within this class. * *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="indexName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="concurrent" type="{http://www.w3.org/2001/XMLSchema}boolean" />
- *       <attribute name="platforms" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="indexName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="concurrent" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       <attribute name="platforms" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
*/ @XmlAccessorType(XmlAccessType.FIELD) diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/DropTable.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/DropTable.java index beb22f36a..640c53ed1 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/DropTable.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/DropTable.java @@ -1,10 +1,6 @@ package io.ebeaninternal.dbmigration.migration; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.*; /** @@ -13,15 +9,15 @@ import javax.xml.bind.annotation.XmlType; *

The following schema fragment specifies the expected content contained within this class. * *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="sequenceCol" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="sequenceName" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="sequenceCol" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="sequenceName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
*/ @XmlAccessorType(XmlAccessType.FIELD) diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/ForeignKey.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/ForeignKey.java index 867e918cf..7673fa881 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/ForeignKey.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/ForeignKey.java @@ -1,10 +1,6 @@ package io.ebeaninternal.dbmigration.migration; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.*; /** @@ -13,19 +9,19 @@ import javax.xml.bind.annotation.XmlType; *

The following schema fragment specifies the expected content contained within this class. * *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="columnNames" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="refColumnNames" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="refTableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="indexName" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="onDelete" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="onUpdate" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="columnNames" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="refColumnNames" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="refTableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="indexName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="onDelete" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="onUpdate" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
*/ @XmlAccessorType(XmlAccessType.FIELD) diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/IdentityType.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/IdentityType.java index 3d59cd0ce..50eba9dad 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/IdentityType.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/IdentityType.java @@ -9,17 +9,16 @@ import javax.xml.bind.annotation.XmlType; *

Java class for identityType. * *

The following schema fragment specifies the expected content contained within this class. - *

*

- * <simpleType name="identityType">
- *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
- *     <enumeration value="identity"/>
- *     <enumeration value="sequence"/>
- *     <enumeration value="generator"/>
- *     <enumeration value="external"/>
- *     <enumeration value="default"/>
- *   </restriction>
- * </simpleType>
+ * <simpleType name="identityType">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *     <enumeration value="identity"/>
+ *     <enumeration value="sequence"/>
+ *     <enumeration value="generator"/>
+ *     <enumeration value="external"/>
+ *     <enumeration value="default"/>
+ *   </restriction>
+ * </simpleType>
  * 
*/ @XmlType(name = "identityType") diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/Migration.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/Migration.java index c830a44d0..78bc2ef99 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/Migration.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/Migration.java @@ -1,10 +1,6 @@ package io.ebeaninternal.dbmigration.migration; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.*; import java.util.ArrayList; import java.util.List; @@ -15,15 +11,15 @@ import java.util.List; *

The following schema fragment specifies the expected content contained within this class. * *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}changeSet" maxOccurs="unbounded"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}changeSet" maxOccurs="unbounded"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
*/ @XmlAccessorType(XmlAccessType.FIELD) @@ -42,7 +38,7 @@ public class Migration { *

* This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. + * returned list will be present inside the Jakarta XML Binding object. * This is why there is not a set method for the changeSet property. * *

diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/ObjectFactory.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/ObjectFactory.java index 38e530287..85e04f4a7 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/ObjectFactory.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/ObjectFactory.java @@ -27,10 +27,59 @@ public class ObjectFactory { } /** - * Create an instance of {@link AddUniqueConstraint } + * Create an instance of {@link Migration } */ - public AddUniqueConstraint createAddUniqueConstraint() { - return new AddUniqueConstraint(); + public Migration createMigration() { + return new Migration(); + } + + /** + * Create an instance of {@link ChangeSet } + */ + public ChangeSet createChangeSet() { + return new ChangeSet(); + } + + /** + * Create an instance of {@link Configuration } + */ + public Configuration createConfiguration() { + return new Configuration(); + } + + /** + * Create an instance of {@link DefaultTablespace } + */ + public DefaultTablespace createDefaultTablespace() { + return new DefaultTablespace(); + } + + /** + * Create an instance of {@link Sql } + */ + public Sql createSql() { + return new Sql(); + } + + /** + * Create an instance of {@link Apply } + */ + public Apply createApply() { + return new Apply(); + } + + /** + * Create an instance of {@link Rollback } + */ + public Rollback createRollback() { + return new Rollback(); + } + + /** + * Create an instance of {@link CreateSchema } + */ + public CreateSchema createCreateSchema() { + return new CreateSchema(); } /** @@ -69,17 +118,17 @@ public class ObjectFactory { } /** - * Create an instance of {@link Configuration } + * Create an instance of {@link AlterTable } */ - public Configuration createConfiguration() { - return new Configuration(); + public AlterTable createAlterTable() { + return new AlterTable(); } /** - * Create an instance of {@link DefaultTablespace } + * Create an instance of {@link DropTable } */ - public DefaultTablespace createDefaultTablespace() { - return new DefaultTablespace(); + public DropTable createDropTable() { + return new DropTable(); } /** @@ -89,6 +138,27 @@ public class ObjectFactory { return new RenameTable(); } + /** + * Create an instance of {@link AddTableComment } + */ + public AddTableComment createAddTableComment() { + return new AddTableComment(); + } + + /** + * Create an instance of {@link AddUniqueConstraint } + */ + public AddUniqueConstraint createAddUniqueConstraint() { + return new AddUniqueConstraint(); + } + + /** + * Create an instance of {@link AddHistoryTable } + */ + public AddHistoryTable createAddHistoryTable() { + return new AddHistoryTable(); + } + /** * Create an instance of {@link DropHistoryTable } */ @@ -103,55 +173,6 @@ public class ObjectFactory { return new AlterForeignKey(); } - /** - * Create an instance of {@link DropColumn } - */ - public DropColumn createDropColumn() { - return new DropColumn(); - } - - /** - * Create an instance of {@link Sql } - */ - public Sql createSql() { - return new Sql(); - } - - /** - * Create an instance of {@link Apply } - */ - public Apply createApply() { - return new Apply(); - } - - /** - * Create an instance of {@link Rollback } - */ - public Rollback createRollback() { - return new Rollback(); - } - - /** - * Create an instance of {@link DropIndex } - */ - public DropIndex createDropIndex() { - return new DropIndex(); - } - - /** - * Create an instance of {@link RenameColumn } - */ - public RenameColumn createRenameColumn() { - return new RenameColumn(); - } - - /** - * Create an instance of {@link DropTable } - */ - public DropTable createDropTable() { - return new DropTable(); - } - /** * Create an instance of {@link AddColumn } */ @@ -160,10 +181,10 @@ public class ObjectFactory { } /** - * Create an instance of {@link AddTableComment } + * Create an instance of {@link DropColumn } */ - public AddTableComment createAddTableComment() { - return new AddTableComment(); + public DropColumn createDropColumn() { + return new DropColumn(); } /** @@ -173,6 +194,13 @@ public class ObjectFactory { return new AlterColumn(); } + /** + * Create an instance of {@link RenameColumn } + */ + public RenameColumn createRenameColumn() { + return new RenameColumn(); + } + /** * Create an instance of {@link CreateIndex } */ @@ -181,24 +209,10 @@ public class ObjectFactory { } /** - * Create an instance of {@link ChangeSet } + * Create an instance of {@link DropIndex } */ - public ChangeSet createChangeSet() { - return new ChangeSet(); - } - - /** - * Create an instance of {@link AlterTable } - */ - public AlterTable createAlterTable() { - return new AlterTable(); - } - - /** - * Create an instance of {@link AddHistoryTable } - */ - public AddHistoryTable createAddHistoryTable() { - return new AddHistoryTable(); + public DropIndex createDropIndex() { + return new DropIndex(); } /** @@ -208,11 +222,4 @@ public class ObjectFactory { return new AlterHistoryTable(); } - /** - * Create an instance of {@link Migration } - */ - public Migration createMigration() { - return new Migration(); - } - } diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/RenameColumn.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/RenameColumn.java index 23c8bee30..4535c5eec 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/RenameColumn.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/RenameColumn.java @@ -1,10 +1,6 @@ package io.ebeaninternal.dbmigration.migration; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.*; /** @@ -13,16 +9,16 @@ import javax.xml.bind.annotation.XmlType; *

The following schema fragment specifies the expected content contained within this class. * *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="oldName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="newName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="dataType" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="oldName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="newName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="dataType" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
*/ @XmlAccessorType(XmlAccessType.FIELD) diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/RenameTable.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/RenameTable.java index 02221fcb6..6e45cbba8 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/RenameTable.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/RenameTable.java @@ -1,10 +1,6 @@ package io.ebeaninternal.dbmigration.migration; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.*; /** @@ -13,14 +9,14 @@ import javax.xml.bind.annotation.XmlType; *

The following schema fragment specifies the expected content contained within this class. * *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="oldName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="newName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="oldName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="newName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
*/ @XmlAccessorType(XmlAccessType.FIELD) diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/Rollback.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/Rollback.java index 994b201c3..893356679 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/Rollback.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/Rollback.java @@ -1,10 +1,6 @@ package io.ebeaninternal.dbmigration.migration; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; +import javax.xml.bind.annotation.*; /** @@ -13,12 +9,12 @@ import javax.xml.bind.annotation.XmlValue; *

The following schema fragment specifies the expected content contained within this class. * *

- * <complexType>
- *   <simpleContent>
- *     <extension base="<http://www.w3.org/2001/XMLSchema>string">
- *     </extension>
- *   </simpleContent>
- * </complexType>
+ * <complexType>
+ *   <simpleContent>
+ *     <extension base="<http://www.w3.org/2001/XMLSchema>string">
+ *     </extension>
+ *   </simpleContent>
+ * </complexType>
  * 
*/ @XmlAccessorType(XmlAccessType.FIELD) diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/Sql.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/Sql.java index 02532da78..954ac5a02 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/Sql.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/Sql.java @@ -1,10 +1,6 @@ package io.ebeaninternal.dbmigration.migration; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.*; /** @@ -13,16 +9,16 @@ import javax.xml.bind.annotation.XmlType; *

The following schema fragment specifies the expected content contained within this class. * *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}apply"/>
- *         <element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}rollback"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}apply"/>
+ *         <element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}rollback"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
*/ @XmlAccessorType(XmlAccessType.FIELD) diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/UniqueConstraint.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/UniqueConstraint.java index f4abbe7b7..47b22f02e 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/UniqueConstraint.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/migration/UniqueConstraint.java @@ -1,10 +1,6 @@ package io.ebeaninternal.dbmigration.migration; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.*; /** @@ -13,17 +9,17 @@ import javax.xml.bind.annotation.XmlType; *

The following schema fragment specifies the expected content contained within this class. * *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="columnNames" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="oneToOne" type="{http://www.w3.org/2001/XMLSchema}boolean" />
- *       <attribute name="nullableColumns" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="platforms" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="columnNames" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="oneToOne" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       <attribute name="nullableColumns" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="platforms" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
  * 
*/ @XmlAccessorType(XmlAccessType.FIELD) diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/model/ModelDiff.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/model/ModelDiff.java index 9bf5cf0d0..1ba81b249 100644 --- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/model/ModelDiff.java +++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/model/ModelDiff.java @@ -1,23 +1,11 @@ package io.ebeaninternal.dbmigration.model; -import io.ebeaninternal.dbmigration.migration.AddColumn; -import io.ebeaninternal.dbmigration.migration.AddHistoryTable; -import io.ebeaninternal.dbmigration.migration.AddTableComment; -import io.ebeaninternal.dbmigration.migration.AddUniqueConstraint; -import io.ebeaninternal.dbmigration.migration.AlterColumn; -import io.ebeaninternal.dbmigration.migration.AlterForeignKey; -import io.ebeaninternal.dbmigration.migration.AlterTable; -import io.ebeaninternal.dbmigration.migration.ChangeSet; -import io.ebeaninternal.dbmigration.migration.ChangeSetType; -import io.ebeaninternal.dbmigration.migration.CreateIndex; -import io.ebeaninternal.dbmigration.migration.DropColumn; -import io.ebeaninternal.dbmigration.migration.DropHistoryTable; -import io.ebeaninternal.dbmigration.migration.DropIndex; -import io.ebeaninternal.dbmigration.migration.Migration; +import io.ebeaninternal.dbmigration.migration.*; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Set; /** * Used to prepare a diff in terms of changes required to migrate from @@ -117,9 +105,15 @@ public class ModelDiff { * Compare to a 'newer' model and collect the differences. */ public void compareTo(ModelContainer newModel) { + Set baseSchemas = baseModel.getSchemas(); + for (String schema : newModel.getSchemas()) { + if (!baseSchemas.contains(schema)) { + addCreateSchema(schema); + } + } + Map newTables = newModel.getTables(); for (MTable newTable : newTables.values()) { - MTable currentTable = baseModel.getTable(newTable.getName()); if (currentTable == null) { addNewTable(newTable); @@ -159,6 +153,12 @@ public class ModelDiff { } } + protected void addCreateSchema(String schema) { + CreateSchema createSchema = new CreateSchema(); + createSchema.setName(schema); + applyChanges.add(createSchema); + } + protected void addDropTable(MTable existingTable) { dropChanges.add(existingTable.dropTable()); } @@ -253,7 +253,7 @@ public class ModelDiff { public void addAlterForeignKey(AlterForeignKey alterForeignKey) { applyChanges.add(alterForeignKey); } - + /** * Adds a table alter. */ diff --git a/ebean-ddl-generator/src/main/resources/ebean-dbmigration-1.0.xsd b/ebean-ddl-generator/src/main/resources/ebean-dbmigration-1.0.xsd index e7ef14be7..382e176b7 100644 --- a/ebean-ddl-generator/src/main/resources/ebean-dbmigration-1.0.xsd +++ b/ebean-ddl-generator/src/main/resources/ebean-dbmigration-1.0.xsd @@ -97,6 +97,12 @@ + + + + + + @@ -218,7 +224,7 @@ - + @@ -238,7 +244,7 @@ - + @@ -372,6 +378,7 @@ + @@ -390,7 +397,6 @@ - diff --git a/ebean-ddl-generator/src/test/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/BaseTableDdlTest.java b/ebean-ddl-generator/src/test/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/BaseTableDdlTest.java index 893ced81d..921769dc4 100644 --- a/ebean-ddl-generator/src/test/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/BaseTableDdlTest.java +++ b/ebean-ddl-generator/src/test/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/BaseTableDdlTest.java @@ -5,13 +5,11 @@ import io.ebean.platform.clickhouse.ClickHousePlatform; import io.ebean.platform.h2.H2Platform; import io.ebean.platform.mysql.MySqlPlatform; import io.ebean.platform.oracle.OraclePlatform; +import io.ebeaninternal.dbmigration.ddlgeneration.BaseDdlHandler; import io.ebeaninternal.dbmigration.ddlgeneration.DdlWrite; import io.ebeaninternal.dbmigration.ddlgeneration.Helper; import io.ebeaninternal.dbmigration.ddlgeneration.PlatformDdlBuilder; -import io.ebeaninternal.dbmigration.migration.AddTableComment; -import io.ebeaninternal.dbmigration.migration.AlterColumn; -import io.ebeaninternal.dbmigration.migration.Column; -import io.ebeaninternal.dbmigration.migration.CreateTable; +import io.ebeaninternal.dbmigration.migration.*; import org.junit.jupiter.api.Test; import java.util.List; @@ -19,14 +17,53 @@ import java.util.List; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; - -public class BaseTableDdlTest { +class BaseTableDdlTest { private final DatabaseConfig serverConfig = new DatabaseConfig(); private final PlatformDdl h2ddl = PlatformDdlBuilder.create(new H2Platform()); @Test - public void testAlterColumn() { + void createSchema_h2() { + BaseTableDdl ddlGen = new BaseTableDdl(serverConfig, h2ddl); + + CreateSchema createSchema = new CreateSchema(); + createSchema.setName("foo"); + + DdlWrite writer = new DdlWrite(); + ddlGen.generate(writer, createSchema); + + String ddl = writer.toString(); + assertThat(ddl).contains("-- apply changes\n"); + assertThat(ddl).contains("create schema if not exists foo;"); + } + + @Test + void createSchema_oracle() { + final PlatformDdl oraDDL = PlatformDdlBuilder.create(new OraclePlatform()); + BaseTableDdl ddlGen = new BaseTableDdl(serverConfig, oraDDL); + + CreateSchema createSchema = new CreateSchema(); + createSchema.setName("foo"); + + DdlWrite writer = new DdlWrite(); + ddlGen.generate(writer, createSchema); + assertThat(writer.toString()) + .contains("-- apply changes\n") + .contains("-- create schema if not exists foo;"); + + ChangeSet changeSet = new ChangeSet(); + changeSet.getChangeSetChildren().add(createSchema); + + BaseDdlHandler ddlHandler = new BaseDdlHandler(new DatabaseConfig(), oraDDL); + DdlWrite writer2 = new DdlWrite(); + ddlHandler.generate(writer2, changeSet); + assertThat(writer.toString()) + .contains("-- apply changes\n") + .contains("-- create schema if not exists foo;"); + } + + @Test + void testAlterColumn() { BaseTableDdl ddlGen = new BaseTableDdl(serverConfig, h2ddl); DdlWrite writer = new DdlWrite(); @@ -44,8 +81,7 @@ public class BaseTableDdlTest { } @Test - public void testAddColumn_withTypeConversion() { - + void testAddColumn_withTypeConversion() { BaseTableDdl ddlGen = new BaseTableDdl(serverConfig, PlatformDdlBuilder.create(new OraclePlatform())); DdlWrite writer = new DdlWrite(); @@ -61,8 +97,7 @@ public class BaseTableDdlTest { } @Test - public void testAddColumn_withTypeConversion_clickHouseVarchar() { - + void testAddColumn_withTypeConversion_clickHouseVarchar() { ClickHouseTableDdl ddlGen = new ClickHouseTableDdl(serverConfig, PlatformDdlBuilder.create(new ClickHousePlatform())); DdlWrite writer = new DdlWrite(); @@ -78,8 +113,7 @@ public class BaseTableDdlTest { } @Test - public void testAlterColumnComment() { - + void testAlterColumnComment() { BaseTableDdl ddlGen = new BaseTableDdl(serverConfig, h2ddl); DdlWrite writer = new DdlWrite(); @@ -96,7 +130,7 @@ public class BaseTableDdlTest { } @Test - public void alterTableAddColumnWithComment() { + void alterTableAddColumnWithComment() { BaseTableDdl ddl = new BaseTableDdl(serverConfig, h2ddl); DdlWrite writer = new DdlWrite(); Column column = new Column(); @@ -111,8 +145,7 @@ public class BaseTableDdlTest { } @Test - public void testAddTableComment() { - + void testAddTableComment() { BaseTableDdl ddlGen = new BaseTableDdl(serverConfig, h2ddl); DdlWrite writer = new DdlWrite(); @@ -128,8 +161,7 @@ public class BaseTableDdlTest { } @Test - public void testAddTableComment_mysql() { - + void testAddTableComment_mysql() { BaseTableDdl ddlGen = new BaseTableDdl(serverConfig, PlatformDdlBuilder.create(new MySqlPlatform())); DdlWrite writer = new DdlWrite(); @@ -145,8 +177,7 @@ public class BaseTableDdlTest { } @Test - public void testGenerate() throws Exception { - + void testGenerate() throws Exception { BaseTableDdl ddlGen = new BaseTableDdl(serverConfig, h2ddl); DdlWrite writer = new DdlWrite(); diff --git a/ebean-ddl-generator/src/test/java/io/ebeaninternal/dbmigration/model/ModelContainerTest.java b/ebean-ddl-generator/src/test/java/io/ebeaninternal/dbmigration/model/ModelContainerTest.java index c76906fd1..2e1272980 100644 --- a/ebean-ddl-generator/src/test/java/io/ebeaninternal/dbmigration/model/ModelContainerTest.java +++ b/ebean-ddl-generator/src/test/java/io/ebeaninternal/dbmigration/model/ModelContainerTest.java @@ -2,10 +2,7 @@ package io.ebeaninternal.dbmigration.model; import io.ebean.migration.MigrationVersion; -import io.ebeaninternal.dbmigration.migration.DropHistoryTable; -import io.ebeaninternal.dbmigration.migration.DropIndex; -import io.ebeaninternal.dbmigration.migration.DropTable; -import io.ebeaninternal.dbmigration.migration.Migration; +import io.ebeaninternal.dbmigration.migration.*; import io.ebeaninternal.dbmigration.migrationreader.MigrationXmlReader; import org.junit.jupiter.api.Test; @@ -14,11 +11,10 @@ import java.util.Set; import static org.assertj.core.api.Assertions.assertThat; -public class ModelContainerTest { +class ModelContainerTest { @Test - public void elementCollectionTable_single_expect_foreignKeys() { - + void elementCollectionTable_single_expect_foreignKeys() { ModelContainer container = new ModelContainer(); container.addTableElementCollection(createElementCollectionTable("ec_bean.id", "fk_ec_bean_ec_table")); @@ -29,8 +25,7 @@ public class ModelContainerTest { } @Test - public void elementCollectionTable_reused_expect_noForeignKeys() { - + void elementCollectionTable_reused_expect_noForeignKeys() { ModelContainer container = new ModelContainer(); container.addTableElementCollection(createElementCollectionTable("ec_bean.id", "fk_ec_bean_ec_table")); @@ -47,7 +42,6 @@ public class ModelContainerTest { } private MTable createElementCollectionTable(String references, String fkName) { - MTable ecTable = new MTable("ec_table"); final MColumn colFk = new MColumn("fk_col", "varchar", true); colFk.setReferences(references); @@ -62,8 +56,7 @@ public class ModelContainerTest { } @Test - public void apply_when_noPendingDrops_then_emptyPending() { - + void apply_when_noPendingDrops_then_emptyPending() { ModelContainer container = new ModelContainer(); container.apply(mig("1.0.model.xml"), ver("1.1")); assertThat(container.getPendingDrops()).isEmpty(); @@ -71,8 +64,7 @@ public class ModelContainerTest { @Test - public void apply_when_pendingDrops_then_registeredHistoryTable() { - + void apply_when_pendingDrops_then_registeredHistoryTable() { ModelContainer base = container_1_1(); MTable table = base.getTable("document"); @@ -85,8 +77,7 @@ public class ModelContainerTest { @Test - public void apply_when_pendingDropsApplied_then_droppedTableNotInHistory() { - + void apply_when_pendingDropsApplied_then_droppedTableNotInHistory() { ModelContainer container = container_1_1(); container.apply(mig("1.1_2__drops.model.xml"), ver("1.1_2")); @@ -99,8 +90,7 @@ public class ModelContainerTest { } @Test - public void apply_when_apply_partial_pendingDrops_then_some_remainder() { - + void apply_when_apply_partial_pendingDrops_then_some_remainder() { ModelContainer container = container_2_1(); container.apply(mig("2.2__drops.model.xml"), ver("2.2")); @@ -116,30 +106,28 @@ public class ModelContainerTest { } @Test - public void apply_sql() { + void apply_sql() { ModelContainer container = new ModelContainer(); container.apply(mig("3.0__rawSql.model.xml"), ver("3.0")); assertThat(container.getPendingDrops()).isEmpty(); } @Test - public void apply_alterForeignKey() { + void apply_alterForeignKey() { ModelContainer container = new ModelContainer(); container.apply(mig("4.0__alterForeignKey.model.xml"), ver("4.0")); assertThat(container.getPendingDrops()).isEmpty(); } @Test - public void apply_dropTable_when_notInModel_then_ok() { - + void apply_dropTable_when_notInModel_then_ok() { ModelContainer container = new ModelContainer(); container.apply(mig("5.0__dropTable.model.xml"), ver("5.0")); assertThat(container.getTables()).isEmpty(); } @Test - public void apply_drop_when_notInModel_then_ok() { - + void apply_drop_when_notInModel_then_ok() { ModelContainer container = new ModelContainer(); DropTable dropTable = new DropTable(); dropTable.setName("DoesNotExist"); @@ -155,7 +143,7 @@ public class ModelContainerTest { } @Test - public void apply_renameColumn() { + void apply_renameColumn() { ModelContainer container = new ModelContainer(); container.apply(mig("6.0__renameColumn.model.xml"), ver("6.0")); @@ -165,8 +153,7 @@ public class ModelContainerTest { } @Test - public void getSchemas() { - + void getSchemas() { MTable t0 = new MTable("foo.one"); MTable t1 = new MTable("foo.two"); MTable t2 = new MTable("bar.three"); diff --git a/ebean-ddl-generator/src/test/java/io/ebeaninternal/dbmigration/model/ModelDiffTest.java b/ebean-ddl-generator/src/test/java/io/ebeaninternal/dbmigration/model/ModelDiffTest.java index 15245e921..bb0cdce50 100644 --- a/ebean-ddl-generator/src/test/java/io/ebeaninternal/dbmigration/model/ModelDiffTest.java +++ b/ebean-ddl-generator/src/test/java/io/ebeaninternal/dbmigration/model/ModelDiffTest.java @@ -1,15 +1,18 @@ package io.ebeaninternal.dbmigration.model; +import io.ebeaninternal.dbmigration.migration.ChangeSet; +import io.ebeaninternal.dbmigration.migration.CreateSchema; +import io.ebeaninternal.dbmigration.migration.CreateTable; import org.junit.jupiter.api.Test; +import java.util.List; + import static org.assertj.core.api.Assertions.assertThat; - -public class ModelDiffTest { +class ModelDiffTest { @Test - public void test_compareTo_with_dropColumnOnHistoryTable_then_historyColumnRegistered() throws Exception { - + void test_compareTo_with_dropColumnOnHistoryTable_then_historyColumnRegistered() throws Exception { ModelContainer base = new ModelContainer(); base.addTable(MTableTest.base().setWithHistory(true)); @@ -24,4 +27,27 @@ public class ModelDiffTest { assertThat(tab.allHistoryColumns(true)).contains("status"); assertThat(tab.allColumns()).extracting("name").doesNotContain("status"); } + + @Test + void schemaDiff() { + ModelContainer base = new ModelContainer(); + base.addTable(new MTable("foo.one")); + base.addTable(new MTable("bar.two")); + + ModelDiff modelDiff = new ModelDiff(base); + + ModelContainer newOne = new ModelContainer(); + newOne.addTable(new MTable("bazz.three")); + newOne.addTable(new MTable("foo.one")); + newOne.addTable(new MTable("buzz.four")); + + modelDiff.compareTo(newOne); + ChangeSet apply = modelDiff.getApplyChangeSet(); + List children = apply.getChangeSetChildren(); + assertThat(children).hasSize(4); + assertThat(((CreateSchema) children.get(0)).getName()).isEqualTo("bazz"); + assertThat(((CreateSchema) children.get(1)).getName()).isEqualTo("buzz"); + assertThat(children.get(2)).isInstanceOf(CreateTable.class); + assertThat(children.get(3)).isInstanceOf(CreateTable.class); + } }