Compare commits

..
Author SHA1 Message Date
Rob Bygrave 1004675a0b [maven-release-plugin] prepare release ebean-parent-13.6.2 2022-05-18 20:11:12 +12:00
Rob Bygrave 12e508ab48 Merge branch 'master' of github.com:ebean-orm/ebean 2022-05-18 18:25:38 +12:00
Rob Bygrave be0e1116a7 Bump ebean-agent to 13.6.2 2022-05-18 18:25:24 +12:00
Rob BygraveandGitHub 4b03c8a00a Merge pull request #2698 from ebean-orm/feature/tidy-beancollection
No effective change - tidy BeanList etc, BeanCollectionHelpFactory to use specific CQueryCollectionAdd for List and Set
2022-05-18 18:03:09 +12:00
Rob Bygrave 0db93bc82d No effective change - tidy BeanList etc, BeanCollectionHelpFactory to use specific CQueryCollectionAdd for List and Set 2022-05-18 17:33:08 +12:00
Rob Bygrave e04a1baabe Bump tile enhancement to 13.6.0 2022-05-18 15:35:38 +12:00
Rob BygraveandGitHub 506e2f5625 Merge pull request #2697 from ebean-orm/feature/postgres-table-partitioning-pk
Postgres DDL - With Postgres table partitioning, add partition column to primary key
2022-05-17 22:18:55 +12:00
Rob Bygrave 7fbc1f8111 Postgres DDL - With Postgres table partitioning, add partition column to primary key
- Postgres DDL generation
- Using table partitioning
- There is a primary key defined that doesn't contain the partition column

In DDL generation, automatically add the partition column to the DB primary key.
2022-05-17 21:39:06 +12:00
Rob Bygrave 4f3c9adf6f #2695 - DDL Generation for @UniqueConstraint ignores the name - should be the index name when given 2022-05-16 22:06:14 +12:00
Rob Bygrave ceac2d12b1 #2694 - Postgres DDL - For Postgres table partitioning, remove the "suppressPrimaryKeyOnPartition" mode 2022-05-16 21:48:19 +12:00
Rob Bygrave cc7f3d49a4 No effective change, tidy whitespace 2022-05-16 21:35:46 +12:00
Rob BygraveandGitHub 091c40867e Merge pull request #2693 from ebean-orm/feature/add-schema-support
DDL - Add support for creating schema via database migrations (and create all ddl)
2022-05-16 21:28:59 +12:00
Rob Bygrave 71b7aa5946 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.
2022-05-16 21:17:41 +12:00
Rob Bygrave 9dea51b7a0 #2692 - [querybean generation] Compile error, incorrect generation with nested inner class/record @Embeddable and @IdClass 2022-05-16 18:48:42 +12:00
Rob Bygrave b7d6374370 Improve error message when no platform providers are in the classpath 2022-05-16 18:47:48 +12:00
Rob Bygrave 195cb9c86c Adjust postgis build test container - use specific containerName 2022-05-16 16:36:32 +12:00
Rob Bygrave 1329a4775c Bump test modules to 13.6.2-SNAPSHOT after release 2022-05-16 12:35:41 +12:00
Rob Bygrave cc91ca5c2a [maven-release-plugin] prepare for next development iteration 2022-05-16 12:22:31 +12:00
Rob Bygrave c863fe7781 [maven-release-plugin] prepare release ebean-parent-13.6.1 2022-05-16 12:22:25 +12:00
Rob Bygrave 8dec17c1f3 Bump ebean-agent to 13.6.1 - #2687 2022-05-16 12:05:54 +12:00
Rob Bygrave 36d589d4f3 #2691 - Improve logging summary when insert bean with no @Id ... 2022-05-16 11:30:36 +12:00
Rob Bygrave dedafa0b93 Modify GH WF EA builds adding mvn --version ... for info on versions used for build 2022-05-13 13:58:13 +12:00
Rob BygraveandGitHub 7b91b9ec48 Merge pull request #2690 from ebean-orm/bug/orphan-collection-replacement
Bug - OneToMany orphanRemoval = true, replace collection adding back …
2022-05-13 12:13:19 +12:00
Rob BygraveandGitHub c5940dacf1 Merge pull request #2688 from ebean-orm/feature/test-docker-52
Bump to ebean-test-docker 5.3
2022-05-13 11:42:33 +12:00
Rob Bygrave a4df643d82 #2690 - Refactor internals, tidy SaveManyBeans
- Introduce hasOrderColumn field
- Add clearedParent flag to only clear the parent bean from persistence context once (not per detail bean)
2022-05-13 11:38:39 +12:00
Rob Bygrave 74174444bb Bug - OneToMany orphanRemoval = true, replace collection adding back original collection entry
- Adding back a bean from the original collection
- Expect that bean to exist in the final result but, it's missing

Fix here is in SaveManyBeans to add a insertAllChildren and use ebi.setNew(); for beans to force them to insert for this case.
2022-05-12 23:14:26 +12:00
Rob Bygrave 317ad8de9c Bump to ebean-test-docker 5.3
- Supports random ports
- Simplified shutdownMode
- Improved logging on shutdown
2022-05-12 18:43:38 +12:00
Rob Bygrave 4b260483ce Test only - Adjust timing in TestHistoryInsert.mariadb_simple_history() 2022-05-12 17:14:20 +12:00
Rob Bygrave 6a575cb1bf Change ebean-test postgis image to postgis/postgis from mdillon/postgis
- Also bump default version to 14
2022-05-12 17:05:23 +12:00
Rob Bygrave a13e1cf074 Bump to ebean-test-docker 5.2
- Supports random ports
- Simplified shutdownMode
2022-05-12 16:43:41 +12:00
Rob Bygrave c59475084a #2686 - [ebean-test] Allow docker configuration options to be at ebean.test.X as well as ebean.test.<platform>.X 2022-05-05 20:54:07 +12:00
Rob Bygrave f41704b58c #2685 - Bump ebean-test-docker to 5.1 with newBuilder() -> builder() with deprecation 2022-05-05 09:17:35 +12:00
Rob Bygrave 5bb9745b3c Bump to 13.6.1-SNAPSHOT after release 2022-05-03 15:36:03 +12:00
Rob Bygrave 1c072f1d0a [maven-release-plugin] prepare for next development iteration 2022-05-03 15:13:20 +12:00
145 changed files with 2246 additions and 1873 deletions
+2
View File
@@ -36,6 +36,8 @@ jobs:
path:
~/.m2
key: build-${{ env.cache-name }}
- name: Maven version
run: mvn --version
- name: Build with Maven
run: mvn package
+6 -6
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.6.0</version>
<version>13.6.2</version>
</parent>
<name>ebean-clickhouse</name>
@@ -16,13 +16,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
@@ -35,18 +35,18 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-clickhouse</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.6.0</tag>
<tag>ebean-parent-13.6.2</tag>
</scm>
</project>
+6 -6
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.6.0</version>
<version>13.6.2</version>
</parent>
<name>ebean-cockroach</name>
@@ -16,13 +16,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
@@ -35,18 +35,18 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.6.0</tag>
<tag>ebean-parent-13.6.2</tag>
</scm>
</project>
+6 -6
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.6.0</version>
<version>13.6.2</version>
</parent>
<name>ebean-db2</name>
@@ -16,13 +16,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
@@ -35,18 +35,18 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-db2</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.6.0</tag>
<tag>ebean-parent-13.6.2</tag>
</scm>
</project>
+6 -6
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.6.0</version>
<version>13.6.2</version>
</parent>
<name>ebean-h2</name>
@@ -16,13 +16,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
@@ -35,18 +35,18 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-h2</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.6.0</tag>
<tag>ebean-parent-13.6.2</tag>
</scm>
</project>
+6 -6
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.6.0</version>
<version>13.6.2</version>
</parent>
<name>ebean-hana</name>
@@ -16,13 +16,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
@@ -35,18 +35,18 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-hana</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.6.0</tag>
<tag>ebean-parent-13.6.2</tag>
</scm>
</project>
+6 -6
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.6.0</version>
<version>13.6.2</version>
</parent>
<name>ebean-mariadb</name>
@@ -16,13 +16,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
@@ -35,18 +35,18 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-mariadb</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.6.0</tag>
<tag>ebean-parent-13.6.2</tag>
</scm>
</project>
+6 -6
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.6.0</version>
<version>13.6.2</version>
</parent>
<name>ebean-mysql</name>
@@ -16,13 +16,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
@@ -35,18 +35,18 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-mysql</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.6.0</tag>
<tag>ebean-parent-13.6.2</tag>
</scm>
</project>
+6 -6
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.6.0</version>
<version>13.6.2</version>
</parent>
<name>ebean-nuodb</name>
@@ -16,13 +16,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
@@ -35,18 +35,18 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-nuodb</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.6.0</tag>
<tag>ebean-parent-13.6.2</tag>
</scm>
</project>
+6 -6
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.6.0</version>
<version>13.6.2</version>
</parent>
<name>ebean-oracle</name>
@@ -16,13 +16,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
@@ -35,18 +35,18 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-oracle</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.6.0</tag>
<tag>ebean-parent-13.6.2</tag>
</scm>
</project>
+6 -6
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.6.0</version>
<version>13.6.2</version>
</parent>
<name>ebean-postgres</name>
@@ -16,13 +16,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
@@ -35,18 +35,18 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.6.0</tag>
<tag>ebean-parent-13.6.2</tag>
</scm>
</project>
+6 -6
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.6.0</version>
<version>13.6.2</version>
</parent>
<name>ebean-sqlite</name>
@@ -16,13 +16,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
@@ -35,18 +35,18 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-sqlite</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.6.0</tag>
<tag>ebean-parent-13.6.2</tag>
</scm>
</project>
+6 -6
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.6.0</version>
<version>13.6.2</version>
</parent>
<name>ebean-sqlserver</name>
@@ -16,13 +16,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
@@ -35,18 +35,18 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-sqlserver</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.6.0</tag>
<tag>ebean-parent-13.6.2</tag>
</scm>
</project>
+6 -6
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.6.0</version>
<version>13.6.2</version>
</parent>
<name>ebean-yugabyte</name>
@@ -16,13 +16,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
@@ -35,18 +35,18 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.6.0</tag>
<tag>ebean-parent-13.6.2</tag>
</scm>
</project>
+6 -6
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.6.0</version>
<version>13.6.2</version>
</parent>
<name>ebean (all platforms)</name>
@@ -16,13 +16,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
@@ -35,18 +35,18 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-all</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.6.0</tag>
<tag>ebean-parent-13.6.2</tag>
</scm>
</project>
+1 -1
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.6.0</version>
<version>13.6.2</version>
</parent>
<artifactId>composites</artifactId>
+1 -1
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.6.0</version>
<version>13.6.2</version>
</parent>
<name>ebean api</name>
@@ -17,39 +17,28 @@ abstract class AbstractBeanCollection<E> implements BeanCollection<E> {
private static final long serialVersionUID = 3365725236140187588L;
protected final ReentrantLock lock = new ReentrantLock();
protected boolean readOnly;
protected boolean disableLazyLoad;
/**
* The Database this is associated with. (used for lazy fetch).
*/
protected transient BeanCollectionLoader loader;
protected transient ExpressionList<?> filterMany;
/**
* Flag set when registered with the batch loading context.
*/
protected boolean registeredWithLoadContext;
protected String ebeanServerName;
/**
* The owning bean (used for lazy fetch).
*/
protected EntityBean ownerBean;
/**
* The name of this property in the owning bean (used for lazy fetch).
*/
protected String propertyName;
protected ModifyHolder<E> modifyHolder;
protected ModifyListenMode modifyListenMode;
protected boolean modifyListening;
/**
@@ -126,8 +115,7 @@ abstract class AbstractBeanCollection<E> implements BeanCollection<E> {
void checkReadOnly() {
if (readOnly) {
String msg = "This collection is in ReadOnly mode";
throw new IllegalStateException(msg);
throw new IllegalStateException("This collection is in ReadOnly mode");
}
}
@@ -11,7 +11,7 @@ import java.util.List;
import java.util.ListIterator;
/**
* List capable of lazy loading.
* List capable of lazy loading and modification awareness.
*/
public final class BeanList<E> extends AbstractBeanCollection<E> implements List<E>, BeanCollectionAdd {
@@ -150,7 +150,6 @@ public final class BeanList<E> extends AbstractBeanCollection<E> implements List
* Set the actual underlying list.
* <p>
* This is primarily for the deferred fetching function.
* </p>
*/
@SuppressWarnings("unchecked")
public void setActualList(List<?> list) {
@@ -206,12 +205,11 @@ public final class BeanList<E> extends AbstractBeanCollection<E> implements List
* Specifically obj does not need to be a BeanList but any list. This does not
* use the FindMany, fetchedMaxRows or finishedFetch properties in the equals
* test.
* </p>
*/
@Override
public boolean equals(Object obj) {
public boolean equals(Object other) {
init();
return list.equals(obj);
return list.equals(other);
}
@Override
@@ -244,40 +242,40 @@ public final class BeanList<E> extends AbstractBeanCollection<E> implements List
}
@Override
public boolean add(E o) {
public boolean add(E bean) {
checkReadOnly();
init();
if (modifyListening) {
if (list.add(o)) {
modifyAddition(o);
if (list.add(bean)) {
modifyAddition(bean);
return true;
} else {
return false;
}
}
return list.add(o);
return list.add(bean);
}
@Override
public boolean addAll(Collection<? extends E> c) {
public boolean addAll(Collection<? extends E> beans) {
checkReadOnly();
init();
if (modifyListening) {
// all elements in c are added (no contains checking)
getModifyHolder().modifyAdditionAll(c);
getModifyHolder().modifyAdditionAll(beans);
}
return list.addAll(c);
return list.addAll(beans);
}
@Override
public boolean addAll(int index, Collection<? extends E> c) {
public boolean addAll(int index, Collection<? extends E> beans) {
checkReadOnly();
init();
if (modifyListening) {
// all elements in c are added (no contains checking)
getModifyHolder().modifyAdditionAll(c);
getModifyHolder().modifyAdditionAll(beans);
}
return list.addAll(index, c);
return list.addAll(index, beans);
}
@Override
@@ -287,23 +285,23 @@ public final class BeanList<E> extends AbstractBeanCollection<E> implements List
// and fetch just the Id's
initClear();
if (modifyListening) {
for (E aList : list) {
getModifyHolder().modifyRemoval(aList);
for (E element : list) {
getModifyHolder().modifyRemoval(element);
}
}
list.clear();
}
@Override
public boolean contains(Object o) {
public boolean contains(Object bean) {
init();
return list.contains(o);
return list.contains(bean);
}
@Override
public boolean containsAll(Collection<?> c) {
public boolean containsAll(Collection<?> beans) {
init();
return list.containsAll(c);
return list.containsAll(beans);
}
@Override
@@ -313,9 +311,9 @@ public final class BeanList<E> extends AbstractBeanCollection<E> implements List
}
@Override
public int indexOf(Object o) {
public int indexOf(Object bean) {
init();
return list.indexOf(o);
return list.indexOf(bean);
}
@Override
@@ -327,31 +325,29 @@ public final class BeanList<E> extends AbstractBeanCollection<E> implements List
@Override
public Iterator<E> iterator() {
init();
if (isReadOnly()) {
if (readOnly) {
return new ReadOnlyListIterator<>(list.listIterator());
}
if (modifyListening) {
Iterator<E> it = list.iterator();
return new ModifyIterator<>(this, it);
return new ModifyIterator<>(this, list.iterator());
}
return list.iterator();
}
@Override
public int lastIndexOf(Object o) {
public int lastIndexOf(Object bean) {
init();
return list.lastIndexOf(o);
return list.lastIndexOf(bean);
}
@Override
public ListIterator<E> listIterator() {
init();
if (isReadOnly()) {
if (readOnly) {
return new ReadOnlyListIterator<>(list.listIterator());
}
if (modifyListening) {
ListIterator<E> it = list.listIterator();
return new ModifyListIterator<>(this, it);
return new ModifyListIterator<>(this, list.listIterator());
}
return list.listIterator();
}
@@ -359,12 +355,11 @@ public final class BeanList<E> extends AbstractBeanCollection<E> implements List
@Override
public ListIterator<E> listIterator(int index) {
init();
if (isReadOnly()) {
if (readOnly) {
return new ReadOnlyListIterator<>(list.listIterator(index));
}
if (modifyListening) {
ListIterator<E> it = list.listIterator(index);
return new ModifyListIterator<>(this, it);
return new ModifyListIterator<>(this, list.listIterator(index));
}
return list.listIterator(index);
}
@@ -389,17 +384,17 @@ public final class BeanList<E> extends AbstractBeanCollection<E> implements List
}
@Override
public boolean remove(Object o) {
public boolean remove(Object bean) {
checkReadOnly();
init();
if (modifyListening) {
boolean isRemove = list.remove(o);
boolean isRemove = list.remove(bean);
if (isRemove) {
modifyRemoval(o);
modifyRemoval(bean);
}
return isRemove;
}
return list.remove(o);
return list.remove(bean);
}
@Override
@@ -463,7 +458,7 @@ public final class BeanList<E> extends AbstractBeanCollection<E> implements List
@Override
public List<E> subList(int fromIndex, int toIndex) {
init();
if (isReadOnly()) {
if (readOnly) {
return Collections.unmodifiableList(list.subList(fromIndex, toIndex));
}
if (modifyListening) {
@@ -479,13 +474,13 @@ public final class BeanList<E> extends AbstractBeanCollection<E> implements List
}
@Override
public <T> T[] toArray(T[] a) {
public <T> T[] toArray(T[] array) {
init();
//noinspection SuspiciousToArrayCall
return list.toArray(a);
return list.toArray(array);
}
private static class ReadOnlyListIterator<E> implements ListIterator<E>, Serializable {
private static final class ReadOnlyListIterator<E> implements ListIterator<E>, Serializable {
private static final long serialVersionUID = 3097271091406323699L;
@@ -12,7 +12,7 @@ import java.util.Map;
import java.util.Set;
/**
* Map capable of lazy loading.
* Map capable of lazy loading and modification aware.
*/
public final class BeanMap<K, E> extends AbstractBeanCollection<E> implements Map<K, E> {
@@ -247,7 +247,7 @@ public final class BeanMap<K, E> extends AbstractBeanCollection<E> implements Ma
@Override
public Set<Entry<K, E>> entrySet() {
init();
if (isReadOnly()) {
if (readOnly) {
return Collections.unmodifiableSet(map.entrySet());
}
return modifyListening ? new ModifyEntrySet<>(this, map.entrySet()) : map.entrySet();
@@ -268,7 +268,7 @@ public final class BeanMap<K, E> extends AbstractBeanCollection<E> implements Ma
@Override
public Set<K> keySet() {
init();
if (isReadOnly()) {
if (readOnly) {
return Collections.unmodifiableSet(map.keySet());
}
return modifyListening ? new ModifyKeySet<>(this, map.keySet()) : map.keySet();
@@ -339,7 +339,7 @@ public final class BeanMap<K, E> extends AbstractBeanCollection<E> implements Ma
@Override
public Collection<E> values() {
init();
if (isReadOnly()) {
if (readOnly) {
return Collections.unmodifiableCollection(map.values());
}
return modifyListening ? new ModifyCollection<>(this, map.values()) : map.values();
@@ -9,7 +9,7 @@ import java.util.LinkedHashSet;
import java.util.Set;
/**
* Set capable of lazy loading.
* Set capable of lazy loading and modification aware.
*/
public final class BeanSet<E> extends AbstractBeanCollection<E> implements Set<E>, BeanCollectionAdd {
@@ -210,27 +210,27 @@ public final class BeanSet<E> extends AbstractBeanCollection<E> implements Set<E
// -----------------------------------------------------//
@Override
public boolean add(E o) {
public boolean add(E bean) {
checkReadOnly();
init();
if (modifyListening) {
if (set.add(o)) {
modifyAddition(o);
if (set.add(bean)) {
modifyAddition(bean);
return true;
} else {
return false;
}
}
return set.add(o);
return set.add(bean);
}
@Override
public boolean addAll(Collection<? extends E> addCollection) {
public boolean addAll(Collection<? extends E> beans) {
checkReadOnly();
init();
if (modifyListening) {
boolean changed = false;
for (E bean : addCollection) {
for (E bean : beans) {
if (set.add(bean)) {
// register the addition of the bean
modifyAddition(bean);
@@ -239,7 +239,7 @@ public final class BeanSet<E> extends AbstractBeanCollection<E> implements Set<E
}
return changed;
}
return set.addAll(addCollection);
return set.addAll(beans);
}
@Override
@@ -255,15 +255,15 @@ public final class BeanSet<E> extends AbstractBeanCollection<E> implements Set<E
}
@Override
public boolean contains(Object o) {
public boolean contains(Object bean) {
init();
return set.contains(o);
return set.contains(bean);
}
@Override
public boolean containsAll(Collection<?> c) {
public boolean containsAll(Collection<?> beans) {
init();
return set.containsAll(c);
return set.containsAll(beans);
}
@Override
@@ -275,7 +275,7 @@ public final class BeanSet<E> extends AbstractBeanCollection<E> implements Set<E
@Override
public Iterator<E> iterator() {
init();
if (isReadOnly()) {
if (readOnly) {
return new ReadOnlyIterator<>(set.iterator());
}
if (modifyListening) {
@@ -285,17 +285,17 @@ public final class BeanSet<E> extends AbstractBeanCollection<E> implements Set<E
}
@Override
public boolean remove(Object o) {
public boolean remove(Object bean) {
checkReadOnly();
init();
if (modifyListening) {
if (set.remove(o)) {
modifyRemoval(o);
if (set.remove(bean)) {
modifyRemoval(bean);
return true;
}
return false;
}
return set.remove(o);
return set.remove(bean);
}
@Override
@@ -349,13 +349,13 @@ public final class BeanSet<E> extends AbstractBeanCollection<E> implements Set<E
}
@Override
public <T> T[] toArray(T[] a) {
public <T> T[] toArray(T[] array) {
init();
//noinspection SuspiciousToArrayCall
return set.toArray(a);
return set.toArray(array);
}
private static class ReadOnlyIterator<E> implements Iterator<E>, Serializable {
private static final class ReadOnlyIterator<E> implements Iterator<E>, Serializable {
private static final long serialVersionUID = 2577697326745352605L;
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.6.0</version>
<version>13.6.2</version>
</parent>
<!-- <parent>-->
<!-- <groupId>org.avaje</groupId>-->
@@ -14,7 +14,7 @@
<scm>
<developerConnection>scm:git:git@github.com:ebean-orm/ebean.git</developerConnection>
<tag>ebean-parent-13.6.0</tag>
<tag>ebean-parent-13.6.2</tag>
</scm>
<name>ebean autotune</name>
@@ -26,7 +26,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
<scope>provided</scope>
</dependency>
@@ -55,7 +55,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-h2</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
<scope>test</scope>
</dependency>
@@ -70,7 +70,7 @@
<extensions>true</extensions>
<configuration>
<tiles>
<tile>io.ebean.tile:enhancement:13.3.0</tile>
<tile>io.ebean.tile:enhancement:13.6.0</tile>
</tiles>
</configuration>
</plugin>
+15 -15
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.6.0</version>
<version>13.6.2</version>
</parent>
<name>ebean bom</name>
@@ -71,88 +71,88 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core-type</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-ddl-generator</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-externalmapping-api</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-externalmapping-xml</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-autotune</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>querybean-generator</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>kotlin-querybean-generator</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-postgis</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-redis</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
</dependencies>
+2 -2
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.6.0</version>
<version>13.6.2</version>
</parent>
<artifactId>ebean-core-type</artifactId>
@@ -16,7 +16,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
+8 -8
View File
@@ -3,7 +3,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.6.0</version>
<version>13.6.2</version>
</parent>
<artifactId>ebean-core</artifactId>
@@ -15,7 +15,7 @@
<scm>
<developerConnection>scm:git:git@github.com:ebean-orm/ebean.git</developerConnection>
<tag>ebean-parent-13.6.0</tag>
<tag>ebean-parent-13.6.2</tag>
</scm>
<dependencies>
@@ -41,19 +41,19 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core-type</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-externalmapping-api</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
@@ -144,21 +144,21 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-h2</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-sqlserver</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
<scope>test</scope>
</dependency>
@@ -93,6 +93,11 @@ public class DatabasePlatformFactory {
return provider.create(majorVersion, minorVersion, metaData, connection);
}
}
if (providers.isEmpty()) {
throw new IllegalStateException("There are no ebean platform providers in the classpath. " +
"Add a missing dependency like ebean-h2, ebean-postgres, ebean-mysql etc to support the database [" + dbProductName
+ "]. Adding a dependency on io.ebean:ebean will add support for all platforms.");
}
throw new IllegalStateException("Unable to determine the appropriate ebean platform given database product name [" + dbProductName
+ "] and ebean platform providers " + providers + ". With ebean 13+ we now have separate platforms (ebean-postgres, ebean-mysql etc)"
+ " and should use database specific platform dependency like ebean-postgres. Note that we can use ebean-platform-all to include"
@@ -9,25 +9,12 @@ import io.ebean.event.BeanPersistController;
import io.ebean.event.BeanPersistListener;
import io.ebean.event.BeanPersistRequest;
import io.ebean.event.changelog.BeanChange;
import io.ebeaninternal.api.ConcurrencyMode;
import io.ebeaninternal.api.SpiEbeanServer;
import io.ebeaninternal.api.SpiProfileTransactionEvent;
import io.ebeaninternal.api.SpiTransaction;
import io.ebeaninternal.api.TransactionEvent;
import io.ebeaninternal.api.*;
import io.ebeaninternal.server.cache.CacheChangeSet;
import io.ebeaninternal.server.deploy.BeanDescriptor;
import io.ebeaninternal.server.deploy.BeanManager;
import io.ebeaninternal.server.deploy.BeanProperty;
import io.ebeaninternal.server.deploy.BeanPropertyAssocMany;
import io.ebeaninternal.server.deploy.BeanPropertyAssocOne;
import io.ebeaninternal.server.deploy.*;
import io.ebeaninternal.server.deploy.generatedproperty.GeneratedProperty;
import io.ebeaninternal.server.deploy.id.ImportedId;
import io.ebeaninternal.server.persist.BatchControl;
import io.ebeaninternal.server.persist.BatchedSqlException;
import io.ebeaninternal.server.persist.DeleteMode;
import io.ebeaninternal.server.persist.Flags;
import io.ebeaninternal.server.persist.PersistExecute;
import io.ebeaninternal.server.persist.SaveMany;
import io.ebeaninternal.server.persist.*;
import io.ebeaninternal.server.transaction.BeanPersistIdMap;
import io.ebeanservice.docstore.api.DocStoreUpdate;
import io.ebeanservice.docstore.api.DocStoreUpdateContext;
@@ -38,11 +25,7 @@ import javax.persistence.OptimisticLockException;
import javax.persistence.PersistenceException;
import java.io.IOException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.*;
/**
* PersistRequest for insert update or delete of a bean.
@@ -953,7 +936,7 @@ public final class PersistRequestBean<T> extends PersistRequest implements BeanP
String name = beanDescriptor.name();
switch (type) {
case INSERT:
transaction.logSummary("Inserted [" + name + "] [" + idValue + "]" + draft);
transaction.logSummary("Inserted [" + name + "] [" + (idValue == null ? "" : idValue) + "]" + draft);
break;
case UPDATE:
transaction.logSummary("Updated [" + name + "] [" + idValue + "]" + draft);
@@ -1,5 +1,9 @@
package io.ebeaninternal.server.deploy;
import io.ebean.bean.BeanCollection;
import io.ebean.bean.EntityBean;
import io.ebean.common.BeanList;
import io.ebean.common.BeanSet;
import io.ebeaninternal.api.SpiQuery;
import io.ebeaninternal.server.core.OrmQueryRequest;
import io.ebeaninternal.server.el.ElPropertyValue;
@@ -12,18 +16,17 @@ import io.ebeaninternal.server.query.CQueryCollectionAdd;
public final class BeanCollectionHelpFactory {
@SuppressWarnings("rawtypes")
private static final BeanListHelp LIST_HELP = new BeanListHelp();
private static final CQueryCollectionAdd LIST_HELP = new ListAdd();
@SuppressWarnings("rawtypes")
private static final BeanSetHelp SET_HELP = new BeanSetHelp();
private static final CQueryCollectionAdd SET_HELP = new SetAdd();
/**
* Create the helper based on the many property.
*/
public static <T> BeanCollectionHelp<T> create(BeanPropertyAssocMany<T> many) {
boolean elementCollection = many.isElementCollection();
ManyType manyType = many.manyType();
switch (manyType) {
switch (many.manyType()) {
case LIST:
return elementCollection ? new BeanListHelpElement<>(many) : new BeanListHelp<>(many);
case SET:
@@ -31,7 +34,7 @@ public final class BeanCollectionHelpFactory {
case MAP:
return elementCollection ? new BeanMapHelpElement<>(many) : new BeanMapHelp<>(many);
default:
throw new RuntimeException("Invalid type " + manyType);
throw new RuntimeException("Invalid type " + many.manyType());
}
}
@@ -53,4 +56,30 @@ public final class BeanCollectionHelpFactory {
}
}
private static final class ListAdd<T> implements CQueryCollectionAdd<T> {
@Override
public BeanCollection<T> createEmptyNoParent() {
return new BeanList<>();
}
@Override
public void add(BeanCollection<?> collection, EntityBean bean, boolean withCheck) {
collection.internalAdd(bean);
}
}
private static final class SetAdd<T> implements CQueryCollectionAdd<T> {
@Override
public BeanCollection<T> createEmptyNoParent() {
return new BeanSet<>();
}
@Override
public void add(BeanCollection<?> collection, EntityBean bean, boolean withCheck) {
collection.internalAdd(bean);
}
}
}
@@ -29,10 +29,10 @@ public final class IndexDefinition {
/**
* Create a unique constraint given the column names.
*/
public IndexDefinition(String[] columns) {
public IndexDefinition(String name, String[] columns) {
this.columns = columns;
this.unique = true;
this.name = null;
this.name = name;
this.platforms = null;
this.concurrent = false;
this.definition = null;
@@ -16,11 +16,17 @@ public final class PartitionMeta {
return mode;
}
/**
* Originally the property name but replaced with the db column.
*/
public String getProperty() {
return property;
}
public void setProperty(String dbColumn) {
/**
* Set the db column being partitioned on.
*/
public void setColumn(String dbColumn) {
this.property = dbColumn;
}
}
@@ -249,12 +249,12 @@ public class DeployBeanDescriptor<T> {
if (partitionMeta != null) {
DeployBeanProperty beanProperty = getBeanProperty(partitionMeta.getProperty());
if (beanProperty != null) {
partitionMeta.setProperty(beanProperty.getDbColumn());
partitionMeta.setColumn(beanProperty.getDbColumn());
}
}
return partitionMeta;
}
public void setTablespaceMeta(TablespaceMeta tablespaceMeta) {
this.tablespaceMeta = tablespaceMeta;
}
@@ -135,7 +135,7 @@ final class AnnotationClass extends AnnotationParser {
UniqueConstraint uc = typeGet(cls, UniqueConstraint.class);
if (uc != null) {
descriptor.addIndex(new IndexDefinition(convertColumnNames(uc.columnNames())));
descriptor.addIndex(new IndexDefinition(uc.name(), convertColumnNames(uc.columnNames())));
}
View view = typeGet(cls, View.class);
if (view != null) {
@@ -145,7 +145,7 @@ final class AnnotationClass extends AnnotationParser {
if (table != null) {
UniqueConstraint[] uniqueConstraints = table.uniqueConstraints();
for (UniqueConstraint c : uniqueConstraints) {
descriptor.addIndex(new IndexDefinition(convertColumnNames(c.columnNames())));
descriptor.addIndex(new IndexDefinition(c.name(), convertColumnNames(c.columnNames())));
}
}
StorageEngine storage = typeGet(cls, StorageEngine.class);
@@ -24,7 +24,7 @@ import static io.ebeaninternal.server.persist.DmlUtil.isNullOrZero;
/**
* Saves the details for a OneToMany or ManyToMany relationship (entity beans).
*/
public final class SaveManyBeans extends SaveManyBase {
final class SaveManyBeans extends SaveManyBase {
private final boolean cascade;
private final boolean publish;
@@ -34,7 +34,9 @@ public final class SaveManyBeans extends SaveManyBase {
private final DeleteMode deleteMode;
private final boolean untouchedBeanCollection;
private final Collection<?> collection;
private final boolean hasOrderColumn;
private int sortOrder;
private boolean insertAllChildren;
SaveManyBeans(DefaultPersister persister, boolean insertedParent, BeanPropertyAssocMany<?> many, EntityBean parentBean, PersistRequestBean<?> request) {
super(persister, insertedParent, many, parentBean, request);
@@ -46,6 +48,7 @@ public final class SaveManyBeans extends SaveManyBase {
this.deleteMode = targetDescriptor.isSoftDelete() ? DeleteMode.SOFT : DeleteMode.HARD;
this.untouchedBeanCollection = untouchedBeanCollection();
this.collection = cascade ? BeanCollectionUtil.getActualEntries(value) : null;
this.hasOrderColumn = many.hasOrderColumn();
}
/**
@@ -73,7 +76,7 @@ public final class SaveManyBeans extends SaveManyBase {
resetModifyState();
}
} else {
if (isModifyListenMode() || many.hasOrderColumn()) {
if (isModifyListenMode() || hasOrderColumn) {
// delete any removed beans / orphans
removeAssocManyOrphans();
}
@@ -90,6 +93,7 @@ public final class SaveManyBeans extends SaveManyBase {
private boolean isSaveIntersection() {
if (!many.isManyToMany()) {
// OneToMany JoinTable
return true;
}
return transaction.isSaveAssocManyIntersection(many.intersectionTableJoin().getTable(), many.descriptor().rootName());
@@ -112,26 +116,22 @@ public final class SaveManyBeans extends SaveManyBase {
private void processDetails() {
BeanProperty orderColumn = null;
boolean hasOrderColumn = many.hasOrderColumn();
if (hasOrderColumn) {
if (!insertedParent && canSkipForOrderColumn() && saveRecurseSkippable) {
return;
}
orderColumn = targetDescriptor.orderColumn();
}
if (insertedParent) {
// performance optimisation for large collections
targetDescriptor.preAllocateIds(collection.size());
}
if (!insertedParent && many.isOrphanRemoval() && request.isForcedUpdate()) {
// collect the Id's (to exclude from deleteManyDetails)
List<Object> detailIds = collectIds(collection, targetDescriptor, isMap);
// deleting missing children - children not in our collected detailIds
persister.deleteManyDetails(transaction, many.descriptor(), parentBean, many, detailIds, deleteMode);
}
transaction.depth(+1);
saveAllBeans(orderColumn);
if (hasOrderColumn) {
@@ -140,17 +140,14 @@ public final class SaveManyBeans extends SaveManyBase {
transaction.depth(-1);
}
private void saveAllBeans(BeanProperty orderColumn) {
// if a map, then we get the key value and
// set it to the appropriate property on the
// detail bean before we save it
private void saveAllBeans(final BeanProperty orderColumn) {
Object mapKeyValue = null;
boolean skipSavingThisBean;
boolean clearedParent = false;
for (Object detailBean : collection) {
sortOrder++;
if (isMap) {
// its a map so need the key and value
// a map so need the key and value
Map.Entry<?, ?> entry = (Map.Entry<?, ?>) detailBean;
mapKeyValue = entry.getKey();
detailBean = entry.getValue();
@@ -169,25 +166,28 @@ public final class SaveManyBeans extends SaveManyBase {
ebi.setDirty(true);
}
}
if (targetDescriptor.isReference(ebi) && originalOrder == 0) {
if (originalOrder == 0 && targetDescriptor.isReference(ebi)) {
// we can skip this one
skipSavingThisBean = true;
} else if (ebi.isNewOrDirty()) {
skipSavingThisBean = false;
// set the parent bean to detailBean
many.setJoinValuesToChild(parentBean, detail, mapKeyValue);
} else if (insertAllChildren) {
ebi.setNew();
skipSavingThisBean = false;
many.setJoinValuesToChild(parentBean, detail, mapKeyValue);
} else {
// unmodified so skip depending on prop.isSaveRecurseSkippable();
skipSavingThisBean = saveRecurseSkippable;
}
}
if (!skipSavingThisBean) {
persister.saveRecurse(detail, transaction, parentBean, request.flags());
if (many.hasOrderColumn()) {
// Clear the bean from the PersistenceContext (L1 cache), because the order of referenced beans might have changed
if (hasOrderColumn && !clearedParent) {
// Clear the parent bean from the PersistenceContext (L1 cache), because the order of referenced beans might have changed
final BeanDescriptor<?> beanDescriptor = many.descriptor();
beanDescriptor.contextClear(transaction.getPersistenceContext(), beanDescriptor.getId(parentBean));
clearedParent = true;
}
}
}
@@ -342,6 +342,7 @@ public final class SaveManyBeans extends SaveManyBase {
if (!(value instanceof BeanCollection<?>)) {
if (!insertedParent && cascade && isChangedProperty()) {
persister.addToFlushQueue(many.deleteByParentId(request.beanId(), null), transaction, 0);
insertAllChildren = true;
}
} else {
BeanCollection<?> c = (BeanCollection<?>) value;
@@ -351,7 +352,7 @@ public final class SaveManyBeans extends SaveManyBase {
c.setModifyListening(many.modifyListenMode());
}
// We must not reset when we still have to update other entities in the collection and set their new orderColumn value
if (!many.hasOrderColumn()) {
if (!hasOrderColumn) {
c.modifyReset();
}
if (modifyRemovals != null && !modifyRemovals.isEmpty()) {
@@ -1,12 +1,11 @@
package io.ebeaninternal.server.deploy;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class IndexDefinitionTest {
class IndexDefinitionTest {
private static final String[] simpleCol1 = new String[]{"one"};
private static final String[] simpleCol2 = new String[]{"one","two"};
@@ -14,29 +13,29 @@ public class IndexDefinitionTest {
private static final String[] formulaCol2 = new String[]{"one","lower(two)"};
@Test
public void isUniqueConstraint_TRUE_when_simpleMultiColumn() {
Assertions.assertTrue(new IndexDefinition(simpleCol1).isUniqueConstraint());
assertTrue(new IndexDefinition(simpleCol2).isUniqueConstraint());
void isUniqueConstraint_TRUE_when_simpleMultiColumn() {
assertTrue(new IndexDefinition("", simpleCol1).isUniqueConstraint());
assertTrue(new IndexDefinition("", simpleCol2).isUniqueConstraint());
}
@Test
public void isUniqueConstraint_NOT_when_columnWithFormula() {
assertFalse(new IndexDefinition(formulaCol1).isUniqueConstraint());
assertFalse(new IndexDefinition(formulaCol2).isUniqueConstraint());
void isUniqueConstraint_NOT_when_columnWithFormula() {
assertFalse(new IndexDefinition("", formulaCol1).isUniqueConstraint());
assertFalse(new IndexDefinition("", formulaCol2).isUniqueConstraint());
}
@Test
public void isUniqueConstraint_NOT_when_concurrentTrue() {
void isUniqueConstraint_NOT_when_concurrentTrue() {
assertFalse(new IndexDefinition(simpleCol1, "name", true, null, true, null).isUniqueConstraint());
}
@Test
public void isUniqueConstraint_NOT_when_definitionNotEmpty() {
void isUniqueConstraint_NOT_when_definitionNotEmpty() {
assertFalse(new IndexDefinition(simpleCol1, "name", true, null, false, "create index foo").isUniqueConstraint());
}
@Test
public void isUniqueConstraint_TRUE_otherwise() {
void isUniqueConstraint_TRUE_otherwise() {
assertTrue(new IndexDefinition(simpleCol1, "name", true, null, false, "").isUniqueConstraint());
assertTrue(new IndexDefinition(simpleCol1, "name", true, null, false, null).isUniqueConstraint());
}
+4 -4
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.6.0</version>
<version>13.6.2</version>
</parent>
<name>ebean ddl generation</name>
@@ -28,14 +28,14 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core-type</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
<scope>provided</scope>
</dependency>
@@ -58,7 +58,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-all</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
<scope>test</scope>
</dependency>
@@ -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<Object> 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<Object> changeSetChildren) {
for (Object change : changeSetChildren) {
if (change instanceof CreateTable) {
generate(writer, (CreateTable) change);
}
}
}
private void createSchemas(DdlWrite writer, List<Object> 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);
@@ -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);
@@ -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.
*/
@@ -10,7 +10,7 @@ import io.ebeaninternal.dbmigration.ddlgeneration.DdlBuffer;
/**
* Contains alter statements per table.
*
*
* @author Roland Praml, FOCONIS AG
*/
public class BaseAlterTableWrite implements DdlAlterTable {
@@ -29,7 +29,7 @@ public class BaseAlterTableWrite implements DdlAlterTable {
@Override
public DdlBuffer endOfStatement() {
throw new UnsupportedOperationException();
};
}
};
protected AlterCmd(String operation, String column) {
@@ -82,9 +82,7 @@ public class BaseAlterTableWrite implements DdlAlterTable {
}
private final String tableName;
private List<AlterCmd> cmds = new ArrayList<>();
private final List<AlterCmd> cmds = new ArrayList<>();
private boolean historyHandled;
public BaseAlterTableWrite(String tableName, PlatformDdl platformDdl) {
@@ -102,10 +100,6 @@ public class BaseAlterTableWrite implements DdlAlterTable {
return cmd;
}
public AlterCmd newOperation(String operation, String column) {
return new AlterCmd(operation, column);
}
/**
* Adds a statement. The statement is prefixed with "alter table TABLENAME" and may be batched, if platform supports this. The
* returned StringBuilder can be used, to complete the statement
@@ -4,32 +4,13 @@ import io.ebean.annotation.Platform;
import io.ebean.config.DatabaseConfig;
import io.ebean.config.DbConstraintNaming;
import io.ebean.config.NamingConvention;
import io.ebean.config.dbplatform.IdType;
import io.ebean.util.StringHelper;
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;
import java.util.ArrayList;
import java.util.Collections;
@@ -195,6 +176,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.
@@ -204,32 +190,18 @@ public class BaseTableDdl implements TableDdl {
reset();
String tableName = createTable.getName();
List<Column> columns = createTable.getColumn();
List<Column> pk = determinePrimaryKeyColumns(columns);
DdlIdentity identity = DdlIdentity.NONE;
if ((pk.size() == 1)) {
final IdentityMode identityMode = MTableIdentity.fromCreateTable(createTable);
IdType idType = platformDdl.useIdentityType(identityMode.getIdType());
String sequenceName = identityMode.getSequenceName();
if (IdType.SEQUENCE == idType && (sequenceName == null || sequenceName.isEmpty())) {
sequenceName = sequenceName(createTable, pk);
}
identity = new DdlIdentity(idType, identityMode, sequenceName);
}
String partitionMode = createTable.getPartitionMode();
BaseTableIdentity baseTableIdentity = new BaseTableIdentity(createTable, platformDdl, namingConvention);
DdlIdentity identity = baseTableIdentity.identity();
DdlBuffer apply = writer.apply();
apply.append(platformDdl.getCreateTableCommandPrefix()).append(" ").append(platformDdl.quote(tableName)).append(" (");
writeTableColumns(apply, columns, identity);
writeTableColumns(apply, createTable.getColumn(), identity);
writeUniqueConstraints(apply, createTable);
writeCompoundUniqueConstraints(apply, createTable);
if (!pk.isEmpty()) {
if (baseTableIdentity.hasPrimaryKey()) {
// defined on the columns
if (partitionMode == null || !platformDdl.suppressPrimaryKeyOnPartition()) {
writePrimaryKeyConstraint(apply, createTable.getPkName(), toColumnNames(pk));
}
writePrimaryKeyConstraint(apply, createTable.getPkName(), toColumnNames(baseTableIdentity.pkColumns()));
}
if (platformDdl.isInlineForeignKeys()) {
writeInlineForeignKeys(apply, createTable);
@@ -238,6 +210,7 @@ public class BaseTableDdl implements TableDdl {
addTableTableSpaces(apply, createTable);
addTableStorageEngine(apply, createTable);
addTableCommentInline(apply, createTable);
String partitionMode = createTable.getPartitionMode();
if (partitionMode != null) {
platformDdl.addTablePartition(apply, partitionMode, createTable.getPartitionColumn());
}
@@ -267,12 +240,6 @@ public class BaseTableDdl implements TableDdl {
}
}
private String sequenceName(CreateTable createTable, List<Column> pk) {
return namingConvention.getSequenceName(createTable.getName(), pk.get(0).getName());
}
/**
* Add table and column comments (separate from the create table statement).
*/
@@ -529,19 +496,6 @@ public class BaseTableDdl implements TableDdl {
return cols;
}
/**
* Return the list of columns that make the primary key.
*/
protected List<Column> determinePrimaryKeyColumns(List<Column> columns) {
List<Column> pk = new ArrayList<>(3);
for (Column column : columns) {
if (isTrue(column.isPrimaryKey())) {
pk.add(column);
}
}
return pk;
}
@Override
public void generate(DdlWrite writer, CreateIndex index) {
if (platformInclude(index.getPlatforms())) {
@@ -737,18 +691,15 @@ public class BaseTableDdl implements TableDdl {
}
boolean alterCheckConstraint = hasValue(alterColumn.getCheckConstraint());
if (alterCheckConstraint) {
// drop constraint before altering type etc
dropCheckConstraint(writer, alterColumn, alterColumn.getCheckConstraintName());
}
if (typeChange(alterColumn)
|| hasValue(alterColumn.getDefaultValue())
|| alterColumn.isNotnull() != null) {
alterColumn(writer, alterColumn);
}
if (alterCheckConstraint) {
// add constraint last (after potential type change)
addCheckConstraint(writer, alterColumn);
@@ -0,0 +1,78 @@
package io.ebeaninternal.dbmigration.ddlgeneration.platform;
import io.ebean.config.NamingConvention;
import io.ebean.config.dbplatform.IdType;
import io.ebeaninternal.dbmigration.migration.Column;
import io.ebeaninternal.dbmigration.migration.CreateTable;
import io.ebeaninternal.dbmigration.model.MTableIdentity;
import io.ebeaninternal.server.deploy.IdentityMode;
import java.util.ArrayList;
import java.util.List;
final class BaseTableIdentity {
private final PlatformDdl platformDdl;
private final NamingConvention namingConvention;
private final CreateTable createTable;
private final List<Column> pk = new ArrayList<>(3);
BaseTableIdentity(CreateTable createTable, PlatformDdl platformDdl, NamingConvention namingConvention) {
this.platformDdl = platformDdl;
this.namingConvention = namingConvention;
this.createTable = createTable;
init(createTable.getColumn());
}
private void init(List<Column> columns) {
for (Column column : columns) {
if (Boolean.TRUE.equals(column.isPrimaryKey())) {
pk.add(column);
}
}
}
DdlIdentity identity() {
if (pk.size() != 1) {
return DdlIdentity.NONE;
}
final IdentityMode identityMode = MTableIdentity.fromCreateTable(createTable);
final IdType idType = platformDdl.useIdentityType(identityMode.getIdType());
String sequenceName = identityMode.getSequenceName();
if (IdType.SEQUENCE == idType && (sequenceName == null || sequenceName.isEmpty())) {
sequenceName = deriveSequenceName();
}
return new DdlIdentity(idType, identityMode, sequenceName);
}
private String deriveSequenceName() {
String columnName = pk.size() == 1 ? pk.get(0).getName() : "";
return namingConvention.getSequenceName(createTable.getName(), columnName);
}
boolean hasPrimaryKey() {
return !pk.isEmpty();
}
List<Column> pkColumns() {
if (createTable.getPartitionMode() != null && platformDdl.addPartitionColumnToPrimaryKey()) {
String partitionColumn = createTable.getPartitionColumn();
if (!pkContains(partitionColumn)) {
Column pc = new Column();
pc.setName(partitionColumn);
// future, could consider prefix option rather than suffix
pk.add(pc);
}
}
return pk;
}
private boolean pkContains(String partitionColumn) {
for (Column column : pk) {
if (column.getName().equals(partitionColumn)) {
return true;
}
}
return false;
}
}
@@ -1,14 +1,11 @@
package io.ebeaninternal.dbmigration.ddlgeneration.platform;
public class DdlHelp {
public static final String TABLESPACE_DEFAULT = "$TABLESPACE_DEFAULT";
public static final String DROP_DEFAULT = "DROP DEFAULT";
public static final String DROP_COMMENT = "DROP COMMENT";
public static final String DROP_CONSTRAINT = "DROP CONSTRAINT";
public static final String DROP_FOREIGN_KEY = "DROP FOREIGN KEY";
/**
@@ -24,7 +21,7 @@ public class DdlHelp {
public static boolean isDropComment(String value) {
return DROP_COMMENT.equals(value);
}
/**
* Return true if the default value is the special DROP CONSTRAINT value.
*/
@@ -43,7 +40,7 @@ public class DdlHelp {
* Returns the tablespace. Returns null, if this is the special '$TABLESPACE_DEFAULT' value.
*/
public static String toTablespace(String tablespace) {
if (TABLESPACE_DEFAULT.equals(tablespace)) {
if (TABLESPACE_DEFAULT.equals(tablespace)) {
return null;
} else {
return tablespace;
@@ -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;
}
/**
@@ -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;
@@ -32,39 +29,30 @@ public class PlatformDdl {
private static final Pattern CHECK_PATTERN = Pattern.compile("(.*?\\( *)([^ ]+)(.*)");
protected final DatabasePlatform platform;
protected PlatformHistoryDdl historyDdl = new NoHistorySupportDdl();
/**
* Converter for logical/standard types to platform specific types. (eg. clob -> text)
*/
private final PlatformTypeConverter typeConverter;
/**
* For handling support of sequences and autoincrement.
*/
private final DbIdentity dbIdentity;
/**
* Set to true if table and column comments are included inline with the create statements.
*/
protected boolean inlineComments;
/**
* Default assumes if exists is supported.
*/
protected String dropTableIfExists = "drop table if exists ";
protected String dropTableCascade = "";
/**
* Default assumes if exists is supported.
*/
protected String dropSequenceIfExists = "drop sequence if exists ";
protected String foreignKeyOnDelete = "on delete";
protected String foreignKeyOnUpdate = "on update";
protected String identitySuffix = " auto_increment";
protected String identityStartWith = "start with";
protected String identityIncrementBy = "increment by";
@@ -72,61 +60,39 @@ public class PlatformDdl {
protected String sequenceStartWith = "start with";
protected String sequenceIncrementBy = "increment by";
protected String sequenceCache = "cache";
protected String alterTableIfExists = "";
protected String dropConstraintIfExists = "drop constraint if exists";
protected String dropIndexIfExists = "drop index if exists ";
protected String alterColumn = "alter column";
protected String dropUniqueConstraint = "drop constraint";
protected String addConstraint = "add constraint";
protected String addColumn = "add column";
protected String columnSetType = "";
protected String columnSetDefault = "set default";
protected String columnDropDefault = "drop default";
protected String columnSetNotnull = "set not null";
protected String columnSetNull = "set null";
protected String columnNotNull = "not null";
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";
protected String addForeignKeySkipCheck = "";
protected String uniqueIndex = "unique";
protected String indexConcurrent = "";
protected String createIndexIfNotExists = "";
/**
* Set false for MsSqlServer to allow multiple nulls for OneToOne mapping.
*/
protected boolean inlineUniqueWhenNullable = true;
protected DbConstraintNaming naming;
/**
* Generally not desired as then they are not named (used with SQLite).
*/
protected boolean inlineForeignKeys;
protected boolean includeStorageEngine;
protected final DbDefaultValue dbDefaultValue;
protected String fallbackArrayType = "varchar(1000)";
public PlatformDdl(DatabasePlatform platform) {
@@ -256,7 +222,6 @@ public class PlatformDdl {
* Write the column definition to the create table statement.
*/
protected void writeColumnDefinition(DdlBuffer buffer, Column column, DdlIdentity identity) {
String columnDefn = convert(column.getType());
if (identity.useIdentity() && isTrue(column.isPrimaryKey())) {
columnDefn = asIdentityColumn(columnDefn, identity);
@@ -274,7 +239,6 @@ public class PlatformDdl {
if (isTrue(column.isNotnull()) || isTrue(column.isPrimaryKey())) {
buffer.appendWithSpace(columnNotNull);
}
// add check constraints later as we really want to give them a nice name
// so that the database can potentially provide a nice SQL error
}
@@ -439,7 +403,6 @@ public class PlatformDdl {
* Return the foreign key constraint when used inline with create table.
*/
public String tableInlineForeignKey(WriteForeignKey request) {
StringBuilder buffer = new StringBuilder(90);
buffer.append("foreign key");
appendColumns(request.cols(), buffer);
@@ -453,7 +416,6 @@ public class PlatformDdl {
* Add foreign key.
*/
public String alterTableAddForeignKey(DdlOptions options, WriteForeignKey request) {
StringBuilder buffer = new StringBuilder(90);
buffer
.append("alter table ").append(quote(request.table()))
@@ -527,7 +489,6 @@ public class PlatformDdl {
* Overridden by MsSqlServer for specific null handling on unique constraints.
*/
public String alterTableAddUniqueConstraint(String tableName, String uqName, String[] columns, String[] nullableColumns) {
StringBuilder buffer = new StringBuilder(90);
buffer.append("alter table ").append(quote(tableName)).append(" add constraint ").append(maxConstraintName(uqName)).append(" unique ");
appendColumns(columns, buffer);
@@ -535,7 +496,6 @@ public class PlatformDdl {
}
public void alterTableAddColumn(DdlWrite writer, String tableName, Column column, boolean onHistoryTable, String defaultValue) {
String convertedType = convert(column.getType());
DdlBuffer buffer = alterTable(writer, tableName).append(addColumn, column.getName());
buffer.append(convertedType);
@@ -547,12 +507,10 @@ public class PlatformDdl {
buffer.append(defaultValue);
}
}
if (!onHistoryTable) {
if (isTrue(column.isNotnull())) {
buffer.appendWithSpace(columnNotNull);
}
// check constraints cannot be added in one statement for h2
if (!StringHelper.isNull(column.getCheckConstraint())) {
String ddl = alterTableAddCheckConstraint(tableName, column.getCheckConstraintName(), column.getCheckConstraint());
@@ -566,7 +524,6 @@ public class PlatformDdl {
* This method is used from DbTriggerBasedHistoryDdl to add the sysPeriodColumns.
*/
public void alterTableAddColumn(DdlWrite writer, String tableName, String columnName, String columnType, String defaultValue) {
String convertedType = convert(columnType);
DdlBuffer buffer = alterTable(writer, tableName).append(addColumn, columnName);
buffer.append(convertedType);
@@ -644,18 +601,14 @@ public class PlatformDdl {
* <p>
* Used by MySql, SQL Server, and HANA as these require all column attributes to
* be set together.
* </p>
*/
public void alterColumn(DdlWrite writer, AlterColumn alter) {
if (hasValue(alter.getType())) {
alterColumnType(writer, alter);
}
if (hasValue(alter.getDefaultValue())) {
alterColumnDefault(writer, alter);
}
if (alter.isNotnull() != null) {
alterColumnNotnull(writer, alter);
}
@@ -739,14 +692,14 @@ public class PlatformDdl {
* Use this to generate a prolog for each script (stored procedures)
*/
public void generateProlog(DdlWrite writer) {
// do nothing by default
}
/**
* Use this to generate an epilog. Will be added at the end of script
*/
public void generateEpilog(DdlWrite writer) {
// do nothing by default
}
/**
@@ -779,14 +732,10 @@ public class PlatformDdl {
return createTable;
}
public boolean suppressPrimaryKeyOnPartition() {
return false;
}
public void addTablePartition(DdlBuffer apply, String partitionMode, String partitionColumn) {
// only supported by postgres initially
}
/**
* Adds tablespace declaration. Now only supported for db2.
*/
@@ -816,4 +765,19 @@ 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();
}
/**
* Override to return true for Postgres / platforms that want the partition column to be
* part of the primary key when using table partitioning.
*/
public boolean addPartitionColumnToPrimaryKey() {
return false;
}
}
@@ -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 ";
@@ -25,13 +26,13 @@ public class PostgresDdl extends PlatformDdl {
}
@Override
public String setLockTimeout(int lockTimeoutSeconds) {
return "set lock_timeout = " + (lockTimeoutSeconds * 1000);
public boolean addPartitionColumnToPrimaryKey() {
return true;
}
@Override
public boolean suppressPrimaryKeyOnPartition() {
return true;
public String setLockTimeout(int lockTimeoutSeconds) {
return "set lock_timeout = " + (lockTimeoutSeconds * 1000);
}
@Override
@@ -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;
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}column" maxOccurs="unbounded"/>
* &lt;/sequence>
* &lt;attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="withHistory" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}column" maxOccurs="unbounded"/&gt;
* &lt;/sequence&gt;
* &lt;attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="withHistory" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@@ -49,7 +44,7 @@ public class AddColumn {
* <p>
* 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 <CODE>set</CODE> method for the column property.
*
* <p>
@@ -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;
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;attribute name="baseTable" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attribute name="baseTable" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@@ -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;
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="comment" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="comment" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@@ -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;
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;attribute name="constraintName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="columnNames" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="oneToOne" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* &lt;attribute name="nullableColumns" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="platforms" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attribute name="constraintName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="columnNames" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="oneToOne" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="nullableColumns" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="platforms" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@@ -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;
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="before" type="{http://ebean-orm.github.io/xml/ns/dbmigration}ddl-script" maxOccurs="unbounded" minOccurs="0"/>
* &lt;element name="after" type="{http://ebean-orm.github.io/xml/ns/dbmigration}ddl-script" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;attribute name="columnName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="withHistory" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* &lt;attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="currentType" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="defaultValue" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="currentDefaultValue" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="notnull" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* &lt;attribute name="currentNotnull" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* &lt;attribute name="comment" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="historyExclude" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* &lt;attribute name="checkConstraint" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="checkConstraintName" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="dropCheckConstraint" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="unique" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="uniqueOneToOne" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="dropUnique" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="references" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="foreignKeyName" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="foreignKeyIndex" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="foreignKeyOnDelete" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="foreignKeyOnUpdate" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="dropForeignKey" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="dropForeignKeyIndex" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="before" type="{http://ebean-orm.github.io/xml/ns/dbmigration}ddl-script" maxOccurs="unbounded" minOccurs="0"/&gt;
* &lt;element name="after" type="{http://ebean-orm.github.io/xml/ns/dbmigration}ddl-script" maxOccurs="unbounded" minOccurs="0"/&gt;
* &lt;/sequence&gt;
* &lt;attribute name="columnName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="withHistory" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="currentType" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="defaultValue" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="currentDefaultValue" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="notnull" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="currentNotnull" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="comment" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="historyExclude" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="checkConstraint" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="checkConstraintName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="dropCheckConstraint" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="unique" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="uniqueOneToOne" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="dropUnique" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="references" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="foreignKeyName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="foreignKeyIndex" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="foreignKeyOnDelete" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="foreignKeyOnUpdate" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="dropForeignKey" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="dropForeignKeyIndex" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@@ -116,7 +112,7 @@ public class AlterColumn {
* <p>
* 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 <CODE>set</CODE> method for the before property.
*
* <p>
@@ -143,7 +139,7 @@ public class AlterColumn {
* <p>
* 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 <CODE>set</CODE> method for the after property.
*
* <p>
@@ -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;
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="columnNames" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="refColumnNames" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="refTableName" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="indexName" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="onDelete" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="onUpdate" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="columnNames" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="refColumnNames" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="refTableName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="indexName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="onDelete" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="onUpdate" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@@ -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;
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;attribute name="baseTable" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attribute name="baseTable" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@@ -1,526 +1,443 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// 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;
/**
* <p>Java class for anonymous complex type.
*
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;attGroup ref="{http://ebean-orm.github.io/xml/ns/dbmigration}tablespaceAttributes"/>
* &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="newName" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="partitionMode" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="partitionColumn" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="identityType" type="{http://ebean-orm.github.io/xml/ns/dbmigration}identityType" />
* &lt;attribute name="identityStart" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
* &lt;attribute name="identityIncrement" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
* &lt;attribute name="identityCache" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
* &lt;attribute name="identityGenerated" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="sequenceName" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="sequenceInitial" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
* &lt;attribute name="sequenceAllocate" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
* &lt;attribute name="pkName" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="storageEngine" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attGroup ref="{http://ebean-orm.github.io/xml/ns/dbmigration}tablespaceAttributes"/&gt;
* &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="newName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="partitionMode" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="partitionColumn" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="identityType" type="{http://ebean-orm.github.io/xml/ns/dbmigration}identityType" /&gt;
* &lt;attribute name="identityStart" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /&gt;
* &lt;attribute name="identityIncrement" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /&gt;
* &lt;attribute name="identityCache" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /&gt;
* &lt;attribute name="identityGenerated" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="sequenceName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="sequenceInitial" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /&gt;
* &lt;attribute name="sequenceAllocate" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /&gt;
* &lt;attribute name="pkName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="storageEngine" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@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;
}
}
@@ -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.*;
/**
@@ -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;
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;simpleContent>
* &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
* &lt;/extension>
* &lt;/simpleContent>
* &lt;/complexType>
* &lt;complexType&gt;
* &lt;simpleContent&gt;
* &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema&gt;string"&gt;
* &lt;/extension&gt;
* &lt;/simpleContent&gt;
* &lt;/complexType&gt;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@@ -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;
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;choice>
* &lt;group ref="{http://ebean-orm.github.io/xml/ns/dbmigration}changeSetChildren" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/choice>
* &lt;/sequence>
* &lt;attribute name="type" use="required" type="{http://ebean-orm.github.io/xml/ns/dbmigration}changeSetType" />
* &lt;attribute name="dropsFor" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="suppressDropsForever" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* &lt;attribute name="generated" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* &lt;attribute name="author" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="comment" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;choice&gt;
* &lt;group ref="{http://ebean-orm.github.io/xml/ns/dbmigration}changeSetChildren" maxOccurs="unbounded" minOccurs="0"/&gt;
* &lt;/choice&gt;
* &lt;/sequence&gt;
* &lt;attribute name="type" use="required" type="{http://ebean-orm.github.io/xml/ns/dbmigration}changeSetType" /&gt;
* &lt;attribute name="dropsFor" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="suppressDropsForever" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="generated" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="author" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="comment" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*/
@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 {
* <p>
* 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 <CODE>set</CODE> method for the changeSetChildren property.
*
* <p>
@@ -94,22 +89,24 @@ public class ChangeSet {
*
* <p>
* 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<Object> getChangeSetChildren() {
if (changeSetChildren == null) {
@@ -9,16 +9,15 @@ import javax.xml.bind.annotation.XmlType;
* <p>Java class for changeSetType.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* <p>
* <pre>
* &lt;simpleType name="changeSetType">
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;enumeration value="apply"/>
* &lt;enumeration value="pendingDrops"/>
* &lt;enumeration value="baseline"/>
* &lt;enumeration value="drop"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;simpleType name="changeSetType"&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"&gt;
* &lt;enumeration value="apply"/&gt;
* &lt;enumeration value="pendingDrops"/&gt;
* &lt;enumeration value="baseline"/&gt;
* &lt;enumeration value="drop"/&gt;
* &lt;/restriction&gt;
* &lt;/simpleType&gt;
* </pre>
*/
@XmlType(name = "changeSetType")
@@ -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;
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="before" type="{http://ebean-orm.github.io/xml/ns/dbmigration}ddl-script" maxOccurs="unbounded" minOccurs="0"/>
* &lt;element name="after" type="{http://ebean-orm.github.io/xml/ns/dbmigration}ddl-script" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="defaultValue" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="notnull" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* &lt;attribute name="historyExclude" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* &lt;attribute name="primaryKey" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* &lt;attribute name="identity" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* &lt;attribute name="checkConstraint" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="checkConstraintName" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="unique" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="uniqueOneToOne" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="references" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="foreignKeyName" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="foreignKeyIndex" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="foreignKeyOnDelete" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="foreignKeyOnUpdate" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="comment" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="before" type="{http://ebean-orm.github.io/xml/ns/dbmigration}ddl-script" maxOccurs="unbounded" minOccurs="0"/&gt;
* &lt;element name="after" type="{http://ebean-orm.github.io/xml/ns/dbmigration}ddl-script" maxOccurs="unbounded" minOccurs="0"/&gt;
* &lt;/sequence&gt;
* &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="defaultValue" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="notnull" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="historyExclude" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="primaryKey" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="identity" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="checkConstraint" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="checkConstraintName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="unique" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="uniqueOneToOne" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="references" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="foreignKeyName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="foreignKeyIndex" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="foreignKeyOnDelete" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="foreignKeyOnUpdate" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="comment" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@@ -95,7 +91,7 @@ public class Column {
* <p>
* 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 <CODE>set</CODE> method for the before property.
*
* <p>
@@ -122,7 +118,7 @@ public class Column {
* <p>
* 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 <CODE>set</CODE> method for the after property.
*
* <p>
@@ -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;
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}defaultTablespace"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}defaultTablespace"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@@ -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;
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;attribute name="indexName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="columns" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="unique" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* &lt;attribute name="concurrent" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* &lt;attribute name="definition" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="platforms" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attribute name="indexName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="columns" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="unique" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="concurrent" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="definition" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="platforms" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@@ -0,0 +1,49 @@
package io.ebeaninternal.dbmigration.migration;
import javax.xml.bind.annotation.*;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*/
@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;
}
}
@@ -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;
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}column" maxOccurs="unbounded"/>
* &lt;element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}uniqueConstraint" maxOccurs="unbounded" minOccurs="0"/>
* &lt;element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}foreignKey" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;attGroup ref="{http://ebean-orm.github.io/xml/ns/dbmigration}tablespaceAttributes"/>
* &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="partitionMode" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="partitionColumn" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="withHistory" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* &lt;attribute name="draft" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* &lt;attribute name="identityType" type="{http://ebean-orm.github.io/xml/ns/dbmigration}identityType" />
* &lt;attribute name="identityStart" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
* &lt;attribute name="identityIncrement" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
* &lt;attribute name="identityCache" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
* &lt;attribute name="identityGenerated" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="sequenceName" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="sequenceInitial" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
* &lt;attribute name="sequenceAllocate" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
* &lt;attribute name="pkName" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="storageEngine" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}column" maxOccurs="unbounded"/&gt;
* &lt;element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}uniqueConstraint" maxOccurs="unbounded" minOccurs="0"/&gt;
* &lt;element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}foreignKey" maxOccurs="unbounded" minOccurs="0"/&gt;
* &lt;/sequence&gt;
* &lt;attGroup ref="{http://ebean-orm.github.io/xml/ns/dbmigration}tablespaceAttributes"/&gt;
* &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="partitionMode" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="partitionColumn" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="withHistory" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="draft" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="identityType" type="{http://ebean-orm.github.io/xml/ns/dbmigration}identityType" /&gt;
* &lt;attribute name="identityStart" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /&gt;
* &lt;attribute name="identityIncrement" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /&gt;
* &lt;attribute name="identityCache" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /&gt;
* &lt;attribute name="identityGenerated" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="sequenceName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="sequenceInitial" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /&gt;
* &lt;attribute name="sequenceAllocate" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /&gt;
* &lt;attribute name="pkName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="storageEngine" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@@ -110,7 +104,7 @@ public class CreateTable {
* <p>
* 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 <CODE>set</CODE> method for the column property.
*
* <p>
@@ -137,7 +131,7 @@ public class CreateTable {
* <p>
* 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 <CODE>set</CODE> method for the uniqueConstraint property.
*
* <p>
@@ -164,7 +158,7 @@ public class CreateTable {
* <p>
* 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 <CODE>set</CODE> method for the foreignKey property.
*
* <p>
@@ -524,7 +518,7 @@ public class CreateTable {
public void setIndexTablespace(String value) {
this.indexTablespace = value;
}
/**
* Gets the value of the lobTablespace property.
*
@@ -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;
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="ddl-script">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="ddl" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
* &lt;/sequence>
* &lt;attribute name="platforms" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;complexType name="ddl-script"&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="ddl" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/&gt;
* &lt;/sequence&gt;
* &lt;attribute name="platforms" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@@ -44,7 +40,7 @@ public class DdlScript {
* <p>
* 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 <CODE>set</CODE> method for the ddl property.
*
* <p>
@@ -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;
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;attribute name="tables" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="indexes" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="history" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attribute name="tables" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="indexes" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="history" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@@ -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;
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;attribute name="columnName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="withHistory" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attribute name="columnName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="withHistory" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@@ -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;
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;attribute name="baseTable" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attribute name="baseTable" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@@ -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;
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;attribute name="indexName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="concurrent" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* &lt;attribute name="platforms" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attribute name="indexName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="concurrent" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="platforms" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@@ -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;
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="sequenceCol" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="sequenceName" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="sequenceCol" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="sequenceName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@@ -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;
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="columnNames" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="refColumnNames" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="refTableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="indexName" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="onDelete" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="onUpdate" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="columnNames" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="refColumnNames" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="refTableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="indexName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="onDelete" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="onUpdate" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@@ -9,17 +9,16 @@ import javax.xml.bind.annotation.XmlType;
* <p>Java class for identityType.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* <p>
* <pre>
* &lt;simpleType name="identityType">
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
* &lt;enumeration value="identity"/>
* &lt;enumeration value="sequence"/>
* &lt;enumeration value="generator"/>
* &lt;enumeration value="external"/>
* &lt;enumeration value="default"/>
* &lt;/restriction>
* &lt;/simpleType>
* &lt;simpleType name="identityType"&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"&gt;
* &lt;enumeration value="identity"/&gt;
* &lt;enumeration value="sequence"/&gt;
* &lt;enumeration value="generator"/&gt;
* &lt;enumeration value="external"/&gt;
* &lt;enumeration value="default"/&gt;
* &lt;/restriction&gt;
* &lt;/simpleType&gt;
* </pre>
*/
@XmlType(name = "identityType")
@@ -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;
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}changeSet" maxOccurs="unbounded"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}changeSet" maxOccurs="unbounded"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@@ -42,7 +38,7 @@ public class Migration {
* <p>
* 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 <CODE>set</CODE> method for the changeSet property.
*
* <p>
@@ -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();
}
}
@@ -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;
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;attribute name="oldName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="newName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="dataType" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attribute name="oldName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="newName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="dataType" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@@ -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;
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;attribute name="oldName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="newName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attribute name="oldName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="newName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@@ -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;
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;simpleContent>
* &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string">
* &lt;/extension>
* &lt;/simpleContent>
* &lt;/complexType>
* &lt;complexType&gt;
* &lt;simpleContent&gt;
* &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema&gt;string"&gt;
* &lt;/extension&gt;
* &lt;/simpleContent&gt;
* &lt;/complexType&gt;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@@ -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;
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}apply"/>
* &lt;element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}rollback"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}apply"/&gt;
* &lt;element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}rollback"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@@ -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;
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="columnNames" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="oneToOne" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* &lt;attribute name="nullableColumns" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="platforms" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="columnNames" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="oneToOne" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="nullableColumns" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="platforms" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@@ -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<String> baseSchemas = baseModel.getSchemas();
for (String schema : newModel.getSchemas()) {
if (!baseSchemas.contains(schema)) {
addCreateSchema(schema);
}
}
Map<String, MTable> 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.
*/
@@ -97,6 +97,12 @@
</xsd:complexType>
</xsd:element>
<xsd:element name="createSchema">
<xsd:complexType>
<xsd:attribute name="name" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<!-- TABLE -->
<xsd:element name="createTable">
@@ -218,7 +224,7 @@
<xsd:attribute name="baseTable" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="alterTable">
<xsd:complexType>
<xsd:attribute name="name" type="xsd:string" use="required"/>
@@ -238,7 +244,7 @@
<xsd:attributeGroup ref="tablespaceAttributes"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="dropHistoryTable">
<xsd:complexType>
@@ -372,6 +378,7 @@
<xsd:element ref="configuration" maxOccurs="1"/>
<xsd:element ref="sql" maxOccurs="unbounded"/>
<xsd:element ref="createSchema" maxOccurs="unbounded"/>
<xsd:element ref="createTable" maxOccurs="unbounded"/>
<xsd:element ref="alterTable" maxOccurs="unbounded"/>
<xsd:element ref="dropTable" maxOccurs="unbounded"/>
@@ -390,7 +397,6 @@
<xsd:element ref="createIndex" maxOccurs="unbounded"/>
<xsd:element ref="dropIndex" maxOccurs="unbounded"/>
</xsd:choice>
</xsd:group>
@@ -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();
@@ -0,0 +1,127 @@
package io.ebeaninternal.dbmigration.ddlgeneration.platform;
import io.ebean.config.NamingConvention;
import io.ebean.config.UnderscoreNamingConvention;
import io.ebean.platform.postgres.PostgresPlatform;
import io.ebeaninternal.dbmigration.migration.Column;
import io.ebeaninternal.dbmigration.migration.CreateTable;
import io.ebeaninternal.dbmigration.migration.IdentityType;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.*;
class BaseTableIdentityTest {
static final PlatformDdl postgresDdl = new PostgresDdl(new PostgresPlatform());
static final NamingConvention namingConvention = new UnderscoreNamingConvention();
static {
namingConvention.setDatabasePlatform(new PostgresPlatform());
}
@Test
void identity_noPk() {
CreateTable createTable = table(column("c0"), column("c1"));
BaseTableIdentity bti = new BaseTableIdentity(createTable, postgresDdl, namingConvention);
DdlIdentity identity = bti.identity();
assertFalse(identity.useIdentity());
assertFalse(bti.hasPrimaryKey());
assertThat(bti.pkColumns()).isEmpty();
}
@Test
void identity_singlePk() {
CreateTable createTable = table(column("c0", true), column("c1"));
BaseTableIdentity bti = new BaseTableIdentity(createTable, postgresDdl, namingConvention);
DdlIdentity identity = bti.identity();
assertTrue(identity.useIdentity());
assertTrue(bti.hasPrimaryKey());
assertThat(bti.pkColumns()).hasSize(1);
}
@Test
void identity_singlePk_useSequence_deriveName() {
BaseTableIdentity bti = new BaseTableIdentity(createTableWithSequence(null), postgresDdl, namingConvention);
DdlIdentity identity = bti.identity();
assertThat(identity.getSequenceName()).isEqualTo("tab0_seq");
assertFalse(identity.useIdentity());
assertTrue(bti.hasPrimaryKey());
assertThat(bti.pkColumns()).hasSize(1);
}
@Test
void identity_singlePk_useSequence_explicitName() {
CreateTable createTable = createTableWithSequence("myseq");
BaseTableIdentity bti = new BaseTableIdentity(createTable, postgresDdl, namingConvention);
DdlIdentity identity = bti.identity();
assertThat(identity.getSequenceName()).isEqualTo("myseq");
assertFalse(identity.useIdentity());
assertTrue(bti.hasPrimaryKey());
assertThat(bti.pkColumns()).hasSize(1);
}
private CreateTable createTableWithSequence(String seqName) {
CreateTable createTable = table(column("c0", true), column("c1"));
createTable.setIdentityType(IdentityType.SEQUENCE);
createTable.setName("tab0");
createTable.setSequenceName(seqName);
return createTable;
}
@Test
void identity_singlePk_withPartitionColumn() {
CreateTable createTable = table(column("c0", true), column("c1"), column("pc"));
createTable.setPartitionMode("DAY");
createTable.setPartitionColumn("pc");
BaseTableIdentity bti = new BaseTableIdentity(createTable, postgresDdl, namingConvention);
DdlIdentity identity = bti.identity();
assertTrue(identity.useIdentity());
assertTrue(bti.hasPrimaryKey());
assertThat(bti.pkColumns()).hasSize(2);
assertThat(bti.pkColumns().get(0).getName()).isEqualTo("c0");
assertThat(bti.pkColumns().get(1).getName()).isEqualTo("pc");
}
@Test
void identity_singlePk_withPartitionColumnAlreadyInPk() {
CreateTable createTable = table(column("c0", true), column("c1"), column("pc", true));
createTable.setPartitionMode("DAY");
createTable.setPartitionColumn("pc");
BaseTableIdentity bti = new BaseTableIdentity(createTable, postgresDdl, namingConvention);
DdlIdentity identity = bti.identity();
assertFalse(identity.useIdentity());
assertTrue(bti.hasPrimaryKey());
assertThat(bti.pkColumns()).hasSize(2);
assertThat(bti.pkColumns().get(0).getName()).isEqualTo("c0");
assertThat(bti.pkColumns().get(1).getName()).isEqualTo("pc");
}
CreateTable table(Column... cols) {
CreateTable createTable = new CreateTable();
for (Column col : cols) {
createTable.getColumn().add(col);
}
return createTable;
}
Column column(String name) {
return column(name, null);
}
Column column(String name, Boolean primaryKey) {
Column col = new Column();
col.setName(name);
col.setPrimaryKey(primaryKey);
return col;
}
}
@@ -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");
@@ -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<Object> 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);
}
}
+1 -1
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.6.0</version>
<version>13.6.2</version>
</parent>
<name>ebean external mapping api</name>
+7 -7
View File
@@ -4,12 +4,12 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.6.0</version>
<version>13.6.2</version>
</parent>
<scm>
<developerConnection>scm:git:git@github.com:ebean-orm/ebean.git</developerConnection>
<tag>ebean-parent-13.6.0</tag>
<tag>ebean-parent-13.6.2</tag>
</scm>
<name>ebean external mapping xml</name>
@@ -28,7 +28,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-externalmapping-api</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
@@ -61,21 +61,21 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-h2</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-ddl-generator</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
<scope>test</scope>
</dependency>
@@ -98,7 +98,7 @@
<configuration>
<tiles>
<!-- other tiles ... -->
<tile>io.ebean.tile:enhancement:13.3.0</tile>
<tile>io.ebean.tile:enhancement:13.6.0</tile>
</tiles>
</configuration>
</plugin>
+4 -4
View File
@@ -6,7 +6,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.6.0-SNAPSHOT</version>
<version>13.6.2-SNAPSHOT</version>
</parent>
<artifactId>ebean-kotlin</artifactId>
@@ -28,7 +28,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.6.0-SNAPSHOT</version>
<version>13.6.2-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
@@ -50,7 +50,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>13.6.0-SNAPSHOT</version>
<version>13.6.2-SNAPSHOT</version>
<scope>test</scope>
</dependency>
@@ -92,7 +92,7 @@
<extensions>true</extensions>
<configuration>
<tiles>
<tile>io.ebean.tile:enhancement:13.3.0</tile>
<tile>io.ebean.tile:enhancement:13.6.0</tile>
</tiles>
</configuration>
</plugin>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.6.0</version>
<version>13.6.2</version>
</parent>
<name>ebean postgis</name>
@@ -22,14 +22,14 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<!-- provided scope -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
<scope>provided</scope>
</dependency>
@@ -73,7 +73,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
<scope>test</scope>
</dependency>
@@ -104,7 +104,7 @@
<extensions>true</extensions>
<configuration>
<tiles>
<tile>io.ebean.tile:enhancement:13.3.0</tile>
<tile>io.ebean.tile:enhancement:13.6.0</tile>
</tiles>
</configuration>
</plugin>
@@ -9,8 +9,9 @@ ebean:
ddlMode: dropCreate # none | dropCreate | create | migration | createOnly | migrationDropCreate
dbName: mygisapp
# postgres:
# containerName: postgis10
postgis:
containerName: ebeanbuild_postgis
port: 9432
# image: mdillon/postgis
# extensions: postgis
# url: jdbc:postgresql_lwgis://localhost:6432/mygisapp
+6 -6
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.6.0</version>
<version>13.6.2</version>
</parent>
<name>ebean querybean</name>
@@ -17,7 +17,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
<scope>provided</scope>
</dependency>
@@ -63,21 +63,21 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-ddl-generator</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>querybean-generator</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
<scope>test</scope>
</dependency>
@@ -107,7 +107,7 @@
<extensions>true</extensions>
<configuration>
<tiles>
<tile>io.ebean.tile:enhancement:13.3.0</tile>
<tile>io.ebean.tile:enhancement:13.6.0</tile>
</tiles>
</configuration>
</plugin>
@@ -0,0 +1,69 @@
package org.example.domain;
import javax.persistence.Embeddable;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import java.util.Objects;
@Entity
@IdClass(MyInner.ID.class)
public class MyInner {
@Embeddable
public static class ID {
final long id;
final String one;
public ID(long id, String one) {
this.id = id;
this.one = one;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ID id1 = (ID) o;
return id == id1.id && one.equals(id1.one);
}
@Override
public int hashCode() {
return Objects.hash(id, one);
}
}
@Id
long id;
@Id
String one;
String description;
public long id() {
return id;
}
public MyInner id(long id) {
this.id = id;
return this;
}
public String one() {
return one;
}
public MyInner one(String beanOne) {
this.one = beanOne;
return this;
}
public String description() {
return description;
}
public MyInner description(String description) {
this.description = description;
return this;
}
}
@@ -0,0 +1,30 @@
package org.querytest;
import io.ebean.DB;
import org.example.domain.MyInner;
import org.example.domain.query.QMyInner;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
class MyInnerTest {
@Test
void insert_and_find() {
MyInner myInner = new MyInner()
.id(42).one("one").description("foo");
DB.save(myInner);
MyInner found = DB.find(MyInner.class, new MyInner.ID(42, "one"));
assertThat(found).isNotNull();
MyInner found2 = new QMyInner()
.id.eq(42)
.one.eq("one")
.findOne();
assertThat(found2).isNotNull();
}
}
+7 -7
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.6.0</version>
<version>13.6.2</version>
</parent>
<artifactId>ebean-redis</artifactId>
@@ -22,35 +22,35 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>querybean-generator</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
<scope>test</scope>
</dependency>
@@ -80,7 +80,7 @@
<extensions>true</extensions>
<configuration>
<tiles>
<tile>io.ebean.tile:enhancement:13.3.0</tile>
<tile>io.ebean.tile:enhancement:13.6.0</tile>
</tiles>
</configuration>
</plugin>
+6 -6
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.6.0</version>
<version>13.6.2</version>
</parent>
<name>ebean test</name>
@@ -29,20 +29,20 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-h2</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-ddl-generator</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
</dependency>
<dependency>
@@ -106,7 +106,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-all</artifactId>
<version>13.6.0</version>
<version>13.6.2</version>
<scope>test</scope>
</dependency>
@@ -266,7 +266,7 @@
<extensions>true</extensions>
<configuration>
<tiles>
<tile>io.ebean.tile:enhancement:13.3.0</tile>
<tile>io.ebean.tile:enhancement:13.6.0</tile>
</tiles>
</configuration>
</plugin>
@@ -4,7 +4,7 @@ import io.ebean.config.DatabaseConfig;
import io.ebean.datasource.DataSourceConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.util.Properties;
/**
@@ -18,7 +18,7 @@ class Config {
* Common optional docker parameters that we just transfer to docker properties.
*/
private static final String[] DOCKER_TEST_PARAMS = {"fastStartMode", "inMemory", "initSqlFile", "seedSqlFile", "adminUser", "adminPassword", "extraDb", "extraDb.dbName", "extraDb.username", "extraDb.password", "extraDb.initSqlFile", "extraDb.seedSqlFile"};
private static final String[] DOCKER_PLATFORM_PARAMS = {"containerName", "image", "internalPort", "startMode", "stopMode", "shutdown", "maxReadyAttempts", "tmpfs", "collation", "characterSet"};
private static final String[] DOCKER_PLATFORM_PARAMS = {"containerName", "image", "internalPort", "startMode", "shutdownMode", "maxReadyAttempts", "tmpfs", "collation", "characterSet"};
private static final String DDL_MODE_OPTIONS = "dropCreate, create, none, migration, createOnly or migrationDropCreate";
@@ -63,7 +63,7 @@ class Config {
}
void setDefaultPort(int defaultPort) {
String val = getPlatformKey("port", null);
String val = getKey("port", null);
if (val != null) {
port = Integer.parseInt(val);
} else {
@@ -225,7 +225,7 @@ class Config {
}
void setUrl(String urlPattern) {
String val = getPlatformKey("url", urlPattern);
String val = getKey("url", urlPattern);
val = val.replace("${host}", host());
val = val.replace("${port}", String.valueOf(port));
val = val.replace("${databaseName}", databaseName);
@@ -245,7 +245,7 @@ class Config {
}
void setDriver(String driver) {
this.driver = getPlatformKey("driver", driver);
this.driver = getKey("driver", driver);
}
void setPasswordDefault() {
@@ -259,7 +259,7 @@ class Config {
private String deriveDbSchema() {
String dbSchema = properties.getProperty("ebean.dbSchema", config.getDbSchema());
dbSchema = properties.getProperty("ebean.test.dbSchema", dbSchema);
return getPlatformKey("schema", dbSchema);
return getKey("schema", dbSchema);
}
/**
@@ -267,7 +267,7 @@ class Config {
*/
void setUsernameDefault() {
this.schema = first(deriveDbSchema());
String defaultValue = schema != null ? schema : getPlatformKey("databaseName", this.databaseName);
String defaultValue = schema != null ? schema : getKey("databaseName", this.databaseName);
this.username = getKey("username", defaultValue);
}
@@ -308,11 +308,11 @@ class Config {
}
void setUsername(String username) {
this.username = getPlatformKey("username", username);
this.username = getKey("username", username);
}
void setDatabaseName(String databaseName) {
this.databaseName = getPlatformKey("databaseName", databaseName);
this.databaseName = getKey("databaseName", databaseName);
}
boolean isUseDocker() {
@@ -321,7 +321,7 @@ class Config {
}
void setDockerVersion(String version) {
String val = getPlatformKey("version", version);
String val = getKey("version", version);
dockerProperties.setProperty(dockerKey("version"), val);
if (containerDropCreate) {
dockerProperties.setProperty(dockerKey("startMode"), "dropCreate");
@@ -334,16 +334,16 @@ class Config {
}
void setDockerContainerName(String containerName) {
dockerProperties.setProperty(dockerKey("containerName"), getPlatformKey("containerName", containerName));
dockerProperties.setProperty(dockerKey("containerName"), getKey("containerName", containerName));
}
void setDockerImage(String defaultImage) {
dockerProperties.setProperty(dockerKey("image"), getPlatformKey("image", defaultImage));
dockerProperties.setProperty(dockerKey("image"), getKey("image", defaultImage));
}
void setExtensions(String defaultValue) {
// ebean.test.postgres.extensions=hstore,pgcrypto
String val = getPlatformKey("extensions", defaultValue);
String val = getKey("extensions", defaultValue);
if (val != null) {
dockerProperties.setProperty(dockerKey("extensions"), trimExtensions(val));
}
@@ -363,7 +363,7 @@ class Config {
return properties.getProperty("ebean.test." + platform + "." + key, defaultValue);
}
private String getKey(String key, String defaultValue) {
String getKey(String key, String defaultValue) {
defaultValue = properties.getProperty("ebean.test." + key, defaultValue);
return properties.getProperty("ebean.test." + platform + "." + key, defaultValue);
}
@@ -388,11 +388,10 @@ class Config {
}
private void setDockerOptionalParameters() {
// check for shutdown mode on all containers
String mode = properties.getProperty("ebean.test.shutdown");
if (mode != null && !ignoreDockerShutdown()) {
dockerProperties.setProperty(dockerKey("shutdown"), mode);
String mode = properties.getProperty("ebean.test.shutdownMode");
if (mode != null) {
dockerProperties.setProperty(dockerKey("shutdownMode"), mode);
}
for (String key : DOCKER_TEST_PARAMS) {
String val = getKey(key, null);
@@ -402,7 +401,7 @@ class Config {
}
}
for (String key : DOCKER_PLATFORM_PARAMS) {
String val = getPlatformKey(key, null);
String val = getKey(key, null);
val = properties.getProperty("docker." + platform + "." + key, val);
if (val != null) {
dockerProperties.setProperty(dockerKey(key), val);
@@ -410,26 +409,6 @@ class Config {
}
}
/**
* For local development we might want to ignore docker shutdown.
* <p>
* So we just want the shutdown mode to be used on the CI server.
*/
boolean ignoreDockerShutdown() {
String localDev = properties.getProperty("ebean.test.localDevelopment", "~/.ebean/ignore-docker-shutdown");
return ignoreDockerShutdown(localDev);
}
boolean ignoreDockerShutdown(String localDev) {
if (localDev.startsWith("~/")) {
File homeDir = new File(System.getProperty("user.home"));
return new File(homeDir, localDev.substring(2)).exists();
}
return new File(localDev).exists();
}
private String dockerKey(String key) {
return dockerPlatform + "." + key;
}
@@ -442,7 +421,7 @@ class Config {
* Pretty much only for SqlServer as we have the 2 platforms we need to choose from.
*/
void setDatabasePlatformName() {
String databasePlatformName = getPlatformKey("databasePlatformName", null);
String databasePlatformName = getKey("databasePlatformName", null);
if (databasePlatformName != null) {
setProperty("ebean." + db + ".databasePlatformName", databasePlatformName);
}
@@ -9,7 +9,7 @@ import java.util.Properties;
*/
class ElasticSearchSetup {
private static final String[] DOCKER_PARAMS = {"containerName", "image", "internalPort", "startMode", "shutdown"};
private static final String[] DOCKER_PARAMS = {"containerName", "image", "internalPort", "startMode", "shutdownMode"};
private final Properties config;
@@ -21,7 +21,7 @@ class ElasticSearchSetup {
String version = read("version", null);
if (version != null) {
Properties properties = populateDockerProperties(version);
ElasticContainer.newBuilder(version)
ElasticContainer.builder(version)
.properties(properties)
.build()
.start();
@@ -30,9 +30,9 @@ class ElasticSearchSetup {
private Properties populateDockerProperties(String version) {
PropertiesBuilder properties = new PropertiesBuilder();
String mode = config.getProperty("ebean.test.shutdown");
String mode = config.getProperty("ebean.test.shutdownMode");
if (mode != null) {
properties.set("shutdown", mode);
properties.set("shutdownMode", mode);
}
properties.set("version", version);
@@ -5,13 +5,12 @@ import java.util.Properties;
/**
* A variation of Postgres that expected Postgis extension support.
*
* Uses mdillon/postgis image by default.
* Uses postgis/postgis image by default.
*/
class PostgisSetup implements PlatformSetup {
@Override
public Properties setup(Config config) {
int defaultPort = config.isUseDocker() ? 7432 : 5432;
config.setDockerPlatform("postgres");
@@ -27,20 +26,17 @@ class PostgisSetup implements PlatformSetup {
config.urlAppend("?currentSchema=" + schema);
}
config.datasourceDefaults();
return dockerProperties(config);
}
private Properties dockerProperties(Config config) {
if (!config.isUseDocker()) {
return new Properties();
}
config.setExtensions("hstore,pgcrypto,postgis");
config.setDockerImage("mdillon/postgis");
config.setDockerContainerName("postgis");
config.setDockerVersion("10");
config.setDockerContainerName("ut_postgis");
config.setDockerImage("postgis/postgis");
config.setDockerVersion("14");
return config.getDockerProperties();
}
@@ -15,7 +15,7 @@ class RedisSetup {
String host = dockerHost.dockerHost(properties.getProperty("ebean.test.dockerHost"));
properties.setProperty("redis.host", host);
}
RedisContainer.newBuilder(version)
RedisContainer.builder(version)
.properties(properties)
.build()
.start();
@@ -6,7 +6,6 @@ import io.ebean.datasource.DataSourceConfig;
import io.ebeaninternal.api.DbOffline;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import java.util.Properties;
@@ -14,22 +13,21 @@ import java.util.Properties;
import static org.assertj.core.api.Assertions.assertThat;
public class ConfigTest {
class ConfigTest {
@BeforeAll
public static void before() {
static void before() {
// so that RunOnceMarker is not set when running these tests
DbOffline.setPlatform(Platform.H2);
}
@AfterAll
public static void after() {
static void after() {
DbOffline.reset();
}
@Test
public void trimExtensions() {
void trimExtensions() {
Config config = new Config("db", "db", "db", new DatabaseConfig());
assertThat(config.trimExtensions("a,b")).isEqualTo("a,b");
@@ -38,8 +36,7 @@ public class ConfigTest {
}
@Test
public void extraDbProperties_basic() {
void extraDbProperties_basic() {
Properties p = new Properties();
p.setProperty("ebean.test.extraDb", "other");
@@ -61,8 +58,7 @@ public class ConfigTest {
}
@Test
public void extraDbProperties_basic_extraDb_dbName() {
void extraDbProperties_basic_extraDb_dbName() {
Properties p = new Properties();
p.setProperty("ebean.test.extraDb.dbName", "other");
@@ -84,8 +80,7 @@ public class ConfigTest {
}
@Test
public void extraDbProperties_withOptions() {
void extraDbProperties_withOptions() {
Properties p = new Properties();
p.setProperty("ebean.test.extraDb", "other1");
p.setProperty("ebean.test.extraDb.dbName", "other_db_name");
@@ -112,10 +107,8 @@ public class ConfigTest {
assertThat(p.getProperty("datasource.other_db_name.url")).isEqualTo("other_url");
}
@Test
public void extraDbProperties_withExtraDbOptions() {
void extraDbProperties_withExtraDbOptions() {
Properties sourceProperties = new Properties();
sourceProperties.setProperty("ebean.test.dbName", "main");
sourceProperties.setProperty("ebean.test.extraDb.dbName", "central");
@@ -144,46 +137,55 @@ public class ConfigTest {
Properties centralProps = serverConfig.getProperties();
assertThat(centralProps.getProperty("datasource.central.username")).isEqualTo("central");
}
@Test
public void ignoreDockerShutdown() {
void readImage_fromPlatform() {
Properties p = new Properties();
p.setProperty("ebean.test.postgres.image", "bar/bar");
Config config = createConfig(p);
Properties sourceProperties = new Properties();
DatabaseConfig serverConfig = new DatabaseConfig();
serverConfig.loadFromProperties(sourceProperties);
String val = config.getPlatformKey("image", "someDefault");
assertThat(val).isEqualTo("bar/bar");
Config config = new Config("main", "postgres", "main", serverConfig);
assertThat(config.ignoreDockerShutdown("./src/test/resources/logback-test.xml")).isTrue();
assertThat(config.ignoreDockerShutdown("./src/test/resources/file-does-not-exist")).isFalse();
}
@Disabled
@Test
public void run_local_only_ignoreDockerShutdown() {
Properties sourceProperties = new Properties();
DatabaseConfig serverConfig = new DatabaseConfig();
serverConfig.loadFromProperties(sourceProperties);
Config config = new Config("main", "postgres", "main", serverConfig);
assertThat(config.ignoreDockerShutdown("~/.ebean/ignore-docker-shutdown")).isTrue();
assertThat(config.ignoreDockerShutdown()).isTrue();
val = config.getKey("image", "someDefault");
assertThat(val).isEqualTo("bar/bar");
}
@Test
public void ignoreDockerShutdown_viaProperties() {
void readImage_fromTopLevel() {
Properties p = new Properties();
p.setProperty("ebean.test.image", "bar/bar");
p.setProperty("ebean.test.notPlatform.image", "bar/bar");
Config config = createConfig(p);
Properties sourceProperties = new Properties();
sourceProperties.setProperty("ebean.test.localDevelopment", "./src/test/resources/logback-test.xml");
String val = config.getPlatformKey("image", "someDefault");
assertThat(val).isEqualTo("someDefault");
val = config.getKey("image", "someDefault");
assertThat(val).isEqualTo("bar/bar");
}
@Test
void readImage_expect_platformSpecificWins() {
Properties p = new Properties();
p.setProperty("ebean.test.image", "foo/foo");
p.setProperty("ebean.test.postgres.image", "bar/bar");
Config config = createConfig(p);
String val = config.getPlatformKey("image", "someDefault");
assertThat(val).isEqualTo("bar/bar");
val = config.getKey("image", "someDefault");
assertThat(val).isEqualTo("bar/bar");
}
private Config createConfig(Properties p) {
DatabaseConfig serverConfig = new DatabaseConfig();
serverConfig.loadFromProperties(sourceProperties);
Config config = new Config("main", "postgres", "main", serverConfig);
assertThat(config.ignoreDockerShutdown()).isTrue();
serverConfig.setName("scOther");
serverConfig.loadFromProperties(p);
return new Config("db_name", "postgres", "db_name", serverConfig);
}
}
@@ -5,7 +5,7 @@ import io.ebean.docker.commands.CockroachContainer;
public class StartCockroach {
public static void main(String[] args) {
CockroachContainer.newBuilder("v21.2.4")
CockroachContainer.builder("v21.2.4")
.dbName("unit")
.build()
.start();
+1 -1
View File
@@ -5,7 +5,7 @@ import io.ebean.docker.commands.Db2Container;
public class StartDb2 {
public static void main(String[] args) {
Db2Container.newBuilder("11.5.6.0a")
Db2Container.builder("11.5.6.0a")
.dbName("unit")
.user("unit")
.password("unit")

Some files were not shown because too many files have changed in this diff Show More