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
Rob Bygrave bac7eb11bd [maven-release-plugin] prepare release ebean-parent-13.6.0 2022-05-03 15:13:13 +12:00
Rob Bygrave a8c2e4db3f Our release profile is now called "central" 2022-05-03 15:09:34 +12:00
Rob Bygrave 67a4e66b00 [maven-release-plugin] rollback the release of ebean-parent-13.6.0 2022-05-03 15:07:55 +12:00
Rob Bygrave 0d1d212f9f [maven-release-plugin] prepare for next development iteration 2022-05-03 14:59:36 +12:00
Rob Bygrave f44c77f5f5 [maven-release-plugin] prepare release ebean-parent-13.6.0 2022-05-03 14:59:29 +12:00
Rob Bygrave 65d07f4af9 Merge branch 'master' of github.com:ebean-orm/ebean 2022-05-03 14:48:52 +12:00
Rob Bygrave c74de4c221 Bump ebean-agent to 13.6.0 2022-05-03 14:48:38 +12:00
Rob BygraveandGitHub ebbef86def Merge pull request #2626 from ebean-orm/wip/EntityBeanIntercept-interface
Support EntityBeanIntercept as an interface with InterceptReadWrite and InterceptReadOnly options
2022-05-03 14:15:49 +12:00
Rob Bygrave 3fab465a13 #2649 - Bump avaje-config to 2.0 (uses System.Logger and not slf4j-api) 2022-05-03 13:50:22 +12:00
Rob BygraveandGitHub ff662bff58 Merge pull request #2683 from ebean-orm/feature/bump-datasource
Bump ebean-datasource to 8.0 with use of System.Logger (from slf4j-api)
2022-05-03 13:46:18 +12:00
Rob Bygrave cc7acd4761 Bump ebean-datasource to 8.0 with use of System.Logger (from slf4j-api) 2022-05-03 13:45:35 +12:00
Rob BygraveandGitHub 1365e39e94 Merge pull request #2681 from ebean-orm/feature/2647
#2647 - When Postgres + isAllQuotedIdentifiers true + using DataSourceConfig THEN `datasourceConfig.addProperty("quoteReturningIdentifiers", false);`
2022-05-03 13:38:10 +12:00
Rob BygraveandGitHub a73eb1c42f Merge pull request #2648 from ebean-orm/feature/bump-classpathscanner
Bump avaje classpath scanner to 7.1, ignores module-info, uses System.Logger (not slf4j-api)
2022-05-03 13:36:39 +12:00
Rob BygraveandGitHub 3f5a610df1 Merge pull request #2650 from ebean-orm/feature/bump-ddlrunner
Bump ebean-ddl-runner (sync version with ebean-migration)
2022-05-03 13:36:29 +12:00
Rob BygraveandGitHub d96e28991c Merge pull request #2682 from ebean-orm/feature/ebean-migration-system-logger
Bump ebean-migration to 13.6.0 (bumps classpath scanner and ebean-ddl-runner)
2022-05-03 13:36:16 +12:00
Rob Bygrave e84d12dad8 Bump ebean-migration to 13.6.0 (bumps classpath scanner and ebean-ddl-runner) 2022-05-03 13:30:09 +12:00
Rob Bygrave 1d4f2ad856 #2626 - Add final modifier to methods - For readOnly disableLazyLoad using Collections.EMPTY_LIST etc 2022-05-03 12:23:22 +12:00
Rob Bygrave 84042397b6 #2626 - For readOnly disableLazyLoad using Collections.EMPTY_LIST etc for reference collections 2022-05-03 12:12:47 +12:00
Rob Bygrave a70461d779 Update InterceptReadWrite with file content diff detection 2022-05-03 10:46:22 +12:00
Rob Bygrave d1b5400f2c Merge branch 'master' into wip/EntityBeanIntercept-interface 2022-05-03 10:45:45 +12:00
Rob Bygrave 244f336f54 #2647 - When Postgres + isAllQuotedIdentifiers true + using DataSourceConfig THEN datasourceConfig.addProperty("quoteReturningIdentifiers", false);
I think there is not a case where we do NOT want to do this. allQuotedIdentifiers + Postgres is almost not usable without this.
2022-05-03 10:15:07 +12:00
Rob Bygrave f92887b2f0 #2680 - Bump parent to java11-oss 3.8 which moves nexus-staging-maven-plugin and distributionManagement under "central" profile
This means that the nexus-staging-maven-plugin should not be used for forks looking to deploy into their own local nexus/archiva maven repo.
2022-05-03 09:06:27 +12:00
Rob Bygrave f49b93a845 Bump to 13.6.0-SNAPSHOT 2022-05-03 08:55:50 +12:00
Rob Bygrave a6f3a4f922 Bump to 13.6.0-SNAPSHOT 2022-05-03 08:37:29 +12:00
Rob Bygrave d6a65e4e66 Bump to 13.6.0-SNAPSHOT 2022-05-02 22:31:32 +12:00
Rob BygraveandGitHub ea5b4e9271 Merge pull request #2662 from ebean-orm/feature/deprecated-remove-Ebean
Remove deprecated Ebean, EbeanServer, EbeanServerFactory, ServerConfig migrate to DB, Database, DatabaseFactory, DatabaseConfig
2022-05-02 22:27:57 +12:00
Rob BygraveandGitHub ffa50b3176 Merge pull request #2679 from ebean-orm/feature/2677
#2677 - Fix for trim failing on mutation of lastAccessTime
2022-05-02 22:25:13 +12:00
Rob Bygrave 2cf83278ea #2677 - Change trimOnPut to be 10% of max or 1_000.
Can look to provide an explicit option via `@CacheBeanTuning` later.
2022-05-02 22:19:37 +12:00
Rob Bygrave 5c332286b6 #2677 - Add ReentrantLock for DefaultServerCache.runEviction() and trigger runEviction() via mutationCounter
If we get a lot of cache mutation (puts) between background trims then also trigger runEviction() in foreground using mutationCounter.
2022-05-02 21:48:58 +12:00
Rob Bygrave 1cd319c495 #2677 - Add try catch around DefaultServerCache.runEviction()
If there is an unexpected error we expect it to be temporary and want runEviction() to keep executing.
2022-05-02 20:51:33 +12:00
Rob BygraveandGitHub cec8a2e482 Merge pull request #2678 from focbenz/patch-1
Fixed typo Junit -> JUnit in README
2022-05-02 20:33:01 +12:00
Rob Bygrave d036edf7fd #2677 - Fix for trim failing on mutation of lastAccessTime
Currently, lastAccessTime can mutate during cache trim processing. This fixes this issue by taking a copy of the lastAccessTime storing as lastAccessSort and using that for sorting for cache trim.
2022-05-02 20:31:10 +12:00
Michael BenzandGitHub 2fefb5c7ef Merge branch 'ebean-orm:master' into patch-1 2022-05-02 10:10:34 +02:00
Michael BenzandGitHub 4278aa46f5 Junit -> JUnit
Just one more change ... verified in Intellij:
Junit -> JUnit
2022-05-02 10:08:46 +02:00
Rob BygraveandGitHub 7873a2b327 Merge pull request #2676 from focbenz/patch-1
Fix grammar in README.md
2022-05-02 20:08:04 +12:00
Rob BygraveandGitHub 9d3a3ddfeb Merge pull request #2675 from ebean-orm/feature/DefaultOrmQuery-final
Modify DefaultOrmQuery to have non-final copy() methods to allow ebean-mocker to be updated
2022-05-02 20:07:40 +12:00
Michael BenzandGitHub ac0b9aa025 Fix grammar in README.md
Just some grammatical fixes and uppercasings in README. No code changes here!
2022-05-02 08:40:34 +02:00
Rob Bygrave 4d4f8e2c4b Modify DefaultOrmQuery to have non-final copy() methods to allow ebean-mocker to be updated 2022-05-02 18:01:25 +12:00
Rob Bygrave 2b581fb148 Update README with details on building ebean from source 2022-05-02 16:36:59 +12:00
Rob BygraveandGitHub 35bd98c14f Merge pull request #2674 from ebean-orm/feature/ebean-test-container-5
Bump to ebean-test-docker 5.0-RC1
2022-05-02 16:36:02 +12:00
Rob Bygrave 8db9991ea3 Bump to ebean-test-docker 5.0 2022-05-02 16:04:42 +12:00
Rob Bygrave fac69f75d0 Bump to ebean-test-docker 5.0-RC2 2022-05-02 15:40:01 +12:00
Rob Bygrave b18226711b Bump to ebean-test-docker 5.0-RC1 2022-04-29 16:43:48 +12:00
Rob Bygrave 4bdb48d340 Bump to 13.5.1-SNAPSHOT after release 2022-04-28 17:58:58 +12:00
Rob Bygrave d2a742fefb [maven-release-plugin] prepare for next development iteration 2022-04-28 17:42:12 +12:00
Rob Bygrave 22de23ddf4 [maven-release-plugin] prepare release ebean-parent-13.5.0 2022-04-28 17:42:05 +12:00
Rob Bygrave 496d9674d2 #2672 - Bump ebean-agent to 13.5.0 for - ToStringBuilder enhancement does not use toString() of the abstract class 2022-04-28 10:50:34 +12:00
Rob Bygrave 4ece9fe6cc Bump to 13.5.0-SNAPSHOT 2022-04-28 10:46:14 +12:00
Rob Bygrave 62f162e4fb Bump to 13.5.0-SNAPSHOT 2022-04-28 10:44:56 +12:00
Rob Bygrave 38803aa7f8 Bump to 13.5.0-SNAPSHOT 2022-04-28 10:33:41 +12:00
Rob Bygrave f9943f14b7 Adjust test ebean.properties 2022-04-28 10:32:27 +12:00
Rob Bygrave 1b24c888ee Put back test jdbc driver for MariaDB ... need to look at changes in newer driver wrt forwardOnlyHintOnFindIterate
That is, forwardOnlyHintOnFindIterate is a hack to support poor MySql jdbc driver behavior but maybe we can remove this
hack in later versions of MariaDB at least
2022-04-27 23:13:28 +12:00
Rob Bygrave 45233e96ab #2673 - Bug introduced in 13.3.1 via #2652 - incorrect binding of history query with SQL2011 standards based queries 2022-04-27 22:48:02 +12:00
Rob Bygrave 517556bfe3 For sql server tests add jdbc parameters ;integratedSecurity=false;trustServerCertificate=true 2022-04-27 20:02:02 +12:00
Rob Bygrave 07101d1528 #2671 - Bump ebean-test-docker to 4.7 2022-04-27 19:53:52 +12:00
Rob Bygrave 9fa1def22b Bump test jdbc drivers 2022-04-27 18:43:27 +12:00
Rob Bygrave dd9d49cfa2 #2671 - Bump ebean-test-docker to 4.7 2022-04-27 18:39:49 +12:00
Rob Bygrave 7680a75ca9 Bump test modules to 13.4.2-SNAPSHOT after release 2022-04-27 09:48:13 +12:00
Rob Bygrave 786286421d [maven-release-plugin] prepare for next development iteration 2022-04-27 09:13:48 +12:00
Rob Bygrave d34da06840 Remove deprecated Ebean, EbeanServer, EbeanServerFactory, ServerConfig migrate to DB, Database, DatabaseFactory, DatabaseConfig 2022-04-20 20:46:53 +12:00
Rob Bygrave 8432fa1320 Bump ebean-ddl-runner (sync version with ebean-migration) 2022-04-14 14:48:37 +12:00
Rob Bygrave 6b81dbbaa2 Bump avaje classpath scanner to 7.1, ignores module-info, uses System.Logger (not slf4j-api) 2022-04-14 12:40:49 +12:00
Rob BygraveandGitHub 9862526352 Merge branch 'master' into wip/EntityBeanIntercept-interface 2022-04-13 10:43:13 +12:00
Rob BygraveandGitHub 45003b3d5f Merge branch 'master' into wip/EntityBeanIntercept-interface 2022-04-12 21:09:58 +12:00
Rob Bygrave bed4721823 Bump ebean-agent to 13.0.1-RC2 with ASM 9.3 - support for Java 19 2022-04-06 16:28:44 +12:00
Rob Bygrave 307832edae Fix test modules in terms of enhancement plugins 2022-04-04 14:04:15 +12:00
Rob Bygrave 1f684107b6 Fix test modules in terms of enhancement plugins 2022-04-04 13:52:37 +12:00
Rob Bygrave 5ab02715ef Support EntityBeanIntercept as an interface with InterceptReadWrite and InterceptReadOnly options
With the view that we can optimise the readOnly + disableLazyLoad case by using InterceptReadOnly which doesn't need to support any of the flags used as part of mutation.
2022-04-04 13:30:26 +12:00
198 changed files with 4658 additions and 4672 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
+30 -1
View File
@@ -55,9 +55,38 @@ Post questions or issues to the Ebean google group - https://groups.google.com/f
## Documentation
Goto [https://ebean.io/docs/](https://ebean.io/docs/)
## Maven central
[Maven central - io.ebean](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22io.ebean%22%20)
## Building Ebean from source
- JDK 11 or higher installed
- Maven installed
- `git clone git@github.com:ebean-orm/ebean.git`
- `mvn clean install`
Ebean 13 uses Java modules with module-info. This means that there are stricter compilation
rules in place now than when building with classpath pre version 13.
For Maven Surefire testing we use `<surefire.useModulePath>false</surefire.useModulePath>` such
that tests run using classpath and not module-path. We are doing this until all the tooling
(Maven, IDE) improves in the area of testing with module-info.
#### Eclipse IDE
Right now we can't use Eclipse IDE to build Ebean and run its tests due to its poor support
for java modules. See [ebean/issues/2653](https://github.com/ebean-orm/ebean/issues/2653)
The current recommendation is to use IntelliJ IDEA as the IDE to build and hack Ebean.
#### IntelliJ IDEA
We want to get IntelliJ to run tests using classpath similar to Maven Surefire. To do this set:
`JUnit -> modify options -> Do not use module-path option`
To set this option as the global default for IntelliJ use:
`Run - Edit Configurations -> Edit configuration templates -> JUnit -> modify options - Do not use module-path option`
+6 -6
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.4.1</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.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
@@ -35,18 +35,18 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-clickhouse</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.4.1</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.4.1</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.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
@@ -35,18 +35,18 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.4.1</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.4.1</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.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
@@ -35,18 +35,18 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-db2</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.4.1</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.4.1</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.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
@@ -35,18 +35,18 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-h2</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.4.1</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.4.1</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.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
@@ -35,18 +35,18 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-hana</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.4.1</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.4.1</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.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
@@ -35,18 +35,18 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-mariadb</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.4.1</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.4.1</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.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
@@ -35,18 +35,18 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-mysql</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.4.1</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.4.1</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.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
@@ -35,18 +35,18 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-nuodb</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.4.1</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.4.1</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.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
@@ -35,18 +35,18 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-oracle</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.4.1</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.4.1</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.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
@@ -35,18 +35,18 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.4.1</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.4.1</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.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
@@ -35,18 +35,18 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-sqlite</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.4.1</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.4.1</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.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
@@ -35,18 +35,18 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-sqlserver</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.4.1</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.4.1</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.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
@@ -35,18 +35,18 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.4.1</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.4.1</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.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
@@ -35,18 +35,18 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-all</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.4.1</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.4.1</version>
<version>13.6.2</version>
</parent>
<artifactId>composites</artifactId>
+3 -3
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.4.1</version>
<version>13.6.2</version>
</parent>
<name>ebean api</name>
@@ -20,14 +20,14 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.30</version>
<version>1.7.36</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-config</artifactId>
<version>1.7</version>
<version>2.0</version>
</dependency>
<!--
File diff suppressed because it is too large Load Diff
@@ -1,15 +0,0 @@
package io.ebean;
/**
* Deprecated - please migrate to <code>io.ebean.Database</code>.
* Provides the API for fetching and saving beans to a particular Database.
* <p>
* Effectively this is an alias for {@link Database} which is now the new
* and improved name for EbeanServer.
* <p>
* The preference is to use DB and Database rather than Ebean and EbeanServer.
*/
@Deprecated
public interface EbeanServer extends Database {
}
@@ -1,70 +0,0 @@
package io.ebean;
import io.ebean.config.ContainerConfig;
import io.ebean.config.ServerConfig;
/**
* Deprecated - please migrate to DatabaseFactory.
* <p>
* Creates EbeanServer instances.
* <p>
* This uses either a ServerConfig or properties in the ebean.properties file to
* configure and create a EbeanServer instance.
* </p>
* <p>
* The EbeanServer instance can either be registered with the Ebean singleton or
* not. The Ebean singleton effectively holds a map of EbeanServers by a name.
* If the EbeanServer is registered with the Ebean singleton you can retrieve it
* later via {@link Ebean#getServer(String)}.
* </p>
* <p>
* One EbeanServer can be nominated as the 'default/primary' EbeanServer. Many
* methods on the Ebean singleton such as {@link Ebean#find(Class)} are just a
* convenient way of using the 'default/primary' EbeanServer.
* </p>
*/
@Deprecated
public class EbeanServerFactory {
/**
* Initialise the container with clustering configuration.
* <p>
* Call this prior to creating any EbeanServer instances or alternatively set the
* ContainerConfig on the ServerConfig when creating the first EbeanServer instance.
*/
public static void initialiseContainer(ContainerConfig containerConfig) {
DatabaseFactory.initialiseContainer(containerConfig);
}
/**
* Create using ebean.properties to configure the database.
*/
public static EbeanServer create(String name) {
return (EbeanServer)DatabaseFactory.create(name);
}
/**
* Create using the ServerConfig object to configure the database.
*/
public static EbeanServer create(ServerConfig config) {
return (EbeanServer)DatabaseFactory.create(config);
}
/**
* Create using the ServerConfig additionally specifying a classLoader to use as the context class loader.
*/
public static EbeanServer createWithContextClassLoader(ServerConfig config, ClassLoader classLoader) {
return (EbeanServer)DatabaseFactory.createWithContextClassLoader(config, classLoader);
}
/**
* Shutdown gracefully all EbeanServers cleaning up any resources as required.
* <p>
* This is typically invoked via JVM shutdown hook and not explicitly called.
* </p>
*/
public static void shutdown() {
DatabaseFactory.shutdown();
}
}
@@ -34,6 +34,13 @@ public interface EntityBean extends Serializable, ToStringAware {
throw new NotEnhancedException();
}
/**
* Create and return a new entity bean instance optimised for read only no interception use.
*/
default Object _ebean_newInstanceReadOnly() {
throw new NotEnhancedException();
}
/**
* Generated method that sets the loaded state on all the embedded beans on
* this entity bean by using EntityBeanIntercept.setEmbeddedLoaded(Object o);
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,536 @@
package io.ebean.bean;
import io.ebean.ValuePair;
import java.util.Collections;
import java.util.Map;
import java.util.Set;
public class InterceptReadOnly implements EntityBeanIntercept {
private final EntityBean owner;
public InterceptReadOnly(Object ownerBean) {
this.owner = (EntityBean) ownerBean;
}
@Override
public EntityBean getOwner() {
return owner;
}
@Override
public PersistenceContext getPersistenceContext() {
return null;
}
@Override
public void setPersistenceContext(PersistenceContext persistenceContext) {
}
@Override
public void setNodeUsageCollector(NodeUsageCollector usageCollector) {
}
@Override
public Object getOwnerId() {
return null;
}
@Override
public void setOwnerId(Object ownerId) {
}
@Override
public Object getEmbeddedOwner() {
return null;
}
@Override
public int getEmbeddedOwnerIndex() {
return 0;
}
@Override
public void clearGetterCallback() {
}
@Override
public void registerGetterCallback(PreGetterCallback getterCallback) {
}
@Override
public void setEmbeddedOwner(EntityBean parentBean, int embeddedOwnerIndex) {
}
@Override
public void setBeanLoader(BeanLoader beanLoader, PersistenceContext ctx) {
}
@Override
public void setBeanLoader(BeanLoader beanLoader) {
}
@Override
public boolean isFullyLoadedBean() {
return false;
}
@Override
public void setFullyLoadedBean(boolean fullyLoadedBean) {
}
@Override
public boolean isPartial() {
return false;
}
@Override
public boolean isDirty() {
return false;
}
@Override
public void setEmbeddedDirty(int embeddedProperty) {
}
@Override
public void setDirty(boolean dirty) {
}
@Override
public boolean isNew() {
return false;
}
@Override
public boolean isNewOrDirty() {
return false;
}
@Override
public boolean hasIdOnly(int idIndex) {
return false;
}
@Override
public boolean isReference() {
return false;
}
@Override
public void setReference(int idPos) {
}
@Override
public void setLoadedFromCache(boolean loadedFromCache) {
}
@Override
public boolean isLoadedFromCache() {
return false;
}
@Override
public boolean isReadOnly() {
return true;
}
@Override
public void setReadOnly(boolean readOnly) {
}
@Override
public void setForceUpdate(boolean forceUpdate) {
}
@Override
public boolean isUpdate() {
return false;
}
@Override
public boolean isLoaded() {
return true;
}
@Override
public void setNew() {
}
@Override
public void setLoaded() {
}
@Override
public void setLoadedLazy() {
}
@Override
public void setLazyLoadFailure(Object ownerId) {
}
@Override
public boolean isLazyLoadFailure() {
return false;
}
@Override
public boolean isDisableLazyLoad() {
return false;
}
@Override
public void setDisableLazyLoad(boolean disableLazyLoad) {
}
@Override
public void setEmbeddedLoaded(Object embeddedBean) {
}
@Override
public boolean isEmbeddedNewOrDirty(Object embeddedBean) {
return false;
}
@Override
public Object getOrigValue(int propertyIndex) {
return null;
}
@Override
public int findProperty(String propertyName) {
return 0;
}
@Override
public String getProperty(int propertyIndex) {
return null;
}
@Override
public int getPropertyLength() {
return 0;
}
@Override
public void setPropertyLoaded(String propertyName, boolean loaded) {
}
@Override
public void setPropertyUnloaded(int propertyIndex) {
}
@Override
public void setLoadedProperty(int propertyIndex) {
}
@Override
public void setLoadedPropertyAll() {
}
@Override
public boolean isLoadedProperty(int propertyIndex) {
return false;
}
@Override
public boolean isChangedProperty(int propertyIndex) {
return false;
}
@Override
public boolean isDirtyProperty(int propertyIndex) {
return false;
}
@Override
public void markPropertyAsChanged(int propertyIndex) {
}
@Override
public void setChangedProperty(int propertyIndex) {
}
@Override
public void setChangeLoaded(int propertyIndex) {
}
@Override
public void setEmbeddedPropertyDirty(int propertyIndex) {
}
@Override
public void setOriginalValue(int propertyIndex, Object value) {
}
@Override
public void setOriginalValueForce(int propertyIndex, Object value) {
}
@Override
public void setNewBeanForUpdate() {
}
@Override
public Set<String> getLoadedPropertyNames() {
return Collections.emptySet();
}
@Override
public boolean[] getDirtyProperties() {
return new boolean[0];
}
@Override
public Set<String> getDirtyPropertyNames() {
return Collections.emptySet();
}
@Override
public void addDirtyPropertyNames(Set<String> props, String prefix) {
}
@Override
public boolean hasDirtyProperty(Set<String> propertyNames) {
return false;
}
@Override
public Map<String, ValuePair> getDirtyValues() {
return Collections.emptyMap();
}
@Override
public void addDirtyPropertyValues(Map<String, ValuePair> dirtyValues, String prefix) {
}
@Override
public void addDirtyPropertyValues(BeanDiffVisitor visitor) {
}
@Override
public StringBuilder getDirtyPropertyKey() {
return null;
}
@Override
public void addDirtyPropertyKey(StringBuilder sb) {
}
@Override
public StringBuilder getLoadedPropertyKey() {
return null;
}
@Override
public boolean[] getLoaded() {
return new boolean[0];
}
@Override
public int getLazyLoadPropertyIndex() {
return 0;
}
@Override
public String getLazyLoadProperty() {
return null;
}
@Override
public void loadBean(int loadProperty) {
}
@Override
public void loadBeanInternal(int loadProperty, BeanLoader loader) {
}
@Override
public void initialisedMany(int propertyIndex) {
}
@Override
public void preGetterCallback(int propertyIndex) {
}
@Override
public void preGetId() {
}
@Override
public void preGetter(int propertyIndex) {
}
@Override
public void preSetterMany(boolean interceptField, int propertyIndex, Object oldValue, Object newValue) {
}
@Override
public void setChangedPropertyValue(int propertyIndex, boolean setDirtyState, Object origValue) {
}
@Override
public void setDirtyStatus() {
}
@Override
public void preSetter(boolean intercept, int propertyIndex, Object oldValue, Object newValue) {
}
@Override
public void preSetter(boolean intercept, int propertyIndex, boolean oldValue, boolean newValue) {
}
@Override
public void preSetter(boolean intercept, int propertyIndex, int oldValue, int newValue) {
}
@Override
public void preSetter(boolean intercept, int propertyIndex, long oldValue, long newValue) {
}
@Override
public void preSetter(boolean intercept, int propertyIndex, double oldValue, double newValue) {
}
@Override
public void preSetter(boolean intercept, int propertyIndex, float oldValue, float newValue) {
}
@Override
public void preSetter(boolean intercept, int propertyIndex, short oldValue, short newValue) {
}
@Override
public void preSetter(boolean intercept, int propertyIndex, char oldValue, char newValue) {
}
@Override
public void preSetter(boolean intercept, int propertyIndex, byte oldValue, byte newValue) {
}
@Override
public void preSetter(boolean intercept, int propertyIndex, char[] oldValue, char[] newValue) {
}
@Override
public void preSetter(boolean intercept, int propertyIndex, byte[] oldValue, byte[] newValue) {
}
@Override
public void setOldValue(int propertyIndex, Object oldValue) {
}
@Override
public int getSortOrder() {
return 0;
}
@Override
public void setSortOrder(int sortOrder) {
}
@Override
public void setDeletedFromCollection(boolean deletedFromCollection) {
}
@Override
public boolean isOrphanDelete() {
return false;
}
@Override
public void setLoadError(int propertyIndex, Exception t) {
}
@Override
public Map<String, Exception> getLoadErrors() {
return null;
}
@Override
public boolean isChangedProp(int i) {
return false;
}
@Override
public MutableValueInfo mutableInfo(int propertyIndex) {
return null;
}
@Override
public void mutableInfo(int propertyIndex, MutableValueInfo info) {
}
@Override
public void mutableNext(int propertyIndex, MutableValueNext next) {
}
@Override
public String mutableNext(int propertyIndex) {
return null;
}
}
File diff suppressed because it is too large Load Diff
@@ -29,9 +29,10 @@ public final class TenantAwareCache implements ServerCache {
/**
* Return the underlying ServerCache that is being delegated to.
*/
@SuppressWarnings("unchecked")
@Override
public <T> T unwrap(Class<T> cls) {
return (T)delegate;
return (T) delegate;
}
@Override
@@ -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;
@@ -1,47 +0,0 @@
package io.ebean.config;
import io.ebean.DatabaseFactory;
/**
* Deprecated - please migrate to <code>io.ebean.DatabaseConfig</code>.
*
* The configuration used for creating a Database.
* <p>
* Used to programmatically construct a Database and optionally register it
* with the DB singleton.
* </p>
* <p>
* If you just use DB without this programmatic configuration DB will read
* the application.properties file and take the configuration from there. This usually
* includes searching the class path and automatically registering any entity
* classes and listeners etc.
* </p>
* <pre>{@code
*
* ServerConfig config = new ServerConfig();
*
* // read the ebean.properties and load
* // those settings into this serverConfig object
* config.loadFromProperties();
*
* // explicitly register the entity beans to avoid classpath scanning
* config.addClass(Customer.class);
* config.addClass(User.class);
*
* Database database = DatabaseFactory.create(config);
*
* }</pre>
*
* <p>
* Note that ServerConfigProvider provides a standard Java ServiceLoader mechanism that can
* be used to apply configuration to the ServerConfig.
* </p>
*
* @author emcgreal
* @author rbygrave
* @see DatabaseFactory
*/
@Deprecated
public class ServerConfig extends DatabaseConfig {
}
@@ -1,41 +0,0 @@
package io.ebean.config;
/**
* Deprecated - migrate to DatabaseConfigProvider.
* <p>
* Provides a ServiceLoader based mechanism to configure a ServerConfig.
* <p>
* Provide an implementation and register it via the standard Java ServiceLoader mechanism
* via a file at <code>META-INF/services/io.ebean.config.ServerConfigProvider</code>.
* <p>
* If you are using a DI container like Spring or Guice you are unlikely to use this but instead use a
* spring specific configuration. When we are not using a DI container we may use this mechanism to
* explicitly register the entity beans and avoid classpath scanning.
* </p>
* <pre>{@code
*
* public class EbeanConfigProvider implements ServerConfigProvider {
*
* @Override
* public void apply(ServerConfig config) {
*
* // register the entity bean classes explicitly
* config.addClass(Customer.class);
* config.addClass(User.class);
* ...
* }
* }
*
* }</pre>
*/
@Deprecated
public interface ServerConfigProvider {
/**
* Apply the configuration to the ServerConfig.
* <p>
* Typically we explicitly register entity bean classes and thus avoid classpath scanning.
* </p>
*/
void apply(ServerConfig config);
}
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.4.1</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.4.1</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.4.1</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.4.1</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.4.1</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.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core-type</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-ddl-generator</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-externalmapping-api</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-externalmapping-xml</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-autotune</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>querybean-generator</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>kotlin-querybean-generator</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-postgis</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-redis</artifactId>
<version>13.4.1</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.4.1</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.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
+9 -9
View File
@@ -3,7 +3,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.4.1</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.4.1</tag>
<tag>ebean-parent-13.6.2</tag>
</scm>
<dependencies>
@@ -29,7 +29,7 @@
<dependency>
<groupId>io.avaje</groupId>
<artifactId>classpath-scanner</artifactId>
<version>6.2</version>
<version>7.1</version>
</dependency>
<dependency>
@@ -41,19 +41,19 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core-type</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-externalmapping-api</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
</dependency>
<dependency>
@@ -144,21 +144,21 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-h2</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-sqlserver</artifactId>
<version>13.4.1</version>
<version>13.6.2</version>
<scope>test</scope>
</dependency>
@@ -23,7 +23,7 @@ import java.util.stream.Stream;
/**
* Service Provider extension to EbeanServer.
*/
public interface SpiEbeanServer extends SpiServer, ExtendedServer, EbeanServer, BeanCollectionLoader {
public interface SpiEbeanServer extends SpiServer, ExtendedServer, BeanCollectionLoader {
/**
* Return true if the L2 cache has been disabled.
@@ -55,7 +55,6 @@ public interface SpiEbeanServer extends SpiServer, ExtendedServer, EbeanServer,
* <p>
* Typically used to identify the origin of queries for AutoTune and object
* graph costing.
* </p>
*/
CallOrigin createCallOrigin();
@@ -13,6 +13,8 @@ import java.io.Serializable;
import java.lang.ref.SoftReference;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.locks.ReentrantLock;
/**
* The default cache implementation.
@@ -43,10 +45,13 @@ public class DefaultServerCache implements ServerCache {
protected final String name;
protected final String shortName;
private final int maxSize;
private final int trimFrequency;
private final int maxIdleSecs;
private final int maxSecsToLive;
protected final int maxSize;
protected final int trimFrequency;
protected final int maxIdleSecs;
protected final int maxSecsToLive;
protected final long trimOnPut;
protected final ReentrantLock lock = new ReentrantLock();
protected final AtomicLong mutationCounter = new AtomicLong();
public DefaultServerCache(DefaultServerCacheConfig config) {
this.name = config.getName();
@@ -56,6 +61,7 @@ public class DefaultServerCache implements ServerCache {
this.maxIdleSecs = config.getMaxIdleSecs();
this.maxSecsToLive = config.getMaxSecsToLive();
this.trimFrequency = config.determineTrimFrequency();
this.trimOnPut = config.determineTrimOnPut();
MetricFactory factory = MetricFactory.get();
String prefix = "l2n.";
@@ -187,6 +193,9 @@ public class DefaultServerCache implements ServerCache {
public void put(Object key, Object value) {
map.put(key, new SoftReference<>(new CacheEntry(key, value)));
putCount.increment();
if (mutationCounter.incrementAndGet() > trimOnPut) {
runEviction();
}
}
/**
@@ -222,62 +231,72 @@ public class DefaultServerCache implements ServerCache {
* Run the eviction based on Idle time, Time to live and LRU last access.
*/
public void runEviction() {
long trimForMaxSize;
if (maxSize == 0) {
trimForMaxSize = 0;
} else {
trimForMaxSize = size() - maxSize;
}
if (maxIdleSecs == 0 && maxSecsToLive == 0 && trimForMaxSize < 0) {
// nothing to trim on this cache
return;
}
long startNanos = System.nanoTime();
long trimmedByIdle = 0;
long trimmedByGC = 0;
long trimmedByTTL = 0;
long trimmedByLRU = 0;
List<CacheEntry> activeList = new ArrayList<>(map.size());
long idleExpireNano = startNanos - TimeUnit.SECONDS.toNanos(maxIdleSecs);
long ttlExpireNano = startNanos - TimeUnit.SECONDS.toNanos(maxSecsToLive);
Iterator<SoftReference<CacheEntry>> it = map.values().iterator();
while (it.hasNext()) {
SoftReference<CacheEntry> ref = it.next();
final CacheEntry cacheEntry = ref.get();
if (cacheEntry == null) {
it.remove();
trimmedByGC++;
} else if (maxIdleSecs > 0 && idleExpireNano > cacheEntry.getLastAccessTime()) {
it.remove();
trimmedByIdle++;
} else if (maxSecsToLive > 0 && ttlExpireNano > cacheEntry.getCreateTime()) {
it.remove();
trimmedByTTL++;
} else if (trimForMaxSize > 0) {
activeList.add(cacheEntry);
lock.lock();
try {
long trimForMaxSize;
if (maxSize == 0) {
trimForMaxSize = 0;
} else {
trimForMaxSize = size() - maxSize;
}
}
if (trimForMaxSize > 0 && activeList.size() > maxSize) {
// sort into last access time ascending
activeList.sort(BY_LAST_ACCESS);
int trimSize = getTrimSize();
for (int i = trimSize; i < activeList.size(); i++) {
// remove if still in the cache
if (map.remove(activeList.get(i).getKey()) != null) {
trimmedByLRU++;
if (maxIdleSecs == 0 && maxSecsToLive == 0 && trimForMaxSize < 0) {
// nothing to trim on this cache
mutationCounter.set(0);
return;
}
long startNanos = System.nanoTime();
long trimmedByIdle = 0;
long trimmedByGC = 0;
long trimmedByTTL = 0;
long trimmedByLRU = 0;
try {
List<CacheEntry> activeList = new ArrayList<>(map.size());
long idleExpireNano = startNanos - TimeUnit.SECONDS.toNanos(maxIdleSecs);
long ttlExpireNano = startNanos - TimeUnit.SECONDS.toNanos(maxSecsToLive);
Iterator<SoftReference<CacheEntry>> it = map.values().iterator();
while (it.hasNext()) {
SoftReference<CacheEntry> ref = it.next();
final CacheEntry cacheEntry = ref.get();
if (cacheEntry == null) {
it.remove();
trimmedByGC++;
} else if (maxIdleSecs > 0 && idleExpireNano > cacheEntry.getLastAccessTime()) {
it.remove();
trimmedByIdle++;
} else if (maxSecsToLive > 0 && ttlExpireNano > cacheEntry.getCreateTime()) {
it.remove();
trimmedByTTL++;
} else if (trimForMaxSize > 0) {
activeList.add(cacheEntry.forSort());
}
}
if (trimForMaxSize > 0 && activeList.size() > maxSize) {
// sort into last access time ascending
activeList.sort(BY_LAST_ACCESS);
int trimSize = getTrimSize();
for (int i = trimSize; i < activeList.size(); i++) {
// remove if still in the cache
if (map.remove(activeList.get(i).getKey()) != null) {
trimmedByLRU++;
}
}
}
mutationCounter.set(0);
evictCount.add(trimmedByIdle);
evictCount.add(trimmedByGC);
evictCount.add(trimmedByTTL);
evictCount.add(trimmedByLRU);
if (logger.isTraceEnabled()) {
long exeMicros = TimeUnit.MICROSECONDS.convert(System.nanoTime() - startNanos, TimeUnit.NANOSECONDS);
logger.trace("Executed trim of cache {} in [{}]millis idle[{}] timeToLive[{}] accessTime[{}] gc[{}]",
name, exeMicros, trimmedByIdle, trimmedByTTL, trimmedByLRU, trimmedByGC);
}
} catch (Throwable e) {
logger.warn("Error during trim of DefaultServerCache [" + name + "]. Cache might be bigger than desired.", e);
}
}
evictCount.add(trimmedByIdle);
evictCount.add(trimmedByGC);
evictCount.add(trimmedByTTL);
evictCount.add(trimmedByLRU);
if (logger.isTraceEnabled()) {
long exeMicros = TimeUnit.MICROSECONDS.convert(System.nanoTime() - startNanos, TimeUnit.NANOSECONDS);
logger.trace("Executed trim of cache {} in [{}]millis idle[{}] timeToLive[{}] accessTime[{}] gc[{}]",
name, exeMicros, trimmedByIdle, trimmedByTTL, trimmedByLRU, trimmedByGC);
} finally {
lock.unlock();
}
}
@@ -293,7 +312,7 @@ public class DefaultServerCache implements ServerCache {
}
/**
* Comparator for sorting by last access time.
* Comparator for sorting by last access sort, a copy of last access time that should not mutate during trim processing.
*/
public static final class CompareByLastAccess implements Comparator<CacheEntry>, Serializable {
@@ -301,7 +320,7 @@ public class DefaultServerCache implements ServerCache {
@Override
public int compare(CacheEntry e1, CacheEntry e2) {
return Long.compare(e1.getLastAccessTime(), e2.getLastAccessTime());
return Long.compare(e1.lastAccessSort, e2.lastAccessSort);
}
}
@@ -314,6 +333,7 @@ public class DefaultServerCache implements ServerCache {
private final Object value;
private final long createTime;
private long lastAccessTime;
private long lastAccessSort;
public CacheEntry(Object key, Object value) {
this.key = key;
@@ -322,6 +342,14 @@ public class DefaultServerCache implements ServerCache {
this.lastAccessTime = createTime;
}
/**
* Store a copy of lastAccessTime used for sorting. This value should not change during trim processing.
*/
public CacheEntry forSort() {
this.lastAccessSort = lastAccessTime;
return this;
}
/**
* Return the entry key.
*/
@@ -76,4 +76,14 @@ public final class DefaultServerCacheConfig {
}
return 0;
}
/**
* Determine the number of mutations/puts required to trigger a runEviction() in the foreground.
*/
public long determineTrimOnPut() {
if (maxSize > 0) {
return maxSize / 10;
}
return 1000;
}
}
@@ -1,6 +1,6 @@
package io.ebeaninternal.server.cluster;
import io.ebean.EbeanServer;
import io.ebean.Database;
import io.ebean.config.ContainerConfig;
import io.ebeaninternal.server.transaction.RemoteTransactionEvent;
import org.slf4j.Logger;
@@ -20,7 +20,7 @@ public class ClusterManager implements ServerLookup {
private final ReentrantLock lock = new ReentrantLock();
private final ConcurrentHashMap<String, EbeanServer> serverMap = new ConcurrentHashMap<>();
private final ConcurrentHashMap<String, Database> serverMap = new ConcurrentHashMap<>();
private final Object monitor = new Object();
@@ -53,7 +53,7 @@ public class ClusterManager implements ServerLookup {
return factory;
}
public void registerServer(EbeanServer server) {
public void registerServer(Database server) {
lock.lock();
try {
serverMap.put(server.name(), server);
@@ -66,7 +66,7 @@ public class ClusterManager implements ServerLookup {
}
@Override
public EbeanServer getServer(String name) {
public Database getServer(String name) {
lock.lock();
try {
return serverMap.get(name);
@@ -1,14 +1,14 @@
package io.ebeaninternal.server.cluster;
import io.ebean.EbeanServer;
import io.ebean.Database;
/**
* Returns EbeanServer instances for remote message reading.
* Returns Database instances for remote message reading.
*/
public interface ServerLookup {
/**
* Return the EbeanServer instance by name.
*/
EbeanServer getServer(String name);
Database getServer(String name);
}
@@ -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"
@@ -5,8 +5,6 @@ import io.ebean.config.ContainerConfig;
import io.ebean.config.DatabaseConfig;
import io.ebean.config.DatabaseConfigProvider;
import io.ebean.config.ModuleInfoLoader;
import io.ebean.config.ServerConfig;
import io.ebean.config.ServerConfigProvider;
import io.ebean.config.TenantMode;
import io.ebean.config.UnderscoreNamingConvention;
import io.ebean.config.dbplatform.DatabasePlatform;
@@ -124,15 +122,8 @@ public final class DefaultContainer implements SpiContainer {
private void applyConfigServices(DatabaseConfig config) {
if (config.isDefaultServer()) {
boolean appliedConfig = false;
for (DatabaseConfigProvider configProvider : ServiceLoader.load(DatabaseConfigProvider.class)) {
configProvider.apply(config);
appliedConfig = true;
}
if (!appliedConfig && config instanceof ServerConfig) {
for (ServerConfigProvider configProvider : ServiceLoader.load(ServerConfigProvider.class)) {
configProvider.apply((ServerConfig)config);
}
}
}
if (config.isAutoLoadModuleInfo()) {
@@ -1,5 +1,6 @@
package io.ebeaninternal.server.core;
import io.ebean.annotation.Platform;
import io.ebean.config.DatabaseConfig;
import io.ebean.datasource.DataSourceAlertFactory;
import io.ebean.datasource.DataSourceConfig;
@@ -97,10 +98,16 @@ final class InitDataSource {
dsConfig.setReadOnly(true);
dsConfig.setDefaults(config.getDataSourceConfig());
dsConfig.setIsolationLevel(config.getDataSourceConfig().getIsolationLevel());
} else if (isPostgresAllQuotedIdentifiers()) {
dsConfig.addProperty("quoteReturningIdentifiers", false);
}
return create(dsConfig, readOnly);
}
boolean isPostgresAllQuotedIdentifiers() {
return config.isAllQuotedIdentifiers() && Platform.POSTGRES == config.getDatabasePlatform().getPlatform().base();
}
private DataSource create(DataSourceConfig dsConfig, boolean readOnly) {
String poolName = config.getName() + (readOnly ? "-ro" : "");
return DataSourceFactory.create(poolName, dsConfig);
@@ -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);
@@ -28,7 +28,7 @@ abstract class BaseCollectionHelp<T> implements BeanCollectionHelp<T> {
}
@Override
public void setLoader(BeanCollectionLoader loader) {
public final void setLoader(BeanCollectionLoader loader) {
this.loader = loader;
}
@@ -43,7 +43,7 @@ abstract class BaseCollectionHelp<T> implements BeanCollectionHelp<T> {
@SuppressWarnings("rawtypes")
@Override
public Collection underlying(Object value) {
public final Collection underlying(Object value) {
if (value instanceof BeanCollection) {
return ((BeanCollection)value).getActualDetails();
} else {
@@ -51,7 +51,7 @@ abstract class BaseCollectionHelp<T> implements BeanCollectionHelp<T> {
}
}
void jsonWriteCollection(SpiJsonWriter ctx, String name, Collection<?> list) throws IOException {
final void jsonWriteCollection(SpiJsonWriter ctx, String name, Collection<?> list) throws IOException {
if (!list.isEmpty() || ctx.isIncludeEmpty()) {
ctx.beginAssocMany(name);
for (Object bean : list) {
@@ -47,6 +47,11 @@ public interface BeanCollectionHelp<T> extends CQueryCollectionAdd<T> {
*/
BeanCollection<T> createEmpty(EntityBean bean);
/**
* Create and return an empty 'vanilla' collection that does not support lazy loading.
*/
Object createEmptyReference();
/**
* Add a bean to the List Set or Map.
*/
@@ -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);
}
}
}
@@ -86,7 +86,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
private final ConcurrentHashMap<String, ElPropertyDeploy> elDeployCache = new ConcurrentHashMap<>();
private final ConcurrentHashMap<String, ElComparator<T>> comparatorCache = new ConcurrentHashMap<>();
private final ConcurrentHashMap<String, STreeProperty> dynamicProperty = new ConcurrentHashMap<>();
private final ConcurrentHashMap<String, Map<String,String>> pathMaps = new ConcurrentHashMap<>();
private final ConcurrentHashMap<String, Map<String, String>> pathMaps = new ConcurrentHashMap<>();
private final Map<String, SpiRawSql> namedRawSql;
private final Map<String, String> namedQuery;
@@ -1765,6 +1765,14 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
return createEntityBean(false);
}
@Override
public EntityBean createEntityBean2(boolean readOnlyNoIntercept) {
if (readOnlyNoIntercept) {
return (EntityBean) prototypeEntityBean._ebean_newInstanceReadOnly();
}
return createEntityBean(false);
}
/**
* Create an entity bean for JSON marshalling (which differs for the element collection case).
*/
@@ -2879,7 +2887,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
for (BeanPropertyAssocMany<?> many : propertiesManySave) {
if (ebi.isLoadedProperty(many.propertyIndex())) {
final Object value = many.getValue(bean);
if (value instanceof BeanCollection && ((BeanCollection<?>)value).hasModifications() || value != null) {
if (value instanceof BeanCollection && ((BeanCollection<?>) value).hasModifications() || value != null) {
return true;
}
}
@@ -11,6 +11,7 @@ import io.ebeaninternal.api.json.SpiJsonWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
@@ -27,8 +28,7 @@ public class BeanListHelp<T> extends BaseCollectionHelp<T> {
}
@Override
public BeanCollectionAdd getBeanCollectionAdd(Object bc, String mapKey) {
public final BeanCollectionAdd getBeanCollectionAdd(Object bc, String mapKey) {
if (bc instanceof BeanList<?>) {
BeanList<?> bl = (BeanList<?>) bc;
if (bl.getActualList() == null) {
@@ -42,12 +42,17 @@ public class BeanListHelp<T> extends BaseCollectionHelp<T> {
}
@Override
public BeanCollection<T> createEmptyNoParent() {
public final Object createEmptyReference() {
return Collections.EMPTY_LIST;
}
@Override
public final BeanCollection<T> createEmptyNoParent() {
return new BeanList<>();
}
@Override
public BeanCollection<T> createEmpty(EntityBean parentBean) {
public final BeanCollection<T> createEmpty(EntityBean parentBean) {
BeanList<T> beanList = new BeanList<>(loader, parentBean, propertyName);
if (many != null) {
beanList.setModifyListening(many.modifyListenMode());
@@ -56,29 +61,23 @@ public class BeanListHelp<T> extends BaseCollectionHelp<T> {
}
@Override
public BeanCollection<T> createReference(EntityBean parentBean) {
public final BeanCollection<T> createReference(EntityBean parentBean) {
BeanList<T> beanList = new BeanList<>(loader, parentBean, propertyName);
beanList.setModifyListening(many.modifyListenMode());
return beanList;
}
@Override
public void refresh(SpiEbeanServer server, Query<?> query, Transaction t, EntityBean parentBean) {
public final void refresh(SpiEbeanServer server, Query<?> query, Transaction t, EntityBean parentBean) {
BeanList<?> newBeanList = (BeanList<?>) server.findList(query, t);
refresh(newBeanList, parentBean);
}
@Override
public void refresh(BeanCollection<?> bc, EntityBean parentBean) {
public final void refresh(BeanCollection<?> bc, EntityBean parentBean) {
BeanList<?> newBeanList = (BeanList<?>) bc;
List<?> currentList = (List<?>) many.getValue(parentBean);
newBeanList.setModifyListening(many.modifyListenMode());
if (currentList == null) {
// the currentList is null? Not really expecting this...
many.setValue(parentBean, newBeanList);
@@ -96,8 +95,7 @@ public class BeanListHelp<T> extends BaseCollectionHelp<T> {
}
@Override
public void jsonWrite(SpiJsonWriter ctx, String name, Object collection, boolean explicitInclude) throws IOException {
public final void jsonWrite(SpiJsonWriter ctx, String name, Object collection, boolean explicitInclude) throws IOException {
List<?> list;
if (collection instanceof BeanCollection<?>) {
BeanList<?> beanList = (BeanList<?>) collection;
@@ -114,7 +112,6 @@ public class BeanListHelp<T> extends BaseCollectionHelp<T> {
} else {
list = (List<?>) collection;
}
jsonWriteCollection(ctx, name, list);
}
@@ -10,6 +10,7 @@ import io.ebeaninternal.api.SpiEbeanServer;
import io.ebeaninternal.api.json.SpiJsonWriter;
import java.io.IOException;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
@@ -36,13 +37,11 @@ public class BeanMapHelp<T> extends BaseCollectionHelp<T> {
@Override
@SuppressWarnings("unchecked")
public BeanCollectionAdd getBeanCollectionAdd(Object bc, String mapKey) {
public final BeanCollectionAdd getBeanCollectionAdd(Object bc, String mapKey) {
if (mapKey == null) {
mapKey = many.mapKey();
}
BeanProperty beanProp = targetDescriptor.beanProperty(mapKey);
if (bc instanceof BeanMap<?, ?>) {
BeanMap<Object, Object> bm = (BeanMap<Object, Object>) bc;
Map<Object, Object> actualMap = bm.getActualMap();
@@ -57,10 +56,9 @@ public class BeanMapHelp<T> extends BaseCollectionHelp<T> {
}
}
static class Adder implements BeanCollectionAdd {
static final class Adder implements BeanCollectionAdd {
private final BeanProperty beanProperty;
private final Map<Object, Object> map;
Adder(BeanProperty beanProperty, Map<Object, Object> map) {
@@ -76,13 +74,17 @@ public class BeanMapHelp<T> extends BaseCollectionHelp<T> {
}
@Override
public BeanCollection<T> createEmptyNoParent() {
public final Object createEmptyReference() {
return Collections.EMPTY_MAP;
}
@Override
public final BeanCollection<T> createEmptyNoParent() {
return new BeanMap<>();
}
@Override
public BeanCollection<T> createEmpty(EntityBean ownerBean) {
public final BeanCollection<T> createEmpty(EntityBean ownerBean) {
BeanMap<?, T> beanMap = new BeanMap<>(loader, ownerBean, propertyName);
if (many != null) {
beanMap.setModifyListening(many.modifyListenMode());
@@ -92,7 +94,6 @@ public class BeanMapHelp<T> extends BaseCollectionHelp<T> {
@Override
public void add(BeanCollection<?> collection, EntityBean bean, boolean withCheck) {
if (bean == null) {
((BeanMap<?, ?>) collection).internalPutNull();
} else {
@@ -104,8 +105,7 @@ public class BeanMapHelp<T> extends BaseCollectionHelp<T> {
@Override
@SuppressWarnings({"unchecked", "rawtypes"})
public BeanCollection<T> createReference(EntityBean parentBean) {
public final BeanCollection<T> createReference(EntityBean parentBean) {
BeanMap beanMap = new BeanMap(loader, parentBean, propertyName);
if (many != null) {
beanMap.setModifyListening(many.modifyListenMode());
@@ -114,14 +114,13 @@ public class BeanMapHelp<T> extends BaseCollectionHelp<T> {
}
@Override
public void refresh(SpiEbeanServer server, Query<?> query, Transaction t, EntityBean parentBean) {
public final void refresh(SpiEbeanServer server, Query<?> query, Transaction t, EntityBean parentBean) {
BeanMap<?, ?> newBeanMap = (BeanMap<?, ?>) server.findMap(query, t);
refresh(newBeanMap, parentBean);
}
@Override
public void refresh(BeanCollection<?> bc, EntityBean parentBean) {
public final void refresh(BeanCollection<?> bc, EntityBean parentBean) {
BeanMap<?, ?> newBeanMap = (BeanMap<?, ?>) bc;
Map<?, ?> current = (Map<?, ?>) many.getValue(parentBean);
@@ -143,8 +142,7 @@ public class BeanMapHelp<T> extends BaseCollectionHelp<T> {
}
@Override
public void jsonWrite(SpiJsonWriter ctx, String name, Object collection, boolean explicitInclude) throws IOException {
public final void jsonWrite(SpiJsonWriter ctx, String name, Object collection, boolean explicitInclude) throws IOException {
Map<?, ?> map;
if (collection instanceof BeanCollection<?>) {
BeanMap<?, ?> bc = (BeanMap<?, ?>) collection;
@@ -15,7 +15,6 @@ public final class BeanMapHelpElement<T> extends BeanMapHelp<T> {
public void add(BeanCollection<?> collection, EntityBean bean, boolean withCheck) {
Object key = bean._ebean_getField(0);
Object val = bean._ebean_getField(1);
BeanMap<?, ?> map = ((BeanMap<?, ?>) collection);
if (withCheck) {
map.internalPutWithCheck(key, val);
@@ -601,6 +601,11 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
return mapKey;
}
@Override
public void createEmptyReference(EntityBean localBean) {
setValue(localBean, help.createEmptyReference());
}
@Override
public BeanCollection<?> createReference(EntityBean localBean, boolean forceNewReference) {
return forceNewReference ? createReference(localBean) : createReferenceIfNull(localBean);
@@ -10,6 +10,7 @@ import io.ebeaninternal.api.SpiEbeanServer;
import io.ebeaninternal.api.json.SpiJsonWriter;
import java.io.IOException;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Set;
@@ -33,7 +34,7 @@ public class BeanSetHelp<T> extends BaseCollectionHelp<T> {
}
@Override
public BeanCollectionAdd getBeanCollectionAdd(Object bc, String mapKey) {
public final BeanCollectionAdd getBeanCollectionAdd(Object bc, String mapKey) {
if (bc instanceof BeanSet<?>) {
BeanSet<?> beanSet = (BeanSet<?>) bc;
if (beanSet.getActualSet() == null) {
@@ -46,12 +47,17 @@ public class BeanSetHelp<T> extends BaseCollectionHelp<T> {
}
@Override
public BeanCollection<T> createEmptyNoParent() {
public final Object createEmptyReference() {
return Collections.EMPTY_SET;
}
@Override
public final BeanCollection<T> createEmptyNoParent() {
return new BeanSet<>();
}
@Override
public BeanCollection<T> createEmpty(EntityBean ownerBean) {
public final BeanCollection<T> createEmpty(EntityBean ownerBean) {
BeanSet<T> beanSet = new BeanSet<>(loader, ownerBean, propertyName);
if (many != null) {
beanSet.setModifyListening(many.modifyListenMode());
@@ -60,20 +66,20 @@ public class BeanSetHelp<T> extends BaseCollectionHelp<T> {
}
@Override
public BeanCollection<T> createReference(EntityBean parentBean) {
public final BeanCollection<T> createReference(EntityBean parentBean) {
BeanSet<T> beanSet = new BeanSet<>(loader, parentBean, propertyName);
beanSet.setModifyListening(many.modifyListenMode());
return beanSet;
}
@Override
public void refresh(SpiEbeanServer server, Query<?> query, Transaction t, EntityBean parentBean) {
public final void refresh(SpiEbeanServer server, Query<?> query, Transaction t, EntityBean parentBean) {
BeanSet<?> newBeanSet = (BeanSet<?>) server.findSet(query, t);
refresh(newBeanSet, parentBean);
}
@Override
public void refresh(BeanCollection<?> bc, EntityBean parentBean) {
public final void refresh(BeanCollection<?> bc, EntityBean parentBean) {
BeanSet<?> newBeanSet = (BeanSet<?>) bc;
Set<?> current = (Set<?>) many.getValue(parentBean);
newBeanSet.setModifyListening(many.modifyListenMode());
@@ -94,7 +100,7 @@ public class BeanSetHelp<T> extends BaseCollectionHelp<T> {
}
@Override
public void jsonWrite(SpiJsonWriter ctx, String name, Object collection, boolean explicitInclude) throws IOException {
public final void jsonWrite(SpiJsonWriter ctx, String name, Object collection, boolean explicitInclude) throws IOException {
Set<?> set;
if (collection instanceof BeanCollection<?>) {
BeanSet<?> bc = (BeanSet<?>) collection;
@@ -2,6 +2,7 @@ package io.ebeaninternal.server.deploy;
import io.ebean.bean.EntityBean;
import io.ebean.bean.EntityBeanIntercept;
import io.ebean.bean.InterceptReadWrite;
final class ElementEntityBean implements EntityBean {
@@ -13,7 +14,7 @@ final class ElementEntityBean implements EntityBean {
ElementEntityBean(String[] properties) {
this.properties = properties;
this.intercept = new EntityBeanIntercept(this);
this.intercept = new InterceptReadWrite(this);
}
@Override
@@ -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()) {
@@ -644,10 +644,12 @@ final class CQueryBuilder {
}
private void appendHistoryAsOfPredicate() {
if (query.isAsOfBaseTable() && !historySupport.isStandardsBased()) {
appendAndOrWhere();
sb.append(historySupport.getAsOfPredicate(request.baseTableAlias()));
if (query.isAsOfBaseTable()) {
query.incrementAsOfTableCount();
if (!historySupport.isStandardsBased()){
appendAndOrWhere();
sb.append(historySupport.getAsOfPredicate(request.baseTableAlias()));
}
}
}
@@ -134,6 +134,9 @@ final class DefaultDbSqlContext implements DbSqlContext {
String asOfView = historySupport.getAsOfView(table);
appendTable(table, asOfView);
if (asOfView != null) {
if (historySupport.isStandardsBased()) {
asOfTableCount++;
}
addAsOfOnClause = !historySupport.isStandardsBased();
}
}
@@ -33,6 +33,11 @@ public interface STreePropertyAssocMany extends STreePropertyAssoc {
*/
BeanCollection<?> createReference(EntityBean localBean, boolean forceNewReference);
/**
* Populate the collection for read-only disabled lazy loading (aka Java Collections non mutable empty collection).
*/
void createEmptyReference(EntityBean localBean);
/**
* Return true if the property has a join table.
*/
@@ -79,6 +79,11 @@ public interface STreeType {
*/
EntityBean createEntityBean();
/**
* Create a new entity bean instance with option for read only optimisation.
*/
EntityBean createEntityBean2(boolean readOnlyNoIntercept);
/**
* Put the entity bean into the persistence context.
*/
@@ -50,6 +50,7 @@ public final class SqlTreeBuilder {
*/
private final boolean rawNoId;
private final boolean disableLazyLoad;
private final boolean readOnly;
private final SpiQuery.TemporalMode temporalMode;
private SqlTreeNode rootNode;
private boolean sqlDistinct;
@@ -63,6 +64,7 @@ public final class SqlTreeBuilder {
this.desc = request.descriptor();
this.rawNoId = rawNoId;
this.disableLazyLoad = request.query().isDisableLazyLoading();
this.readOnly = Boolean.TRUE.equals(request.query().isReadOnly());
this.query = null;
this.subQuery = false;
this.distinctOnPlatform = false;
@@ -88,6 +90,7 @@ public final class SqlTreeBuilder {
this.query = request.query();
this.temporalMode = SpiQuery.TemporalMode.of(query);
this.disableLazyLoad = query.isDisableLazyLoading();
this.readOnly = Boolean.TRUE.equals(query.isReadOnly());
this.subQuery = Type.SQ_EXISTS == query.getType()
|| Type.SQ_IN == query.getType()
|| Type.ID_LIST == query.getType()
@@ -309,13 +312,13 @@ public final class SqlTreeBuilder {
if (baseTable == null) {
baseTable = desc.baseTable(temporalMode);
}
return new SqlTreeNodeRoot(desc, props, myList, withId, includeJoin, lazyLoadMany, temporalMode, disableLazyLoad, sqlDistinct, baseTable);
return new SqlTreeNodeRoot(desc, props, myList, withId, includeJoin, lazyLoadMany, temporalMode, disableLazyLoad, readOnly, sqlDistinct, baseTable);
} else if (prop instanceof STreePropertyAssocMany) {
return new SqlTreeNodeManyRoot(prefix, (STreePropertyAssocMany) prop, props, myList, withId(), temporalMode, disableLazyLoad);
return new SqlTreeNodeManyRoot(prefix, (STreePropertyAssocMany) prop, props, myList, withId(), temporalMode, disableLazyLoad, readOnly);
} else {
return new SqlTreeNodeBean(prefix, prop, props, myList, withId(), temporalMode, disableLazyLoad);
return new SqlTreeNodeBean(prefix, prop, props, myList, withId(), temporalMode, disableLazyLoad, readOnly);
}
}
@@ -28,6 +28,7 @@ class SqlTreeLoadBean implements SqlTreeLoad {
final boolean readId;
private final boolean readIdNormal;
private final boolean disableLazyLoad;
private final boolean readOnlyNoIntercept;
private final InheritInfo inheritInfo;
final String prefix;
private final Map<String, String> pathMap;
@@ -49,6 +50,7 @@ class SqlTreeLoadBean implements SqlTreeLoad {
this.readId = node.readId;
this.readIdNormal = readId && !temporalVersions;
this.disableLazyLoad = node.disableLazyLoad;
this.readOnlyNoIntercept = disableLazyLoad && node.readOnly;
this.partialObject = node.partialObject;
this.properties = node.properties;
this.pathMap = node.pathMap;
@@ -145,7 +147,7 @@ class SqlTreeLoadBean implements SqlTreeLoad {
void initBeanType() throws SQLException {
localDesc = desc;
localBean = desc.createEntityBean();
localBean = desc.createEntityBean2(readOnlyNoIntercept);
localIdBinder = idBinder;
}
@@ -282,14 +284,18 @@ class SqlTreeLoadBean implements SqlTreeLoad {
boolean forceNewReference = queryMode == Mode.REFRESH_BEAN;
for (STreePropertyAssocMany many : localDesc.propsMany()) {
if (many != fetchedMany) {
// create a proxy for the many (deferred fetching)
BeanCollection<?> ref = many.createReference(localBean, forceNewReference);
if (ref != null) {
if (disableLazyLoad) {
ref.setDisableLazyLoad(true);
}
if (!ref.isRegisteredWithLoadContext()) {
ctx.register(many.asMany(), ref);
if (readOnlyNoIntercept) {
many.createEmptyReference(localBean);
} else {
// create a proxy for the many (deferred fetching)
BeanCollection<?> ref = many.createReference(localBean, forceNewReference);
if (ref != null) {
if (disableLazyLoad) {
ref.setDisableLazyLoad(true);
}
if (!ref.isRegisteredWithLoadContext()) {
ctx.register(many.asMany(), ref);
}
}
}
}
@@ -38,6 +38,7 @@ class SqlTreeNodeBean implements SqlTreeNode {
final boolean readId;
final boolean readIdNormal;
final boolean disableLazyLoad;
final boolean readOnly;
final InheritInfo inheritInfo;
final String prefix;
final Map<String, String> pathMap;
@@ -57,16 +58,16 @@ class SqlTreeNodeBean implements SqlTreeNode {
* Construct for leaf node.
*/
SqlTreeNodeBean(String prefix, STreePropertyAssoc beanProp, SqlTreeProperties props,
List<SqlTreeNode> myChildren, boolean withId, SpiQuery.TemporalMode temporalMode, boolean disableLazyLoad) {
this(prefix, beanProp, beanProp.target(), props, myChildren, withId, null, temporalMode, disableLazyLoad);
List<SqlTreeNode> myChildren, boolean withId, SpiQuery.TemporalMode temporalMode, boolean disableLazyLoad, boolean readOnly) {
this(prefix, beanProp, beanProp.target(), props, myChildren, withId, null, temporalMode, disableLazyLoad, readOnly);
}
/**
* Construct for root node.
*/
SqlTreeNodeBean(STreeType desc, SqlTreeProperties props, List<SqlTreeNode> myList, boolean withId,
STreePropertyAssocMany many, SpiQuery.TemporalMode temporalMode, boolean disableLazyLoad) {
this(null, null, desc, props, myList, withId, many, temporalMode, disableLazyLoad);
STreePropertyAssocMany many, SpiQuery.TemporalMode temporalMode, boolean disableLazyLoad, boolean readOnly) {
this(null, null, desc, props, myList, withId, many, temporalMode, disableLazyLoad, readOnly);
}
/**
@@ -74,7 +75,7 @@ class SqlTreeNodeBean implements SqlTreeNode {
*/
private SqlTreeNodeBean(String prefix, STreePropertyAssoc beanProp, STreeType desc, SqlTreeProperties props,
List<SqlTreeNode> myChildren, boolean withId, STreePropertyAssocMany lazyLoadParent,
SpiQuery.TemporalMode temporalMode, boolean disableLazyLoad) {
SpiQuery.TemporalMode temporalMode, boolean disableLazyLoad, boolean readOnly) {
this.lazyLoadParent = lazyLoadParent;
this.lazyLoadParentIdBinder = (lazyLoadParent == null) ? null : lazyLoadParent.idBinder();
this.prefix = prefix;
@@ -91,6 +92,7 @@ class SqlTreeNodeBean implements SqlTreeNode {
this.readId = !aggregationRoot && withId && desc.hasId();
this.readIdNormal = readId && !temporalVersions;
this.disableLazyLoad = disableLazyLoad || !readIdNormal || desc.isRawSqlBased();
this.readOnly = readOnly;
this.partialObject = props.isPartialObject();
this.properties = props.getProps();
this.children = myChildren == null ? Collections.emptyList() : myChildren;
@@ -10,8 +10,8 @@ final class SqlTreeNodeManyRoot extends SqlTreeNodeBean {
final STreePropertyAssocMany manyProp;
SqlTreeNodeManyRoot(String prefix, STreePropertyAssocMany prop, SqlTreeProperties props, List<SqlTreeNode> myList,
boolean withId, SpiQuery.TemporalMode temporalMode, boolean disableLazyLoad) {
super(prefix, prop, props, myList, withId, temporalMode, disableLazyLoad);
boolean withId, SpiQuery.TemporalMode temporalMode, boolean disableLazyLoad, boolean readOnly) {
super(prefix, prop, props, myList, withId, temporalMode, disableLazyLoad, readOnly);
this.manyProp = prop;
}
@@ -20,9 +20,9 @@ final class SqlTreeNodeRoot extends SqlTreeNodeBean {
* Specify for SqlSelect to include an Id property or not.
*/
SqlTreeNodeRoot(STreeType desc, SqlTreeProperties props, List<SqlTreeNode> myList, boolean withId, TableJoin includeJoin,
STreePropertyAssocMany many, SpiQuery.TemporalMode temporalMode, boolean disableLazyLoad, boolean sqlDistinct, String baseTable) {
STreePropertyAssocMany many, SpiQuery.TemporalMode temporalMode, boolean disableLazyLoad, boolean readOnly, boolean sqlDistinct, String baseTable) {
super(desc, props, myList, withId, many, temporalMode, disableLazyLoad);
super(desc, props, myList, withId, many, temporalMode, disableLazyLoad, readOnly);
this.includeJoin = includeJoin;
this.sqlDistinct = sqlDistinct;
this.baseTable = baseTable;
File diff suppressed because it is too large Load Diff
@@ -1,6 +1,6 @@
package io.ebeaninternal.server.querydefn;
import io.ebean.EbeanServer;
import io.ebean.Database;
import io.ebean.Update;
import io.ebeaninternal.api.BindParams;
import io.ebeaninternal.api.SpiUpdate;
@@ -14,7 +14,7 @@ public final class DefaultOrmUpdate<T> implements SpiUpdate<T>, Serializable {
private static final long serialVersionUID = -8791423602246515438L;
private transient final EbeanServer server;
private transient final Database server;
private final Class<?> beanType;
private final String name;
private String label;
@@ -35,7 +35,7 @@ public final class DefaultOrmUpdate<T> implements SpiUpdate<T>, Serializable {
* Create with a specific server. This means you can use the
* UpdateSql.execute() method.
*/
public DefaultOrmUpdate(Class<?> beanType, EbeanServer server, String baseTable, String updateStatement) {
public DefaultOrmUpdate(Class<?> beanType, Database server, String baseTable, String updateStatement) {
this.beanType = beanType;
this.server = server;
this.baseTable = baseTable;
@@ -4,7 +4,6 @@ module io.ebean.core {
uses io.ebean.cache.ServerCachePlugin;
uses io.ebean.cache.ServerCacheNotifyPlugin;
uses io.ebean.config.DatabaseConfigProvider;
uses io.ebean.config.ServerConfigProvider;
uses io.ebean.config.ModuleInfoLoader;
uses io.ebean.config.dbplatform.DatabasePlatformProvider;
uses io.ebean.datasource.DataSourceAlertFactory;
@@ -1 +1 @@
ebean-version: 133
ebean-version: 141
@@ -6,8 +6,7 @@ import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class DefaultServerCacheConfigTest {
class DefaultServerCacheConfigTest {
private DefaultServerCacheConfig create(int maxSize, int maxIdleSecs, int maxSecsToLive, int trimFreq) {
ServerCacheOptions options = new ServerCacheOptions();
@@ -20,33 +19,45 @@ public class DefaultServerCacheConfigTest {
}
@Test
public void trimFreq_halfIdle() {
void trimFreq_halfIdle() {
assertEquals(create(10000,10,20, 0).determineTrimFrequency(), 4);
}
@Test
public void trimFreq_halfIdle_withRounding() {
void trimFreq_halfIdle_withRounding() {
assertEquals(create(10000,11,20, 0).determineTrimFrequency(), 4);
}
@Test
public void trimFreq_halfTTL() {
void trimFreq_halfTTL() {
assertEquals(create(10000,0,20, 0).determineTrimFrequency(), 9);
}
@Test
public void trimFreq_halfTTL_withRounding() {
void trimFreq_halfTTL_withRounding() {
assertEquals(create(10000,0,21, 0).determineTrimFrequency(), 9);
}
@Test
public void trimFreq_explicit() {
void trimFreq_explicit() {
assertEquals(create(10000,10,20, 42).determineTrimFrequency(), 42);
}
@Test
void trimOnPut_default() {
assertEquals(create(0,0,0, 0).determineTrimOnPut(), 1_000);
}
@Test
void trimOnPut_tenPercent() {
assertEquals(create(10_000,0,0, 0).determineTrimOnPut(), 1_000);
assertEquals(create(9_000,0,0, 0).determineTrimOnPut(), 900);
assertEquals(create(100,0,0, 0).determineTrimOnPut(), 10);
}
@Test
void trimOnPut_roundDown() {
assertEquals(create(9010,0,0, 0).determineTrimOnPut(), 901);
assertEquals(create(9009,0,0, 0).determineTrimOnPut(), 900);
}
}
@@ -10,16 +10,14 @@ import org.junit.jupiter.api.Test;
import java.util.Random;
public class DefaultServerCache_RunEvictionTest {
class DefaultServerCache_RunEvictionTest {
private DefaultServerCache createCache() {
ServerCacheOptions cacheOptions = new ServerCacheOptions();
cacheOptions.setMaxSize(10000);
cacheOptions.setMaxSize(300);
cacheOptions.setMaxIdleSecs(1);
cacheOptions.setMaxSecsToLive(2);
cacheOptions.setTrimFrequency(1);
cacheOptions.setTrimFrequency(5);
ServerCacheConfig con = new ServerCacheConfig(ServerCacheType.BEAN, "foo", "foo", cacheOptions, null, null);
return new DefaultServerCache(new DefaultServerCacheConfig(con));
@@ -35,8 +33,7 @@ public class DefaultServerCache_RunEvictionTest {
@Disabled("test takes long time")
@Test
public void runEvict() throws InterruptedException {
void runEvict() throws InterruptedException {
for (int i = 0; i < 15; i++) {
doStuff();
cache.runEviction();
@@ -47,12 +44,10 @@ public class DefaultServerCache_RunEvictionTest {
}
private void doStuff() {
for (int i = 0; i < 500; i++) {
for (int i = 0; i < 5000; i++) {
String key = "" + random.nextInt(20000);
int mode = random.nextInt(10);
if (mode < 8) {
if (mode < 7) {
cache.get(key);
} else {
cache.put(key, key + "-" + System.currentTimeMillis());
@@ -4,6 +4,9 @@ import io.ebean.config.DatabaseConfig;
import io.ebean.datasource.DataSourceAlert;
import io.ebean.datasource.DataSourceConfig;
import io.ebean.datasource.DataSourcePool;
import io.ebean.platform.h2.H2Platform;
import io.ebean.platform.postgres.Postgres9Platform;
import io.ebean.platform.postgres.PostgresPlatform;
import org.junit.jupiter.api.Test;
import javax.sql.DataSource;
@@ -128,6 +131,41 @@ public class InitDataSourceTest {
assertEquals("foo", roConfig.getUrl());
}
@Test
void isPostgresAllQuotedIdentifiers_true_when_postgres() {
DatabaseConfig config = new DatabaseConfig();
config.setAllQuotedIdentifiers(true);
config.setDatabasePlatform(new PostgresPlatform());
assertTrue(new InitDataSource(config).isPostgresAllQuotedIdentifiers());
}
@Test
void isPostgresAllQuotedIdentifiers_true_when_postgres9() {
DatabaseConfig config = new DatabaseConfig();
config.setAllQuotedIdentifiers(true);
config.setDatabasePlatform(new Postgres9Platform());
assertTrue(new InitDataSource(config).isPostgresAllQuotedIdentifiers());
}
@Test
void isPostgresAllQuotedIdentifiers_false() {
DatabaseConfig config = new DatabaseConfig();
config.setAllQuotedIdentifiers(false);
config.setDatabasePlatform(new PostgresPlatform());
assertFalse(new InitDataSource(config).isPostgresAllQuotedIdentifiers());
}
@Test
void isPostgresAllQuotedIdentifiers_false_when_notPostgres() {
DatabaseConfig config = new DatabaseConfig();
config.setAllQuotedIdentifiers(true);
config.setDatabasePlatform(new H2Platform());
assertFalse(new InitDataSource(config).isPostgresAllQuotedIdentifiers());
}
@Test
public void online() {
@@ -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());
}
+1
View File
@@ -0,0 +1 @@
synthetic: false
+4 -4
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.4.1</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.4.1</version>
<version>13.6.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.4.1</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.4.1</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) {

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