mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b565a5843e | ||
|
|
79c96c9ec1 | ||
|
|
b703b683d8 | ||
|
|
456eb3aca9 | ||
|
|
54c35300d4 | ||
|
|
dfc5963e35 | ||
|
|
36777d5a3d | ||
|
|
12b028fc43 | ||
|
|
72b2f30f2d | ||
|
|
1de74ac366 | ||
|
|
07cb243db3 | ||
|
|
9a02618b67 | ||
|
|
801cb6fa73 | ||
|
|
1c8a416de0 | ||
|
|
c30a8c79a2 | ||
|
|
35cb4356c5 | ||
|
|
a73c985315 | ||
|
|
b5fbfbf1b6 | ||
|
|
4471607b2d | ||
|
|
e4c4b0b43d | ||
|
|
d7ffc4bbb5 | ||
|
|
0bb2f104a4 | ||
|
|
ac3ca8113d | ||
|
|
4ec46e3008 | ||
|
|
e9ab0f34f3 | ||
|
|
a9575048b4 | ||
|
|
82fd6dc65f | ||
|
|
5b4ff2627c | ||
|
|
2aa92d63fd | ||
|
|
658b5b7e06 | ||
|
|
4e3cd83e36 | ||
|
|
e00e490e73 | ||
|
|
dd95081e63 | ||
|
|
03bd31677a | ||
|
|
4619c56b09 | ||
|
|
c3dc57f0fb | ||
|
|
50ba20289b | ||
|
|
6b73072982 | ||
|
|
6e340bd149 | ||
|
|
65f551650f | ||
|
|
3be3741db6 | ||
|
|
610afd3717 | ||
|
|
4084822d2c | ||
|
|
a2c82263ee | ||
|
|
30f3d542b3 | ||
|
|
56cb2c69aa | ||
|
|
bd1dd43cbf | ||
|
|
5caae29df9 | ||
|
|
9713b607b5 | ||
|
|
0e46558cae | ||
|
|
2386f1034b | ||
|
|
ddf9f5c508 | ||
|
|
559867294f | ||
|
|
bf0c8d8dab | ||
|
|
7077e92cb0 | ||
|
|
035c5570c3 | ||
|
|
0be0fd1e05 | ||
|
|
bdfd380687 | ||
|
|
d1a4c73cd6 | ||
|
|
7133c81fc5 | ||
|
|
c6b4de39e8 | ||
|
|
94f367af70 | ||
|
|
dc6c393300 | ||
|
|
239f3a0a54 | ||
|
|
d3e78ab54e | ||
|
|
c6483535bd | ||
|
|
95bb2a5d56 | ||
|
|
23649ed840 | ||
|
|
3ee4034a76 | ||
|
|
21d377546e | ||
|
|
8c9dccc6a3 | ||
|
|
6fdf681993 | ||
|
|
7e8f413578 | ||
|
|
6705e5a962 | ||
|
|
d9126a936d | ||
|
|
4ee024b1ce | ||
|
|
19491d5ae6 | ||
|
|
db816594c5 | ||
|
|
fa73b7791f | ||
|
|
c61da5b0e5 | ||
|
|
49d724ad65 | ||
|
|
3ee2410a79 | ||
|
|
c2ddc70565 | ||
|
|
2f66e07c25 | ||
|
|
0807569ee2 | ||
|
|
206dec1bf8 | ||
|
|
0e852f5bb5 | ||
|
|
a272fb4e02 | ||
|
|
cbdc6e09aa | ||
|
|
211087f636 | ||
|
|
dca824b431 | ||
|
|
6bcc8eb0f2 | ||
|
|
844df4d5c9 | ||
|
|
6360d5fe1c | ||
|
|
e57a074b68 | ||
|
|
052632239e | ||
|
|
16aa4caceb | ||
|
|
83d84f6079 | ||
|
|
23c278d878 | ||
|
|
7074b0de71 | ||
|
|
2a9b025e88 | ||
|
|
16b3a0b1c1 | ||
|
|
e0c4f73600 | ||
|
|
6eb1947a6e | ||
|
|
2f793c29dc | ||
|
|
326fc221bf | ||
|
|
d49018363c | ||
|
|
2a2a0ad1f4 | ||
|
|
463b03ef7c | ||
|
|
80d39775ba | ||
|
|
92cdd25ca9 | ||
|
|
53680ba53b | ||
|
|
aa85c5fa3b | ||
|
|
a1ce6f8a81 | ||
|
|
7480904792 | ||
|
|
b12cfafc21 | ||
|
|
f07727651e | ||
|
|
6090eaa167 | ||
|
|
40eada4e80 | ||
|
|
2d375b3596 | ||
|
|
d864e2c723 | ||
|
|
e50c372562 | ||
|
|
e2cb033119 | ||
|
|
9620c57f19 | ||
|
|
07cc0fcbb6 | ||
|
|
6d1beb5c03 | ||
|
|
1667107422 | ||
|
|
de5cf1df2c | ||
|
|
a83114ced2 | ||
|
|
d6983422bf | ||
|
|
6d4b3ad84e | ||
|
|
a3df7919b5 | ||
|
|
6f1aa39cc9 | ||
|
|
f18c24c1d1 | ||
|
|
068401c29c | ||
|
|
6fbbd8b107 | ||
|
|
6379bd9e5d | ||
|
|
94d58dfa7c | ||
|
|
035fb80959 | ||
|
|
3b97f77083 | ||
|
|
a7d47202e6 | ||
|
|
199a9d3118 | ||
|
|
5df3ac4b04 | ||
|
|
782f77b688 | ||
|
|
1d570a233e | ||
|
|
4a6b58bd9b | ||
|
|
d64073bef0 | ||
|
|
6d8a9236f8 | ||
|
|
1665b4f2fa |
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-clickhouse</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,13 +35,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-clickhouse</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-cockroach</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,13 +35,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-db2</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,13 +35,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-db2</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-h2</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,13 +35,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-hana</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,13 +35,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-hana</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-mariadb</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,13 +35,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-mariadb</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-mysql</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,13 +35,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-mysql</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-nuodb</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,13 +35,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-nuodb</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-oracle</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,13 +35,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-oracle</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-postgres</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,13 +35,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-sqlite</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,13 +35,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlite</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-sqlserver</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,13 +35,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlserver</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-yugabyte</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,13 +35,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean (all platforms)</name>
|
||||
@@ -16,31 +16,31 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-joda-time</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-jackson-jsonnode</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-jackson-mapper</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -53,13 +53,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-all</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>composites</artifactId>
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean api</name>
|
||||
|
||||
@@ -690,7 +690,7 @@ public final class InterceptReadWrite implements EntityBeanIntercept {
|
||||
if (beanLoader == null) {
|
||||
final Database database = DB.byName(ebeanServerName);
|
||||
if (database == null) {
|
||||
throw new PersistenceException("Database [" + ebeanServerName + "] was not found?");
|
||||
throw new PersistenceException(ebeanServerName == null ? "No registered default server" : "Database [" + ebeanServerName + "] is not registered");
|
||||
}
|
||||
// For stand alone reference bean or after deserialisation lazy load
|
||||
// using the ebeanServer. Synchronise only on the bean.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
<!-- <parent>-->
|
||||
<!-- <groupId>org.avaje</groupId>-->
|
||||
@@ -26,7 +26,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
+35
-29
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean bom</name>
|
||||
@@ -89,106 +89,112 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-joda-time</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-jackson-jsonnode</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-jackson-mapper</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-generator</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-externalmapping-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-externalmapping-xml</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-autotune</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>querybean-generator</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>kotlin-querybean-generator</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-postgis</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-redis</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-spring-txn</artifactId>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- platforms -->
|
||||
@@ -196,67 +202,67 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-clickhouse</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-db2</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-h2</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-hana</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-mariadb</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-mysql</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-nuodb</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-oracle</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-postgres</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-sqlite</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-sqlserver</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
@@ -16,7 +16,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
+7
-7
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-core</artifactId>
|
||||
@@ -22,7 +22,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -46,13 +46,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-externalmapping-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -143,21 +143,21 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlserver</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static java.lang.System.Logger.Level.DEBUG;
|
||||
import static java.lang.System.Logger.Level.INFO;
|
||||
|
||||
/**
|
||||
* Request for loading Associated Many Beans.
|
||||
@@ -22,26 +23,29 @@ public final class LoadManyRequest extends LoadRequest {
|
||||
private final LoadManyBuffer loadContext;
|
||||
private final boolean onlyIds;
|
||||
private final boolean loadCache;
|
||||
private final BeanCollection<?> originCollection;
|
||||
private boolean originIncluded;
|
||||
|
||||
/**
|
||||
* Construct for lazy loading.
|
||||
*/
|
||||
public LoadManyRequest(LoadManyBuffer loadContext, boolean onlyIds, boolean loadCache) {
|
||||
this(loadContext, null, true, onlyIds, loadCache);
|
||||
public LoadManyRequest(LoadManyBuffer loadContext, boolean onlyIds, boolean loadCache, BeanCollection<?> originCollection) {
|
||||
super(null, true);
|
||||
this.loadContext = loadContext;
|
||||
this.onlyIds = onlyIds;
|
||||
this.loadCache = loadCache;
|
||||
this.originCollection = originCollection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct for secondary query.
|
||||
*/
|
||||
public LoadManyRequest(LoadManyBuffer loadContext, OrmQueryRequest<?> parentRequest) {
|
||||
this(loadContext, parentRequest, false, false, false);
|
||||
}
|
||||
|
||||
private LoadManyRequest(LoadManyBuffer loadContext, OrmQueryRequest<?> parentRequest, boolean lazy, boolean onlyIds, boolean loadCache) {
|
||||
super(parentRequest, lazy);
|
||||
super(parentRequest, false);
|
||||
this.loadContext = loadContext;
|
||||
this.onlyIds = onlyIds;
|
||||
this.loadCache = loadCache;
|
||||
this.onlyIds = false;
|
||||
this.loadCache = false;
|
||||
this.originCollection = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -59,10 +63,18 @@ public final class LoadManyRequest extends LoadRequest {
|
||||
for (int i = 0; i < loadContext.size(); i++) {
|
||||
BeanCollection<?> bc = loadContext.get(i);
|
||||
if (bc != null) {
|
||||
if (lazy && !originIncluded && bc == originCollection) {
|
||||
originIncluded = true;
|
||||
}
|
||||
idList.add(many.parentId(bc.getOwnerBean()));
|
||||
bc.setLoader(server); // don't use the load buffer again
|
||||
}
|
||||
}
|
||||
if (originCollection != null && !originIncluded) {
|
||||
CoreLog.log.log(INFO, "Batch lazy loading including origin collection - size:{0}", idList.size());
|
||||
idList.add(many.parentId(originCollection.getOwnerBean()));
|
||||
originCollection.setLoader(server); // don't use the load buffer again
|
||||
}
|
||||
if (many.targetDescriptor().isPadInExpression()) {
|
||||
BindPadding.padIds(idList);
|
||||
}
|
||||
|
||||
+7
-8
@@ -9,8 +9,7 @@ import io.ebeaninternal.server.deploy.ManyType;
|
||||
import io.ebeaninternal.server.deploy.meta.*;
|
||||
import io.ebeaninternal.server.type.TypeManager;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
import javax.persistence.Transient;
|
||||
import javax.persistence.*;
|
||||
import java.lang.reflect.*;
|
||||
|
||||
import static java.lang.System.Logger.Level.*;
|
||||
@@ -105,20 +104,18 @@ public final class DeployCreateProperties {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
private DeployBeanProperty createManyType(DeployBeanDescriptor<?> desc, Class<?> targetType, ManyType manyType) {
|
||||
try {
|
||||
ScalarType<?> scalarType = typeManager.type(targetType);
|
||||
if (scalarType != null) {
|
||||
return new DeployBeanPropertySimpleCollection(desc, targetType, manyType);
|
||||
return new DeployBeanPropertySimpleCollection<>(desc, targetType, manyType);
|
||||
}
|
||||
} catch (NullPointerException e) {
|
||||
CoreLog.internal.log(DEBUG, "expected non-scalar type {0}", e.getMessage());
|
||||
}
|
||||
return new DeployBeanPropertyAssocMany(desc, targetType, manyType);
|
||||
return new DeployBeanPropertyAssocMany<>(desc, targetType, manyType);
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
private DeployBeanProperty createProp(DeployBeanDescriptor<?> desc, Field field) {
|
||||
Class<?> propertyType = field.getType();
|
||||
if (isSpecialScalarType(field)) {
|
||||
@@ -149,9 +146,11 @@ public final class DeployCreateProperties {
|
||||
// return with no ScalarType (still support JSON features)
|
||||
return new DeployBeanProperty(desc, propertyType, null, null);
|
||||
}
|
||||
if (AnnotationUtil.has(field, Convert.class)) {
|
||||
throw new IllegalStateException("No AttributeConverter registered for type " + propertyType + " at " + desc.getFullName() + "." + field.getName());
|
||||
}
|
||||
try {
|
||||
return new DeployBeanPropertyAssocOne(desc, propertyType);
|
||||
|
||||
return new DeployBeanPropertyAssocOne<>(desc, propertyType);
|
||||
} catch (Exception e) {
|
||||
CoreLog.log.log(ERROR, "Error with " + desc + " field:" + field.getName(), e);
|
||||
return null;
|
||||
|
||||
@@ -212,7 +212,7 @@ final class DLoadManyContext extends DLoadBaseContext implements LoadManyContext
|
||||
}
|
||||
}
|
||||
|
||||
context.parent.getEbeanServer().loadMany(new LoadManyRequest(this, onlyIds, useCache));
|
||||
context.parent.getEbeanServer().loadMany(new LoadManyRequest(this, onlyIds, useCache, bc));
|
||||
// clear the buffer as all entries have been loaded
|
||||
clear();
|
||||
} finally {
|
||||
|
||||
@@ -20,6 +20,7 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import static io.ebeaninternal.server.persist.DmlUtil.isNullOrZero;
|
||||
import static java.lang.System.Logger.Level.WARNING;
|
||||
|
||||
/**
|
||||
* Saves the details for a OneToMany or ManyToMany relationship (entity beans).
|
||||
@@ -309,11 +310,11 @@ final class SaveManyBeans extends SaveManyBase {
|
||||
EntityBean otherBean = (EntityBean) other;
|
||||
// the object from the 'other' side of the ManyToMany
|
||||
if (deletions != null && deletions.remove(otherBean)) {
|
||||
String m = "Inserting and Deleting same object? " + otherBean;
|
||||
String msg = "Inserting and Deleting same object? " + otherBean;
|
||||
if (transaction.isLogSummary()) {
|
||||
transaction.logSummary(m);
|
||||
transaction.logSummary(msg);
|
||||
}
|
||||
CoreLog.log.log(System.Logger.Level.WARNING, m);
|
||||
CoreLog.log.log(WARNING, msg);
|
||||
} else {
|
||||
if (!many.hasImportedId(otherBean)) {
|
||||
throw new PersistenceException("ManyToMany bean does not have an Id value? " + otherBean);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-csv-reader</artifactId>
|
||||
@@ -14,21 +14,21 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean ddl generation</name>
|
||||
@@ -28,14 +28,14 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-all</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean external mapping api</name>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<scm>
|
||||
@@ -21,7 +21,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-externalmapping-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- JAVAX-DEPENDENCY-START -->
|
||||
@@ -68,21 +68,21 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-generator</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-jackson-jsonnode</artifactId>
|
||||
@@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-kotlin</artifactId>
|
||||
@@ -28,7 +28,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean postgis</name>
|
||||
@@ -22,14 +22,14 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- provided scope -->
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean querybean</name>
|
||||
@@ -17,7 +17,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -63,21 +63,21 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-generator</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>querybean-generator</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -103,11 +103,11 @@
|
||||
<plugin>
|
||||
<groupId>io.repaint.maven</groupId>
|
||||
<artifactId>tiles-maven-plugin</artifactId>
|
||||
<version>2.24</version>
|
||||
<version>2.34</version>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<tiles>
|
||||
<tile>io.ebean.tile:enhancement:13.13.1</tile>
|
||||
<tile>io.ebean.tile:enhancement:13.13.2</tile>
|
||||
</tiles>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
@@ -0,0 +1,162 @@
|
||||
package io.ebean.typequery;
|
||||
|
||||
import io.avaje.lang.Nullable;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* Base type for associated beans.
|
||||
*
|
||||
* @param <T> the entity bean type (normal entity bean type e.g. Customer)
|
||||
* @param <R> the specific root query bean type (e.g. QCustomer)
|
||||
*/
|
||||
public abstract class TQAssoc<T, R> extends TQProperty<R, Object> {
|
||||
|
||||
/**
|
||||
* Construct with a property name and root instance.
|
||||
*
|
||||
* @param name the name of the property
|
||||
* @param root the root query bean instance
|
||||
*/
|
||||
public TQAssoc(String name, R root) {
|
||||
this(name, root, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct with additional path prefix.
|
||||
*/
|
||||
public TQAssoc(String name, R root, String prefix) {
|
||||
super(name, root, prefix);
|
||||
}
|
||||
|
||||
/**
|
||||
* Is equal to by ID property.
|
||||
*/
|
||||
public final R eq(T other) {
|
||||
expr().eq(_name, other);
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is EQUAL TO if value is non-null and otherwise no expression is added to the query.
|
||||
* <p>
|
||||
* This is effectively a helper method that allows a query to be built in fluid style where some predicates are
|
||||
* effectively optional. We can use <code>eqIfPresent()</code> rather than having a separate if block.
|
||||
*/
|
||||
public final R eqIfPresent(@Nullable T other) {
|
||||
expr().eqIfPresent(_name, other);
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is equal to by ID property.
|
||||
*/
|
||||
public final R equalTo(T other) {
|
||||
return eq(other);
|
||||
}
|
||||
|
||||
/**
|
||||
* Is not equal to by ID property.
|
||||
*/
|
||||
public final R ne(T other) {
|
||||
expr().ne(_name, other);
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is not equal to by ID property.
|
||||
*/
|
||||
public final R notEqualTo(T other) {
|
||||
return ne(other);
|
||||
}
|
||||
|
||||
/**
|
||||
* Is in a list of values.
|
||||
*
|
||||
* @param values the list of values for the predicate
|
||||
* @return the root query bean instance
|
||||
*/
|
||||
@SafeVarargs
|
||||
public final R in(T... values) {
|
||||
expr().in(_name, (Object[]) values);
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is in a list of values.
|
||||
*
|
||||
* @param values the list of values for the predicate
|
||||
* @return the root query bean instance
|
||||
*/
|
||||
public final R in(Collection<T> values) {
|
||||
expr().in(_name, values);
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* In where null or empty values means that no predicate is added to the query.
|
||||
* <p>
|
||||
* That is, only add the IN predicate if the values are not null or empty.
|
||||
* <p>
|
||||
* Without this we typically need to code an <code>if</code> block to only add
|
||||
* the IN predicate if the collection is not empty like:
|
||||
* </p>
|
||||
*
|
||||
* <h3>Without inOrEmpty()</h3>
|
||||
* <pre>{@code
|
||||
*
|
||||
* List<String> names = Arrays.asList("foo", "bar");
|
||||
*
|
||||
* QCustomer query = new QCustomer()
|
||||
* .registered.before(LocalDate.now())
|
||||
*
|
||||
* // conditionally add the IN expression to the query
|
||||
* if (names != null && !names.isEmpty()) {
|
||||
* query.name.in(names)
|
||||
* }
|
||||
*
|
||||
* query.findList();
|
||||
*
|
||||
* }</pre>
|
||||
*
|
||||
* <h3>Using inOrEmpty()</h3>
|
||||
* <pre>{@code
|
||||
*
|
||||
* List<String> names = Arrays.asList("foo", "bar");
|
||||
*
|
||||
* new QCustomer()
|
||||
* .registered.before(LocalDate.now())
|
||||
* .name.inOrEmpty(names)
|
||||
* .findList();
|
||||
*
|
||||
* }</pre>
|
||||
*/
|
||||
public final R inOrEmpty(Collection<T> values) {
|
||||
expr().inOrEmpty(_name, values);
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is NOT in a list of values.
|
||||
*
|
||||
* @param values the list of values for the predicate
|
||||
* @return the root query bean instance
|
||||
*/
|
||||
public final R notIn(Collection<T> values) {
|
||||
expr().notIn(_name, values);
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is NOT in a list of values.
|
||||
*
|
||||
* @param values the list of values for the predicate
|
||||
* @return the root query bean instance
|
||||
*/
|
||||
@SafeVarargs
|
||||
public final R notIn(T... values) {
|
||||
expr().notIn(_name, (Object[]) values);
|
||||
return _root;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package io.ebean.typequery;
|
||||
|
||||
import io.avaje.lang.Nullable;
|
||||
import io.ebean.ExpressionList;
|
||||
import io.ebean.FetchConfig;
|
||||
import io.ebean.FetchGroup;
|
||||
@@ -8,18 +7,18 @@ import io.ebeaninternal.api.SpiQueryFetch;
|
||||
import io.ebeaninternal.server.querydefn.OrmQueryDetail;
|
||||
import io.ebeaninternal.server.querydefn.SpiFetchGroup;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Base type for associated beans.
|
||||
* Base type for associated beans that are not embeddable.
|
||||
*
|
||||
* @param <T> the entity bean type (normal entity bean type e.g. Customer)
|
||||
* @param <R> the specific root query bean type (e.g. QCustomer)
|
||||
* @param <QB> the query bean type
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
public abstract class TQAssocBean<T, R> extends TQProperty<R, Object> {
|
||||
public abstract class TQAssocBean<T, R, QB> extends TQAssoc<T, R> {
|
||||
|
||||
private static final FetchConfig FETCH_DEFAULT = FetchConfig.ofDefault();
|
||||
private static final FetchConfig FETCH_QUERY = FetchConfig.ofQuery();
|
||||
@@ -110,38 +109,37 @@ public abstract class TQAssocBean<T, R> extends TQProperty<R, Object> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Eagerly fetch this association fetching some of the properties.
|
||||
* Eagerly fetch this association loading the specified properties.
|
||||
*/
|
||||
@SafeVarargs
|
||||
protected final R fetchProperties(TQProperty<?, ?>... props) {
|
||||
return fetchWithProperties(FETCH_DEFAULT, props);
|
||||
@SafeVarargs @SuppressWarnings("varargs")
|
||||
public final R fetch(TQProperty<QB,?>... properties) {
|
||||
return fetchWithProperties(FETCH_DEFAULT, properties);
|
||||
}
|
||||
|
||||
/**
|
||||
* Eagerly fetch query this association fetching some of the properties.
|
||||
* Eagerly fetch this association using a 'query join' loading the specified properties.
|
||||
*/
|
||||
@SafeVarargs
|
||||
protected final R fetchQueryProperties(TQProperty<?, ?>... props) {
|
||||
return fetchWithProperties(FETCH_QUERY, props);
|
||||
@SafeVarargs @SuppressWarnings("varargs")
|
||||
public final R fetchQuery(TQProperty<QB,?>... properties) {
|
||||
return fetchWithProperties(FETCH_QUERY, properties);
|
||||
}
|
||||
|
||||
/**
|
||||
* Eagerly fetch this association using L2 bean cache.
|
||||
* Eagerly fetch this association using L2 cache.
|
||||
*/
|
||||
@SafeVarargs
|
||||
protected final R fetchCacheProperties(TQProperty<?, ?>... props) {
|
||||
return fetchWithProperties(FETCH_CACHE, props);
|
||||
@SafeVarargs @SuppressWarnings("varargs")
|
||||
public final R fetchCache(TQProperty<QB,?>... properties) {
|
||||
return fetchWithProperties(FETCH_CACHE, properties);
|
||||
}
|
||||
|
||||
/**
|
||||
* Eagerly fetch query this association fetching some of the properties.
|
||||
* Use lazy loading for this association loading the specified properties.
|
||||
*/
|
||||
@SafeVarargs
|
||||
protected final R fetchLazyProperties(TQProperty<?, ?>... props) {
|
||||
return fetchWithProperties(FETCH_LAZY, props);
|
||||
@SafeVarargs @SuppressWarnings("varargs")
|
||||
public final R fetchLazy(TQProperty<QB,?>... properties) {
|
||||
return fetchWithProperties(FETCH_LAZY, properties);
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
private R fetchWithProperties(FetchConfig config, TQProperty<?, ?>... props) {
|
||||
spiQuery().fetchProperties(_name, properties(props), config);
|
||||
return _root;
|
||||
@@ -178,7 +176,6 @@ public abstract class TQAssocBean<T, R> extends TQProperty<R, Object> {
|
||||
return (SpiQueryFetch) ((TQRootBean) _root).query();
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
private Set<String> properties(TQProperty<?, ?>... props) {
|
||||
Set<String> set = new LinkedHashSet<>();
|
||||
for (TQProperty<?, ?> prop : props) {
|
||||
@@ -187,135 +184,6 @@ public abstract class TQAssocBean<T, R> extends TQProperty<R, Object> {
|
||||
return set;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is equal to by ID property.
|
||||
*/
|
||||
public final R eq(T other) {
|
||||
expr().eq(_name, other);
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is EQUAL TO if value is non-null and otherwise no expression is added to the query.
|
||||
* <p>
|
||||
* This is effectively a helper method that allows a query to be built in fluid style where some predicates are
|
||||
* effectively optional. We can use <code>eqIfPresent()</code> rather than having a separate if block.
|
||||
*/
|
||||
public final R eqIfPresent(@Nullable T other) {
|
||||
expr().eqIfPresent(_name, other);
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is equal to by ID property.
|
||||
*/
|
||||
public final R equalTo(T other) {
|
||||
return eq(other);
|
||||
}
|
||||
|
||||
/**
|
||||
* Is not equal to by ID property.
|
||||
*/
|
||||
public final R ne(T other) {
|
||||
expr().ne(_name, other);
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is not equal to by ID property.
|
||||
*/
|
||||
public final R notEqualTo(T other) {
|
||||
return ne(other);
|
||||
}
|
||||
|
||||
/**
|
||||
* Is in a list of values.
|
||||
*
|
||||
* @param values the list of values for the predicate
|
||||
* @return the root query bean instance
|
||||
*/
|
||||
@SafeVarargs
|
||||
public final R in(T... values) {
|
||||
expr().in(_name, (Object[]) values);
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is in a list of values.
|
||||
*
|
||||
* @param values the list of values for the predicate
|
||||
* @return the root query bean instance
|
||||
*/
|
||||
public final R in(Collection<T> values) {
|
||||
expr().in(_name, values);
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* In where null or empty values means that no predicate is added to the query.
|
||||
* <p>
|
||||
* That is, only add the IN predicate if the values are not null or empty.
|
||||
* <p>
|
||||
* Without this we typically need to code an <code>if</code> block to only add
|
||||
* the IN predicate if the collection is not empty like:
|
||||
* </p>
|
||||
*
|
||||
* <h3>Without inOrEmpty()</h3>
|
||||
* <pre>{@code
|
||||
*
|
||||
* List<String> names = Arrays.asList("foo", "bar");
|
||||
*
|
||||
* QCustomer query = new QCustomer()
|
||||
* .registered.before(LocalDate.now())
|
||||
*
|
||||
* // conditionally add the IN expression to the query
|
||||
* if (names != null && !names.isEmpty()) {
|
||||
* query.name.in(names)
|
||||
* }
|
||||
*
|
||||
* query.findList();
|
||||
*
|
||||
* }</pre>
|
||||
*
|
||||
* <h3>Using inOrEmpty()</h3>
|
||||
* <pre>{@code
|
||||
*
|
||||
* List<String> names = Arrays.asList("foo", "bar");
|
||||
*
|
||||
* new QCustomer()
|
||||
* .registered.before(LocalDate.now())
|
||||
* .name.inOrEmpty(names)
|
||||
* .findList();
|
||||
*
|
||||
* }</pre>
|
||||
*/
|
||||
public final R inOrEmpty(Collection<T> values) {
|
||||
expr().inOrEmpty(_name, values);
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is NOT in a list of values.
|
||||
*
|
||||
* @param values the list of values for the predicate
|
||||
* @return the root query bean instance
|
||||
*/
|
||||
public final R notIn(Collection<T> values) {
|
||||
expr().notIn(_name, values);
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is NOT in a list of values.
|
||||
*
|
||||
* @param values the list of values for the predicate
|
||||
* @return the root query bean instance
|
||||
*/
|
||||
@SafeVarargs
|
||||
public final R notIn(T... values) {
|
||||
expr().notIn(_name, (Object[]) values);
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply a filter when fetching these beans.
|
||||
|
||||
@@ -2,15 +2,22 @@ package org.example.domain;
|
||||
|
||||
import javax.persistence.DiscriminatorValue;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Inheritance;
|
||||
|
||||
@Inheritance
|
||||
@DiscriminatorValue("CAT")
|
||||
@Entity
|
||||
public class ACat extends Animal {
|
||||
|
||||
private String catProp;
|
||||
|
||||
public ACat(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public String getCatProp() {
|
||||
return catProp;
|
||||
}
|
||||
|
||||
public void setCatProp(String catProp) {
|
||||
this.catProp = catProp;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package org.example.domain;
|
||||
|
||||
import javax.persistence.DiscriminatorValue;
|
||||
import javax.persistence.Entity;
|
||||
|
||||
@DiscriminatorValue("SCAT")
|
||||
@Entity
|
||||
public class ASuperCat extends ACat {
|
||||
|
||||
private String superCat;
|
||||
|
||||
public ASuperCat(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public String getSuperCat() {
|
||||
return superCat;
|
||||
}
|
||||
|
||||
public void setSuperCat(String superCat) {
|
||||
this.superCat = superCat;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package org.querytest;
|
||||
|
||||
import org.example.domain.ACat;
|
||||
import org.example.domain.ADog;
|
||||
import org.example.domain.Animal;
|
||||
import org.example.domain.query.QACat;
|
||||
import org.example.domain.query.QASuperCat;
|
||||
import org.example.domain.query.QAnimal;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
class InheritanceTest {
|
||||
|
||||
@Test
|
||||
void query_setInheritType() {
|
||||
|
||||
ACat cat = new ACat("C1");
|
||||
cat.save();
|
||||
|
||||
ACat cat2 = new ACat("C2");
|
||||
cat2.save();
|
||||
|
||||
ADog dog = new ADog("D1", "D878");
|
||||
dog.save();
|
||||
|
||||
List<Animal> animals = new QAnimal()
|
||||
.id.greaterOrEqualTo(1L)
|
||||
.setInheritType(ACat.class)
|
||||
.findList();
|
||||
|
||||
assertThat(animals).isNotEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
void query_onInheritedProperty() {
|
||||
new QACat()
|
||||
.name.eq("foo")
|
||||
.catProp.eq("foo")
|
||||
.findList();
|
||||
}
|
||||
|
||||
@Test
|
||||
void query_onInheritedProperty_whenParentOnlyHasDiscriminator() {
|
||||
// the .name and .catProp properties exist on QASuperCat()
|
||||
new QASuperCat()
|
||||
.superCat.eq("foo")
|
||||
.name.eq("foo")
|
||||
.catProp.eq("foo")
|
||||
.findList();
|
||||
}
|
||||
}
|
||||
@@ -591,25 +591,7 @@ public class QCustomerTest {
|
||||
.findList();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void query_setInheritType() {
|
||||
|
||||
ACat cat = new ACat("C1");
|
||||
cat.save();
|
||||
|
||||
ACat cat2 = new ACat("C2");
|
||||
cat2.save();
|
||||
|
||||
ADog dog = new ADog("D1", "D878");
|
||||
dog.save();
|
||||
|
||||
List<Animal> animals = new QAnimal()
|
||||
.id.greaterOrEqualTo(1L)
|
||||
.setInheritType(ACat.class)
|
||||
.findList();
|
||||
|
||||
System.out.println(animals);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void select_assocManyToOne() {
|
||||
|
||||
+6
-6
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-redis</artifactId>
|
||||
@@ -22,35 +22,35 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>querybean-generator</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
# editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
spaces_around_operators = true
|
||||
max_line_length = 130
|
||||
@@ -0,0 +1,9 @@
|
||||
*.sql
|
||||
.classpath
|
||||
.project
|
||||
.settings/
|
||||
target/
|
||||
logs/
|
||||
.idea/
|
||||
*.iml
|
||||
|
||||
@@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright 2012 Authors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
@@ -0,0 +1,45 @@
|
||||
[](https://maven-badges.herokuapp.com/maven-central/io.ebean/ebean-spring-txn)
|
||||
[](https://github.com/ebean-orm/ebean-spring-txn/blob/master/LICENSE)
|
||||
|
||||
ebean-spring-txn
|
||||
=====================
|
||||
|
||||
Integration with Spring managed transactions.
|
||||
|
||||
This project provides an Ebean `ExternalTransactionManager` specifically
|
||||
to integrate with Springs JDBC Transaction manager.
|
||||
|
||||
## To use
|
||||
|
||||
```java
|
||||
DatabaseConfig config = new DatabaseConfig();
|
||||
|
||||
// set SpringJdbcTransactionManager ... as the external transaction manager
|
||||
config.setExternalTransactionManager(new SpringJdbcTransactionManager());
|
||||
|
||||
...
|
||||
Database database = DatabaseFactory.create(config);
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
You can use Ebean in Spring/Spring Boot *without* this and that case Ebean
|
||||
manages the Transactions itself. With Ebean managing the transactions there
|
||||
are some benefits with more control over JDBC batch, getGeneratedKeys
|
||||
and a simpler abstraction (as Spring transactions is designed to manage
|
||||
multiple resources such as JDBC Transactions and JPA EntityManager and Ebean
|
||||
only needs to manage JDBC Transactions).
|
||||
|
||||
|
||||
## Java modules
|
||||
|
||||
Add `requires io.ebean.spring.txn` to module-info.
|
||||
|
||||
```java
|
||||
module foo {
|
||||
|
||||
requires io.ebean.spring.txn;
|
||||
...
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-spring-txn</artifactId>
|
||||
<name>ebean-spring-txn</name>
|
||||
<description>Ebean support for Spring transactions</description>
|
||||
|
||||
<properties>
|
||||
<spring.framework.version>5.3.25</spring.framework.version>
|
||||
<spring.boot.version>2.7.3</spring.boot.version>
|
||||
<surefire.useModulePath>false</surefire.useModulePath>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<version>1.7.32</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.14.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>2.14.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Provided: Spring, Spring Boot -->
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-jdbc</artifactId>
|
||||
<version>${spring.framework.version}</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- Test dependencies -->
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
<version>${spring.framework.version}</version>
|
||||
<scope>test</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-test</artifactId>
|
||||
<version>${spring.boot.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>13.14.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.avaje</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>1.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jcl-over-slf4j</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
<plugin>
|
||||
<groupId>io.repaint.maven</groupId>
|
||||
<artifactId>tiles-maven-plugin</artifactId>
|
||||
<version>2.24</version>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<tiles>
|
||||
<tile>io.ebean.tile:enhancement:13.14.0</tile>
|
||||
</tiles>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,20 @@
|
||||
package io.ebean.spring.txn;
|
||||
|
||||
import io.ebeaninternal.server.transaction.ExternalJdbcTransaction;
|
||||
import io.ebeaninternal.server.transaction.TransactionManager;
|
||||
import org.springframework.jdbc.datasource.ConnectionHolder;
|
||||
|
||||
final class SpringJdbcTransaction extends ExternalJdbcTransaction {
|
||||
|
||||
private final ConnectionHolder holder;
|
||||
|
||||
SpringJdbcTransaction(ConnectionHolder holder, TransactionManager manager) {
|
||||
super(true, holder.getConnection(), manager);
|
||||
this.holder = holder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
return holder.isSynchronizedWithTransaction();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
package io.ebean.spring.txn;
|
||||
|
||||
import io.avaje.applog.AppLog;
|
||||
import io.ebean.TxScope;
|
||||
import io.ebean.config.ExternalTransactionManager;
|
||||
import io.ebeaninternal.api.SpiTransaction;
|
||||
import io.ebeaninternal.server.transaction.TransactionManager;
|
||||
import org.springframework.jdbc.datasource.ConnectionHolder;
|
||||
import org.springframework.transaction.support.TransactionSynchronization;
|
||||
import org.springframework.transaction.support.TransactionSynchronizationManager;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
import javax.sql.DataSource;
|
||||
import java.util.List;
|
||||
|
||||
import static java.lang.System.Logger.Level.DEBUG;
|
||||
|
||||
/**
|
||||
* A Spring-aware {@link ExternalTransactionManager}.
|
||||
* <p>
|
||||
* Will look for Spring transactions and use them if they exist.
|
||||
*
|
||||
* @author E Mc Greal
|
||||
* @since 18.05.2009
|
||||
*/
|
||||
public final class SpringJdbcTransactionManager implements ExternalTransactionManager {
|
||||
|
||||
private static final System.Logger log = AppLog.getLogger(SpringJdbcTransactionManager.class);
|
||||
|
||||
private DataSource dataSource;
|
||||
private TransactionManager transactionManager;
|
||||
|
||||
/**
|
||||
* Instantiates a new spring aware transaction scope manager.
|
||||
*/
|
||||
public SpringJdbcTransactionManager() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialise this with the Ebean internal transaction manager.
|
||||
*/
|
||||
@Override
|
||||
public void setTransactionManager(Object txnMgr) {
|
||||
// RB: At this stage not exposing TransactionManager to
|
||||
// the public API and hence the Object type and casting here
|
||||
this.transactionManager = (TransactionManager) txnMgr;
|
||||
this.dataSource = transactionManager.dataSource();
|
||||
}
|
||||
|
||||
/**
|
||||
* Looks for a current Spring managed transaction and wraps/returns that as a Ebean transaction.
|
||||
* <p>
|
||||
* Returns null if there is no current spring transaction (lazy loading outside a spring txn).
|
||||
*/
|
||||
@Override
|
||||
public Object getCurrentTransaction() {
|
||||
// Get the current Spring ConnectionHolder associated to the current spring managed transaction
|
||||
ConnectionHolder holder = (ConnectionHolder) TransactionSynchronizationManager.getResource(dataSource);
|
||||
if (holder == null || !holder.isSynchronizedWithTransaction()) {
|
||||
// no current Spring transaction
|
||||
SpiTransaction currentEbeanTransaction = transactionManager.inScope();
|
||||
if (currentEbeanTransaction == null || !currentEbeanTransaction.isActive()) {
|
||||
return null;
|
||||
} else {
|
||||
return currentEbeanTransaction;
|
||||
}
|
||||
}
|
||||
|
||||
SpringTxnListener springTxnLister = listener();
|
||||
if (springTxnLister != null) {
|
||||
// we have already seen this transaction
|
||||
return springTxnLister.transaction();
|
||||
} else {
|
||||
// This is a new spring transaction that we have not seen before.
|
||||
// "wrap" it in a SpringJdbcTransaction for use with Ebean
|
||||
SpringJdbcTransaction newTrans = new SpringJdbcTransaction(holder, transactionManager);
|
||||
|
||||
// Create and register a Spring TransactionSynchronization for this transaction
|
||||
springTxnLister = createListener(newTrans);
|
||||
TransactionSynchronizationManager.registerSynchronization(springTxnLister);
|
||||
return transactionManager.externalBeginTransaction(newTrans, TxScope.required());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Search for our specific transaction listener.
|
||||
* <p>
|
||||
* If it exists then we have already seen and "wrapped" this transaction.
|
||||
*/
|
||||
private SpringTxnListener listener() {
|
||||
if (TransactionSynchronizationManager.isSynchronizationActive()) {
|
||||
List<TransactionSynchronization> synchronizations = TransactionSynchronizationManager.getSynchronizations();
|
||||
// search for our specific listener
|
||||
for (TransactionSynchronization synchronization : synchronizations) {
|
||||
if (synchronization instanceof SpringTxnListener) {
|
||||
return (SpringTxnListener) synchronization;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a listener to enable Ebean to be notified when transactions commit and rollback.
|
||||
*/
|
||||
private SpringTxnListener createListener(SpringJdbcTransaction transaction) {
|
||||
return new SpringTxnListener(transactionManager, transaction);
|
||||
}
|
||||
|
||||
/**
|
||||
* A Spring TransactionSynchronization that we register with Spring to get notified when
|
||||
* a Spring managed transaction has been committed or rolled back.
|
||||
* <p>
|
||||
* When Ebean is notified (of the commit/rollback) it can then manage its cache, notify
|
||||
* BeanPersistListeners etc.
|
||||
*/
|
||||
private static class SpringTxnListener implements TransactionSynchronization {
|
||||
|
||||
private final TransactionManager transactionManager;
|
||||
|
||||
private final SpringJdbcTransaction transaction;
|
||||
|
||||
private SpringTxnListener(TransactionManager transactionManager, SpringJdbcTransaction t) {
|
||||
this.transactionManager = transactionManager;
|
||||
this.transaction = t;
|
||||
}
|
||||
|
||||
private SpringJdbcTransaction transaction() {
|
||||
return transaction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void flush() {
|
||||
transaction.flush();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeCommit(boolean readOnly) {
|
||||
if (!readOnly) {
|
||||
transaction.preCommit();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterCompletion(int status) {
|
||||
switch (status) {
|
||||
case STATUS_COMMITTED:
|
||||
log.log(DEBUG, "Spring Txn [{0}] committed", transaction.getId());
|
||||
transaction.postCommit();
|
||||
break;
|
||||
|
||||
case STATUS_ROLLED_BACK:
|
||||
log.log(DEBUG, "Spring Txn [{0}] rollback", transaction.getId());
|
||||
transaction.postRollback(null);
|
||||
break;
|
||||
|
||||
default:
|
||||
// this should never happen
|
||||
throw new PersistenceException("Invalid status " + status);
|
||||
}
|
||||
|
||||
// Remove this transaction object as it is completed
|
||||
transactionManager.externalRemoveTransaction();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
module io.ebean.spring.txn {
|
||||
|
||||
exports io.ebean.spring.txn;
|
||||
|
||||
requires io.ebean.api;
|
||||
requires io.ebean.core;
|
||||
requires spring.jdbc;
|
||||
requires spring.tx;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package org.example;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.OneToOne;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Table(name="o_account")
|
||||
@Entity
|
||||
public class Account {
|
||||
|
||||
@Id
|
||||
private Long id;
|
||||
|
||||
@OneToOne
|
||||
private User user;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public User getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(User user) {
|
||||
this.user = user;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package org.example;
|
||||
|
||||
import io.ebean.Database;
|
||||
import io.ebean.DatabaseFactory;
|
||||
import io.ebean.annotation.PersistBatch;
|
||||
import io.ebean.config.DatabaseConfig;
|
||||
import org.springframework.beans.factory.FactoryBean;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
|
||||
/**
|
||||
* A Spring FactoryBean for constructing EbeanServer instances.
|
||||
*
|
||||
* @since 18.05.2009
|
||||
* @author E Mc Greal
|
||||
*/
|
||||
public class EbeanServerFactoryBean implements InitializingBean, FactoryBean<Database> {
|
||||
|
||||
/**
|
||||
* The Ebean server configuration.
|
||||
*/
|
||||
private DatabaseConfig serverConfig;
|
||||
|
||||
/**
|
||||
* The EbeanServer instance.
|
||||
*/
|
||||
private Database ebeanServer;
|
||||
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
|
||||
if (serverConfig == null) {
|
||||
throw new Exception("No ServerConig set. You must define a ServerConfig bean");
|
||||
}
|
||||
|
||||
serverConfig.setPersistBatch(PersistBatch.ALL);
|
||||
// Create the new EbeanServer using the configuration
|
||||
this.ebeanServer = DatabaseFactory.create(serverConfig);
|
||||
}
|
||||
|
||||
public Database getObject() throws Exception {
|
||||
return ebeanServer;
|
||||
}
|
||||
|
||||
public Class<? extends Database> getObjectType() {
|
||||
return Database.class;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true for EbeanServer.
|
||||
*/
|
||||
public boolean isSingleton() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the server configuration.
|
||||
*/
|
||||
public DatabaseConfig getServerConfig() {
|
||||
return serverConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the server configuration.
|
||||
*/
|
||||
public void setServerConfig(DatabaseConfig serverConfig) {
|
||||
this.serverConfig = serverConfig;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
package org.example;
|
||||
|
||||
import io.ebean.DB;
|
||||
import io.ebean.Transaction;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit.jupiter.SpringExtension;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
/**
|
||||
* Unit test for Ebean Spring Module.
|
||||
*
|
||||
* @author E Mc Greal
|
||||
* @since 18.05.2009
|
||||
*/
|
||||
@ExtendWith(SpringExtension.class)
|
||||
@ContextConfiguration(locations = {"/init-database.xml"})
|
||||
public class EbeanSpringModuleTest {
|
||||
|
||||
/**
|
||||
* The Constant logger.
|
||||
*/
|
||||
private final static Logger logger = LoggerFactory.getLogger(EbeanSpringModuleTest.class);
|
||||
|
||||
/**
|
||||
* The user service.
|
||||
*/
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
|
||||
/**
|
||||
* Create the test case.
|
||||
*/
|
||||
public EbeanSpringModuleTest() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test app.
|
||||
*/
|
||||
@Test
|
||||
public void testInactiveTransaction() {
|
||||
|
||||
Transaction transaction = DB.beginTransaction();
|
||||
long id;
|
||||
try {
|
||||
User user = new User();
|
||||
user.setName("save with txn 1");
|
||||
DB.save(user);
|
||||
transaction.commit();
|
||||
id = user.getOid();
|
||||
} finally {
|
||||
// don't end the transaction ...
|
||||
//transaction.end();
|
||||
}
|
||||
|
||||
DB.delete(User.class, id);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBatchInsert() {
|
||||
userService.batchInsert();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRequiresNew() {
|
||||
userService.requiresNew();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test app.
|
||||
*/
|
||||
@Test
|
||||
public void testSaveUser() {
|
||||
logger.info("Saving new User...");
|
||||
User user = new User();
|
||||
user.setName("ebean");
|
||||
userService.save(user);
|
||||
logger.info("Saved new User");
|
||||
assertThat(user.getOid()).isGreaterThan(0);
|
||||
|
||||
final User found = DB.find(User.class, user.getOid());
|
||||
assertThat(found).isNotNull();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test app.
|
||||
*/
|
||||
@Test
|
||||
public void testFindUser() {
|
||||
logger.info("Finding User with OID = 1 ...");
|
||||
User user = userService.find(1);
|
||||
|
||||
assertNotNull(user);
|
||||
assertTrue("ebean".equals(user.getName()));
|
||||
logger.info("Found User with OID = 1");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNonTransactional() {
|
||||
userService.nonTransactional();
|
||||
logger.info("nonTransactional done");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFindNonTransactional() {
|
||||
logger.info("Finding User with OID = 1 ...");
|
||||
User user = userService.find(1);
|
||||
User user2 = userService.findNoCurrentTransaction(2);
|
||||
logger.info("nonTransactional find user1:{} user2:{}", user, user2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the user service.
|
||||
*/
|
||||
public UserService getUserService() {
|
||||
return userService;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the user service.
|
||||
*/
|
||||
public void setUserService(UserService userService) {
|
||||
this.userService = userService;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package org.example;
|
||||
|
||||
import java.util.Set;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.ManyToMany;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Table(name="o_role")
|
||||
@Entity
|
||||
public class Role {
|
||||
|
||||
@Id
|
||||
Long id;
|
||||
|
||||
@ManyToMany
|
||||
private Set<User> users;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Set<User> getUsers() {
|
||||
return users;
|
||||
}
|
||||
|
||||
public void setUsers(Set<User> users) {
|
||||
this.users = users;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package org.example;
|
||||
|
||||
import io.ebean.Model;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.Set;
|
||||
|
||||
@Table(name="o_user")
|
||||
@Entity
|
||||
public class User extends Model {
|
||||
|
||||
@Id
|
||||
long oid;
|
||||
|
||||
private String name;
|
||||
|
||||
@ManyToMany
|
||||
private Set<Role> roles;
|
||||
|
||||
@OneToOne(mappedBy = "user")
|
||||
private Account account;
|
||||
|
||||
public String toString() {
|
||||
return "{user:" + oid + " name:" + name + "}";
|
||||
}
|
||||
|
||||
public long getOid() {
|
||||
return oid;
|
||||
}
|
||||
|
||||
public void setOid(long oid) {
|
||||
this.oid = oid;
|
||||
}
|
||||
|
||||
public Set<Role> getRoles() {
|
||||
return roles;
|
||||
}
|
||||
|
||||
public void setRoles(Set<Role> roles) {
|
||||
this.roles = roles;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Account getAccount() {
|
||||
return account;
|
||||
}
|
||||
|
||||
public void setAccount(Account account) {
|
||||
this.account = account;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package org.example;
|
||||
|
||||
/**
|
||||
* The Interface UserService.
|
||||
*/
|
||||
public interface UserService {
|
||||
|
||||
void save(User user);
|
||||
|
||||
User find(long id);
|
||||
|
||||
User findNoCurrentTransaction(long id);
|
||||
|
||||
void nonTransactional();
|
||||
|
||||
void batchInsert();
|
||||
|
||||
void requiresNew();
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package org.example;
|
||||
|
||||
import io.ebean.Database;
|
||||
import io.ebean.Transaction;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* The Class UserServiceImpl.
|
||||
*
|
||||
* @author E Mc Greal
|
||||
* @since 18.05.2009
|
||||
*/
|
||||
public class UserServiceImpl implements UserService, ApplicationContextAware {
|
||||
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
/**
|
||||
* The ebean server.
|
||||
*/
|
||||
@Autowired
|
||||
private Database ebeanServer;
|
||||
|
||||
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public void save(User user) {
|
||||
ebeanServer.save(user);
|
||||
}
|
||||
|
||||
@Transactional(readOnly = true, propagation = Propagation.REQUIRED)
|
||||
public User find(long id) {
|
||||
return ebeanServer.find(User.class, id);
|
||||
}
|
||||
|
||||
public void nonTransactional() {
|
||||
ebeanServer.currentTransaction();
|
||||
}
|
||||
|
||||
public User findNoCurrentTransaction(long id) {
|
||||
return ebeanServer.find(User.class, id);
|
||||
}
|
||||
|
||||
@Transactional(propagation = Propagation.REQUIRED)
|
||||
public void batchInsert() {
|
||||
|
||||
List<User> users = new ArrayList<>();
|
||||
for (int i = 0; i < 25; i++) {
|
||||
User user = new User();
|
||||
user.setName("user" + i);
|
||||
users.add(user);
|
||||
}
|
||||
|
||||
System.out.println("---------before batch-------");
|
||||
|
||||
Transaction tx = ebeanServer.currentTransaction();
|
||||
tx.setBatchSize(20);
|
||||
ebeanServer.saveAll(users);
|
||||
|
||||
System.out.println("---------after batch-------");
|
||||
|
||||
applicationContext.getBean(UserService.class).requiresNew();
|
||||
}
|
||||
|
||||
@Transactional(propagation = Propagation.REQUIRES_NEW)
|
||||
public void requiresNew() {
|
||||
User user = new User();
|
||||
user.setName("user_x0");
|
||||
user.insert();
|
||||
//ebeanServer.save(user);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the ebean server.
|
||||
*/
|
||||
public Database getEbeanServer() {
|
||||
return ebeanServer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the ebean server.
|
||||
*/
|
||||
public void setEbeanServer(Database ebeanServer) {
|
||||
this.ebeanServer = ebeanServer;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
||||
this.applicationContext = applicationContext;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd">
|
||||
|
||||
<!-- Default abstract Ebean Server configuration -->
|
||||
<bean id="defaultEbeanServerConfig" class="io.ebean.config.DatabaseConfig" abstract="true">
|
||||
<property name="externalTransactionManager">
|
||||
<bean class="io.ebean.spring.txn.SpringJdbcTransactionManager"/>
|
||||
</property>
|
||||
<property name="namingConvention">
|
||||
<bean class="io.ebean.config.UnderscoreNamingConvention"/>
|
||||
</property>
|
||||
</bean>
|
||||
</beans>
|
||||
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:tx="http://www.springframework.org/schema/tx"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
|
||||
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
|
||||
http://www.springframework.org/schema/context
|
||||
http://www.springframework.org/schema/context/spring-context-2.5.xsd">
|
||||
|
||||
<import resource="classpath:default-ebean-server.xml"/>
|
||||
|
||||
<!-- Transaktionen via Annotation use Springs @Transactional -->
|
||||
<tx:annotation-driven transaction-manager="transactionManager" />
|
||||
<context:annotation-config />
|
||||
|
||||
<bean id="dataSource" class="org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy">
|
||||
<constructor-arg>
|
||||
<bean class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
|
||||
<property name="driverClass" value="org.h2.Driver" />
|
||||
<property name="url"
|
||||
value="jdbc:h2:mem:ebean-testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=false" />
|
||||
</bean>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
|
||||
<!-- Transaction Manager -->
|
||||
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
|
||||
<property name="dataSource" ref="dataSource"/>
|
||||
</bean>
|
||||
|
||||
<bean id="serverConfig" parent="defaultEbeanServerConfig">
|
||||
<property name="name" value="test"/>
|
||||
<property name="classes">
|
||||
<list>
|
||||
<value>org.example.User</value>
|
||||
<value>org.example.Role</value>
|
||||
<value>org.example.Account</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="dataSource" ref="dataSource"/>
|
||||
|
||||
<property name="ddlGenerate" value="true"/>
|
||||
<property name="ddlRun" value="true"/>
|
||||
</bean>
|
||||
|
||||
<!-- Ebean server -->
|
||||
<bean id="ebeanServer" class="org.example.EbeanServerFactoryBean">
|
||||
<property name="serverConfig" ref="serverConfig"/>
|
||||
</bean>
|
||||
|
||||
<bean id="userService" class="org.example.UserServiceImpl">
|
||||
<property name="ebeanServer" ref="ebeanServer"/>
|
||||
</bean>
|
||||
</beans>
|
||||
@@ -0,0 +1,29 @@
|
||||
<configuration scan="true" scanPeriod="10 seconds">
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<root level="INFO">
|
||||
<appender-ref ref="STDOUT"/>
|
||||
</root>
|
||||
|
||||
<logger name="io.ebean" level="INFO"/>
|
||||
|
||||
<!-- sql and transaction logging -->
|
||||
<logger name="io.ebean.SQL" level="TRACE"/>
|
||||
<logger name="io.ebean.TXN" level="TRACE"/>
|
||||
<logger name="io.ebean.SUM" level="TRACE"/>
|
||||
<logger name="io.ebean.DDL" level="TRACE"/>
|
||||
|
||||
<!-- l2 cache logging -->
|
||||
<logger name="io.ebean.cache.QUERY" level="TRACE"/>
|
||||
<logger name="io.ebean.cache.BEAN" level="TRACE"/>
|
||||
<logger name="io.ebean.cache.COLL" level="TRACE"/>
|
||||
<logger name="io.ebean.cache.NATKEY" level="TRACE"/>
|
||||
|
||||
<!-- elasticSearch query logging -->
|
||||
<!--<logger name="io.ebean.ELA" level="TRACE"/>-->
|
||||
|
||||
</configuration>
|
||||
+8
-8
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean test</name>
|
||||
@@ -28,20 +28,20 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-generator</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -118,28 +118,28 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-joda-time</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-jackson-jsonnode</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-jackson-mapper</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-all</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<name>kotlin querybean generator</name>
|
||||
@@ -29,7 +29,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -64,14 +64,14 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-generator</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -100,37 +100,17 @@
|
||||
<goal>test-compile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>test-kapt</id>
|
||||
<goals>
|
||||
<goal>test-kapt</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sourceDirs>
|
||||
<sourceDir>src/test/kotlin</sourceDir>
|
||||
</sourceDirs>
|
||||
<annotationProcessorPaths>
|
||||
<annotationProcessorPath>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>kotlin-querybean-generator</artifactId>
|
||||
<version>13.13.0</version>
|
||||
</annotationProcessorPath>
|
||||
</annotationProcessorPaths>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>compile</id>
|
||||
<phase>compile</phase>
|
||||
<goals>
|
||||
<goal>compile</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sourceDirs>
|
||||
<source>src/main/java</source>
|
||||
<source>target/generated-sources/kapt/test</source>
|
||||
<source>target/generated-sources/kaptKotlin/test</source>
|
||||
</sourceDirs>
|
||||
</configuration>
|
||||
<!-- <configuration>-->
|
||||
<!-- <sourceDirs>-->
|
||||
<!-- <source>src/main/java</source>-->
|
||||
<!-- </sourceDirs>-->
|
||||
<!-- </configuration>-->
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
|
||||
@@ -7,6 +7,7 @@ interface Constants {
|
||||
String GENERATED = "io.ebean.typequery.Generated";
|
||||
|
||||
String MAPPED_SUPERCLASS = "javax.persistence.MappedSuperclass";
|
||||
String DISCRIMINATOR_VALUE = "javax.persistence.DiscriminatorValue";
|
||||
String INHERITANCE = "javax.persistence.Inheritance";
|
||||
String ENTITY = "javax.persistence.Entity";
|
||||
String EMBEDDABLE = "javax.persistence.Embeddable";
|
||||
@@ -19,6 +20,7 @@ interface Constants {
|
||||
String DBNAME = "io.ebean.annotation.DbName";
|
||||
|
||||
String TQROOTBEAN = "io.ebean.typequery.TQRootBean";
|
||||
String TQASSOC = "io.ebean.typequery.TQAssoc";
|
||||
String TQASSOCBEAN = "io.ebean.typequery.TQAssocBean";
|
||||
String TQPROPERTY = "io.ebean.typequery.TQProperty";
|
||||
String TYPEQUERYBEAN = "io.ebean.typequery.TypeQueryBean";
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ class KotlinLangAdapter implements LangAdapter {
|
||||
|
||||
@Override
|
||||
public void beginAssocClass(Append writer, String shortName, String origShortName) {
|
||||
writer.append("class Q%s<R> : TQAssocBean<%s,R> {", shortName, origShortName).eol();
|
||||
// writer.append("class Q%s<R> : TQAssocBean<%s,R> {", shortName, origShortName).eol();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -224,7 +224,7 @@ class ProcessingContext implements Constants {
|
||||
}
|
||||
|
||||
private boolean isMappedSuperOrInheritance(Element mappedSuper) {
|
||||
return hasAnnotations(mappedSuper, MAPPED_SUPERCLASS, INHERITANCE);
|
||||
return hasAnnotations(mappedSuper, MAPPED_SUPERCLASS, INHERITANCE, DISCRIMINATOR_VALUE);
|
||||
}
|
||||
|
||||
private boolean isEntityOrEmbedded(Element mappedSuper) {
|
||||
|
||||
+10
-3
@@ -236,7 +236,11 @@ class SimpleQueryBeanWriter {
|
||||
importTypes.remove(Constants.DATABASE);
|
||||
importTypes.remove(Constants.FETCHGROUP);
|
||||
importTypes.remove(Constants.QUERY);
|
||||
importTypes.add(Constants.TQASSOCBEAN);
|
||||
if (embeddable) {
|
||||
importTypes.add(Constants.TQASSOC);
|
||||
} else {
|
||||
importTypes.add(Constants.TQASSOCBEAN);
|
||||
}
|
||||
if (isEntity()) {
|
||||
importTypes.add(Constants.TQPROPERTY);
|
||||
importTypes.add(origDestPackage + ".Q" + origShortName);
|
||||
@@ -280,7 +284,6 @@ class SimpleQueryBeanWriter {
|
||||
|
||||
private void writeAssocBeanFetch() {
|
||||
if (isEntity()) {
|
||||
lang().fetch(writer, origShortName);
|
||||
//if (implementsInterface != null) {
|
||||
// writeAssocBeanExpression(false, "eq", "Is equal to by ID property.");
|
||||
// writeAssocBeanExpression(true, "eqIfPresent", "Is equal to by ID property if the value is not null, if null no expression is added.");
|
||||
@@ -340,7 +343,11 @@ class SimpleQueryBeanWriter {
|
||||
writer.append(" */").eol();
|
||||
writer.append(Constants.AT_GENERATED).eol();
|
||||
writer.append(Constants.AT_TYPEQUERYBEAN).eol();
|
||||
lang().beginAssocClass(writer, shortName, shortInnerName);
|
||||
if (embeddable) {
|
||||
writer.append("class Q%s<R> : TQAssoc<%s,R> {", shortName, shortInnerName).eol();
|
||||
} else {
|
||||
writer.append("class Q%s<R> : TQAssocBean<%s,R,Q%s> {", shortName, shortInnerName, origShortName).eol();
|
||||
}
|
||||
|
||||
} else {
|
||||
writer.append("/**").eol();
|
||||
|
||||
+14
-14
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>platforms</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-platform-all</artifactId>
|
||||
@@ -14,67 +14,67 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-clickhouse</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-db2</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-hana</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-hsqldb</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-mysql</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-mariadb</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-nuodb</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-oracle</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlanywhere</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlite</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlserver</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>platforms</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-platform-clickhouse</artifactId>
|
||||
@@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>platforms</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-platform-db2</artifactId>
|
||||
@@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>platforms</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
@@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Provided scope so that the H2HistoryTrigger can live in Ebean core
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>platforms</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-platform-hana</artifactId>
|
||||
@@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>platforms</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-platform-hsqldb</artifactId>
|
||||
@@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>platforms</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-platform-mariadb</artifactId>
|
||||
@@ -14,13 +14,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-mysql</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>platforms</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-platform-mysql</artifactId>
|
||||
@@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>platforms</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-platform-nuodb</artifactId>
|
||||
@@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>platforms</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-platform-oracle</artifactId>
|
||||
@@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>platforms</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>platforms</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
@@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>platforms</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-platform-sqlanywhere</artifactId>
|
||||
@@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>platforms</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-platform-sqlite</artifactId>
|
||||
@@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>platforms</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-platform-sqlserver</artifactId>
|
||||
@@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>ebean parent</name>
|
||||
@@ -49,8 +49,8 @@
|
||||
<ebean-migration.version>13.7.0</ebean-migration.version>
|
||||
<ebean-test-containers.version>6.3</ebean-test-containers.version>
|
||||
<ebean-datasource.version>8.5</ebean-datasource.version>
|
||||
<ebean-agent.version>13.13.2</ebean-agent.version>
|
||||
<ebean-maven-plugin.version>13.13.2</ebean-maven-plugin.version>
|
||||
<ebean-agent.version>13.14.1</ebean-agent.version>
|
||||
<ebean-maven-plugin.version>13.14.1</ebean-maven-plugin.version>
|
||||
<surefire.useModulePath>false</surefire.useModulePath>
|
||||
</properties>
|
||||
|
||||
@@ -93,6 +93,7 @@
|
||||
<module>ebean-csv-reader</module>
|
||||
<module>ebean-jackson-jsonnode</module>
|
||||
<module>ebean-jackson-mapper</module>
|
||||
<module>ebean-spring-txn</module>
|
||||
<!-- <module>ebean-kotlin</module>-->
|
||||
|
||||
</modules>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<name>querybean generator</name>
|
||||
|
||||
@@ -8,6 +8,7 @@ interface Constants {
|
||||
String GENERATED = "io.ebean.typequery.Generated";
|
||||
|
||||
String MAPPED_SUPERCLASS = "javax.persistence.MappedSuperclass";
|
||||
String DISCRIMINATOR_VALUE = "javax.persistence.DiscriminatorValue";
|
||||
String INHERITANCE = "javax.persistence.Inheritance";
|
||||
String ENTITY = "javax.persistence.Entity";
|
||||
String EMBEDDABLE = "javax.persistence.Embeddable";
|
||||
@@ -20,6 +21,7 @@ interface Constants {
|
||||
String DBNAME = "io.ebean.annotation.DbName";
|
||||
|
||||
String TQROOTBEAN = "io.ebean.typequery.TQRootBean";
|
||||
String TQASSOC = "io.ebean.typequery.TQAssoc";
|
||||
String TQASSOCBEAN = "io.ebean.typequery.TQAssocBean";
|
||||
String TQPROPERTY = "io.ebean.typequery.TQProperty";
|
||||
String TYPEQUERYBEAN = "io.ebean.typequery.TypeQueryBean";
|
||||
|
||||
+1
-1
@@ -181,7 +181,7 @@ class ProcessingContext implements Constants {
|
||||
}
|
||||
|
||||
private boolean isMappedSuperOrInheritance(Element mappedSuper) {
|
||||
return hasAnnotations(mappedSuper, MAPPED_SUPERCLASS, INHERITANCE);
|
||||
return hasAnnotations(mappedSuper, MAPPED_SUPERCLASS, INHERITANCE, DISCRIMINATOR_VALUE);
|
||||
}
|
||||
|
||||
private boolean isEntityOrEmbedded(Element mappedSuper) {
|
||||
|
||||
+12
-10
@@ -117,7 +117,6 @@ class SimpleQueryBeanWriter {
|
||||
* Write the type query bean (root bean).
|
||||
*/
|
||||
void writeRootBean() throws IOException {
|
||||
|
||||
gatherPropertyDetails();
|
||||
if (isEmbeddable()) {
|
||||
processingContext.addEntity(beanFullName, dbName);
|
||||
@@ -170,7 +169,11 @@ class SimpleQueryBeanWriter {
|
||||
importTypes.remove(Constants.DATABASE);
|
||||
importTypes.remove(Constants.FETCHGROUP);
|
||||
importTypes.remove(Constants.QUERY);
|
||||
importTypes.add(Constants.TQASSOCBEAN);
|
||||
if (embeddable) {
|
||||
importTypes.add(Constants.TQASSOC);
|
||||
} else {
|
||||
importTypes.add(Constants.TQASSOCBEAN);
|
||||
}
|
||||
if (isEntity()) {
|
||||
importTypes.add(Constants.TQPROPERTY);
|
||||
importTypes.add(origDestPackage + ".Q" + origShortName);
|
||||
@@ -288,10 +291,7 @@ class SimpleQueryBeanWriter {
|
||||
|
||||
private void writeAssocBeanFetch() {
|
||||
if (isEntity()) {
|
||||
writeAssocBeanFetch("", "Eagerly fetch this association loading the specified properties.");
|
||||
writeAssocBeanFetch("Query", "Eagerly fetch this association using a 'query join' loading the specified properties.");
|
||||
writeAssocBeanFetch("Cache", "Eagerly fetch this association using L2 cache.");
|
||||
writeAssocBeanFetch("Lazy", "Use lazy loading for this association loading the specified properties.");
|
||||
// inherit the fetch methods
|
||||
if (implementsInterface != null) {
|
||||
writeAssocBeanExpression(false, "eq", "Is equal to by ID property.");
|
||||
writeAssocBeanExpression(true, "eqIfPresent", "Is equal to by ID property if the value is not null, if null no expression is added.");
|
||||
@@ -367,8 +367,11 @@ class SimpleQueryBeanWriter {
|
||||
writer.append(" */").eol();
|
||||
writer.append(Constants.AT_GENERATED).eol();
|
||||
writer.append(Constants.AT_TYPEQUERYBEAN).eol();
|
||||
writer.append("public class Q%s<R> extends TQAssocBean<%s,R> {", shortName, shortInnerName).eol();
|
||||
|
||||
if (embeddable) {
|
||||
writer.append("public final class Q%s<R> extends TQAssoc<%s,R> {", shortName, shortInnerName).eol();
|
||||
} else {
|
||||
writer.append("public final class Q%s<R> extends TQAssocBean<%s,R,Q%s> {", shortName, shortInnerName, origShortName).eol();
|
||||
}
|
||||
} else {
|
||||
writer.append("/**").eol();
|
||||
writer.append(" * Query bean for %s.", shortName).eol();
|
||||
@@ -377,7 +380,7 @@ class SimpleQueryBeanWriter {
|
||||
writer.append(" */").eol();
|
||||
writer.append(Constants.AT_GENERATED).eol();
|
||||
writer.append(Constants.AT_TYPEQUERYBEAN).eol();
|
||||
writer.append("public class Q%s extends TQRootBean<%1$s,Q%1$s> {", shortName).eol();
|
||||
writer.append("public final class Q%s extends TQRootBean<%1$s,Q%1$s> {", shortName).eol();
|
||||
}
|
||||
|
||||
writer.eol();
|
||||
@@ -420,7 +423,6 @@ class SimpleQueryBeanWriter {
|
||||
* Write all the imports.
|
||||
*/
|
||||
private void writeImports() {
|
||||
|
||||
for (String importType : importTypes) {
|
||||
writer.append("import %s;", importType).eol();
|
||||
}
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>tests</artifactId>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>tests</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>test-java16</artifactId>
|
||||
@@ -18,7 +18,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -30,7 +30,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
<path>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>querybean-generator</artifactId>
|
||||
<version>13.13.1</version>
|
||||
<version>13.14.1-SNAPSHOT</version>
|
||||
</path>
|
||||
</annotationProcessorPaths>
|
||||
</configuration>
|
||||
@@ -65,7 +65,7 @@
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<tiles>
|
||||
<tile>io.ebean.tile:enhancement:13.12.0</tile>
|
||||
<tile>io.ebean.tile:enhancement:13.14.0</tile>
|
||||
</tiles>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
+94
-46
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<artifactId>tests</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>test-kotlin</artifactId>
|
||||
@@ -16,15 +16,31 @@
|
||||
<maven.compiler.target>11</maven.compiler.target>
|
||||
|
||||
<ebean-maven-plugin.version>13.13.0</ebean-maven-plugin.version>
|
||||
<kotlin.version>1.6.0</kotlin.version>
|
||||
<kotlin.version>1.7.22</kotlin.version>
|
||||
<jackson.version>2.12.1</jackson.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-stdlib-jdk8</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
<version>1.2.10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.validation</groupId>
|
||||
<artifactId>validation-api</artifactId>
|
||||
<version>2.0.1.Final</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<version>13.14.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -37,28 +53,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.13.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
<version>1.2.10</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-stdlib-jdk8</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
<version>13.14.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -68,9 +63,11 @@
|
||||
<version>${kotlin.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<sourceDirectory>src/main/kotlin</sourceDirectory>
|
||||
<testSourceDirectory>src/test/kotlin</testSourceDirectory>
|
||||
<plugins>
|
||||
<plugin>
|
||||
@@ -78,40 +75,91 @@
|
||||
<artifactId>kotlin-maven-plugin</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
<configuration>
|
||||
<jvmTarget>11</jvmTarget>
|
||||
<jvmTarget>${maven.compiler.target}</jvmTarget>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>test-compile</id>
|
||||
<id>kapt</id>
|
||||
<goals>
|
||||
<goal>test-compile</goal>
|
||||
<goal>kapt</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sourceDirs>
|
||||
<sourceDir>src/main/kotlin</sourceDir>
|
||||
</sourceDirs>
|
||||
<annotationProcessorPaths>
|
||||
<annotationProcessorPath>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>kotlin-querybean-generator</artifactId>
|
||||
<version>13.14.0</version>
|
||||
</annotationProcessorPath>
|
||||
</annotationProcessorPaths>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>compile</id>
|
||||
<phase>compile</phase>
|
||||
<goals>
|
||||
<goal>compile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<!-- <execution>-->
|
||||
<!-- <id>test-kapt</id>-->
|
||||
<!-- <goals>-->
|
||||
<!-- <goal>test-kapt</goal>-->
|
||||
<!-- </goals>-->
|
||||
<!-- <configuration>-->
|
||||
<!-- <sourceDirs>-->
|
||||
<!-- <sourceDir>src/test/kotlin</sourceDir>-->
|
||||
<!-- </sourceDirs>-->
|
||||
<!-- <annotationProcessorPaths>-->
|
||||
<!-- <annotationProcessorPath>-->
|
||||
<!-- <groupId>io.ebean</groupId>-->
|
||||
<!-- <artifactId>kotlin-querybean-generator</artifactId>-->
|
||||
<!-- <version>13.13.2</version>-->
|
||||
<!-- </annotationProcessorPath>-->
|
||||
<!-- </annotationProcessorPaths>-->
|
||||
<!-- </configuration>-->
|
||||
<!-- </execution>-->
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>${maven-compiler-plugin.version}</version>
|
||||
<configuration>
|
||||
<release>${java.release}</release>
|
||||
</configuration>
|
||||
<executions>
|
||||
<!-- Replacing default-compile as it is treated specially by maven -->
|
||||
<execution>
|
||||
<id>default-compile</id>
|
||||
<phase>none</phase>
|
||||
<configuration/>
|
||||
</execution>
|
||||
<!-- Replacing default-testCompile as it is treated specially by maven -->
|
||||
<execution>
|
||||
<id>default-testCompile</id>
|
||||
<phase>none</phase>
|
||||
<configuration/>
|
||||
</execution>
|
||||
<execution>
|
||||
<configuration/>
|
||||
<id>java-compile</id>
|
||||
<phase>compile</phase>
|
||||
<goals>
|
||||
<goal>compile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<configuration/>
|
||||
<id>java-test-compile</id>
|
||||
<phase>test-compile</phase>
|
||||
<goals>
|
||||
<goal>testCompile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-maven-plugin</artifactId>
|
||||
<version>${ebean-maven-plugin.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>main</id>
|
||||
<phase>process-classes</phase>
|
||||
<configuration>
|
||||
<transformArgs>debug=1</transformArgs>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>enhance</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>test</id>
|
||||
<phase>process-test-classes</phase>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user