mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-09-20 11:17:36 +00:00
Compare commits
53
Commits
16.0.0-RC2
...
16.1.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c9a6f822ac | ||
|
|
2231ef9fd1 | ||
|
|
3ff1905318 | ||
|
|
9b4fecff96 | ||
|
|
6f356fd55e | ||
|
|
591f260f5b | ||
|
|
b361b10571 | ||
|
|
c0e4e548ee | ||
|
|
92f3245919 | ||
|
|
59c2290916 | ||
|
|
1135eb3f99 | ||
|
|
1dccdff7bf | ||
|
|
5f74a53e3e | ||
|
|
1f9e652ea9 | ||
|
|
4e592c97ff | ||
|
|
760d19a10d | ||
|
|
d2693c3ff2 | ||
|
|
3324b2bda4 | ||
|
|
1b5e066562 | ||
|
|
104e4ec756 | ||
|
|
74a2967a6e | ||
|
|
e693b12a97 | ||
|
|
48fb9b34bb | ||
|
|
f64400400a | ||
|
|
d7cc081942 | ||
|
|
3351548b60 | ||
|
|
8d9858f57a | ||
|
|
9b520bc176 | ||
|
|
44fd8e3a56 | ||
|
|
6910016c4d | ||
|
|
5f8a3c0591 | ||
|
|
0ae6956c1c | ||
|
|
2e9c5d8548 | ||
|
|
93edc840b3 | ||
|
|
34311785fa | ||
|
|
63929f8ff3 | ||
|
|
d918c5117f | ||
|
|
dd845a7b0c | ||
|
|
df0e4d57f0 | ||
|
|
9c7fa25d49 | ||
|
|
e82c1a4140 | ||
|
|
389bf48e3e | ||
|
|
3b3b44543e | ||
|
|
297f334da5 | ||
|
|
78c7439445 | ||
|
|
2043ba6411 | ||
|
|
437c58001b | ||
|
|
0e812efa7e | ||
|
|
80d4d21986 | ||
|
|
fe66b8c242 | ||
|
|
206b2b2d3b | ||
|
|
c0bc3faea0 | ||
|
|
3d07e7d804 |
@@ -40,5 +40,5 @@ jobs:
|
||||
# - name: Maven single test
|
||||
# run: mvn --batch-mode clean verify -Dtest="io.ebeaninternal.server.core.DefaultServer_getReferenceTest" -DfailIfNoTests=false
|
||||
- name: Build with Maven
|
||||
run: mvn -T 8 clean test
|
||||
run: mvn -T 8 clean test -Pdefault
|
||||
|
||||
|
||||
@@ -37,5 +37,5 @@ jobs:
|
||||
- name: Maven version
|
||||
run: mvn --version
|
||||
- name: Build with Maven
|
||||
run: mvn -T 8 test
|
||||
run: mvn test -Pea
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -42,13 +42,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-clickhouse</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -42,13 +42,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -42,13 +42,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-db2</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -42,13 +42,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -42,13 +42,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-hana</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -42,13 +42,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-mariadb</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -42,13 +42,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-mysql</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -22,13 +22,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -47,19 +47,19 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-net-postgis-types</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -42,13 +42,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-nuodb</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -42,13 +42,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-oracle</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -22,13 +22,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -47,19 +47,19 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-postgis-types</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -42,13 +42,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -42,13 +42,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlite</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -42,13 +42,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlserver</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -42,13 +42,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -41,7 +41,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-jackson-mapper</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -60,13 +60,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-all</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>composites</artifactId>
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean api</name>
|
||||
@@ -35,7 +35,7 @@
|
||||
<dependency>
|
||||
<groupId>io.avaje</groupId>
|
||||
<artifactId>avaje-config</artifactId>
|
||||
<version>4.0</version>
|
||||
<version>4.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -1062,6 +1062,11 @@ public interface DatabaseBuilder {
|
||||
*/
|
||||
DatabaseBuilder readOnlyDatabase(boolean readOnlyDatabase);
|
||||
|
||||
/**
|
||||
* Set to false such that the instance does not register a JVM shutdown hook.
|
||||
*/
|
||||
DatabaseBuilder shutdownHook(boolean shutdownHook);
|
||||
|
||||
/**
|
||||
* Set a DataSource.
|
||||
*/
|
||||
@@ -2643,6 +2648,11 @@ public interface DatabaseBuilder {
|
||||
*/
|
||||
boolean readOnlyDatabase();
|
||||
|
||||
/**
|
||||
* Return if a JVM shutdown hook should be registered.
|
||||
*/
|
||||
boolean shutdownHook();
|
||||
|
||||
/**
|
||||
* Return the DataSource.
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package io.ebean;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* Object relational query for finding a List, Set, Map or single entity bean.
|
||||
@@ -310,6 +311,7 @@ public interface Query<T> extends CancelableQuery, QueryBuilder<Query<T>, T> {
|
||||
/**
|
||||
* Return the Id value.
|
||||
*/
|
||||
@Nullable
|
||||
Object getId();
|
||||
|
||||
/**
|
||||
@@ -446,11 +448,13 @@ public interface Query<T> extends CancelableQuery, QueryBuilder<Query<T>, T> {
|
||||
/**
|
||||
* Return the "for update" wait mode to use.
|
||||
*/
|
||||
@Nullable
|
||||
LockWait getForUpdateLockWait();
|
||||
|
||||
/**
|
||||
* Return the lock type (strength) to use with "for update".
|
||||
*/
|
||||
@Nullable
|
||||
LockType getForUpdateLockType();
|
||||
|
||||
/**
|
||||
|
||||
@@ -311,6 +311,7 @@ public class DatabaseConfig implements DatabaseBuilder.Settings {
|
||||
private boolean skipDataSourceCheck;
|
||||
|
||||
private boolean readOnlyDatabase;
|
||||
private boolean shutdownHook = true;
|
||||
|
||||
/**
|
||||
* The data source (if programmatically provided).
|
||||
@@ -1365,6 +1366,17 @@ public class DatabaseConfig implements DatabaseBuilder.Settings {
|
||||
return readOnlyDatabase;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DatabaseBuilder shutdownHook(boolean shutdownHook) {
|
||||
this.shutdownHook = shutdownHook;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shutdownHook() {
|
||||
return shutdownHook;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataSource getDataSource() {
|
||||
return dataSource;
|
||||
@@ -2137,6 +2149,7 @@ public class DatabaseConfig implements DatabaseBuilder.Settings {
|
||||
loadDocStoreSettings(p);
|
||||
|
||||
defaultServer = p.getBoolean("defaultServer", defaultServer);
|
||||
shutdownHook = p.getBoolean("shutdownHook", shutdownHook);
|
||||
readOnlyDatabase = p.getBoolean("readOnlyDatabase", readOnlyDatabase);
|
||||
autoPersistUpdates = p.getBoolean("autoPersistUpdates", autoPersistUpdates);
|
||||
loadModuleInfo = p.getBoolean("loadModuleInfo", loadModuleInfo);
|
||||
|
||||
@@ -167,6 +167,7 @@ public class DatabasePlatform {
|
||||
* findIterate() and findVisit().
|
||||
*/
|
||||
protected boolean forwardOnlyHintOnFindIterate;
|
||||
protected boolean autoCommitFalseOnFindIterate;
|
||||
|
||||
/**
|
||||
* If set then use the CONCUR_UPDATABLE hint when creating ResultSets.
|
||||
@@ -528,6 +529,10 @@ public class DatabasePlatform {
|
||||
this.forwardOnlyHintOnFindIterate = forwardOnlyHintOnFindIterate;
|
||||
}
|
||||
|
||||
public boolean autoCommitFalseOnFindIterate() {
|
||||
return autoCommitFalseOnFindIterate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the ResultSet CONCUR_UPDATABLE Hint should be used on
|
||||
* createNativeSqlTree() PreparedStatements.
|
||||
@@ -780,4 +785,5 @@ public class DatabasePlatform {
|
||||
public String inlineSqlHint(String hint) {
|
||||
return "/*+ " + hint + " */ ";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -97,8 +97,7 @@ public final class ShutdownManager {
|
||||
private static void registerShutdownHook() {
|
||||
lock.lock();
|
||||
try {
|
||||
String value = System.getProperty("ebean.registerShutdownHook");
|
||||
if (value == null || !value.trim().equalsIgnoreCase("false")) {
|
||||
if ("true".equalsIgnoreCase(System.getProperty("ebean.registerShutdownHook", "true"))) {
|
||||
Runtime.getRuntime().addShutdownHook(shutdownHook);
|
||||
}
|
||||
} catch (IllegalStateException ex) {
|
||||
|
||||
@@ -79,6 +79,7 @@ class DatabaseConfigTest {
|
||||
props.setProperty("includeLabelInSql", "false");
|
||||
props.setProperty("lazyLoadBatchSize", "50");
|
||||
props.setProperty("queryBatchSize", "60");
|
||||
props.setProperty("shutdownHook", "false");
|
||||
|
||||
props.setProperty("queryPlan.enable", "true");
|
||||
props.setProperty("queryPlan.thresholdMicros", "10000");
|
||||
@@ -100,6 +101,7 @@ class DatabaseConfigTest {
|
||||
assertTrue(settings.isLoadModuleInfo());
|
||||
assertTrue(settings.skipDataSourceCheck());
|
||||
assertTrue(settings.readOnlyDatabase());
|
||||
assertFalse(settings.shutdownHook());
|
||||
assertFalse(settings.isIncludeLabelInSql());
|
||||
assertThat(settings.getLengthCheck()).isEqualTo(LengthCheck.ON);
|
||||
assertThat(settings.getLazyLoadBatchSize()).isEqualTo(50);
|
||||
@@ -172,6 +174,7 @@ class DatabaseConfigTest {
|
||||
DatabaseBuilder.Settings config = new DatabaseConfig().settings();
|
||||
assertTrue(config.isIdGeneratorAutomatic());
|
||||
assertTrue(config.isDefaultServer());
|
||||
assertTrue(config.shutdownHook());
|
||||
assertFalse(config.isAutoPersistUpdates());
|
||||
assertFalse(config.skipDataSourceCheck());
|
||||
|
||||
@@ -196,6 +199,8 @@ class DatabaseConfigTest {
|
||||
assertThat(config.getLengthCheck()).isEqualTo(LengthCheck.OFF);
|
||||
assertTrue(config.isIncludeLabelInSql());
|
||||
|
||||
config.shutdownHook(false);
|
||||
assertFalse(config.shutdownHook());
|
||||
config.setLoadModuleInfo(false);
|
||||
assertFalse(config.isAutoLoadModuleInfo());
|
||||
assertFalse(config.isLoadModuleInfo());
|
||||
|
||||
+26
-26
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean bom</name>
|
||||
@@ -89,25 +89,25 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -125,13 +125,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-jackson-mapper</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-generator</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -155,37 +155,37 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>querybean-generator</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>kotlin-querybean-generator</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-redis</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-spring-txn</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- platforms -->
|
||||
@@ -193,79 +193,79 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-clickhouse</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-db2</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-h2</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-hana</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-mariadb</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-mysql</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-nuodb</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-oracle</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-postgres</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-postgis</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-postgis-types</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-sqlite</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-sqlserver</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<version>16.1.0</version>
|
||||
</parent>
|
||||
<artifactId>ebean-core-json</artifactId>
|
||||
<name>ebean-core-json</name>
|
||||
<scm>
|
||||
<developerConnection>scm:git:git@github.com:ebean-orm/ebean.git</developerConnection>
|
||||
<tag>HEAD</tag>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Jackson core used internally by Ebean -->
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-core</artifactId>
|
||||
<version>${jackson.version}</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
+5
-10
@@ -8,11 +8,7 @@ import io.ebean.service.SpiJsonService;
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
import java.io.Writer;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Utility that converts between JSON content and simple java Maps/Lists.
|
||||
@@ -52,8 +48,8 @@ public final class DJsonService implements SpiJsonService {
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the json and return as a Map additionally specifying if the returned map should
|
||||
* be modify aware meaning that it can detect when it has been modified.
|
||||
* Parse the json and return as a Map additionally specifying if the returned map should be modify
|
||||
* aware meaning that it can detect when it has been modified.
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> parseObject(String json, boolean modifyAware) throws IOException {
|
||||
@@ -94,9 +90,8 @@ public final class DJsonService implements SpiJsonService {
|
||||
|
||||
/**
|
||||
* Parse the json and return as a Map taking a JsonParser and a starting token.
|
||||
* <p>
|
||||
* Used when the first token is checked to see if the value is null prior to calling this.
|
||||
* </p>
|
||||
*
|
||||
* <p>Used when the first token is checked to see if the value is null prior to calling this.
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> parseObject(JsonParser parser, JsonToken token) throws IOException {
|
||||
+20
-32
@@ -8,15 +8,23 @@ import io.ebean.ModifyAwareType;
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
import java.io.StringReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.*;
|
||||
|
||||
final class EJsonReader {
|
||||
|
||||
static final JsonFactory json = new JsonFactory();
|
||||
private final JsonParser parser;
|
||||
private final boolean modifyAware;
|
||||
private final ModifyAwareFlag modifyAwareOwner;
|
||||
private int depth;
|
||||
private Stack stack;
|
||||
private Context currentContext;
|
||||
|
||||
EJsonReader(JsonParser parser, boolean modifyAware) {
|
||||
this.parser = parser;
|
||||
this.modifyAware = modifyAware;
|
||||
this.modifyAwareOwner = modifyAware ? new ModifyAwareFlag() : null;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
static Map<String, Object> parseObject(String json, boolean modifyAware) throws IOException {
|
||||
@@ -102,24 +110,6 @@ final class EJsonReader {
|
||||
return new EJsonReader(parser, modifyAware).parseJson(token);
|
||||
}
|
||||
|
||||
private final JsonParser parser;
|
||||
|
||||
private final boolean modifyAware;
|
||||
|
||||
private final ModifyAwareFlag modifyAwareOwner;
|
||||
|
||||
private int depth;
|
||||
|
||||
private Stack stack;
|
||||
|
||||
private Context currentContext;
|
||||
|
||||
EJsonReader(JsonParser parser, boolean modifyAware) {
|
||||
this.parser = parser;
|
||||
this.modifyAware = modifyAware;
|
||||
this.modifyAwareOwner = (modifyAware) ? new ModifyAwareFlag() : null;
|
||||
}
|
||||
|
||||
private void startArray() {
|
||||
depth++;
|
||||
stack.push(currentContext);
|
||||
@@ -197,7 +187,6 @@ final class EJsonReader {
|
||||
*/
|
||||
private void processJsonToken(JsonToken token) throws IOException {
|
||||
switch (token) {
|
||||
|
||||
case START_ARRAY:
|
||||
startArray();
|
||||
break;
|
||||
@@ -273,17 +262,17 @@ final class EJsonReader {
|
||||
}
|
||||
}
|
||||
|
||||
private static abstract class Context {
|
||||
private abstract static class Context {
|
||||
Context next;
|
||||
|
||||
abstract void popContext(Context temp);
|
||||
|
||||
abstract Object getValue();
|
||||
|
||||
abstract void setKey(String key);
|
||||
|
||||
abstract void setValue(Object value);
|
||||
|
||||
abstract void setKey(String key);
|
||||
|
||||
abstract void setValueNull();
|
||||
}
|
||||
|
||||
@@ -312,13 +301,13 @@ final class EJsonReader {
|
||||
}
|
||||
|
||||
@Override
|
||||
void setKey(String key) {
|
||||
this.key = key;
|
||||
void setValue(Object value) {
|
||||
map.put(key, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
void setValue(Object value) {
|
||||
map.put(key, value);
|
||||
void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -364,5 +353,4 @@ final class EJsonReader {
|
||||
// not expected
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+5
-7
@@ -20,6 +20,11 @@ final class EJsonWriter {
|
||||
* Base jsonFactory implementation used when it is not passed in.
|
||||
*/
|
||||
static final JsonFactory jsonFactory = new JsonFactory();
|
||||
private final JsonGenerator jsonGenerator;
|
||||
|
||||
private EJsonWriter(JsonGenerator jsonGenerator) {
|
||||
this.jsonGenerator = jsonGenerator;
|
||||
}
|
||||
|
||||
static String write(Object object) throws IOException {
|
||||
StringWriter writer = new StringWriter(200);
|
||||
@@ -42,12 +47,6 @@ final class EJsonWriter {
|
||||
new EJsonWriter(jsonGenerator).writeCollection(null, collection);
|
||||
}
|
||||
|
||||
private final JsonGenerator jsonGenerator;
|
||||
|
||||
private EJsonWriter(JsonGenerator jsonGenerator) {
|
||||
this.jsonGenerator = jsonGenerator;
|
||||
}
|
||||
|
||||
private void writeJson(Object object) {
|
||||
writeJson(null, object);
|
||||
}
|
||||
@@ -210,5 +209,4 @@ final class EJsonWriter {
|
||||
}
|
||||
jsonGenerator.writeEndObject();
|
||||
}
|
||||
|
||||
}
|
||||
-1
@@ -22,5 +22,4 @@ public final class ModifyAwareFlag implements ModifyAwareType, Serializable {
|
||||
public void setMarkedDirty(boolean markedDirty) {
|
||||
this.markedDirty = markedDirty;
|
||||
}
|
||||
|
||||
}
|
||||
+2
-4
@@ -14,9 +14,8 @@ public final class ModifyAwareIterator<E> implements Iterator<E> {
|
||||
|
||||
/**
|
||||
* Create with an Owner and the underlying Iterator this wraps.
|
||||
* <p>
|
||||
* The owner is notified of the removals.
|
||||
* </p>
|
||||
*
|
||||
* <p>The owner is notified of the removals.
|
||||
*/
|
||||
public ModifyAwareIterator(ModifyAwareType owner, Iterator<E> it) {
|
||||
this.owner = owner;
|
||||
@@ -38,5 +37,4 @@ public final class ModifyAwareIterator<E> implements Iterator<E> {
|
||||
owner.setMarkedDirty(true);
|
||||
it.remove();
|
||||
}
|
||||
|
||||
}
|
||||
+2
-4
@@ -34,11 +34,11 @@ public final class ModifyAwareMap<K, V> implements Map<K, V>, ModifyAwareType, S
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o instanceof ModifyAwareMap) {
|
||||
ModifyAwareMap<?,?> that = (ModifyAwareMap<?,?>) o;
|
||||
ModifyAwareMap<?, ?> that = (ModifyAwareMap<?, ?>) o;
|
||||
return Objects.equals(map, that.map);
|
||||
}
|
||||
if (!(o instanceof Map)) return false;
|
||||
Map<?,?> that = (Map<?,?>) o;
|
||||
Map<?, ?> that = (Map<?, ?>) o;
|
||||
return Objects.equals(map, that);
|
||||
}
|
||||
|
||||
@@ -112,7 +112,6 @@ public final class ModifyAwareMap<K, V> implements Map<K, V>, ModifyAwareType, S
|
||||
map.putAll(m);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
if (!map.isEmpty()) {
|
||||
@@ -135,5 +134,4 @@ public final class ModifyAwareMap<K, V> implements Map<K, V>, ModifyAwareType, S
|
||||
public Set<Map.Entry<K, V>> entrySet() {
|
||||
return new ModifyAwareSet<>(this, map.entrySet());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
module io.ebean.core.json {
|
||||
|
||||
requires io.ebean.api;
|
||||
|
||||
requires transitive com.fasterxml.jackson.core;
|
||||
exports io.ebeaninternal.json to io.ebean.test, io.ebean.core;
|
||||
|
||||
provides io.ebean.service.BootstrapService with io.ebeaninternal.json.DJsonService;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
io.ebeaninternal.json.DJsonService
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
@@ -16,7 +16,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
+12
-6
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-core</artifactId>
|
||||
@@ -22,7 +22,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-json</artifactId>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -46,7 +52,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -159,21 +165,21 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlserver</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package io.ebeaninternal.api;
|
||||
|
||||
import io.ebean.bean.EntityBean;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -13,10 +14,23 @@ public final class BindValuesKey {
|
||||
|
||||
private final List<Object> values = new ArrayList<>();
|
||||
|
||||
private final SpiEbeanServer server;
|
||||
|
||||
public BindValuesKey(SpiEbeanServer server) {
|
||||
this.server = server;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a bind value.
|
||||
*/
|
||||
public BindValuesKey add(Object value) {
|
||||
if (value instanceof EntityBean) {
|
||||
// only interested in id to keep the memory footprint low
|
||||
Object id = server.beanId(value);
|
||||
if (id != null) {
|
||||
value = id;
|
||||
}
|
||||
}
|
||||
values.add(value);
|
||||
return this;
|
||||
}
|
||||
@@ -31,5 +45,4 @@ public final class BindValuesKey {
|
||||
return values.hashCode();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -65,12 +65,12 @@ public interface SpiTransaction extends Transaction {
|
||||
* <p>
|
||||
* This is to handle bi-directional relationships where both sides Cascade.
|
||||
*/
|
||||
void registerDeleteBean(Integer hash);
|
||||
void registerDeleteBean(Class<?> type, Object id);
|
||||
|
||||
/**
|
||||
* Return true if this is a bean that has already been saved/deleted.
|
||||
*/
|
||||
boolean isRegisteredDeleteBean(Integer hash);
|
||||
boolean isRegisteredDeleteBean(Class<?> type, Object id);
|
||||
|
||||
/**
|
||||
* Unregister the persisted beans. Expected after persisting top level beans
|
||||
@@ -362,4 +362,14 @@ public interface SpiTransaction extends Transaction {
|
||||
* Set the transaction to be inactive via external transaction manager.
|
||||
*/
|
||||
void deactivateExternal();
|
||||
|
||||
/**
|
||||
* Set autocommit to false for a findIterate query.
|
||||
* <p>
|
||||
* This is done for specific platforms that need it, in order to make
|
||||
* use cursors to stream a large or unbounded query result to the client.
|
||||
*/
|
||||
default void setAutoCommitOnFindIterate() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,13 +195,13 @@ public abstract class SpiTransactionProxy implements SpiTransaction {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerDeleteBean(Integer hash) {
|
||||
transaction.registerDeleteBean(hash);
|
||||
public void registerDeleteBean(Class<?> type, Object id) {
|
||||
transaction.registerDeleteBean(type, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRegisteredDeleteBean(Integer hash) {
|
||||
return transaction.isRegisteredDeleteBean(hash);
|
||||
public boolean isRegisteredDeleteBean(Class<?> type, Object id) {
|
||||
return transaction.isRegisteredDeleteBean(type, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package io.ebeaninternal.server.core;
|
||||
|
||||
import io.ebean.CancelableQuery;
|
||||
import io.ebean.Transaction;
|
||||
import io.ebean.util.JdbcClose;
|
||||
import io.ebeaninternal.api.*;
|
||||
import io.ebeaninternal.server.persist.Binder;
|
||||
@@ -98,6 +97,13 @@ public abstract class AbstractSqlQueryRequest implements CancelableQuery {
|
||||
public void setDefaultFetchBuffer(int fetchSize) {
|
||||
query.setDefaultFetchBuffer(fetchSize);
|
||||
}
|
||||
|
||||
public void setAutoCommitOnFindIterate() {
|
||||
if (createdTransaction) {
|
||||
transaction.setAutoCommitOnFindIterate();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the underlying resources.
|
||||
*/
|
||||
|
||||
@@ -162,8 +162,10 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
this.scriptRunner = new DScriptRunner(this);
|
||||
|
||||
configureServerPlugins();
|
||||
// Register with the JVM Shutdown hook
|
||||
ShutdownManager.registerDatabase(this);
|
||||
if (this.config.shutdownHook() && "true".equalsIgnoreCase(System.getProperty("ebean.registerShutdownHook", "true"))) {
|
||||
// register with the JVM Shutdown hook
|
||||
ShutdownManager.registerDatabase(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -301,12 +301,12 @@ public final class InternalConfiguration {
|
||||
}
|
||||
|
||||
DtoQueryEngine createDtoQueryEngine() {
|
||||
return new DtoQueryEngine(binder, config.getJdbcFetchSizeFindEach(), config.getJdbcFetchSizeFindList());
|
||||
return new DtoQueryEngine(binder, config.getJdbcFetchSizeFindEach(), config.getJdbcFetchSizeFindList(), databasePlatform.autoCommitFalseOnFindIterate());
|
||||
}
|
||||
|
||||
RelationalQueryEngine createRelationalQueryEngine() {
|
||||
return new DefaultRelationalQueryEngine(binder, config.getDatabaseBooleanTrue(), config.getPlatformConfig().getDbUuid().useBinaryOptimized(),
|
||||
config.getJdbcFetchSizeFindEach(), config.getJdbcFetchSizeFindList());
|
||||
config.getJdbcFetchSizeFindEach(), config.getJdbcFetchSizeFindList(), databasePlatform.autoCommitFalseOnFindIterate());
|
||||
}
|
||||
|
||||
OrmQueryEngine createOrmQueryEngine() {
|
||||
|
||||
@@ -786,4 +786,10 @@ public final class OrmQueryRequest<T> extends BeanRequest implements SpiOrmQuery
|
||||
beanDescriptor.freeze(bean);
|
||||
}
|
||||
}
|
||||
|
||||
public void setAutoCommitOnFindIterate() {
|
||||
if (createdTransaction) {
|
||||
transaction.setAutoCommitOnFindIterate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,10 +54,6 @@ public final class PersistRequestBean<T> extends PersistRequest implements BeanP
|
||||
* The unique id used for logging summary.
|
||||
*/
|
||||
private Object idValue;
|
||||
/**
|
||||
* Hash value used to handle cascade delete both ways in a relationship.
|
||||
*/
|
||||
private Integer beanHash;
|
||||
private boolean statelessUpdate;
|
||||
private boolean notifyCache;
|
||||
/**
|
||||
@@ -285,7 +281,9 @@ public final class PersistRequestBean<T> extends PersistRequest implements BeanP
|
||||
private void onFailedUpdateUndoGeneratedProperties() {
|
||||
for (BeanProperty prop : beanDescriptor.propertiesGenUpdate()) {
|
||||
Object oldVal = intercept.origValue(prop.propertyIndex());
|
||||
prop.setValue(entityBean, oldVal);
|
||||
if (oldVal != null) {
|
||||
prop.setValue(entityBean, oldVal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -553,34 +551,17 @@ public final class PersistRequestBean<T> extends PersistRequest implements BeanP
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The hash used to register the bean with the transaction.
|
||||
* <p>
|
||||
* Takes into account the class type and id value.
|
||||
*/
|
||||
private Integer beanHash() {
|
||||
if (beanHash == null) {
|
||||
Object id = beanDescriptor.getId(entityBean);
|
||||
int hc = 92821 * bean.getClass().getName().hashCode();
|
||||
if (id != null) {
|
||||
hc += id.hashCode();
|
||||
}
|
||||
beanHash = hc;
|
||||
}
|
||||
return beanHash;
|
||||
}
|
||||
|
||||
public void registerDeleteBean() {
|
||||
Integer hash = beanHash();
|
||||
transaction.registerDeleteBean(hash);
|
||||
final Object id = beanDescriptor.id(entityBean);
|
||||
transaction.registerDeleteBean(beanDescriptor.type(), id);
|
||||
}
|
||||
|
||||
public boolean isRegisteredForDeleteBean() {
|
||||
if (transaction == null) {
|
||||
return false;
|
||||
} else {
|
||||
Integer hash = beanHash();
|
||||
return transaction.isRegisteredDeleteBean(hash);
|
||||
final Object id = beanDescriptor.id(entityBean);
|
||||
return transaction.isRegisteredDeleteBean(beanDescriptor.type(), id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -809,7 +790,9 @@ public final class PersistRequestBean<T> extends PersistRequest implements BeanP
|
||||
public void checkRowCount(int rowCount) {
|
||||
if (rowCount != 1 && rowCount != Statement.SUCCESS_NO_INFO) {
|
||||
if (ConcurrencyMode.VERSION == concurrencyMode) {
|
||||
onFailedUpdateUndoGeneratedProperties();
|
||||
if (type == Type.UPDATE) {
|
||||
onFailedUpdateUndoGeneratedProperties();
|
||||
}
|
||||
throw new OptimisticLockException("Data has changed. updated row count " + rowCount, null, bean);
|
||||
} else if (rowCount == 0 && type == Type.UPDATE) {
|
||||
throw new EntityNotFoundException("No rows updated");
|
||||
|
||||
@@ -436,14 +436,15 @@ public abstract class BeanPropertyAssoc<T> extends BeanProperty implements STree
|
||||
}
|
||||
TableJoinColumn[] cols = join.columns();
|
||||
if (!idProp.isEmbedded()) {
|
||||
// simple single scalar id
|
||||
if (cols.length != 1) {
|
||||
CoreLog.log.log(ERROR, "No Imported Id column for {0} in table {1}", idProp, join.getTable());
|
||||
return null;
|
||||
} else {
|
||||
BeanProperty[] idProps = {idProp};
|
||||
return createImportedScalar(owner, cols[0], idProps, others);
|
||||
// simple single scalar id, match on the foreign column, allow extra TableJoinColumn for #3664
|
||||
String matchColumn = idProp.dbColumn();
|
||||
for (TableJoinColumn col : cols) {
|
||||
if (matchColumn.equals(col.getForeignDbColumn())) {
|
||||
return createImportedScalar(owner, col, new BeanProperty[]{idProp}, others);
|
||||
}
|
||||
}
|
||||
CoreLog.log.log(ERROR, "No Imported Id column for {0} in table {1}", idProp, join.getTable());
|
||||
return null;
|
||||
} else {
|
||||
// embedded id
|
||||
BeanPropertyAssocOne<?> embProp = (BeanPropertyAssocOne<?>) idProp;
|
||||
|
||||
@@ -128,16 +128,6 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
|
||||
throw new PersistenceException("Cannot find imported id for " + fullName() + " from " + targetDescriptor
|
||||
+ ". If using native-image, possibly missing reflect-config for the Id property.");
|
||||
}
|
||||
if (importedId.isScalar()) {
|
||||
// limit JoinColumn mapping to the @Id / primary key
|
||||
TableJoinColumn[] columns = tableJoin.columns();
|
||||
String foreignJoinColumn = columns[0].getForeignDbColumn();
|
||||
String foreignIdColumn = targetDescriptor.idProperty().dbColumn();
|
||||
if (!foreignJoinColumn.equalsIgnoreCase(foreignIdColumn)) {
|
||||
throw new PersistenceException("Mapping limitation - @JoinColumn on " + fullName() + " needs to map to a primary key as per Issue #529 "
|
||||
+ " - joining to " + foreignJoinColumn + " and not " + foreignIdColumn);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
exportedProperties = createExported();
|
||||
String delStmt = "delete from " + targetDescriptor.baseTable() + " where ";
|
||||
|
||||
+6
-6
@@ -726,7 +726,7 @@ public class DefaultExpressionFactory implements SpiExpressionFactory {
|
||||
*/
|
||||
@Override
|
||||
public <T> Junction<T> conjunction(Query<T> query) {
|
||||
return new JunctionExpression<>(Junction.Type.AND, query, query.where());
|
||||
return new JunctionExpression<>(Junction.Type.AND, query, this, query.where());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -734,7 +734,7 @@ public class DefaultExpressionFactory implements SpiExpressionFactory {
|
||||
*/
|
||||
@Override
|
||||
public <T> Junction<T> disjunction(Query<T> query) {
|
||||
return new JunctionExpression<>(Junction.Type.OR, query, query.where());
|
||||
return new JunctionExpression<>(Junction.Type.OR, query, this, query.where());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -742,7 +742,7 @@ public class DefaultExpressionFactory implements SpiExpressionFactory {
|
||||
*/
|
||||
@Override
|
||||
public <T> Junction<T> conjunction(Query<T> query, ExpressionList<T> parent) {
|
||||
return new JunctionExpression<>(Junction.Type.AND, query, parent);
|
||||
return new JunctionExpression<>(Junction.Type.AND, query, this, parent);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -750,14 +750,14 @@ public class DefaultExpressionFactory implements SpiExpressionFactory {
|
||||
*/
|
||||
@Override
|
||||
public <T> Junction<T> disjunction(Query<T> query, ExpressionList<T> parent) {
|
||||
return new JunctionExpression<>(Junction.Type.OR, query, parent);
|
||||
return new JunctionExpression<>(Junction.Type.OR, query, this, parent);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a list of expressions that are wrapped by NOT.
|
||||
*/
|
||||
public <T> Junction<T> junction(Junction.Type type, Query<T> query) {
|
||||
return new JunctionExpression<>(type, query, query.where());
|
||||
return new JunctionExpression<>(type, query, this, query.where());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -765,6 +765,6 @@ public class DefaultExpressionFactory implements SpiExpressionFactory {
|
||||
*/
|
||||
@Override
|
||||
public <T> Junction<T> junction(Junction.Type type, Query<T> query, ExpressionList<T> parent) {
|
||||
return new JunctionExpression<>(type, query, parent);
|
||||
return new JunctionExpression<>(type, query, this, parent);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-6
@@ -40,12 +40,8 @@ public class DefaultExpressionList<T> implements SpiExpressionList<T> {
|
||||
/**
|
||||
* Construct for Text root expression list - this handles implicit Bool Should, Must etc.
|
||||
*/
|
||||
public DefaultExpressionList(Query<T> query) {
|
||||
this(query, query.getExpressionFactory(), null, new ArrayList<>(), true);
|
||||
}
|
||||
|
||||
public DefaultExpressionList(Query<T> query, ExpressionList<T> parentExprList) {
|
||||
this(query, query.getExpressionFactory(), parentExprList, new ArrayList<>());
|
||||
public DefaultExpressionList(Query<T> query, boolean textRoot) {
|
||||
this(query, query.getExpressionFactory(), null, new ArrayList<>(), textRoot);
|
||||
}
|
||||
|
||||
DefaultExpressionList(Query<T> query, ExpressionFactory expr, ExpressionList<T> parentExprList, List<SpiExpression> list) {
|
||||
|
||||
@@ -24,9 +24,9 @@ final class JunctionExpression<T> implements SpiJunction<T>, SpiExpression, Expr
|
||||
DefaultExpressionList<T> exprList;
|
||||
Junction.Type type;
|
||||
|
||||
JunctionExpression(Junction.Type type, Query<T> query, ExpressionList<T> parent) {
|
||||
JunctionExpression(Junction.Type type, Query<T> query, ExpressionFactory expr, ExpressionList<T> parent) {
|
||||
this.type = type;
|
||||
this.exprList = new DefaultExpressionList<>(query, parent);
|
||||
this.exprList = new DefaultExpressionList<>(query, expr, parent, new ArrayList<>());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -37,12 +37,14 @@ public final class CQueryEngine {
|
||||
private final CQueryBuilder queryBuilder;
|
||||
private final CQueryHistorySupport historySupport;
|
||||
private final DatabasePlatform dbPlatform;
|
||||
private final boolean autoCommitFalseOnFindIterate;
|
||||
|
||||
public CQueryEngine(DatabaseBuilder.Settings config, DatabasePlatform dbPlatform, Binder binder, Map<String, String> asOfTableMapping, Map<String, String> draftTableMap) {
|
||||
this.dbPlatform = dbPlatform;
|
||||
this.defaultFetchSizeFindEach = config.getJdbcFetchSizeFindEach();
|
||||
this.defaultFetchSizeFindList = config.getJdbcFetchSizeFindList();
|
||||
this.forwardOnlyHintOnFindIterate = dbPlatform.forwardOnlyHintOnFindIterate();
|
||||
this.autoCommitFalseOnFindIterate = dbPlatform.autoCommitFalseOnFindIterate();
|
||||
this.historySupport = new CQueryHistorySupport(dbPlatform.historySupport(), asOfTableMapping, config.getAsOfSysPeriod());
|
||||
this.queryBuilder = new CQueryBuilder(config, dbPlatform, binder, historySupport, new CQueryDraftSupport(draftTableMap));
|
||||
}
|
||||
@@ -181,6 +183,9 @@ public final class CQueryEngine {
|
||||
if (defaultFetchSizeFindEach > 0) {
|
||||
request.setDefaultFetchBuffer(defaultFetchSizeFindEach);
|
||||
}
|
||||
if (autoCommitFalseOnFindIterate) {
|
||||
request.setAutoCommitOnFindIterate();
|
||||
}
|
||||
if (!cquery.prepareBindExecuteQueryForwardOnly(forwardOnlyHintOnFindIterate)) {
|
||||
// query has been cancelled already
|
||||
return null;
|
||||
|
||||
@@ -15,8 +15,8 @@ final class DFetchGroup<T> implements SpiFetchGroup<T> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrmQueryDetail detail() {
|
||||
return detail.copy();
|
||||
public OrmQueryDetail detail(OrmQueryDetail existing) {
|
||||
return detail.copy(existing);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -52,7 +52,7 @@ final class DefaultFetchGroupQuery<T> implements SpiFetchGroupQuery<T>, SpiQuery
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public Query<T> select(FetchGroup fetchGroup) {
|
||||
this.detail = ((SpiFetchGroup) fetchGroup).detail();
|
||||
this.detail = ((SpiFetchGroup) fetchGroup).detail(detail);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
+18
-9
@@ -15,6 +15,8 @@ import io.ebeaninternal.server.core.RowReader;
|
||||
import io.ebeaninternal.server.persist.Binder;
|
||||
|
||||
import jakarta.persistence.PersistenceException;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
@@ -28,15 +30,18 @@ public final class DefaultRelationalQueryEngine implements RelationalQueryEngine
|
||||
private final Binder binder;
|
||||
private final String dbTrueValue;
|
||||
private final boolean binaryOptimizedUUID;
|
||||
private final boolean autoCommitFalseOnFindIterate;
|
||||
private final TimedMetricMap timedMetricMap;
|
||||
private final int defaultFetchSizeFindEach;
|
||||
private final int defaultFetchSizeFindList;
|
||||
|
||||
public DefaultRelationalQueryEngine(Binder binder, String dbTrueValue, boolean binaryOptimizedUUID,
|
||||
int defaultFetchSizeFindEach, int defaultFetchSizeFindList) {
|
||||
int defaultFetchSizeFindEach, int defaultFetchSizeFindList,
|
||||
boolean autoCommitFalseOnFindIterate) {
|
||||
this.binder = binder;
|
||||
this.dbTrueValue = dbTrueValue == null ? "true" : dbTrueValue;
|
||||
this.binaryOptimizedUUID = binaryOptimizedUUID;
|
||||
this.autoCommitFalseOnFindIterate = autoCommitFalseOnFindIterate;
|
||||
this.timedMetricMap = MetricFactory.get().createTimedMetricMap("sql.query.");
|
||||
this.defaultFetchSizeFindEach = defaultFetchSizeFindEach;
|
||||
this.defaultFetchSizeFindList = defaultFetchSizeFindList;
|
||||
@@ -61,13 +66,20 @@ public final class DefaultRelationalQueryEngine implements RelationalQueryEngine
|
||||
return "Query threw SQLException:" + msg + " Query was:" + sql;
|
||||
}
|
||||
|
||||
private <T> void prepareForIterate(RelationalQueryRequest request) throws SQLException {
|
||||
if (defaultFetchSizeFindEach > 0) {
|
||||
request.setDefaultFetchBuffer(defaultFetchSizeFindEach);
|
||||
}
|
||||
if (autoCommitFalseOnFindIterate) {
|
||||
request.setAutoCommitOnFindIterate();
|
||||
}
|
||||
request.executeSql(binder, SpiQuery.Type.ITERATE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void findEach(RelationalQueryRequest request, RowConsumer consumer) {
|
||||
try {
|
||||
if (defaultFetchSizeFindEach > 0) {
|
||||
request.setDefaultFetchBuffer(defaultFetchSizeFindEach);
|
||||
}
|
||||
request.executeSql(binder, SpiQuery.Type.ITERATE);
|
||||
prepareForIterate(request);
|
||||
request.mapEach(consumer);
|
||||
request.logSummary();
|
||||
|
||||
@@ -82,10 +94,7 @@ public final class DefaultRelationalQueryEngine implements RelationalQueryEngine
|
||||
@Override
|
||||
public <T> void findEach(RelationalQueryRequest request, RowReader<T> reader, Predicate<T> consumer) {
|
||||
try {
|
||||
if (defaultFetchSizeFindEach > 0) {
|
||||
request.setDefaultFetchBuffer(defaultFetchSizeFindEach);
|
||||
}
|
||||
request.executeSql(binder, SpiQuery.Type.ITERATE);
|
||||
prepareForIterate(request);
|
||||
while (request.next()) {
|
||||
if (!consumer.test(reader.read())) {
|
||||
break;
|
||||
|
||||
@@ -17,11 +17,13 @@ public final class DtoQueryEngine {
|
||||
private final Binder binder;
|
||||
private final int defaultFetchSizeFindEach;
|
||||
private final int defaultFetchSizeFindList;
|
||||
private final boolean autoCommitFalseOnFindIterate;
|
||||
|
||||
public DtoQueryEngine(Binder binder, int defaultFetchSizeFindEach, int defaultFetchSizeFindList) {
|
||||
public DtoQueryEngine(Binder binder, int defaultFetchSizeFindEach, int defaultFetchSizeFindList, boolean autoCommitFalseOnFindIterate) {
|
||||
this.binder = binder;
|
||||
this.defaultFetchSizeFindEach = defaultFetchSizeFindEach;
|
||||
this.defaultFetchSizeFindList = defaultFetchSizeFindList;
|
||||
this.autoCommitFalseOnFindIterate = autoCommitFalseOnFindIterate;
|
||||
}
|
||||
|
||||
public <T> List<T> findList(DtoQueryRequest<T> request) {
|
||||
@@ -43,12 +45,19 @@ public final class DtoQueryEngine {
|
||||
}
|
||||
}
|
||||
|
||||
private <T> void prepareForIterate(DtoQueryRequest<T> request) throws SQLException {
|
||||
if (defaultFetchSizeFindEach > 0) {
|
||||
request.setDefaultFetchBuffer(defaultFetchSizeFindEach);
|
||||
}
|
||||
if (autoCommitFalseOnFindIterate) {
|
||||
request.setAutoCommitOnFindIterate();
|
||||
}
|
||||
request.executeSql(binder, SpiQuery.Type.ITERATE);
|
||||
}
|
||||
|
||||
public <T> QueryIterator<T> findIterate(DtoQueryRequest<T> request) {
|
||||
try {
|
||||
if (defaultFetchSizeFindEach > 0) {
|
||||
request.setDefaultFetchBuffer(defaultFetchSizeFindEach);
|
||||
}
|
||||
request.executeSql(binder, SpiQuery.Type.ITERATE);
|
||||
prepareForIterate(request);
|
||||
return new DtoQueryIterator<>(request);
|
||||
} catch (SQLException e) {
|
||||
throw new PersistenceException(errMsg(e.getMessage(), request.getSql()), e);
|
||||
@@ -57,10 +66,7 @@ public final class DtoQueryEngine {
|
||||
|
||||
public <T> void findEach(DtoQueryRequest<T> request, Consumer<T> consumer) {
|
||||
try {
|
||||
if (defaultFetchSizeFindEach > 0) {
|
||||
request.setDefaultFetchBuffer(defaultFetchSizeFindEach);
|
||||
}
|
||||
request.executeSql(binder, SpiQuery.Type.ITERATE);
|
||||
prepareForIterate(request);
|
||||
while (request.next()) {
|
||||
consumer.accept(request.readNextBean());
|
||||
}
|
||||
@@ -73,11 +79,8 @@ public final class DtoQueryEngine {
|
||||
|
||||
public <T> void findEach(DtoQueryRequest<T> request, int batchSize, Consumer<List<T>> consumer) {
|
||||
try {
|
||||
prepareForIterate(request);
|
||||
List<T> buffer = new ArrayList<>();
|
||||
if (defaultFetchSizeFindEach > 0) {
|
||||
request.setDefaultFetchBuffer(defaultFetchSizeFindEach);
|
||||
}
|
||||
request.executeSql(binder, SpiQuery.Type.ITERATE);
|
||||
while (request.next()) {
|
||||
buffer.add(request.readNextBean());
|
||||
if (buffer.size() >= batchSize) {
|
||||
@@ -98,10 +101,7 @@ public final class DtoQueryEngine {
|
||||
|
||||
public <T> void findEachWhile(DtoQueryRequest<T> request, Predicate<T> consumer) {
|
||||
try {
|
||||
if (defaultFetchSizeFindEach > 0) {
|
||||
request.setDefaultFetchBuffer(defaultFetchSizeFindEach);
|
||||
}
|
||||
request.executeSql(binder, SpiQuery.Type.ITERATE);
|
||||
prepareForIterate(request);
|
||||
while (request.next()) {
|
||||
if (!consumer.test(request.readNextBean())) {
|
||||
break;
|
||||
|
||||
@@ -769,7 +769,7 @@ public class DefaultOrmQuery<T> extends AbstractQuery implements SpiQuery<T> {
|
||||
copy.useQueryCache = useQueryCache;
|
||||
copy.unmodifiable = unmodifiable;
|
||||
if (detail != null) {
|
||||
copy.detail = detail.copy();
|
||||
copy.detail = detail.copy(null);
|
||||
}
|
||||
copy.temporalMode = temporalMode;
|
||||
copy.firstRow = firstRow;
|
||||
@@ -1244,7 +1244,7 @@ public class DefaultOrmQuery<T> extends AbstractQuery implements SpiQuery<T> {
|
||||
public final HashQuery queryHash() {
|
||||
// calculateQueryPlanHash is called just after potential AutoTune tuning
|
||||
// so queryPlanHash is calculated well before this method is called
|
||||
BindValuesKey bindKey = new BindValuesKey();
|
||||
BindValuesKey bindKey = new BindValuesKey(server);
|
||||
queryBindKey(bindKey);
|
||||
return new HashQuery(queryPlanKey, bindKey);
|
||||
}
|
||||
@@ -1387,7 +1387,7 @@ public class DefaultOrmQuery<T> extends AbstractQuery implements SpiQuery<T> {
|
||||
@Override
|
||||
public final Query<T> select(FetchGroup<T> fetchGroup) {
|
||||
if (fetchGroup != null) {
|
||||
this.detail = ((SpiFetchGroup<T>) fetchGroup).detail();
|
||||
this.detail = ((SpiFetchGroup<T>) fetchGroup).detail(detail);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
@@ -1895,7 +1895,7 @@ public class DefaultOrmQuery<T> extends AbstractQuery implements SpiQuery<T> {
|
||||
public final ExpressionList<T> text() {
|
||||
if (textExpressions == null) {
|
||||
useDocStore = true;
|
||||
textExpressions = new DefaultExpressionList<>(this);
|
||||
textExpressions = new DefaultExpressionList<>(this, true);
|
||||
}
|
||||
return textExpressions;
|
||||
}
|
||||
@@ -1903,7 +1903,7 @@ public class DefaultOrmQuery<T> extends AbstractQuery implements SpiQuery<T> {
|
||||
@Override
|
||||
public final ExpressionList<T> where() {
|
||||
if (whereExpressions == null) {
|
||||
whereExpressions = new DefaultExpressionList<>(this, null);
|
||||
whereExpressions = new DefaultExpressionList<>(this, false);
|
||||
}
|
||||
return whereExpressions;
|
||||
}
|
||||
@@ -1924,7 +1924,7 @@ public class DefaultOrmQuery<T> extends AbstractQuery implements SpiQuery<T> {
|
||||
@Override
|
||||
public final ExpressionList<T> having() {
|
||||
if (havingExpressions == null) {
|
||||
havingExpressions = new DefaultExpressionList<>(this, null);
|
||||
havingExpressions = new DefaultExpressionList<>(this, false);
|
||||
}
|
||||
return havingExpressions;
|
||||
}
|
||||
|
||||
@@ -39,12 +39,21 @@ public final class OrmQueryDetail implements Serializable {
|
||||
/**
|
||||
* Return a deep copy of the OrmQueryDetail.
|
||||
*/
|
||||
public OrmQueryDetail copy() {
|
||||
public OrmQueryDetail copy(OrmQueryDetail existing) {
|
||||
OrmQueryDetail copy = new OrmQueryDetail();
|
||||
copy.baseProps = baseProps.copy();
|
||||
for (Map.Entry<String, OrmQueryProperties> entry : fetchPaths.entrySet()) {
|
||||
copy.fetchPaths.put(entry.getKey(), entry.getValue().copy());
|
||||
}
|
||||
if (existing != null) {
|
||||
// transfer any existing filterMany expressions
|
||||
for (Map.Entry<String, OrmQueryProperties> entry : existing.fetchPaths.entrySet()) {
|
||||
var filterMany = entry.getValue().getFilterMany();
|
||||
if (filterMany != null) {
|
||||
copy.getChunk(entry.getKey(), true).setFilterMany(filterMany);
|
||||
}
|
||||
}
|
||||
}
|
||||
return copy;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ public interface SpiFetchGroup<T> extends FetchGroup<T> {
|
||||
/**
|
||||
* Return the detail to use for query execution.
|
||||
*/
|
||||
OrmQueryDetail detail();
|
||||
OrmQueryDetail detail(OrmQueryDetail existing);
|
||||
|
||||
/**
|
||||
* Return the underlying detail for copy purposes.
|
||||
|
||||
+1
-5
@@ -20,7 +20,7 @@ public final class DocStoreTransactionManager extends TransactionManager {
|
||||
|
||||
@Override
|
||||
public SpiTransaction createTransaction(boolean explicit, int isolationLevel) {
|
||||
return createTransaction(explicit, null);
|
||||
return new DocStoreOnlyTransaction(explicit, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -28,8 +28,4 @@ public final class DocStoreTransactionManager extends TransactionManager {
|
||||
return new DocStoreOnlyTransaction(false, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SpiTransaction createTransaction(boolean explicit, Connection c) {
|
||||
return new DocStoreOnlyTransaction(explicit, this);
|
||||
}
|
||||
}
|
||||
|
||||
+13
-3
@@ -36,7 +36,7 @@ final class ImplicitReadOnlyTransaction implements SpiTransaction, TxnProfileEve
|
||||
/**
|
||||
* Set false when using autoCommit (as a performance optimisation for the read-only case).
|
||||
*/
|
||||
private final boolean useCommit;
|
||||
private boolean useCommit;
|
||||
private final TransactionManager manager;
|
||||
private final SpiTxnLogger logger;
|
||||
private final boolean logSql;
|
||||
@@ -200,7 +200,7 @@ final class ImplicitReadOnlyTransaction implements SpiTransaction, TxnProfileEve
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerDeleteBean(Integer persistingBean) {
|
||||
public void registerDeleteBean(Class<?> type, Object id) {
|
||||
throw new IllegalStateException(notExpectedMessage);
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ final class ImplicitReadOnlyTransaction implements SpiTransaction, TxnProfileEve
|
||||
* Return true if this is a bean that has already been saved/deleted.
|
||||
*/
|
||||
@Override
|
||||
public boolean isRegisteredDeleteBean(Integer persistingBean) {
|
||||
public boolean isRegisteredDeleteBean(Class<?> type, Object id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -550,6 +550,16 @@ final class ImplicitReadOnlyTransaction implements SpiTransaction, TxnProfileEve
|
||||
throw new IllegalStateException(notExpectedMessage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAutoCommitOnFindIterate() {
|
||||
try {
|
||||
connection.setAutoCommit(false);
|
||||
useCommit = true;
|
||||
} catch (SQLException e) {
|
||||
throw new PersistenceException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rollbackAndContinue() {
|
||||
// do nothing
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package io.ebeaninternal.server.transaction;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import java.sql.Connection;
|
||||
|
||||
/**
|
||||
* Ebean transaction used for AutoCommit true connections.
|
||||
*/
|
||||
final class JdbcAutoCommitTransaction extends JdbcTransaction {
|
||||
|
||||
JdbcAutoCommitTransaction(boolean explicit, Connection connection, @Nullable TransactionManager manager) {
|
||||
super(true, explicit, connection, manager);
|
||||
}
|
||||
|
||||
@Override
|
||||
void performRollback() {
|
||||
long offset = profileOffset();
|
||||
if (profileStream != null) {
|
||||
profileStream.addEvent(EVT_ROLLBACK, offset);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
void performCommit() {
|
||||
long offset = profileOffset();
|
||||
if (profileStream != null) {
|
||||
profileStream.addEvent(EVT_COMMIT, offset);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -68,7 +68,7 @@ class JdbcTransaction implements SpiTransaction, TxnProfileEventCodes {
|
||||
private int depth;
|
||||
private boolean autoCommit;
|
||||
private IdentityHashMap<Object, Object> persistingBeans;
|
||||
private HashSet<Integer> deletingBeansHash;
|
||||
private Map<Class<?>, Set<Object>> deletingBeans;
|
||||
private HashMap<String, String> m2mIntersectionSave;
|
||||
private Map<String, Object> userObjects;
|
||||
private List<TransactionCallback> callbackList;
|
||||
@@ -90,13 +90,17 @@ class JdbcTransaction implements SpiTransaction, TxnProfileEventCodes {
|
||||
*/
|
||||
private final boolean skipCacheAfterWrite;
|
||||
DocStoreTransaction docStoreTxn;
|
||||
private ProfileStream profileStream;
|
||||
protected ProfileStream profileStream;
|
||||
private ProfileLocation profileLocation;
|
||||
private final Instant startTime = Instant.now();
|
||||
private final long startNanos;
|
||||
private boolean autoPersistUpdates;
|
||||
|
||||
JdbcTransaction(boolean explicit, Connection connection, TransactionManager manager) {
|
||||
this(false, explicit, connection, manager);
|
||||
}
|
||||
|
||||
JdbcTransaction(boolean autoCommit, boolean explicit, Connection connection, TransactionManager manager) {
|
||||
try {
|
||||
this.active = true;
|
||||
this.explicit = explicit;
|
||||
@@ -125,7 +129,9 @@ class JdbcTransaction implements SpiTransaction, TxnProfileEventCodes {
|
||||
this.onQueryOnlyCommit = true;
|
||||
}
|
||||
|
||||
checkAutoCommit(connection);
|
||||
if (!autoCommit) {
|
||||
checkAutoCommit(connection);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new PersistenceException(e);
|
||||
@@ -328,40 +334,28 @@ class JdbcTransaction implements SpiTransaction, TxnProfileEventCodes {
|
||||
deferredList.add(derived);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a bean to the registed list.
|
||||
* <p>
|
||||
* This is to handle bi-directional relationships where both sides Cascade.
|
||||
* </p>
|
||||
*/
|
||||
@Override
|
||||
public final void registerDeleteBean(Integer persistingBean) {
|
||||
if (deletingBeansHash == null) {
|
||||
deletingBeansHash = new HashSet<>();
|
||||
public final void registerDeleteBean(Class<?> type, Object id) {
|
||||
deleteBeanIds(type).add(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean isRegisteredDeleteBean(Class<?> type, Object id) {
|
||||
return deleteBeanIds(type).contains(id);
|
||||
}
|
||||
|
||||
private Set<Object> deleteBeanIds(Class<?> type) {
|
||||
if (deletingBeans == null) {
|
||||
deletingBeans = new HashMap<>();
|
||||
}
|
||||
deletingBeansHash.add(persistingBean);
|
||||
return deletingBeans.computeIfAbsent(type, k -> new HashSet<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if this is a bean that has already been saved/deleted.
|
||||
*/
|
||||
@Override
|
||||
public final boolean isRegisteredDeleteBean(Integer persistingBean) {
|
||||
return deletingBeansHash != null && deletingBeansHash.contains(persistingBean);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregister the persisted beans (when persisting at the top level).
|
||||
*/
|
||||
@Override
|
||||
public final void unregisterBeans() {
|
||||
persistingBeans.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if this is a bean that has already been saved. This will
|
||||
* register the bean if it is not already.
|
||||
*/
|
||||
@Override
|
||||
public final boolean isRegisteredBean(Object bean) {
|
||||
if (persistingBeans == null) {
|
||||
@@ -370,10 +364,6 @@ class JdbcTransaction implements SpiTransaction, TxnProfileEventCodes {
|
||||
return (persistingBeans.put(bean, PLACEHOLDER) != null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the m2m intersection save is allowed from a given bean direction.
|
||||
* This is to stop m2m intersection management via both directions of a m2m.
|
||||
*/
|
||||
@Override
|
||||
public final boolean isSaveAssocManyIntersection(String intersectionTable, String beanName) {
|
||||
if (m2mIntersectionSave == null) {
|
||||
|
||||
@@ -154,12 +154,12 @@ final class NoTransaction implements SpiTransaction {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerDeleteBean(Integer hash) {
|
||||
public void registerDeleteBean(Class<?> type, Object id) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRegisteredDeleteBean(Integer hash) {
|
||||
public boolean isRegisteredDeleteBean(Class<?> type, Object id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+10
-1
@@ -13,9 +13,18 @@ import java.sql.SQLException;
|
||||
abstract class TransactionFactory {
|
||||
|
||||
final TransactionManager manager;
|
||||
private final boolean autoCommitMode;
|
||||
|
||||
TransactionFactory(TransactionManager manager) {
|
||||
this.manager = manager;
|
||||
this.autoCommitMode = manager.isAutoCommitMode();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a new transaction.
|
||||
*/
|
||||
SpiTransaction createTransaction(boolean explicit, Connection connection) {
|
||||
return autoCommitMode ? new JdbcAutoCommitTransaction(explicit, connection, manager) : new JdbcTransaction(explicit, connection, manager);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -34,7 +43,7 @@ abstract class TransactionFactory {
|
||||
/**
|
||||
* Set the Transaction Isolation level if required.
|
||||
*/
|
||||
final SpiTransaction setIsolationLevel(SpiTransaction t, boolean explicit, int isolationLevel) {
|
||||
final SpiTransaction setIsolationLevel(SpiTransaction t, int isolationLevel) {
|
||||
if (isolationLevel > -1) {
|
||||
Connection connection = t.internalConnection();
|
||||
try {
|
||||
|
||||
+2
-6
@@ -39,8 +39,8 @@ class TransactionFactoryBasic extends TransactionFactory {
|
||||
Connection connection = null;
|
||||
try {
|
||||
connection = dataSource.getConnection();
|
||||
SpiTransaction t = create(explicit, connection);
|
||||
return setIsolationLevel(t, explicit, isolationLevel);
|
||||
SpiTransaction t = createTransaction(explicit, connection);
|
||||
return setIsolationLevel(t, isolationLevel);
|
||||
} catch (PersistenceException ex) {
|
||||
JdbcClose.close(connection);
|
||||
throw ex;
|
||||
@@ -49,8 +49,4 @@ class TransactionFactoryBasic extends TransactionFactory {
|
||||
}
|
||||
}
|
||||
|
||||
private SpiTransaction create(boolean explicit, Connection c) {
|
||||
return manager.createTransaction(explicit, c);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+18
-12
@@ -25,26 +25,32 @@ class TransactionFactoryTenant extends TransactionFactory {
|
||||
|
||||
@Override
|
||||
public SpiTransaction createReadOnlyTransaction(Object tenantId, boolean useMaster) {
|
||||
return create(false, tenantId);
|
||||
Connection connection = null;
|
||||
try {
|
||||
if (tenantId == null) {
|
||||
tenantId = tenantProvider.currentId();
|
||||
}
|
||||
connection = dataSourceSupplier.readOnlyConnection(tenantId, useMaster);
|
||||
return new ImplicitReadOnlyTransaction(manager, connection, tenantId);
|
||||
|
||||
} catch (PersistenceException ex) {
|
||||
JdbcClose.close(connection);
|
||||
throw ex;
|
||||
|
||||
} catch (SQLException ex) {
|
||||
throw new PersistenceException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final SpiTransaction createTransaction(boolean explicit, int isolationLevel) {
|
||||
SpiTransaction t = create(explicit, null);
|
||||
return setIsolationLevel(t, explicit, isolationLevel);
|
||||
}
|
||||
|
||||
private SpiTransaction create(boolean explicit, Object tenantId) {
|
||||
Connection connection = null;
|
||||
try {
|
||||
if (tenantId == null) {
|
||||
// tenantId not set (by lazy loading) so get current tenantId
|
||||
tenantId = tenantProvider.currentId();
|
||||
}
|
||||
Object tenantId = tenantProvider.currentId();
|
||||
connection = dataSourceSupplier.connection(tenantId);
|
||||
SpiTransaction transaction = manager.createTransaction(explicit, connection);
|
||||
SpiTransaction transaction = createTransaction(explicit, connection);
|
||||
transaction.setTenantId(tenantId);
|
||||
return transaction;
|
||||
return setIsolationLevel(transaction, isolationLevel);
|
||||
|
||||
} catch (PersistenceException ex) {
|
||||
JdbcClose.close(connection);
|
||||
|
||||
+7
-8
@@ -5,12 +5,12 @@ import io.ebean.BackgroundExecutor;
|
||||
import io.ebean.ProfileLocation;
|
||||
import io.ebean.TxScope;
|
||||
import io.ebean.annotation.PersistBatch;
|
||||
import io.ebean.annotation.Platform;
|
||||
import io.ebean.annotation.TxType;
|
||||
import io.ebean.cache.ServerCacheNotification;
|
||||
import io.ebean.cache.ServerCacheNotify;
|
||||
import io.ebean.config.CurrentTenantProvider;
|
||||
import io.ebean.config.dbplatform.DatabasePlatform;
|
||||
import io.ebean.datasource.DataSourcePool;
|
||||
import io.ebean.event.changelog.ChangeLogListener;
|
||||
import io.ebean.event.changelog.ChangeLogPrepare;
|
||||
import io.ebean.event.changelog.ChangeSet;
|
||||
@@ -106,6 +106,7 @@ public class TransactionManager implements SpiTransactionManager {
|
||||
private final ServerCacheNotify cacheNotify;
|
||||
private final boolean supportsSavepointId;
|
||||
private final ConcurrentHashMap<String, ProfileLocation> profileLocations = new ConcurrentHashMap<>();
|
||||
private final boolean autoCommitMode;
|
||||
|
||||
/**
|
||||
* Create the TransactionManager
|
||||
@@ -115,6 +116,7 @@ public class TransactionManager implements SpiTransactionManager {
|
||||
this.logManager = options.logManager;
|
||||
this.databasePlatform = options.config.getDatabasePlatform();
|
||||
this.supportsSavepointId = databasePlatform.supportsSavepointId();
|
||||
this.autoCommitMode = databasePlatform.platform() == Platform.CLICKHOUSE;
|
||||
this.skipCacheAfterWrite = options.config.isSkipCacheAfterWrite();
|
||||
this.notifyL2CacheInForeground = options.notifyL2CacheInForeground;
|
||||
this.autoPersistUpdates = options.config.isAutoPersistUpdates();
|
||||
@@ -206,6 +208,10 @@ public class TransactionManager implements SpiTransactionManager {
|
||||
}
|
||||
}
|
||||
|
||||
final boolean isAutoCommitMode() {
|
||||
return autoCommitMode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the DB platform supports SavepointId().
|
||||
*/
|
||||
@@ -298,13 +304,6 @@ public class TransactionManager implements SpiTransactionManager {
|
||||
return transactionFactory.createReadOnlyTransaction(tenantId, useMaster);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new transaction.
|
||||
*/
|
||||
SpiTransaction createTransaction(boolean explicit, Connection c) {
|
||||
return new JdbcTransaction(explicit, c, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Process a local rolled back transaction.
|
||||
*/
|
||||
|
||||
@@ -31,6 +31,7 @@ module io.ebean.core {
|
||||
requires io.ebean.types;
|
||||
|
||||
requires static io.avaje.jsr305x;
|
||||
requires static io.ebean.core.json;
|
||||
requires static com.fasterxml.jackson.annotation;
|
||||
requires static com.fasterxml.jackson.core;
|
||||
requires static com.fasterxml.jackson.databind;
|
||||
@@ -49,7 +50,6 @@ module io.ebean.core {
|
||||
|
||||
exports io.ebeaninternal.api to io.ebean.ddl.generator, io.ebean.querybean, io.ebean.autotune, io.ebean.postgis, io.ebean.test, io.ebean.elastic, io.ebean.spring.txn, io.ebean.postgis.types;
|
||||
exports io.ebeaninternal.api.json to io.ebean.test;
|
||||
exports io.ebeaninternal.json to io.ebean.test;
|
||||
exports io.ebeaninternal.server.autotune to io.ebean.autotune;
|
||||
exports io.ebeaninternal.server.core to io.ebean.test, io.ebean.elastic;
|
||||
exports io.ebeaninternal.server.core.bootup to io.ebean.test;
|
||||
@@ -78,7 +78,6 @@ module io.ebean.core {
|
||||
io.ebeaninternal.server.query.DFetchGroupService,
|
||||
io.ebeaninternal.server.profile.DProfileLocationFactory,
|
||||
io.ebeaninternal.server.rawsql.DRawSqlService,
|
||||
io.ebeaninternal.server.profile.DMetricFactory,
|
||||
io.ebeaninternal.json.DJsonService;
|
||||
io.ebeaninternal.server.profile.DMetricFactory;
|
||||
|
||||
}
|
||||
|
||||
@@ -3,4 +3,3 @@ io.ebeaninternal.server.rawsql.DRawSqlService
|
||||
io.ebeaninternal.server.query.DFetchGroupService
|
||||
io.ebeaninternal.server.profile.DProfileLocationFactory
|
||||
io.ebeaninternal.server.profile.DMetricFactory
|
||||
io.ebeaninternal.json.DJsonService
|
||||
|
||||
@@ -70,7 +70,7 @@ public class RawExpressionTest extends BaseExpressionTest {
|
||||
}
|
||||
|
||||
private BindValuesKey bindKey(RawExpression query) {
|
||||
BindValuesKey bindValuesKey = new BindValuesKey();
|
||||
BindValuesKey bindValuesKey = new BindValuesKey(spiEbeanServer());
|
||||
query.queryBindKey(bindValuesKey);
|
||||
return bindValuesKey;
|
||||
}
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
package io.ebeaninternal.server.querydefn;
|
||||
|
||||
import io.ebeaninternal.api.BindValuesKey;
|
||||
import io.ebeaninternal.server.deploy.BaseTest;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class BindValuesKeyTest {
|
||||
public class BindValuesKeyTest extends BaseTest {
|
||||
|
||||
@Test
|
||||
public void update_with_null() {
|
||||
|
||||
BindValuesKey hash = new BindValuesKey();
|
||||
BindValuesKey hash = new BindValuesKey(spiEbeanServer());
|
||||
hash.add(1).add(null).add("hello");
|
||||
|
||||
BindValuesKey hash2 = new BindValuesKey();
|
||||
BindValuesKey hash2 = new BindValuesKey(spiEbeanServer());
|
||||
hash2.add(1).add(null).add("hello");
|
||||
|
||||
assertThat(hash).isEqualTo(hash2);
|
||||
@@ -22,13 +23,13 @@ public class BindValuesKeyTest {
|
||||
@Test
|
||||
public void notEqual() {
|
||||
|
||||
BindValuesKey hash = new BindValuesKey();
|
||||
BindValuesKey hash = new BindValuesKey(spiEbeanServer());
|
||||
hash.add(1).add(null).add("hello");
|
||||
|
||||
BindValuesKey hash2 = new BindValuesKey();
|
||||
BindValuesKey hash2 = new BindValuesKey(spiEbeanServer());
|
||||
hash2.add(1).add("hello");
|
||||
|
||||
BindValuesKey hash3 = new BindValuesKey();
|
||||
BindValuesKey hash3 = new BindValuesKey(spiEbeanServer());
|
||||
hash2.add(1).add(null);
|
||||
|
||||
assertThat(hash).isNotEqualTo(hash2);
|
||||
|
||||
@@ -139,7 +139,7 @@ public class DefaultOrmQueryTest extends BaseExpressionTest {
|
||||
}
|
||||
|
||||
private BindValuesKey bindKey(DefaultOrmQuery<Order> query) {
|
||||
BindValuesKey key = new BindValuesKey();
|
||||
BindValuesKey key = new BindValuesKey(spiEbeanServer());
|
||||
query.queryBindKey(key);
|
||||
return key;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean ddl generation</name>
|
||||
@@ -28,14 +28,14 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-all</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
+1
-1
@@ -202,7 +202,7 @@ public class DB2Ddl extends PlatformDdl {
|
||||
}
|
||||
}
|
||||
if (requiresReorg) {
|
||||
ret.add(newRawCommand("call sysproc.admin_cmd('reorg table " + tableName() + "')"));
|
||||
ret.add(newRawCommand("call sysproc.admin_cmd('reorg table " + tableName() + " ${reorgArgs}')"));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
+1
-1
@@ -195,7 +195,7 @@ public class ModelBuildPropertyVisitor extends BaseTablePropertyVisitor {
|
||||
String dbCol = column.getLocalDbColumn();
|
||||
BeanProperty importedProperty = p.findMatchImport(dbCol);
|
||||
if (importedProperty == null) {
|
||||
throw new RuntimeException("Imported BeanProperty not found?");
|
||||
continue;
|
||||
}
|
||||
String columnDefn = ctx.getColumnDefn(importedProperty, true);
|
||||
String refColumn = importedProperty.dbColumn();
|
||||
|
||||
+5
-5
@@ -136,7 +136,7 @@ public class PlatformDdl_AlterColumnTest {
|
||||
+ "alter table mytab alter column acol set data type varchar(50);\n"
|
||||
+ "alter table mytab alter column acol set default 'hi';\n"
|
||||
+ "alter table mytab alter column acol set not null;\n"
|
||||
+ "call sysproc.admin_cmd('reorg table mytab');\n");
|
||||
+ "call sysproc.admin_cmd('reorg table mytab ${reorgArgs}');\n");
|
||||
|
||||
//
|
||||
alter.setCurrentNotnull(Boolean.TRUE);
|
||||
@@ -176,7 +176,7 @@ public class PlatformDdl_AlterColumnTest {
|
||||
softly.assertThat(sql).isEqualTo("-- apply alter tables\n"
|
||||
+ "alter table mytab alter column acol drop default;\n"
|
||||
+ "alter table mytab alter column acol drop not null;\n"
|
||||
+ "call sysproc.admin_cmd('reorg table mytab');\n");
|
||||
+ "call sysproc.admin_cmd('reorg table mytab ${reorgArgs}');\n");
|
||||
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ public class PlatformDdl_AlterColumnTest {
|
||||
+ "alter table mytab alter column acol set data type varchar(20);\n"
|
||||
// Note, this reorg may be not necessary when only length attribute is alterd
|
||||
// but this is currently not implemented.
|
||||
+ "call sysproc.admin_cmd('reorg table mytab');\n");
|
||||
+ "call sysproc.admin_cmd('reorg table mytab ${reorgArgs}');\n");
|
||||
|
||||
alter.setType("bigint");
|
||||
sql = alterColumn(pgDdl, alter);
|
||||
@@ -277,7 +277,7 @@ public class PlatformDdl_AlterColumnTest {
|
||||
sql = alterColumn(db2Ddl, alter);
|
||||
softly.assertThat(sql).isEqualTo("-- apply alter tables\n"
|
||||
+ "alter table mytab alter column acol set not null;\n"
|
||||
+ "call sysproc.admin_cmd('reorg table mytab');\n");
|
||||
+ "call sysproc.admin_cmd('reorg table mytab ${reorgArgs}');\n");
|
||||
|
||||
}
|
||||
|
||||
@@ -321,7 +321,7 @@ public class PlatformDdl_AlterColumnTest {
|
||||
sql = alterColumn(db2Ddl, alter);
|
||||
softly.assertThat(sql).isEqualTo("-- apply alter tables\n"
|
||||
+ "alter table mytab alter column acol drop not null;\n"
|
||||
+ "call sysproc.admin_cmd('reorg table mytab');\n");
|
||||
+ "call sysproc.admin_cmd('reorg table mytab ${reorgArgs}');\n");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -3,18 +3,19 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>ebean-jackson-mapper</artifactId>
|
||||
<name>ebean-jackson-mapper</name>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean net postgis types</name>
|
||||
@@ -19,14 +19,14 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- provided scope -->
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean postgis types</name>
|
||||
@@ -19,14 +19,14 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- provided scope -->
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean querybean</name>
|
||||
@@ -17,7 +17,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -59,14 +59,14 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-generator</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>querybean-generator</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ public abstract class QueryBean<T, R extends QueryBean<T, R>> implements IQueryB
|
||||
/** Construct for FilterMany */
|
||||
protected QueryBean(ExpressionList<T> filter) {
|
||||
this.query = null;
|
||||
this.root = null;
|
||||
this.root = (R) this;
|
||||
this.whereStack = new ArrayStack<>();
|
||||
whereStack.push(filter);
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import org.example.domain.otherpackage.ValidEmail;
|
||||
import org.example.domain.query.QContact;
|
||||
import org.example.domain.query.QCustomer;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
@@ -377,6 +378,37 @@ public class QCustomerTest {
|
||||
assertThat(q.getGeneratedSql()).contains(" from be_customer t0 left join be_contact t1 on t1.customer_id = t0.id where (t1.id is null or (t1.first_name like ? and t1.first_name like ? escape'|')) order by t0.id");
|
||||
}
|
||||
|
||||
@Test
|
||||
void filterManyOr() {
|
||||
var q = new QCustomer()
|
||||
.contacts.filterMany(c ->
|
||||
c.or()
|
||||
.firstName.startsWith("R")
|
||||
.lastName.startsWith("R")
|
||||
.endOr())
|
||||
.query();
|
||||
|
||||
q.findList();
|
||||
assertThat(q.getGeneratedSql()).contains(" from be_customer t0 left join be_contact t1 on t1.customer_id = t0.id where (t1.id is null or ((t1.first_name like ? escape'|' or t1.last_name like ? escape'|'))) order by t0.id");
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("Retain filterMany expression when select fetchGroup applied after filterMany")
|
||||
void filterManyBeforeSelectFetchGroup_expect_filterManyExpressionRetained() {
|
||||
var fetchGroup = QCustomer.forFetchGroup()
|
||||
.select(name)
|
||||
.contacts.fetch(QContact.Alias.email)
|
||||
.buildFetchGroup();
|
||||
|
||||
var q = new QCustomer()
|
||||
.contacts.filterMany(c -> c.firstName.startsWith("R"))
|
||||
.select(fetchGroup)
|
||||
.query();
|
||||
|
||||
q.findList();
|
||||
assertThat(q.getGeneratedSql()).contains(" t0.id, t0.name, t1.id, t1.email from be_customer t0 left join be_contact t1 on t1.customer_id = t0.id where (t1.id is null or (t1.first_name like ? escape'|')) order by t0.id");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIdIn() {
|
||||
|
||||
|
||||
+6
-6
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-redis</artifactId>
|
||||
@@ -29,35 +29,35 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>querybean-generator</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-spring-txn</artifactId>
|
||||
@@ -28,7 +28,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
+6
-6
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean test</name>
|
||||
@@ -33,20 +33,20 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-generator</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -149,14 +149,14 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-jackson-mapper</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-all</artifactId>
|
||||
<version>16.0.0-RC2</version>
|
||||
<version>16.1.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ import java.sql.Timestamp;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@@ -40,7 +41,7 @@ public class DbMigrationTest extends BaseTestCase {
|
||||
private void runScript(String scriptName) {
|
||||
URL url = getClass().getResource("/migrationtest/dbmigration/" + server().platform().name().toLowerCase() + "/" + scriptName);
|
||||
assert url != null : scriptName + " not found for platform [" + server().platform().name().toLowerCase() + "]";
|
||||
server().script().run(url);
|
||||
server().script().run(url, Map.of("reorgArgs", "use tempspace1 resetdictionary"));
|
||||
}
|
||||
|
||||
@IgnorePlatform({
|
||||
|
||||
@@ -5,7 +5,7 @@ import io.ebean.test.containers.PostgresContainer;
|
||||
public class StartPostgres {
|
||||
|
||||
public static void main(String[] args) {
|
||||
PostgresContainer.builder("15")
|
||||
PostgresContainer.builder("17")
|
||||
.dbName("unit")
|
||||
//.port(6432)
|
||||
//.user("unit")
|
||||
|
||||
@@ -2,14 +2,15 @@ package org.tests.basic;
|
||||
|
||||
import io.ebean.*;
|
||||
import io.ebean.annotation.Platform;
|
||||
import io.ebean.annotation.TxIsolation;
|
||||
import io.ebean.test.LoggedSql;
|
||||
import io.ebean.xtest.BaseTestCase;
|
||||
import io.ebean.xtest.ForPlatform;
|
||||
import io.ebean.xtest.IgnorePlatform;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.tests.model.basic.Customer;
|
||||
import org.tests.model.basic.EBasic;
|
||||
import org.tests.model.basic.Order;
|
||||
import org.tests.model.basic.ResetBasicData;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.tests.model.basic.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -18,6 +19,8 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
public class TestQueryForUpdate extends BaseTestCase {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(TestQueryForUpdate.class);
|
||||
|
||||
@Test
|
||||
public void testForUpdate() {
|
||||
|
||||
@@ -41,54 +44,99 @@ public class TestQueryForUpdate extends BaseTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
// Nah, nothing to do with repeatable read here
|
||||
// @ForPlatform(Platform.YUGABYTE)
|
||||
// @Test
|
||||
// void concurrentForUpdate() throws InterruptedException {
|
||||
// ResetBasicData.reset();
|
||||
//
|
||||
// Database db = DB.getDefault();
|
||||
// Thread t1 = new Thread() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// try (final Transaction transaction = db.createTransaction(TxIsolation.REPEATABLE_READ)) {
|
||||
// log.info("(REPEATABLE_READ) Thread: before find");
|
||||
// List<Country> list = DB.find(Country.class)
|
||||
// .usingTransaction(transaction)
|
||||
// .forUpdate()
|
||||
// .findList();
|
||||
//
|
||||
// try {
|
||||
// log.info("(REPEATABLE_READ) Thread: after find - size:{}, hold locks for some time", list.size());
|
||||
// Thread.sleep(500);
|
||||
// } catch (InterruptedException e) {
|
||||
// throw new RuntimeException(e);
|
||||
// }
|
||||
// log.info("(REPEATABLE_READ) Thread: done, release locks");
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
//
|
||||
// t1.start();
|
||||
// Thread.sleep(100);
|
||||
//
|
||||
// long start = System.currentTimeMillis();
|
||||
// try (final Transaction transaction = db.createTransaction(TxIsolation.REPEATABLE_READ)) {
|
||||
// log.info("(REPEATABLE_READ) Main: before find, should wait for locks to be released...");
|
||||
// DB.find(Country.class)
|
||||
// .usingTransaction(transaction)
|
||||
// .forUpdate()
|
||||
// .findList();
|
||||
//
|
||||
// log.info("(REPEATABLE_READ) Main: complete");
|
||||
// }
|
||||
//
|
||||
// long exeMillis = System.currentTimeMillis() - start;
|
||||
// assertThat(exeMillis).isGreaterThan(300);
|
||||
// }
|
||||
|
||||
// @IgnorePlatform(Platform.YUGABYTE) // ignore this for yugabyte and see if everything else passes
|
||||
@Test
|
||||
public void testConcurrentForUpdate() throws InterruptedException {
|
||||
|
||||
ResetBasicData.reset();
|
||||
|
||||
Thread t1 = new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
try (final Transaction transaction = DB.beginTransaction()) {
|
||||
System.out.println("Thread: before find");
|
||||
DB.find(Customer.class)
|
||||
.forUpdate()
|
||||
// .orderBy().desc("1") // this would help by the locks in DB2
|
||||
.findList();
|
||||
Database db = DB.getDefault();
|
||||
Thread t1 = new Thread(() -> {
|
||||
try (final Transaction transaction = db.createTransaction()) {
|
||||
log.info("Thread: before find");
|
||||
List<Customer> list = DB.find(Customer.class)
|
||||
.usingTransaction(transaction)
|
||||
.forUpdate()
|
||||
.findList();
|
||||
|
||||
System.out.println("Thread: after find");
|
||||
try {
|
||||
Thread.sleep(3000);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
System.out.println("Thread: done");
|
||||
try {
|
||||
log.info("Thread: after find - rows locked:{}, hold for 700ms", list.size());
|
||||
Thread.sleep(600); // 3000
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
log.info("Thread: done, releasing locks");
|
||||
} // transaction ended here via try-with-resources
|
||||
});
|
||||
|
||||
t1.start();
|
||||
|
||||
Thread.sleep(100);
|
||||
|
||||
long start = System.currentTimeMillis();
|
||||
try (final Transaction transaction = DB.beginTransaction()) {
|
||||
try (final Transaction transaction = db.beginTransaction()) { // second transaction
|
||||
if (isH2()) {
|
||||
DB.sqlUpdate("SET LOCK_TIMEOUT 5000").execute();
|
||||
}
|
||||
System.out.println("Main: before find");
|
||||
log.info("Main: before find, should wait (blocked by other thread) ...");
|
||||
DB.find(Customer.class)
|
||||
.usingTransaction(transaction)
|
||||
.forUpdate()
|
||||
//.orderBy().desc("1") // this would help by the locks in DB2
|
||||
.findList();
|
||||
|
||||
System.out.println("Main: after find");
|
||||
}
|
||||
|
||||
start = System.currentTimeMillis() - start;
|
||||
|
||||
assertThat(start).isGreaterThan(2800);
|
||||
log.info("Main: complete");
|
||||
} // end second transaction
|
||||
|
||||
long exeMillis = System.currentTimeMillis() - start;
|
||||
assertThat(exeMillis)
|
||||
.describedAs("select for update expected to wait")
|
||||
.isGreaterThan(400); // 2500
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package org.tests.el;
|
||||
|
||||
import io.ebean.annotation.Platform;
|
||||
import io.ebean.xtest.BaseTestCase;
|
||||
import io.ebean.DB;
|
||||
import io.ebean.Query;
|
||||
import io.ebean.xtest.IgnorePlatform;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.tests.model.basic.Customer;
|
||||
|
||||
class TestRawExpressionInterpolation extends BaseTestCase {
|
||||
|
||||
@IgnorePlatform({Platform.ORACLE, Platform.DB2})
|
||||
@Test
|
||||
void test() {
|
||||
|
||||
Query<Customer> query = DB.find(Customer.class)
|
||||
.where().raw("name like ?", "Rob%")
|
||||
.query();
|
||||
|
||||
query.findList();
|
||||
|
||||
assertSql(query).contains("where t0.name like ?");
|
||||
|
||||
Query<Customer> query2 = DB.find(Customer.class)
|
||||
.where().raw("? like concat('%', name, '%')", "Rob")
|
||||
.query();
|
||||
|
||||
query2.findList();
|
||||
|
||||
assertSql(query2).contains("where ? like concat('%', t0.name, '%')");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package org.tests.el;
|
||||
|
||||
import io.ebean.xtest.BaseTestCase;
|
||||
import io.ebean.DB;
|
||||
import io.ebean.Query;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.tests.model.basic.Customer;
|
||||
|
||||
public class TestUnderscoreParam extends BaseTestCase {
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
|
||||
Query<Customer> query = DB.find(Customer.class)
|
||||
.where().raw("name like ?", "Rob%")
|
||||
.query();
|
||||
|
||||
query.findList();
|
||||
|
||||
assertSql(query).contains("where t0.name like ?");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -56,7 +56,6 @@ public class TestCarWheelIud extends BaseTestCase {
|
||||
Car car2 = DB.find(Car.class, car.getId());
|
||||
|
||||
DB.delete(car2);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package org.tests.model.m2o;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
|
||||
@Entity
|
||||
public class MTJOrder {
|
||||
|
||||
@Id
|
||||
private long id;
|
||||
|
||||
@Column(name = "org_id")
|
||||
private long orgId;
|
||||
|
||||
@Column
|
||||
private String other;
|
||||
|
||||
public Long id() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public MTJOrder setId(Long id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Long orgId() {
|
||||
return orgId;
|
||||
}
|
||||
|
||||
public MTJOrder setOrgId(Long orgId) {
|
||||
this.orgId = orgId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String other() {
|
||||
return other;
|
||||
}
|
||||
|
||||
public MTJOrder setOther(String other) {
|
||||
this.other = other;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package org.tests.model.m2o;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
|
||||
@Entity
|
||||
public class MTJTrans {
|
||||
|
||||
@Id
|
||||
private long id;
|
||||
|
||||
@Column(name = "org_id")
|
||||
private long orgId;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumns({
|
||||
@JoinColumn(name = "org_id", referencedColumnName = "org_id"), // extra join column, not strictly needed
|
||||
@JoinColumn(name = "order_id", referencedColumnName = "id")
|
||||
})
|
||||
private MTJOrder order;
|
||||
|
||||
public Long id() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public MTJTrans setId(Long id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Long orgId() {
|
||||
return orgId;
|
||||
}
|
||||
|
||||
public MTJTrans setOrgId(Long orgId) {
|
||||
this.orgId = orgId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public MTJOrder order() {
|
||||
return order;
|
||||
}
|
||||
|
||||
public MTJTrans setOrder(MTJOrder order) {
|
||||
this.order = order;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package org.tests.model.m2o;
|
||||
|
||||
import io.ebean.DB;
|
||||
import io.ebean.test.LoggedSql;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
class TestMTJoinColumns {
|
||||
|
||||
@Test
|
||||
void test() {
|
||||
MTJTrans parent = new MTJTrans();
|
||||
parent.setOrgId(51L);
|
||||
|
||||
DB.save(parent);
|
||||
|
||||
MTJTrans found = DB.find(MTJTrans.class)
|
||||
.setId(parent.id())
|
||||
.fetch("order")
|
||||
.findOne();
|
||||
|
||||
assertThat(found.order()).isNull();
|
||||
|
||||
var order = new MTJOrder()
|
||||
.setOrgId(51L)
|
||||
.setOther("some");
|
||||
DB.save(order);
|
||||
found.setOrder(order);
|
||||
DB.save(found);
|
||||
|
||||
LoggedSql.start();
|
||||
MTJTrans found2 = DB.find(MTJTrans.class)
|
||||
.setId(parent.id())
|
||||
.fetch("order")
|
||||
.findOne();
|
||||
|
||||
assertThat(found2.order()).isNotNull();
|
||||
assertThat(found2.order().id()).isEqualTo(order.id());
|
||||
assertThat(found2.order().other()).isEqualTo("some");
|
||||
|
||||
List<String> sql = LoggedSql.stop();
|
||||
assertThat(sql).hasSize(1);
|
||||
assertThat(sql.get(0)).contains("from mtjtrans t0 left join mtjorder t1 on t1.org_id = t0.org_id and t1.id = t0.order_id where t0.id = ?");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package org.tests.model.memleak;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
|
||||
/**
|
||||
* Class with @Cache(enableQueryCache = true)
|
||||
*
|
||||
* @author Jonas Fröhler, FOCONIS AG
|
||||
*/
|
||||
@Entity
|
||||
public class MemleakChild {
|
||||
|
||||
@Id
|
||||
Long id;
|
||||
|
||||
String name;
|
||||
|
||||
transient byte[] memConsumer = new byte[1000000];
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user