mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Compare commits
90
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
96e3c95c29 | ||
|
|
e6e25b979f | ||
|
|
50fd0f6b1a | ||
|
|
0e9b83a1ce | ||
|
|
d2f629e7bb | ||
|
|
e290f68b29 | ||
|
|
a17e62b491 | ||
|
|
928db1f0f6 | ||
|
|
c317092dc5 | ||
|
|
95512d4851 | ||
|
|
62ed5a9f2b | ||
|
|
37ba0b63e4 | ||
|
|
22a5bd9b9d | ||
|
|
45529958ef | ||
|
|
7aa64f47c8 | ||
|
|
919adf331a | ||
|
|
9f229e3cc2 | ||
|
|
3277fe81a1 | ||
|
|
6c6ec3663a | ||
|
|
0461580d1c | ||
|
|
75dbb58c85 | ||
|
|
808f69cac1 | ||
|
|
974953a376 | ||
|
|
f85a367e98 | ||
|
|
87a3c58d93 | ||
|
|
1d1aea77d0 | ||
|
|
2a02935cee | ||
|
|
fd2e5c0fc7 | ||
|
|
6d6b07bf87 | ||
|
|
2cac3cd0bb | ||
|
|
d56098dbf0 | ||
|
|
07682c97a7 | ||
|
|
331a9152aa | ||
|
|
e87a06a713 | ||
|
|
3b5393dca6 | ||
|
|
101c5e52b1 | ||
|
|
5d3bcf4008 | ||
|
|
dd7605ac3a | ||
|
|
47dfbb6157 | ||
|
|
013123c1a7 | ||
|
|
cbc463cd10 | ||
|
|
6e9a8704b4 | ||
|
|
0fd2f34ed0 | ||
|
|
72f1ab18cc | ||
|
|
b1bba9da5d | ||
|
|
8966faeb7e | ||
|
|
fed4413259 | ||
|
|
14dddb4866 | ||
|
|
d7d6082038 | ||
|
|
c96357377b | ||
|
|
2789d0f97c | ||
|
|
79cd1da9a4 | ||
|
|
759cf18c41 | ||
|
|
0a61852711 | ||
|
|
6f5e144a93 | ||
|
|
391b33beae | ||
|
|
08e1a05bc9 | ||
|
|
f145aaa1e2 | ||
|
|
245ba9c6b3 | ||
|
|
66f4055b8f | ||
|
|
5170b9f329 | ||
|
|
3a2b20eb43 | ||
|
|
dd0ed8ea76 | ||
|
|
600aa10453 | ||
|
|
f6b87ed0b4 | ||
|
|
b300db77ff | ||
|
|
3f5800da3b | ||
|
|
c5612d50fe | ||
|
|
30bdfc4755 | ||
|
|
8fd24491da | ||
|
|
61deb2517c | ||
|
|
faa58f0fe4 | ||
|
|
d2bb985016 | ||
|
|
d190cd3a08 | ||
|
|
c8853cda58 | ||
|
|
e2d75f4c2e | ||
|
|
b56fa851e0 | ||
|
|
a82ba6d4aa | ||
|
|
359f8b41fe | ||
|
|
22e1403f43 | ||
|
|
9d60ebd19e | ||
|
|
87a27da2b9 | ||
|
|
f8c6a3c960 | ||
|
|
f4c747c6af | ||
|
|
7152cf656b | ||
|
|
c855df8b8d | ||
|
|
d710925cc7 | ||
|
|
f24f912693 | ||
|
|
8f9772e493 | ||
|
|
3c298a67ff |
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-clickhouse</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-clickhouse</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.0</tag>
|
||||
<tag>ebean-parent-13.11.0</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-cockroach</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.0</tag>
|
||||
<tag>ebean-parent-13.11.0</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-db2</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-db2</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.0</tag>
|
||||
<tag>ebean-parent-13.11.0</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-h2</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.0</tag>
|
||||
<tag>ebean-parent-13.11.0</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-hana</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-hana</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.0</tag>
|
||||
<tag>ebean-parent-13.11.0</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-mariadb</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-mariadb</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.0</tag>
|
||||
<tag>ebean-parent-13.11.0</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-mysql</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-mysql</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.0</tag>
|
||||
<tag>ebean-parent-13.11.0</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-nuodb</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-nuodb</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.0</tag>
|
||||
<tag>ebean-parent-13.11.0</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-oracle</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-oracle</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.0</tag>
|
||||
<tag>ebean-parent-13.11.0</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-postgres</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.0</tag>
|
||||
<tag>ebean-parent-13.11.0</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-sqlite</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlite</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.0</tag>
|
||||
<tag>ebean-parent-13.11.0</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-sqlserver</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlserver</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.0</tag>
|
||||
<tag>ebean-parent-13.11.0</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-yugabyte</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.0</tag>
|
||||
<tag>ebean-parent-13.11.0</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean (all platforms)</name>
|
||||
@@ -16,31 +16,31 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-joda-time</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-jackson-jsonnode</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-jackson-mapper</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -53,18 +53,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-all</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.0</tag>
|
||||
<tag>ebean-parent-13.11.0</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>composites</artifactId>
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean api</name>
|
||||
@@ -29,7 +29,7 @@
|
||||
<dependency>
|
||||
<groupId>io.avaje</groupId>
|
||||
<artifactId>avaje-config</artifactId>
|
||||
<version>2.2</version>
|
||||
<version>2.4</version>
|
||||
</dependency>
|
||||
|
||||
<!--
|
||||
|
||||
@@ -129,6 +129,11 @@ public interface DtoQuery<T> extends CancelableQuery {
|
||||
*/
|
||||
DtoQuery<T> setParameter(String name, Object value);
|
||||
|
||||
/**
|
||||
* Bind the named parameter to SQL NULL.
|
||||
*/
|
||||
DtoQuery<T> setNullParameter(String name, int jdbcType);
|
||||
|
||||
/**
|
||||
* Bind the named multi-value array parameter which we would use with Postgres ANY.
|
||||
* <p>
|
||||
@@ -141,6 +146,11 @@ public interface DtoQuery<T> extends CancelableQuery {
|
||||
*/
|
||||
DtoQuery<T> setParameter(int position, Object value);
|
||||
|
||||
/**
|
||||
* Set a positioned parameter to SQL NULL.
|
||||
*/
|
||||
DtoQuery<T> setNullParameter(int position, int jdbcType);
|
||||
|
||||
/**
|
||||
* Set the index of the first row of the results to return.
|
||||
*/
|
||||
|
||||
@@ -117,6 +117,11 @@ public interface ExpressionFactory {
|
||||
*/
|
||||
Expression arrayIsNotEmpty(String propertyName);
|
||||
|
||||
/**
|
||||
* Equal To the result of a sub-query.
|
||||
*/
|
||||
Expression eq(String propertyName, Query<?> subQuery);
|
||||
|
||||
/**
|
||||
* Equal To - property equal to the given value.
|
||||
*/
|
||||
@@ -127,6 +132,11 @@ public interface ExpressionFactory {
|
||||
*/
|
||||
Expression eqOrNull(String propertyName, Object value);
|
||||
|
||||
/**
|
||||
* Not Equal To the result of a sub-query.
|
||||
*/
|
||||
Expression ne(String propertyName, Query<?> subQuery);
|
||||
|
||||
/**
|
||||
* Not Equal To - property not equal to the given value.
|
||||
*/
|
||||
@@ -181,6 +191,23 @@ public interface ExpressionFactory {
|
||||
*/
|
||||
Expression inRangeWith(String lowProperty, String highProperty, Object value);
|
||||
|
||||
/**
|
||||
* A Property is in Range between 2 properties.
|
||||
*
|
||||
* <pre>{@code
|
||||
*
|
||||
* .orderDate.inRangeWith(QOrder.Alias.product.startDate, QOrder.Alias.product.endDate)
|
||||
*
|
||||
* // which equates to
|
||||
* product.startDate <= orderDate and (orderDate < product.endDate or product.endDate is null)
|
||||
*
|
||||
* }</pre>
|
||||
*
|
||||
* <p>
|
||||
* This is a convenience expression combining a number of simple expressions.
|
||||
*/
|
||||
Expression inRangeWithProperties(String propertyName, String lowProperty, String highProperty);
|
||||
|
||||
/**
|
||||
* Between - property between the two given values.
|
||||
*/
|
||||
@@ -207,11 +234,21 @@ public interface ExpressionFactory {
|
||||
*/
|
||||
Expression geOrNull(String propertyName, Object value);
|
||||
|
||||
/**
|
||||
* Greater Than the result of a sub-query.
|
||||
*/
|
||||
Expression gt(String propertyName, Query<?> subQuery);
|
||||
|
||||
/**
|
||||
* Greater Than - property greater than the given value.
|
||||
*/
|
||||
Expression gt(String propertyName, Object value);
|
||||
|
||||
/**
|
||||
* Greater Than or Equal to the result of a sub-query.
|
||||
*/
|
||||
Expression ge(String propertyName, Query<?> subQuery);
|
||||
|
||||
/**
|
||||
* Greater Than or Equal to - property greater than or equal to the given
|
||||
* value.
|
||||
@@ -234,11 +271,21 @@ public interface ExpressionFactory {
|
||||
*/
|
||||
Expression leOrNull(String propertyName, Object value);
|
||||
|
||||
/**
|
||||
* Less Than the result of a sub-query.
|
||||
*/
|
||||
Expression lt(String propertyName, Query<?> subQuery);
|
||||
|
||||
/**
|
||||
* Less Than - property less than the given value.
|
||||
*/
|
||||
Expression lt(String propertyName, Object value);
|
||||
|
||||
/**
|
||||
* Less Than or Equal to the result of a sub-query.
|
||||
*/
|
||||
Expression le(String propertyName, Query<?> subQuery);
|
||||
|
||||
/**
|
||||
* Less Than or Equal to - property less than or equal to the given value.
|
||||
*/
|
||||
|
||||
@@ -830,6 +830,11 @@ public interface ExpressionList<T> {
|
||||
*/
|
||||
ExpressionList<T> addAll(ExpressionList<T> exprList);
|
||||
|
||||
/**
|
||||
* Equal To the result of a sub-query.
|
||||
*/
|
||||
ExpressionList<T> eq(String propertyName, Query<?> subQuery);
|
||||
|
||||
/**
|
||||
* Equal To - property is equal to a given value.
|
||||
*/
|
||||
@@ -854,6 +859,11 @@ public interface ExpressionList<T> {
|
||||
*/
|
||||
ExpressionList<T> eqOrNull(String propertyName, Object value);
|
||||
|
||||
/**
|
||||
* Not Equal To the result of a sub-query.
|
||||
*/
|
||||
ExpressionList<T> ne(String propertyName, Query<?> subQuery);
|
||||
|
||||
/**
|
||||
* Not Equal To - property not equal to the given value.
|
||||
*/
|
||||
@@ -890,6 +900,23 @@ public interface ExpressionList<T> {
|
||||
*/
|
||||
ExpressionList<T> inRangeWith(String lowProperty, String highProperty, Object value);
|
||||
|
||||
/**
|
||||
* A Property is in Range between 2 properties.
|
||||
*
|
||||
* <pre>{@code
|
||||
*
|
||||
* .orderDate.inRangeWith(QOrder.Alias.product.startDate, QOrder.Alias.product.endDate)
|
||||
*
|
||||
* // which equates to
|
||||
* product.startDate <= orderDate and (orderDate < product.endDate or product.endDate is null)
|
||||
*
|
||||
* }</pre>
|
||||
*
|
||||
* <p>
|
||||
* This is a convenience expression combining a number of simple expressions.
|
||||
*/
|
||||
ExpressionList<T> inRangeWithProperties(String propertyName, String lowProperty, String highProperty);
|
||||
|
||||
/**
|
||||
* In Range - {@code property >= value1 and property < value2}.
|
||||
* <p>
|
||||
@@ -908,6 +935,11 @@ public interface ExpressionList<T> {
|
||||
*/
|
||||
ExpressionList<T> betweenProperties(String lowProperty, String highProperty, Object value);
|
||||
|
||||
/**
|
||||
* Greater Than the result of a sub-query.
|
||||
*/
|
||||
ExpressionList<T> gt(String propertyName, Query<?> subQuery);
|
||||
|
||||
/**
|
||||
* Greater Than - property greater than the given value.
|
||||
*/
|
||||
@@ -923,12 +955,22 @@ public interface ExpressionList<T> {
|
||||
*/
|
||||
ExpressionList<T> geOrNull(String propertyName, Object value);
|
||||
|
||||
/**
|
||||
* Greater Than or Equal to the result of a sub-query.
|
||||
*/
|
||||
ExpressionList<T> ge(String propertyName, Query<?> subQuery);
|
||||
|
||||
/**
|
||||
* Greater Than or Equal to - property greater than or equal to the given
|
||||
* value.
|
||||
*/
|
||||
ExpressionList<T> ge(String propertyName, Object value);
|
||||
|
||||
/**
|
||||
* Less Than the result of a sub-query.
|
||||
*/
|
||||
ExpressionList<T> lt(String propertyName, Query<?> subQuery);
|
||||
|
||||
/**
|
||||
* Less Than - property less than the given value.
|
||||
*/
|
||||
@@ -944,6 +986,11 @@ public interface ExpressionList<T> {
|
||||
*/
|
||||
ExpressionList<T> leOrNull(String propertyName, Object value);
|
||||
|
||||
/**
|
||||
* Less Than or Equal to the result of a sub-query.
|
||||
*/
|
||||
ExpressionList<T> le(String propertyName, Query<?> subQuery);
|
||||
|
||||
/**
|
||||
* Less Than or Equal to - property less than or equal to the given value.
|
||||
*/
|
||||
|
||||
@@ -6,7 +6,6 @@ import java.util.Set;
|
||||
* Notification event that dependent tables have been modified.
|
||||
* <p>
|
||||
* This is sent to other interested servers (in the cluster).
|
||||
* </p>
|
||||
*/
|
||||
public class ServerCacheNotification {
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import io.ebean.config.DatabaseConfig;
|
||||
* Plugin that provides a ServerCacheNotify implementation.
|
||||
* <p>
|
||||
* Is supplied this will be used to send the ServerCacheNotification event to other cluster members.
|
||||
* </p>
|
||||
*/
|
||||
public interface ServerCacheNotifyPlugin {
|
||||
|
||||
|
||||
@@ -6,6 +6,10 @@ import java.util.concurrent.Callable;
|
||||
* BackgroundExecutorWrapper that can be used to wrap tasks that are sent to background (i.e. another thread).
|
||||
* It should copy all necessary thread-local variables. See {@link MdcBackgroundExecutorWrapper} for implementation details.
|
||||
*
|
||||
* Note: only tasks that are executed immediately (submit, execute) are wrapped. Periodic or scheduled tasks are not wrapped,
|
||||
* as these may keep copied variables in memory either forever or until the scheduled task is finished.
|
||||
* The caller is responsible to handle these cases.
|
||||
*
|
||||
* @author Roland Praml, FOCONIS AG
|
||||
*/
|
||||
public interface BackgroundExecutorWrapper {
|
||||
|
||||
@@ -32,13 +32,11 @@ import java.util.function.Function;
|
||||
* <p>
|
||||
* Used to programmatically construct an Database and optionally register it
|
||||
* with the DB singleton.
|
||||
* </p>
|
||||
* <p>
|
||||
* If you just use DB thout this programmatic configuration Ebean will read
|
||||
* the application.properties file and take the configuration from there. This usually
|
||||
* includes searching the class path and automatically registering any entity
|
||||
* classes and listeners etc.
|
||||
* </p>
|
||||
* <pre>{@code
|
||||
*
|
||||
* DatabaseConfig config = new DatabaseConfig();
|
||||
@@ -58,7 +56,6 @@ import java.util.function.Function;
|
||||
* <p>
|
||||
* Note that DatabaseConfigProvider provides a standard Java ServiceLoader mechanism that can
|
||||
* be used to apply configuration to the DatabaseConfig.
|
||||
* </p>
|
||||
*
|
||||
* @author emcgreal
|
||||
* @author rbygrave
|
||||
@@ -615,7 +612,7 @@ public class DatabaseConfig {
|
||||
}
|
||||
|
||||
/**
|
||||
* Put a service object into configuration such that it can be passed to a plugin.
|
||||
* Put a service object into configuration such that it can be used by ebean or a plugin.
|
||||
* <p>
|
||||
* For example, put IgniteConfiguration in to be passed to the Ignite plugin.
|
||||
*/
|
||||
@@ -623,6 +620,23 @@ public class DatabaseConfig {
|
||||
serviceObject.put(key, configObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* Put a service object into configuration such that it can be used by ebean or a plugin.
|
||||
* <p>
|
||||
* For example, put IgniteConfiguration in to be passed to the Ignite plugin.
|
||||
* You can also override some SPI objects that should be used for that Database. Currently, the following
|
||||
* objects are possible.
|
||||
* <ul>
|
||||
* <li>DataSourceAlertFactory (e.g. add different alert factories for different ebean instances)</li>
|
||||
* <li>DocStoreFactory</li>
|
||||
* <li>SlowQueryListener (e.g. add custom query listener for a certain ebean instance)</li>
|
||||
* <li>ServerCacheNotifyPlugin</li>
|
||||
* </ul>
|
||||
*/
|
||||
public <T> void putServiceObject(Class<T> iface, T configObject) {
|
||||
serviceObject.put(serviceObjectKey(iface), configObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the service object given the key.
|
||||
*/
|
||||
@@ -631,7 +645,7 @@ public class DatabaseConfig {
|
||||
}
|
||||
|
||||
/**
|
||||
* Put a service object into configuration such that it can be passed to a plugin.
|
||||
* Put a service object into configuration such that it can be used by ebean or a plugin.
|
||||
*
|
||||
* <pre>{@code
|
||||
*
|
||||
@@ -656,7 +670,7 @@ public class DatabaseConfig {
|
||||
}
|
||||
|
||||
/**
|
||||
* Used by plugins to obtain service objects.
|
||||
* Used by ebean or plugins to obtain service objects.
|
||||
*
|
||||
* <pre>{@code
|
||||
*
|
||||
|
||||
+5
-10
@@ -1,20 +1,16 @@
|
||||
package io.ebean.platform.db2;
|
||||
package io.ebean.config.dbplatform;
|
||||
|
||||
import io.ebean.config.dbplatform.SqlLimitRequest;
|
||||
import io.ebean.config.dbplatform.SqlLimitResponse;
|
||||
import io.ebean.config.dbplatform.SqlLimiter;
|
||||
|
||||
public class Db2SqlLimiter implements SqlLimiter {
|
||||
public final class AnsiSqlRowsLimiter implements SqlLimiter {
|
||||
|
||||
@Override
|
||||
public SqlLimitResponse limit(SqlLimitRequest request) {
|
||||
|
||||
StringBuilder sb = new StringBuilder(512);
|
||||
String dbSql = request.getDbSql();
|
||||
StringBuilder sb = new StringBuilder(50 + dbSql.length());
|
||||
sb.append("select ");
|
||||
if (request.isDistinct()) {
|
||||
sb.append("distinct ");
|
||||
}
|
||||
sb.append(request.getDbSql());
|
||||
sb.append(dbSql);
|
||||
int firstRow = request.getFirstRow();
|
||||
if (firstRow > 0) {
|
||||
sb.append(" offset ").append(firstRow).append(" rows");
|
||||
@@ -23,7 +19,6 @@ public class Db2SqlLimiter implements SqlLimiter {
|
||||
if (maxRows > 0) {
|
||||
sb.append(" fetch next ").append(maxRows).append(" rows only");
|
||||
}
|
||||
|
||||
String sql = request.getDbPlatform().completeSql(sb.toString(), request.getOrmQuery());
|
||||
return new SqlLimitResponse(sql);
|
||||
}
|
||||
@@ -3,42 +3,25 @@ package io.ebean.config.dbplatform;
|
||||
/**
|
||||
* Adds LIMIT OFFSET clauses to a SQL query.
|
||||
*/
|
||||
public class LimitOffsetSqlLimiter implements SqlLimiter {
|
||||
|
||||
/**
|
||||
* LIMIT keyword.
|
||||
*/
|
||||
private static final String LIMIT = "limit";
|
||||
|
||||
/**
|
||||
* OFFSET keyword.
|
||||
*/
|
||||
private static final String OFFSET = "offset";
|
||||
public final class LimitOffsetSqlLimiter implements SqlLimiter {
|
||||
|
||||
@Override
|
||||
public SqlLimitResponse limit(SqlLimitRequest request) {
|
||||
|
||||
String dbSql = request.getDbSql();
|
||||
|
||||
StringBuilder sb = new StringBuilder(50 + dbSql.length());
|
||||
sb.append("select ");
|
||||
if (request.isDistinct()) {
|
||||
sb.append("distinct ");
|
||||
}
|
||||
|
||||
sb.append(dbSql);
|
||||
|
||||
int firstRow = request.getFirstRow();
|
||||
int maxRows = request.getMaxRows();
|
||||
|
||||
if (maxRows > 0 || firstRow > 0) {
|
||||
sb.append(" ").append(LIMIT).append(" ").append(maxRows);
|
||||
if (firstRow > 0) {
|
||||
sb.append(" ").append(OFFSET).append(" ");
|
||||
sb.append(firstRow);
|
||||
}
|
||||
if (maxRows > 0) {
|
||||
sb.append(" limit ").append(maxRows);
|
||||
}
|
||||
int firstRow = request.getFirstRow();
|
||||
if (firstRow > 0) {
|
||||
sb.append(" offset ").append(firstRow);
|
||||
}
|
||||
|
||||
String sql = request.getDbPlatform().completeSql(sb.toString(), request.getOrmQuery());
|
||||
return new SqlLimitResponse(sql);
|
||||
}
|
||||
|
||||
@@ -5,14 +5,6 @@ package io.ebean.config.dbplatform;
|
||||
*/
|
||||
public interface SqlLimiter {
|
||||
|
||||
/**
|
||||
* the new line character used.
|
||||
* <p>
|
||||
* Note that this is removed for logging sql to the transaction log.
|
||||
* </p>
|
||||
*/
|
||||
char NEW_LINE = '\n';
|
||||
|
||||
/**
|
||||
* Add the SQL limiting statements around the query.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</parent>
|
||||
<!-- <parent>-->
|
||||
<!-- <groupId>org.avaje</groupId>-->
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
<scm>
|
||||
<developerConnection>scm:git:git@github.com:ebean-orm/ebean.git</developerConnection>
|
||||
<tag>ebean-parent-13.10.0</tag>
|
||||
<tag>ebean-parent-13.11.0</tag>
|
||||
</scm>
|
||||
|
||||
<name>ebean autotune</name>
|
||||
@@ -26,7 +26,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<tiles>
|
||||
<tile>io.ebean.tile:enhancement:13.6.5</tile>
|
||||
<tile>io.ebean.tile:enhancement:13.10.1</tile>
|
||||
</tiles>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
+1
-1
@@ -148,7 +148,7 @@ public class BaseQueryTuner {
|
||||
case UPDATE:
|
||||
case DELETE:
|
||||
case SQ_EXISTS:
|
||||
case SQ_IN:
|
||||
case SQ_EX:
|
||||
return false;
|
||||
default:
|
||||
// not using autoTune when explicitly loading the l2 bean cache
|
||||
|
||||
+104
-18
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean bom</name>
|
||||
@@ -89,106 +89,192 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-joda-time</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-jackson-jsonnode</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-jackson-mapper</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-generator</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-externalmapping-api</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-externalmapping-xml</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-autotune</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>querybean-generator</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>kotlin-querybean-generator</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-postgis</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-redis</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- platforms -->
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-all</artifactId>
|
||||
<version>13.11.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-clickhouse</artifactId>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-db2</artifactId>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-h2</artifactId>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-hana</artifactId>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-hsqldb</artifactId>
|
||||
<version>13.11.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-mariadb</artifactId>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-mysql</artifactId>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-nuodb</artifactId>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-oracle</artifactId>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-postgres</artifactId>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-sqlanywhere</artifactId>
|
||||
<version>13.11.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-sqlite</artifactId>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-sqlserver</artifactId>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
@@ -16,7 +16,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -30,7 +30,7 @@
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>42.4.1</version>
|
||||
<version>42.4.3</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
|
||||
+9
-9
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-core</artifactId>
|
||||
@@ -15,14 +15,14 @@
|
||||
|
||||
<scm>
|
||||
<developerConnection>scm:git:git@github.com:ebean-orm/ebean.git</developerConnection>
|
||||
<tag>ebean-parent-13.10.0</tag>
|
||||
<tag>ebean-parent-13.11.0</tag>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -46,13 +46,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-externalmapping-api</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -135,7 +135,7 @@
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>42.5.0</version>
|
||||
<version>42.5.1</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
@@ -143,21 +143,21 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlserver</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -103,14 +103,14 @@ public interface SpiQuery<T> extends Query<T>, SpiQueryFetch, TxnProfileEventCod
|
||||
COUNT(FIND_COUNT, "findCount"),
|
||||
|
||||
/**
|
||||
* A subquery used as part of an exists where clause.
|
||||
* A sub-query used as part of an exists where clause.
|
||||
*/
|
||||
SQ_EXISTS(FIND_SUBQUERY, "sqExists", false, false),
|
||||
|
||||
/**
|
||||
* A subquery used as part of an in where clause.
|
||||
* A sub-query expression used as part of where clause.
|
||||
*/
|
||||
SQ_IN(FIND_SUBQUERY, "sqIn", false, false),
|
||||
SQ_EX(FIND_SUBQUERY, "sqEx", false, false),
|
||||
|
||||
/**
|
||||
* Delete query.
|
||||
@@ -759,6 +759,11 @@ public interface SpiQuery<T> extends Query<T>, SpiQueryFetch, TxnProfileEventCod
|
||||
*/
|
||||
BindParams getBindParams();
|
||||
|
||||
/**
|
||||
* Return the bind parameters ensuring it is initialised.
|
||||
*/
|
||||
BindParams initBindParams();
|
||||
|
||||
/**
|
||||
* Replace the query detail. This is used by the AutoTune feature to as a
|
||||
* fast way to set the query properties and joins.
|
||||
|
||||
@@ -115,88 +115,88 @@ public class DataBind implements DataBinder {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setString(String s) throws SQLException {
|
||||
pstmt.setString(++pos, s);
|
||||
public void setString(String value) throws SQLException {
|
||||
pstmt.setString(++pos, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void setInt(int i) throws SQLException {
|
||||
pstmt.setInt(++pos, i);
|
||||
public final void setInt(int value) throws SQLException {
|
||||
pstmt.setInt(++pos, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void setLong(long i) throws SQLException {
|
||||
pstmt.setLong(++pos, i);
|
||||
public final void setLong(long value) throws SQLException {
|
||||
pstmt.setLong(++pos, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void setShort(short i) throws SQLException {
|
||||
pstmt.setShort(++pos, i);
|
||||
public final void setShort(short value) throws SQLException {
|
||||
pstmt.setShort(++pos, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void setFloat(float i) throws SQLException {
|
||||
pstmt.setFloat(++pos, i);
|
||||
public final void setFloat(float value) throws SQLException {
|
||||
pstmt.setFloat(++pos, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void setDouble(double i) throws SQLException {
|
||||
pstmt.setDouble(++pos, i);
|
||||
public final void setDouble(double value) throws SQLException {
|
||||
pstmt.setDouble(++pos, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void setBigDecimal(BigDecimal v) throws SQLException {
|
||||
pstmt.setBigDecimal(++pos, v);
|
||||
public final void setBigDecimal(BigDecimal value) throws SQLException {
|
||||
pstmt.setBigDecimal(++pos, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void setDate(java.sql.Date v) throws SQLException {
|
||||
public final void setDate(java.sql.Date value) throws SQLException {
|
||||
Calendar timeZone = dataTimeZone.getTimeComponentTimeZone();
|
||||
if (timeZone != null) {
|
||||
pstmt.setDate(++pos, v, timeZone);
|
||||
pstmt.setDate(++pos, value, timeZone);
|
||||
} else {
|
||||
pstmt.setDate(++pos, v);
|
||||
pstmt.setDate(++pos, value);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void setTimestamp(Timestamp v) throws SQLException {
|
||||
public final void setTimestamp(Timestamp value) throws SQLException {
|
||||
Calendar timeZone = dataTimeZone.getTimeZone();
|
||||
if (timeZone != null) {
|
||||
pstmt.setTimestamp(++pos, v, timeZone);
|
||||
pstmt.setTimestamp(++pos, value, timeZone);
|
||||
} else {
|
||||
pstmt.setTimestamp(++pos, v);
|
||||
pstmt.setTimestamp(++pos, value);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void setTime(Time v) throws SQLException {
|
||||
public final void setTime(Time value) throws SQLException {
|
||||
Calendar timeZone = dataTimeZone.getTimeComponentTimeZone();
|
||||
if (timeZone != null) {
|
||||
pstmt.setTime(++pos, v, timeZone);
|
||||
pstmt.setTime(++pos, value, timeZone);
|
||||
} else {
|
||||
pstmt.setTime(++pos, v);
|
||||
pstmt.setTime(++pos, value);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBoolean(boolean v) throws SQLException {
|
||||
pstmt.setBoolean(++pos, v);
|
||||
public void setBoolean(boolean value) throws SQLException {
|
||||
pstmt.setBoolean(++pos, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBytes(byte[] v) throws SQLException {
|
||||
pstmt.setBytes(++pos, v);
|
||||
public void setBytes(byte[] value) throws SQLException {
|
||||
pstmt.setBytes(++pos, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setByte(byte v) throws SQLException {
|
||||
pstmt.setByte(++pos, v);
|
||||
public void setByte(byte value) throws SQLException {
|
||||
pstmt.setByte(++pos, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setChar(char v) throws SQLException {
|
||||
pstmt.setString(++pos, String.valueOf(v));
|
||||
public void setChar(char value) throws SQLException {
|
||||
pstmt.setString(++pos, String.valueOf(value));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -215,20 +215,17 @@ public class DataBind implements DataBinder {
|
||||
|
||||
@Override
|
||||
public void setBlob(byte[] bytes) throws SQLException {
|
||||
ByteArrayInputStream is = new ByteArrayInputStream(bytes);
|
||||
pstmt.setBinaryStream(++pos, is, bytes.length);
|
||||
pstmt.setBinaryStream(++pos, new ByteArrayInputStream(bytes), bytes.length);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setClob(String content) throws SQLException {
|
||||
Reader reader = new StringReader(content);
|
||||
pstmt.setCharacterStream(++pos, reader, content.length());
|
||||
pstmt.setCharacterStream(++pos, new StringReader(content), content.length());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setArray(String arrayType, Object[] elements) throws SQLException {
|
||||
Array array = connection.createArrayOf(arrayType, elements);
|
||||
pstmt.setArray(++pos, array);
|
||||
pstmt.setArray(++pos, connection.createArrayOf(arrayType, elements));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+32
-32
@@ -33,87 +33,87 @@ public final class BindCaptureStatement extends BindCaptureStatementBase impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBoolean(int parameterIndex, boolean x) {
|
||||
capture.add(new BindCaptureTypes.Boolean(parameterIndex, x));
|
||||
public void setBoolean(int parameterIndex, boolean value) {
|
||||
capture.add(new BindCaptureTypes.Boolean(parameterIndex, value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setByte(int parameterIndex, byte x) {
|
||||
capture.add(new BindCaptureTypes.Byte(parameterIndex, x));
|
||||
public void setByte(int parameterIndex, byte value) {
|
||||
capture.add(new BindCaptureTypes.Byte(parameterIndex, value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setShort(int parameterIndex, short x) {
|
||||
capture.add(new BindCaptureTypes.TShort(parameterIndex, x));
|
||||
public void setShort(int parameterIndex, short value) {
|
||||
capture.add(new BindCaptureTypes.TShort(parameterIndex, value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInt(int parameterIndex, int x) {
|
||||
capture.add(new BindCaptureTypes.TInt(parameterIndex, x));
|
||||
public void setInt(int parameterIndex, int value) {
|
||||
capture.add(new BindCaptureTypes.TInt(parameterIndex, value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLong(int parameterIndex, long x) {
|
||||
capture.add(new BindCaptureTypes.TLong(parameterIndex, x));
|
||||
public void setLong(int parameterIndex, long value) {
|
||||
capture.add(new BindCaptureTypes.TLong(parameterIndex, value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFloat(int parameterIndex, float x) {
|
||||
capture.add(new BindCaptureTypes.TFloat(parameterIndex, x));
|
||||
public void setFloat(int parameterIndex, float value) {
|
||||
capture.add(new BindCaptureTypes.TFloat(parameterIndex, value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDouble(int parameterIndex, double x) {
|
||||
capture.add(new BindCaptureTypes.TDouble(parameterIndex, x));
|
||||
public void setDouble(int parameterIndex, double value) {
|
||||
capture.add(new BindCaptureTypes.TDouble(parameterIndex, value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBigDecimal(int parameterIndex, BigDecimal x) {
|
||||
capture.add(new BindCaptureTypes.TBigDecimal(parameterIndex, x));
|
||||
public void setBigDecimal(int parameterIndex, BigDecimal value) {
|
||||
capture.add(new BindCaptureTypes.TBigDecimal(parameterIndex, value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setString(int parameterIndex, String x) {
|
||||
capture.add(new BindCaptureTypes.TString(parameterIndex, x));
|
||||
public void setString(int parameterIndex, String value) {
|
||||
capture.add(new BindCaptureTypes.TString(parameterIndex, value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBytes(int parameterIndex, byte[] x) {
|
||||
capture.add(new BindCaptureTypes.Bytes(parameterIndex, x));
|
||||
public void setBytes(int parameterIndex, byte[] value) {
|
||||
capture.add(new BindCaptureTypes.Bytes(parameterIndex, value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDate(int parameterIndex, Date x) {
|
||||
capture.add(new BindCaptureTypes.TDate(parameterIndex, x));
|
||||
public void setDate(int parameterIndex, Date value) {
|
||||
capture.add(new BindCaptureTypes.TDate(parameterIndex, value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTime(int parameterIndex, Time x) {
|
||||
capture.add(new BindCaptureTypes.TTime(parameterIndex, x));
|
||||
public void setTime(int parameterIndex, Time value) {
|
||||
capture.add(new BindCaptureTypes.TTime(parameterIndex, value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTimestamp(int parameterIndex, Timestamp x) {
|
||||
capture.add(new BindCaptureTypes.TTimestamp(parameterIndex, x, null));
|
||||
public void setTimestamp(int parameterIndex, Timestamp value) {
|
||||
capture.add(new BindCaptureTypes.TTimestamp(parameterIndex, value, null));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) {
|
||||
capture.add(new BindCaptureTypes.TTimestamp(parameterIndex, x, cal));
|
||||
public void setTimestamp(int parameterIndex, Timestamp value, Calendar cal) {
|
||||
capture.add(new BindCaptureTypes.TTimestamp(parameterIndex, value, cal));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setObject(int parameterIndex, Object x) {
|
||||
capture.add(new BindCaptureTypes.TObject(parameterIndex, x));
|
||||
public void setObject(int parameterIndex, Object value) {
|
||||
capture.add(new BindCaptureTypes.TObject(parameterIndex, value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBinaryStream(int parameterIndex, InputStream x, int length) {
|
||||
public void setBinaryStream(int parameterIndex, InputStream value, int length) {
|
||||
capture.add(new BindCaptureTypes.BinaryStream(parameterIndex));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCharacterStream(int parameterIndex, Reader reader, int length) {
|
||||
public void setCharacterStream(int parameterIndex, Reader value, int length) {
|
||||
capture.add(new BindCaptureTypes.CharacterStream(parameterIndex));
|
||||
}
|
||||
|
||||
|
||||
@@ -307,7 +307,10 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
*/
|
||||
public void start() {
|
||||
if (config.isRunMigration() && TenantMode.DB != config.getTenantMode()) {
|
||||
final AutoMigrationRunner migrationRunner = ServiceUtil.service(AutoMigrationRunner.class);
|
||||
AutoMigrationRunner migrationRunner = config.getServiceObject(AutoMigrationRunner.class);
|
||||
if (migrationRunner == null) {
|
||||
migrationRunner = ServiceUtil.service(AutoMigrationRunner.class);
|
||||
}
|
||||
if (migrationRunner == null) {
|
||||
throw new IllegalStateException("No AutoMigrationRunner found. Probably ebean-migration is not in the classpath?");
|
||||
}
|
||||
|
||||
@@ -117,7 +117,10 @@ final class InitDataSource {
|
||||
* Attach DataSourceAlert via service loader if present.
|
||||
*/
|
||||
private void attachAlert(DataSourceConfig dsConfig) {
|
||||
DataSourceAlertFactory alertFactory = ServiceUtil.service(DataSourceAlertFactory.class);
|
||||
DataSourceAlertFactory alertFactory = config.getServiceObject(DataSourceAlertFactory.class);
|
||||
if (alertFactory == null) {
|
||||
alertFactory = ServiceUtil.service(DataSourceAlertFactory.class);
|
||||
}
|
||||
if (alertFactory != null) {
|
||||
dsConfig.setAlert(alertFactory.createAlert());
|
||||
}
|
||||
|
||||
@@ -144,7 +144,12 @@ public final class InternalConfiguration {
|
||||
}
|
||||
|
||||
private <S> S service(Class<S> cls) {
|
||||
return ServiceUtil.service(cls);
|
||||
S service = config.getServiceObject(cls);
|
||||
if (service != null) {
|
||||
return service;
|
||||
} else {
|
||||
return ServiceUtil.service(cls);
|
||||
}
|
||||
}
|
||||
|
||||
private List<XmapEbean> readExternalMapping() {
|
||||
|
||||
@@ -121,7 +121,7 @@ public interface SpiOrmQueryRequest<T> extends BeanQueryRequest<T>, DocQueryRequ
|
||||
<K> Map<K, T> findMap();
|
||||
|
||||
/**
|
||||
* Execute the findSingleAttributeList query.
|
||||
* Execute the findSingleAttributeCollection query.
|
||||
*/
|
||||
<A extends Collection<?>> A findSingleAttributeCollection(A collection);
|
||||
|
||||
|
||||
+1
-1
@@ -1123,7 +1123,7 @@ public class DeployBeanProperty {
|
||||
|
||||
private boolean matchPlatform(Platform[] platforms, Platform match) {
|
||||
for (Platform platform : platforms) {
|
||||
if (platform == match) {
|
||||
if (platform == match || platform == match.base()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -106,23 +106,23 @@ public final class DefaultBackgroundExecutor implements SpiBackgroundExecutor {
|
||||
|
||||
@Override
|
||||
public ScheduledFuture<?> scheduleWithFixedDelay(Runnable task, long initialDelay, long delay, TimeUnit unit) {
|
||||
return schedulePool.scheduleWithFixedDelay(wrap(logExceptions(task)), initialDelay, delay, unit);
|
||||
return schedulePool.scheduleWithFixedDelay(logExceptions(task), initialDelay, delay, unit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ScheduledFuture<?> scheduleAtFixedRate(Runnable task, long initialDelay, long delay, TimeUnit unit) {
|
||||
return schedulePool.scheduleAtFixedRate(wrap(logExceptions(task)), initialDelay, delay, unit);
|
||||
return schedulePool.scheduleAtFixedRate(logExceptions(task), initialDelay, delay, unit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ScheduledFuture<?> schedule(Runnable task, long delay, TimeUnit unit) {
|
||||
return schedulePool.schedule(wrap(logExceptions(task)), delay, unit);
|
||||
return schedulePool.schedule(logExceptions(task), delay, unit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <V> ScheduledFuture<V> schedule(Callable<V> task, long delay, TimeUnit unit) {
|
||||
// Note: No "logExceptions" as we expect Future.get() by the invoker
|
||||
return schedulePool.schedule(wrap(task), delay, unit);
|
||||
return schedulePool.schedule(task, delay, unit);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,6 +3,7 @@ package io.ebeaninternal.server.expression;
|
||||
import io.ebeaninternal.api.BindValuesKey;
|
||||
import io.ebeaninternal.api.SpiExpression;
|
||||
import io.ebeaninternal.api.SpiExpressionRequest;
|
||||
import io.ebeaninternal.server.el.ElPropertyValue;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -34,13 +35,24 @@ final class BetweenExpression extends AbstractExpression {
|
||||
|
||||
@Override
|
||||
public void addBindValues(SpiExpressionRequest request) {
|
||||
ElPropertyValue prop = getElProp(request);
|
||||
if (prop != null && prop.isDbEncrypted()) {
|
||||
// bind the key as well as the value
|
||||
String encryptKey = prop.beanProperty().encryptKey().getStringValue();
|
||||
request.addBindEncryptKey(encryptKey);
|
||||
}
|
||||
request.addBindValue(low());
|
||||
request.addBindValue(high());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addSql(SpiExpressionRequest request) {
|
||||
request.append(propName).append(_BETWEEN);
|
||||
String pname = propName;
|
||||
ElPropertyValue prop = getElProp(request);
|
||||
if (prop != null && prop.isDbEncrypted()) {
|
||||
pname = prop.beanProperty().decryptProperty(propName);
|
||||
}
|
||||
request.append(pname).append(_BETWEEN);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+40
-15
@@ -1,21 +1,11 @@
|
||||
package io.ebeaninternal.server.expression;
|
||||
|
||||
import io.ebean.ExampleExpression;
|
||||
import io.ebean.Expression;
|
||||
import io.ebean.ExpressionFactory;
|
||||
import io.ebean.ExpressionList;
|
||||
import io.ebean.Junction;
|
||||
import io.ebean.LikeType;
|
||||
import io.ebean.Pairs;
|
||||
import io.ebean.Query;
|
||||
import io.ebean.*;
|
||||
import io.ebean.bean.EntityBean;
|
||||
import io.ebean.search.Match;
|
||||
import io.ebean.search.MultiMatch;
|
||||
import io.ebean.search.TextCommonTerms;
|
||||
import io.ebean.search.TextQueryString;
|
||||
import io.ebean.search.TextSimple;
|
||||
import io.ebean.search.*;
|
||||
import io.ebeaninternal.api.SpiExpressionFactory;
|
||||
import io.ebeaninternal.api.SpiQuery;
|
||||
import io.ebeaninternal.server.expression.SubQueryExpression.SQOp;
|
||||
import io.ebeaninternal.server.grammer.EqlParser;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -157,6 +147,11 @@ public class DefaultExpressionFactory implements SpiExpressionFactory {
|
||||
EqlParser.parseWhere(expressions, list, this, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Expression eq(String propertyName, Query<?> subQuery) {
|
||||
return new SubQueryExpression(SQOp.EQ, propertyName, (SpiQuery<?>) subQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* Equal To - property equal to the given value.
|
||||
*/
|
||||
@@ -173,6 +168,11 @@ public class DefaultExpressionFactory implements SpiExpressionFactory {
|
||||
return or(eq(propertyName, value), isNull(propertyName));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Expression ne(String propertyName, Query<?> subQuery) {
|
||||
return new SubQueryExpression(SQOp.NE, propertyName, (SpiQuery<?>) subQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* Not Equal To - property not equal to the given value.
|
||||
*/
|
||||
@@ -237,6 +237,11 @@ public class DefaultExpressionFactory implements SpiExpressionFactory {
|
||||
return and(le(lowProperty, value), gtOrNull(highProperty, value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Expression inRangeWithProperties(String propertyName, String lowProperty, String highProperty) {
|
||||
return raw(lowProperty + " <= " + propertyName + " and (" + propertyName + " < " + highProperty + " or " + highProperty + " is null)");
|
||||
}
|
||||
|
||||
/**
|
||||
* Between - property between the two given values.
|
||||
*/
|
||||
@@ -253,6 +258,11 @@ public class DefaultExpressionFactory implements SpiExpressionFactory {
|
||||
return new BetweenPropertyExpression(lowProperty, highProperty, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Expression gt(String propertyName, Query<?> subQuery) {
|
||||
return new SubQueryExpression(SQOp.GT, propertyName, (SpiQuery<?>) subQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* Greater Than - property greater than the given value.
|
||||
*/
|
||||
@@ -274,6 +284,11 @@ public class DefaultExpressionFactory implements SpiExpressionFactory {
|
||||
return or(ge(propertyName, value), isNull(propertyName));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Expression ge(String propertyName, Query<?> subQuery) {
|
||||
return new SubQueryExpression(SQOp.GE, propertyName, (SpiQuery<?>) subQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* Greater Than or Equal to - property greater than or equal to the given
|
||||
* value.
|
||||
@@ -296,6 +311,11 @@ public class DefaultExpressionFactory implements SpiExpressionFactory {
|
||||
return or(le(propertyName, value), isNull(propertyName));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Expression lt(String propertyName, Query<?> subQuery) {
|
||||
return new SubQueryExpression(SQOp.LT, propertyName, (SpiQuery<?>) subQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* Less Than - property less than the given value.
|
||||
*/
|
||||
@@ -304,6 +324,11 @@ public class DefaultExpressionFactory implements SpiExpressionFactory {
|
||||
return new SimpleExpression(propertyName, Op.LT, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Expression le(String propertyName, Query<?> subQuery) {
|
||||
return new SubQueryExpression(SQOp.LE, propertyName, (SpiQuery<?>) subQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* Less Than or Equal to - property less than or equal to the given value.
|
||||
*/
|
||||
@@ -460,7 +485,7 @@ public class DefaultExpressionFactory implements SpiExpressionFactory {
|
||||
*/
|
||||
@Override
|
||||
public Expression in(String propertyName, Query<?> subQuery) {
|
||||
return new InQueryExpression(propertyName, (SpiQuery<?>) subQuery, false);
|
||||
return new SubQueryExpression(SQOp.IN, propertyName, (SpiQuery<?>) subQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -502,7 +527,7 @@ public class DefaultExpressionFactory implements SpiExpressionFactory {
|
||||
*/
|
||||
@Override
|
||||
public Expression notIn(String propertyName, Query<?> subQuery) {
|
||||
return new InQueryExpression(propertyName, (SpiQuery<?>) subQuery, true);
|
||||
return new SubQueryExpression(SQOp.NOTIN, propertyName, (SpiQuery<?>) subQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+38
-6
@@ -788,6 +788,11 @@ public class DefaultExpressionList<T> implements SpiExpressionList<T> {
|
||||
return add(expr.bitwiseAnd(propertyName, flags, match));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> eq(String propertyName, Query<?> subQuery) {
|
||||
return add(expr.eq(propertyName, subQuery));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> eq(String propertyName, Object value) {
|
||||
return add(expr.eq(propertyName, value));
|
||||
@@ -813,6 +818,11 @@ public class DefaultExpressionList<T> implements SpiExpressionList<T> {
|
||||
return add(expr.ine(propertyName, value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> ne(String propertyName, Query<?> subQuery) {
|
||||
return add(expr.ne(propertyName, subQuery));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> ne(String propertyName, Object value) {
|
||||
return add(expr.ne(propertyName, value));
|
||||
@@ -833,6 +843,11 @@ public class DefaultExpressionList<T> implements SpiExpressionList<T> {
|
||||
return add(expr.inRangeWith(lowProperty, highProperty, value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> inRangeWithProperties(String propertyName, String lowProperty, String highProperty) {
|
||||
return add(expr.inRangeWithProperties(propertyName, lowProperty, highProperty));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> inRange(String propertyName, Object value1, Object value2) {
|
||||
return add(expr.inRange(propertyName, value1, value2));
|
||||
@@ -858,10 +873,19 @@ public class DefaultExpressionList<T> implements SpiExpressionList<T> {
|
||||
return add(expr.endsWith(propertyName, value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> ge(String propertyName, Query<?> subQuery) {
|
||||
return add(expr.ge(propertyName, subQuery));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> ge(String propertyName, Object value) {
|
||||
add(expr.ge(propertyName, value));
|
||||
return this;
|
||||
return add(expr.ge(propertyName, value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> gt(String propertyName, Query<?> subQuery) {
|
||||
return add(expr.gt(propertyName, subQuery));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -871,14 +895,12 @@ public class DefaultExpressionList<T> implements SpiExpressionList<T> {
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> gtOrNull(String propertyName, Object value) {
|
||||
add(expr.gtOrNull(propertyName, value));
|
||||
return this;
|
||||
return add(expr.gtOrNull(propertyName, value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> geOrNull(String propertyName, Object value) {
|
||||
add(expr.geOrNull(propertyName, value));
|
||||
return this;
|
||||
return add(expr.geOrNull(propertyName, value));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -994,6 +1016,11 @@ public class DefaultExpressionList<T> implements SpiExpressionList<T> {
|
||||
return add(expr.istartsWith(propertyName, value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> le(String propertyName, Query<?> subQuery) {
|
||||
return add(expr.le(propertyName, subQuery));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> le(String propertyName, Object value) {
|
||||
return add(expr.le(propertyName, value));
|
||||
@@ -1014,6 +1041,11 @@ public class DefaultExpressionList<T> implements SpiExpressionList<T> {
|
||||
return add(expr.like(propertyName, value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> lt(String propertyName, Query<?> subQuery) {
|
||||
return add(expr.lt(propertyName, subQuery));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> lt(String propertyName, Object value) {
|
||||
return add(expr.lt(propertyName, value));
|
||||
|
||||
@@ -14,17 +14,13 @@ import java.util.*;
|
||||
|
||||
public final class InExpression extends AbstractExpression implements IdInCommon {
|
||||
|
||||
private final boolean not;
|
||||
|
||||
/**
|
||||
* Set to true when adding "1=1" predicate (due to null or empty sourceValues).
|
||||
*/
|
||||
private final boolean empty;
|
||||
|
||||
private final boolean not;
|
||||
private final Collection<?> sourceValues;
|
||||
|
||||
private List<Object> bindValues;
|
||||
|
||||
private boolean multiValueSupported;
|
||||
|
||||
InExpression(String propertyName, Collection<?> sourceValues, boolean not) {
|
||||
@@ -95,7 +91,7 @@ public final class InExpression extends AbstractExpression implements IdInCommon
|
||||
public void prepareExpression(BeanQueryRequest<?> request) {
|
||||
initBindValues();
|
||||
if (bindValues.size() > 0) {
|
||||
multiValueSupported = request.isMultiValueSupported((bindValues.get(0)).getClass());
|
||||
multiValueSupported = request.isMultiValueSupported(bindValues.get(0).getClass());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,29 +113,37 @@ public final class InExpression extends AbstractExpression implements IdInCommon
|
||||
}
|
||||
}
|
||||
ElPropertyValue prop = getElProp(request);
|
||||
if (prop != null && !prop.isAssocId()) {
|
||||
prop = null;
|
||||
}
|
||||
|
||||
if (prop == null) {
|
||||
if (bindValues.size() > 0) {
|
||||
// if we have no property, we wrap them in a multi value wrapper.
|
||||
// later the binder will decide, which bind strategy to use.
|
||||
request.addBindValue(new MultiValueWrapper(bindValues));
|
||||
}
|
||||
} else {
|
||||
List<Object> idList = new ArrayList<>();
|
||||
List<Object> values = bindValues;
|
||||
if (prop != null && prop.isAssocId()) {
|
||||
values = new ArrayList<>();
|
||||
for (Object bindValue : bindValues) {
|
||||
// extract the id values from the bean
|
||||
Object[] ids = prop.assocIdValues((EntityBean) bindValue);
|
||||
if (ids != null) {
|
||||
Collections.addAll(idList, ids);
|
||||
Collections.addAll(values, ids);
|
||||
}
|
||||
}
|
||||
if (!idList.isEmpty()) {
|
||||
request.addBindValue(new MultiValueWrapper(idList));
|
||||
}
|
||||
if (values.isEmpty()) {
|
||||
// nothing in in-query
|
||||
return;
|
||||
}
|
||||
if (prop != null) {
|
||||
if (prop.isDbEncrypted()) {
|
||||
// bind the key as well as the value
|
||||
request.addBindEncryptKey(prop.beanProperty().encryptKey().getStringValue());
|
||||
} else if (prop.isLocalEncrypted()) {
|
||||
List<Object> encValues = new ArrayList<>(values.size());
|
||||
for (Object value : values) {
|
||||
encValues.add(prop.localEncrypt(value));
|
||||
}
|
||||
// this is most likely binary garbage, so don't add it to the bind log
|
||||
request.addBindEncryptKey(new MultiValueWrapper(encValues));
|
||||
return;
|
||||
}
|
||||
}
|
||||
// wrap in a multi value wrapper, later the binder will decide the bind strategy to use
|
||||
request.addBindValue(new MultiValueWrapper(values));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -154,17 +158,20 @@ public final class InExpression extends AbstractExpression implements IdInCommon
|
||||
}
|
||||
|
||||
ElPropertyValue prop = getElProp(request);
|
||||
if (prop != null && !prop.isAssocId()) {
|
||||
prop = null;
|
||||
}
|
||||
|
||||
if (prop != null) {
|
||||
request.append(prop.assocIdInExpr(propName));
|
||||
request.append(prop.assocIdInValueExpr(not, bindValues.size()));
|
||||
} else {
|
||||
request.append(propName);
|
||||
request.appendInExpression(not, bindValues);
|
||||
if (prop.isAssocId()) {
|
||||
request.append(prop.assocIdInExpr(propName));
|
||||
request.append(prop.assocIdInValueExpr(not, bindValues.size()));
|
||||
return;
|
||||
}
|
||||
if (prop.isDbEncrypted()) {
|
||||
request.append(prop.beanProperty().decryptProperty(propName));
|
||||
request.appendInExpression(not, bindValues);
|
||||
return;
|
||||
}
|
||||
}
|
||||
request.append(propName);
|
||||
request.appendInExpression(not, bindValues);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,6 +3,7 @@ package io.ebeaninternal.server.expression;
|
||||
import io.ebeaninternal.api.BindValuesKey;
|
||||
import io.ebeaninternal.api.SpiExpression;
|
||||
import io.ebeaninternal.api.SpiExpressionRequest;
|
||||
import io.ebeaninternal.server.el.ElPropertyValue;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -32,13 +33,29 @@ final class InRangeExpression extends AbstractExpression {
|
||||
|
||||
@Override
|
||||
public void addBindValues(SpiExpressionRequest request) {
|
||||
ElPropertyValue prop = getElProp(request);
|
||||
if (prop != null && prop.isDbEncrypted()) {
|
||||
// bind the key twice, for both values
|
||||
String encryptKey = prop.beanProperty().encryptKey().getStringValue();
|
||||
request.addBindEncryptKey(encryptKey);
|
||||
request.addBindValue(low());
|
||||
request.addBindEncryptKey(encryptKey);
|
||||
request.addBindValue(high());
|
||||
return;
|
||||
}
|
||||
request.addBindValue(low());
|
||||
request.addBindValue(high());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addSql(SpiExpressionRequest request) {
|
||||
request.append("(").append(propName).append(" >= ? and ").append(propName).append(" < ?)");
|
||||
String pname = propName;
|
||||
ElPropertyValue prop = getElProp(request);
|
||||
if (prop != null && prop.isDbEncrypted()) {
|
||||
pname = prop.beanProperty().decryptProperty(propName);
|
||||
}
|
||||
request.append("(").append(pname).append(" >= ? and ").append(pname).append(" < ?)");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -279,6 +279,11 @@ final class JunctionExpression<T> implements SpiJunction<T>, SpiExpression, Expr
|
||||
return exprList.inRangeWith(lowProperty, highProperty, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> inRangeWithProperties(String propertyName, String lowProperty, String highProperty) {
|
||||
return exprList.inRangeWithProperties(propertyName, lowProperty, highProperty);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> inRange(String propertyName, Object value1, Object value2) {
|
||||
return exprList.inRange(propertyName, value1, value2);
|
||||
@@ -304,6 +309,11 @@ final class JunctionExpression<T> implements SpiJunction<T>, SpiExpression, Expr
|
||||
return exprList.endsWith(propertyName, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> eq(String propertyName, Query<?> subQuery) {
|
||||
return exprList.eq(propertyName, subQuery);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> eq(String propertyName, Object value) {
|
||||
return exprList.eq(propertyName, value);
|
||||
@@ -637,11 +647,21 @@ final class JunctionExpression<T> implements SpiJunction<T>, SpiExpression, Expr
|
||||
return exprList.bitwiseNot(propertyName, flags);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> ge(String propertyName, Query<?> subQuery) {
|
||||
return exprList.ge(propertyName, subQuery);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> ge(String propertyName, Object value) {
|
||||
return exprList.ge(propertyName, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> gt(String propertyName, Query<?> subQuery) {
|
||||
return exprList.gt(propertyName, subQuery);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> gt(String propertyName, Object value) {
|
||||
return exprList.gt(propertyName, value);
|
||||
@@ -782,6 +802,11 @@ final class JunctionExpression<T> implements SpiJunction<T>, SpiExpression, Expr
|
||||
return exprList.istartsWith(propertyName, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> le(String propertyName, Query<?> subQuery) {
|
||||
return exprList.le(propertyName, subQuery);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> le(String propertyName, Object value) {
|
||||
return exprList.le(propertyName, value);
|
||||
@@ -792,6 +817,11 @@ final class JunctionExpression<T> implements SpiJunction<T>, SpiExpression, Expr
|
||||
return exprList.like(propertyName, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> lt(String propertyName, Query<?> subQuery) {
|
||||
return exprList.lt(propertyName, subQuery);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> lt(String propertyName, Object value) {
|
||||
return exprList.lt(propertyName, value);
|
||||
@@ -807,6 +837,11 @@ final class JunctionExpression<T> implements SpiJunction<T>, SpiExpression, Expr
|
||||
return exprList.leOrNull(propertyName, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> ne(String propertyName, Query<?> subQuery) {
|
||||
return exprList.ne(propertyName, subQuery);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> ne(String propertyName, Object value) {
|
||||
return exprList.ne(propertyName, value);
|
||||
|
||||
+28
-19
@@ -8,32 +8,47 @@ import io.ebeaninternal.server.query.CQuery;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* In expression using a sub query.
|
||||
* Sub-Query expression.
|
||||
*/
|
||||
final class InQueryExpression extends AbstractExpression implements UnsupportedDocStoreExpression {
|
||||
final class SubQueryExpression extends AbstractExpression implements UnsupportedDocStoreExpression {
|
||||
|
||||
private final boolean not;
|
||||
enum SQOp {
|
||||
EQ(" = "),
|
||||
NE(" <> "),
|
||||
GT(" > "),
|
||||
GE(" >= "),
|
||||
LT(" < "),
|
||||
LE(" <= "),
|
||||
IN(" in "),
|
||||
NOTIN(" not in ");
|
||||
final String expression;
|
||||
SQOp(String expression) {
|
||||
this.expression = expression;
|
||||
}
|
||||
}
|
||||
|
||||
private final SQOp op;
|
||||
private final SpiQuery<?> subQuery;
|
||||
private List<Object> bindParams;
|
||||
private String sql;
|
||||
|
||||
InQueryExpression(String propertyName, SpiQuery<?> subQuery, boolean not) {
|
||||
SubQueryExpression(SQOp op, String propertyName, SpiQuery<?> subQuery) {
|
||||
super(propertyName);
|
||||
this.op = op;
|
||||
this.subQuery = subQuery;
|
||||
this.not = not;
|
||||
}
|
||||
|
||||
InQueryExpression(String propertyName, boolean not, String sql, List<Object> bindParams) {
|
||||
SubQueryExpression(SQOp op, String propertyName, String sql, List<Object> bindParams) {
|
||||
super(propertyName);
|
||||
this.op = op;
|
||||
this.subQuery = null;
|
||||
this.not = not;
|
||||
this.sql = sql;
|
||||
this.bindParams = bindParams;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpiExpression copy() {
|
||||
return subQuery == null ? this : new InQueryExpression(propName, subQuery.copy(), not);
|
||||
return subQuery == null ? this : new SubQueryExpression(op, propName, subQuery.copy());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -55,8 +70,8 @@ final class InQueryExpression extends AbstractExpression implements UnsupportedD
|
||||
|
||||
@Override
|
||||
public void queryPlanHash(StringBuilder builder) {
|
||||
builder.append("InQuery[").append(propName)
|
||||
.append(" not:").append(not).append(" sql:").append(sql)
|
||||
builder.append("SubQuery[").append(propName).append(op.expression)
|
||||
.append(" sql:").append(sql)
|
||||
.append(" ?:").append(bindParams.size()).append("]");
|
||||
}
|
||||
|
||||
@@ -65,7 +80,7 @@ final class InQueryExpression extends AbstractExpression implements UnsupportedD
|
||||
*/
|
||||
private CQuery<?> compileSubQuery(BeanQueryRequest<?> queryRequest) {
|
||||
SpiEbeanServer ebeanServer = (SpiEbeanServer) queryRequest.database();
|
||||
return ebeanServer.compileQuery(Type.SQ_IN, subQuery, queryRequest.transaction());
|
||||
return ebeanServer.compileQuery(Type.SQ_EX, subQuery, queryRequest.transaction());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -75,13 +90,7 @@ final class InQueryExpression extends AbstractExpression implements UnsupportedD
|
||||
|
||||
@Override
|
||||
public void addSql(SpiExpressionRequest request) {
|
||||
request.append(" (").append(propName).append(")");
|
||||
if (not) {
|
||||
request.append(" not");
|
||||
}
|
||||
request.append(" in (");
|
||||
request.append(sql);
|
||||
request.append(")");
|
||||
request.append(propName).append(op.expression).append("(").append(sql).append(")");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -93,7 +102,7 @@ final class InQueryExpression extends AbstractExpression implements UnsupportedD
|
||||
|
||||
@Override
|
||||
public boolean isSameByBind(SpiExpression other) {
|
||||
InQueryExpression that = (InQueryExpression) other;
|
||||
SubQueryExpression that = (SubQueryExpression) other;
|
||||
if (this.bindParams.size() != that.bindParams.size()) {
|
||||
return false;
|
||||
}
|
||||
@@ -106,7 +106,7 @@ public class UuidV1RndIdGenerator implements PlatformIdGenerator {
|
||||
|
||||
delta = current - last;
|
||||
if (delta < -10000 * 20000) {
|
||||
log.log(INFO, "Clock skew of {} ms detected", delta / -10000);
|
||||
log.log(INFO, "Clock skew of {0} ms detected", delta / -10000);
|
||||
// The clock was adjusted back about 2 seconds, or we were generating a lot of ids too fast
|
||||
// if so, we try to set the current as last and also increment the clockSeq.
|
||||
lock.lock();
|
||||
|
||||
+3
-19
@@ -7,25 +7,7 @@ import io.ebeaninternal.server.bind.DataBind;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Collection;
|
||||
|
||||
import static java.sql.Types.BIGINT;
|
||||
import static java.sql.Types.BIT;
|
||||
import static java.sql.Types.BOOLEAN;
|
||||
import static java.sql.Types.CHAR;
|
||||
import static java.sql.Types.DATE;
|
||||
import static java.sql.Types.DECIMAL;
|
||||
import static java.sql.Types.DOUBLE;
|
||||
import static java.sql.Types.FLOAT;
|
||||
import static java.sql.Types.INTEGER;
|
||||
import static java.sql.Types.NCHAR;
|
||||
import static java.sql.Types.NUMERIC;
|
||||
import static java.sql.Types.NVARCHAR;
|
||||
import static java.sql.Types.REAL;
|
||||
import static java.sql.Types.SMALLINT;
|
||||
import static java.sql.Types.TIMESTAMP;
|
||||
import static java.sql.Types.TIMESTAMP_WITH_TIMEZONE;
|
||||
import static java.sql.Types.TIME_WITH_TIMEZONE;
|
||||
import static java.sql.Types.TINYINT;
|
||||
import static java.sql.Types.VARCHAR;
|
||||
import static java.sql.Types.*;
|
||||
|
||||
/**
|
||||
* Base MultiValueBind for platform specific support.
|
||||
@@ -86,6 +68,8 @@ abstract class AbstractMultiValueBind extends MultiValueBind {
|
||||
case ExtraDbTypes.UUID: // Postgres cast to uuid[]
|
||||
case ExtraDbTypes.INET: // Postgres cast to inet[]
|
||||
return "varchar";
|
||||
case VARBINARY:
|
||||
return "bytea";
|
||||
|
||||
default:
|
||||
return null;
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ public class MultiValueBind {
|
||||
}
|
||||
|
||||
Object[] toArray(Collection<?> values, ScalarType<?> type) {
|
||||
Object[] array = new Object[values.size()];
|
||||
Object[] array = type.binary() ? new byte[values.size()][] : new Object[values.size()];
|
||||
int i = 0;
|
||||
for (Object value : values) {
|
||||
array[i++] = type.toJdbcType(value);
|
||||
|
||||
@@ -396,7 +396,7 @@ final class CQueryBuilder {
|
||||
sql = nativeQueryPaging(query, sql);
|
||||
}
|
||||
query.setGeneratedSql(sql);
|
||||
Connection connection = request.transaction().connection();
|
||||
Connection connection = request.transaction().getInternalConnection();
|
||||
BeanDescriptor<?> desc = request.descriptor();
|
||||
try {
|
||||
// For SqlServer we need either "selectMethod=cursor" in the connection string or fetch explicitly a cursorable
|
||||
|
||||
@@ -86,7 +86,7 @@ public final class SqlTreeBuilder {
|
||||
this.disableLazyLoad = query.isDisableLazyLoading();
|
||||
this.readOnly = Boolean.TRUE.equals(query.isReadOnly());
|
||||
this.subQuery = Type.SQ_EXISTS == query.getType()
|
||||
|| Type.SQ_IN == query.getType()
|
||||
|| Type.SQ_EX == query.getType()
|
||||
|| Type.ID_LIST == query.getType()
|
||||
|| Type.DELETE == query.getType()
|
||||
|| query.isCountDistinct();
|
||||
|
||||
@@ -129,6 +129,26 @@ public final class DefaultDtoQuery<T> extends AbstractQuery implements SpiDtoQue
|
||||
return Optional.ofNullable(findOne());
|
||||
}
|
||||
|
||||
@Override
|
||||
public DtoQuery<T> setNullParameter(String name, int jdbcType) {
|
||||
if (ormQuery != null) {
|
||||
ormQuery.initBindParams().setNullParameter(name, jdbcType);
|
||||
} else {
|
||||
bindParams.setNullParameter(name, jdbcType);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DtoQuery<T> setNullParameter(int position, int jdbcType) {
|
||||
if (ormQuery != null) {
|
||||
ormQuery.initBindParams().setNullParameter(position, jdbcType);
|
||||
} else {
|
||||
bindParams.setNullParameter(position, jdbcType);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DtoQuery<T> setParameter(int position, Object value) {
|
||||
if (ormQuery != null) {
|
||||
|
||||
@@ -1544,19 +1544,13 @@ public class DefaultOrmQuery<T> extends AbstractQuery implements SpiQuery<T> {
|
||||
|
||||
@Override
|
||||
public final Query<T> setParameter(Object value) {
|
||||
if (bindParams == null) {
|
||||
bindParams = new BindParams();
|
||||
}
|
||||
bindParams.setNextParameter(value);
|
||||
initBindParams().setNextParameter(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Query<T> setParameters(Object... values) {
|
||||
if (bindParams == null) {
|
||||
bindParams = new BindParams();
|
||||
}
|
||||
bindParams.setNextParameters(values);
|
||||
initBindParams().setNextParameters(values);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -1567,10 +1561,7 @@ public class DefaultOrmQuery<T> extends AbstractQuery implements SpiQuery<T> {
|
||||
*/
|
||||
@Override
|
||||
public final Query<T> setParameter(int position, Object value) {
|
||||
if (bindParams == null) {
|
||||
bindParams = new BindParams();
|
||||
}
|
||||
bindParams.setParameter(position, value);
|
||||
initBindParams().setParameter(position, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -1586,10 +1577,7 @@ public class DefaultOrmQuery<T> extends AbstractQuery implements SpiQuery<T> {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
if (bindParams == null) {
|
||||
bindParams = new BindParams();
|
||||
}
|
||||
bindParams.setParameter(name, value);
|
||||
initBindParams().setParameter(name, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -1598,10 +1586,7 @@ public class DefaultOrmQuery<T> extends AbstractQuery implements SpiQuery<T> {
|
||||
if (namedParams != null) {
|
||||
throw new IllegalStateException("setArrayParameter() not supported when EQL parsed query");
|
||||
}
|
||||
if (bindParams == null) {
|
||||
bindParams = new BindParams();
|
||||
}
|
||||
bindParams.setArrayParameter(name, values);
|
||||
initBindParams().setArrayParameter(name, values);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1789,6 +1774,14 @@ public class DefaultOrmQuery<T> extends AbstractQuery implements SpiQuery<T> {
|
||||
return bindParams;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BindParams initBindParams() {
|
||||
if (bindParams == null) {
|
||||
bindParams = new BindParams();
|
||||
}
|
||||
return bindParams;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Query<T> where(Expression expression) {
|
||||
where().add(expression);
|
||||
|
||||
@@ -885,6 +885,9 @@ class JdbcTransaction implements SpiTransaction, TxnProfileEventCodes {
|
||||
public final void preCommit() {
|
||||
internalBatchFlush();
|
||||
firePreCommit();
|
||||
// we must flush the batch queue again, because the callback can
|
||||
// modify current transaction
|
||||
internalBatchFlush();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ abstract class TransactionFactory {
|
||||
*/
|
||||
final SpiTransaction setIsolationLevel(SpiTransaction t, boolean explicit, int isolationLevel) {
|
||||
if (isolationLevel > -1) {
|
||||
Connection connection = t.connection();
|
||||
Connection connection = t.getInternalConnection();
|
||||
try {
|
||||
connection.setTransactionIsolation(isolationLevel);
|
||||
} catch (SQLException e) {
|
||||
|
||||
@@ -111,7 +111,10 @@ public final class DefaultTypeManager implements TypeManager {
|
||||
}
|
||||
|
||||
private void loadGeoTypeBinder(DatabaseConfig config) {
|
||||
final GeoTypeProvider provider = ServiceUtil.service(GeoTypeProvider.class);
|
||||
GeoTypeProvider provider = config.getServiceObject(GeoTypeProvider.class);
|
||||
if (provider == null) {
|
||||
provider = ServiceUtil.service(GeoTypeProvider.class);
|
||||
}
|
||||
if (provider != null) {
|
||||
geoTypeBinder = provider.createBinder(config);
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ final class ScalarTypeCalendar extends ScalarTypeBaseDateTime<Calendar> {
|
||||
|
||||
@Override
|
||||
protected String toJsonNanos(Calendar value) {
|
||||
return String.valueOf(value.getTime());
|
||||
return String.valueOf(value.getTime().getTime());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,6 +11,7 @@ import java.sql.Timestamp;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeParseException;
|
||||
|
||||
/**
|
||||
* ScalarType for java.sql.Timestamp.
|
||||
@@ -48,7 +49,7 @@ final class ScalarTypeLocalDateTime extends ScalarTypeBaseDateTime<LocalDateTime
|
||||
|
||||
@Override
|
||||
public LocalDateTime jsonRead(JsonParser parser) throws IOException {
|
||||
return LocalDateTime.parse(parser.getText());
|
||||
return parse(parser.getText());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -63,7 +64,11 @@ final class ScalarTypeLocalDateTime extends ScalarTypeBaseDateTime<LocalDateTime
|
||||
|
||||
@Override
|
||||
public LocalDateTime parse(String value) {
|
||||
return LocalDateTime.parse(value);
|
||||
try {
|
||||
return LocalDateTime.parse(value);
|
||||
} catch (DateTimeParseException pe) {
|
||||
return super.parse(value);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+5
-5
@@ -35,7 +35,7 @@ public class DefaultExpressionFactoryTest {
|
||||
public void testEq() {
|
||||
|
||||
DefaultExpressionFactory factory = new DefaultExpressionFactory(false, false);
|
||||
Expression expression = factory.eq("name", null);
|
||||
Expression expression = factory.eq("name", (String)null);
|
||||
assertThat(expression).isInstanceOf(NullExpression.class);
|
||||
assertThat(toQueryPlanHash(expression)).isEqualTo("Null[name]");
|
||||
}
|
||||
@@ -44,7 +44,7 @@ public class DefaultExpressionFactoryTest {
|
||||
public void testNe() {
|
||||
|
||||
DefaultExpressionFactory factory = new DefaultExpressionFactory(false, false);
|
||||
Expression expression = factory.ne("name", null);
|
||||
Expression expression = factory.ne("name", (String)null);
|
||||
assertThat(expression).isInstanceOf(NullExpression.class);
|
||||
assertThat(toQueryPlanHash(expression)).isEqualTo("NotNull[name]");
|
||||
}
|
||||
@@ -71,7 +71,7 @@ public class DefaultExpressionFactoryTest {
|
||||
public void testEq_with_equalsWithNullAsNoop() {
|
||||
|
||||
DefaultExpressionFactory factory = new DefaultExpressionFactory(true, false);
|
||||
Expression expression = factory.eq("name", null);
|
||||
Expression expression = factory.eq("name", (String)null);
|
||||
assertThat(expression).isInstanceOf(NoopExpression.class);
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ public class DefaultExpressionFactoryTest {
|
||||
public void testNe_with_equalsWithNullAsNoop() {
|
||||
|
||||
DefaultExpressionFactory factory = new DefaultExpressionFactory(true, false);
|
||||
Expression expression = factory.ne("name", null);
|
||||
Expression expression = factory.ne("name", (String)null);
|
||||
assertThat(expression).isInstanceOf(NoopExpression.class);
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public class DefaultExpressionFactoryTest {
|
||||
public void testIeq_with_equalsWithNullAsNoop() {
|
||||
|
||||
DefaultExpressionFactory factory = new DefaultExpressionFactory(true, false);
|
||||
Expression expression = factory.ieq("name", null);
|
||||
Expression expression = factory.ieq("name", (String)null);
|
||||
assertThat(expression).isInstanceOf(NoopExpression.class);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-3
@@ -12,14 +12,15 @@ import static org.mockito.Mockito.verify;
|
||||
|
||||
public class InQueryExpressionTest extends BaseExpressionTest {
|
||||
|
||||
private InQueryExpression exp(String propertyName, boolean not, String sql, Object... bindValues) {
|
||||
return new InQueryExpression(propertyName, not, sql, Arrays.asList(bindValues));
|
||||
private SubQueryExpression exp(String propertyName, boolean not, String sql, Object... bindValues) {
|
||||
var op = not ? SubQueryExpression.SQOp.NOTIN : SubQueryExpression.SQOp.IN;
|
||||
return new SubQueryExpression(op, propertyName, sql, Arrays.asList(bindValues));
|
||||
}
|
||||
|
||||
@Test
|
||||
void copy_subQuery_expectNewInstance() {
|
||||
SpiQuery<?> subQuery = mock(SpiQuery.class);
|
||||
var orig = new InQueryExpression("name", subQuery, false);
|
||||
var orig = new SubQueryExpression(SubQueryExpression.SQOp.IN, "name", subQuery);
|
||||
SpiExpression copy = orig.copy();
|
||||
assertThat(copy).isNotSameAs(orig);
|
||||
verify(subQuery).copy();
|
||||
|
||||
@@ -27,9 +27,9 @@ public class NoopExpressionTest extends BaseExpressionTest {
|
||||
initTables();
|
||||
Query<Customer> query = DB.find(Customer.class)
|
||||
.select("id")
|
||||
.where().eq("name", null)
|
||||
.where().eq("name", (String) null)
|
||||
.add(NoopExpression.INSTANCE)
|
||||
.ne("status", null)
|
||||
.ne("status", (String) null)
|
||||
.query();
|
||||
|
||||
query.findList();
|
||||
|
||||
+2
-2
@@ -65,8 +65,8 @@ class BasePlatformArrayTypeFactoryTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setString(String s) {
|
||||
setEmptyString = "[]".equals(s);
|
||||
public void setString(String value) {
|
||||
setEmptyString = "[]".equals(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+37
-1
@@ -2,15 +2,20 @@ package io.ebeaninternal.server.type;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonFactory;
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
import io.ebean.config.JsonConfig;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
import java.sql.Timestamp;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
public class ScalarTypeLocalDateTimeTest {
|
||||
|
||||
@@ -123,4 +128,35 @@ public class ScalarTypeLocalDateTimeTest {
|
||||
LocalDateTime value = typeIso.fromJsonISO8601(asJson);
|
||||
assertThat(localDateTime).isEqualToIgnoringNanos(value);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParseEbean11() throws IOException {
|
||||
ScalarTypeLocalDateTime type = new ScalarTypeLocalDateTime(JsonConfig.DateTime.ISO8601);
|
||||
JsonFactory factory = new JsonFactory();
|
||||
JsonParser parser11 = factory.createParser("1517627106000"); // its a number!
|
||||
JsonParser parser13 = factory.createParser("\"2022-01-01T01:00:00\"");
|
||||
|
||||
// test parsing an ebean 11/13 timestamp, we do not expect an exception
|
||||
LocalDateTime p = type.parse("1517627106000");
|
||||
parser11.nextToken();
|
||||
LocalDateTime q = type.jsonRead(parser11);
|
||||
assertThat(p).isEqualTo(q);
|
||||
|
||||
p = type.parse("2022-01-01T01:00:00");
|
||||
parser13.nextToken();
|
||||
q = type.jsonRead(parser13);
|
||||
assertThat(p).isEqualTo(q);
|
||||
TimeZone tz = TimeZone.getDefault();
|
||||
try {
|
||||
// Adjust Timezone to run on build server
|
||||
// Note Millis and Iso have a time offset according to TZ
|
||||
TimeZone.setDefault(TimeZone.getTimeZone("Europe/Berlin"));
|
||||
LocalDateTime fromMillis = type.parse("0");
|
||||
LocalDateTime fromIso = type.parse("1970-01-01T01:00");
|
||||
|
||||
assertThat(fromMillis).isEqualToIgnoringNanos(fromIso);
|
||||
} finally {
|
||||
TimeZone.setDefault(tz);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-csv-reader</artifactId>
|
||||
@@ -14,21 +14,21 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<tiles>
|
||||
<tile>io.ebean.tile:enhancement:13.6.5</tile>
|
||||
<tile>io.ebean.tile:enhancement:13.10.1</tile>
|
||||
</tiles>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
@@ -11,10 +11,11 @@ import java.io.Reader;
|
||||
import java.net.URL;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Locale;
|
||||
|
||||
class CsvReaderTest {
|
||||
|
||||
final DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("dd-MMM-yyyy");
|
||||
final DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("dd-MMM-yyyy", Locale.ENGLISH);
|
||||
|
||||
@Test
|
||||
void test() throws Exception {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean ddl generation</name>
|
||||
@@ -28,14 +28,14 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-all</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ public class ExtraDdlXmlReader {
|
||||
StringBuilder sb = new StringBuilder(300);
|
||||
for (DdlScript script : read.getDdlScript()) {
|
||||
if (script.isDrop() == drops && matchPlatform(platform, script.getPlatforms())) {
|
||||
logger.log(DEBUG, "include script {}", script.getName());
|
||||
logger.log(DEBUG, "include script {0}", script.getName());
|
||||
String value = script.getValue();
|
||||
sb.append(value);
|
||||
if (value.lastIndexOf(';') == -1) {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean external mapping api</name>
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</parent>
|
||||
|
||||
<scm>
|
||||
<developerConnection>scm:git:git@github.com:ebean-orm/ebean.git</developerConnection>
|
||||
<tag>ebean-parent-13.10.0</tag>
|
||||
<tag>ebean-parent-13.11.0</tag>
|
||||
</scm>
|
||||
|
||||
<name>ebean external mapping xml</name>
|
||||
@@ -21,7 +21,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-externalmapping-api</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -54,21 +54,21 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-generator</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
<configuration>
|
||||
<tiles>
|
||||
<!-- other tiles ... -->
|
||||
<tile>io.ebean.tile:enhancement:13.6.5</tile>
|
||||
<tile>io.ebean.tile:enhancement:13.10.1</tile>
|
||||
</tiles>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-jackson-jsonnode</artifactId>
|
||||
@@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.0-SNAPSHOT</version>
|
||||
<version>13.11.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-kotlin</artifactId>
|
||||
@@ -28,7 +28,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.0-SNAPSHOT</version>
|
||||
<version>13.11.0-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>13.10.0-SNAPSHOT</version>
|
||||
<version>13.11.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<tiles>
|
||||
<tile>io.ebean.tile:enhancement:13.6.5</tile>
|
||||
<tile>io.ebean.tile:enhancement:13.10.1</tile>
|
||||
</tiles>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean postgis</name>
|
||||
@@ -22,14 +22,14 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- provided scope -->
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>42.5.0</version>
|
||||
<version>42.5.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<tiles>
|
||||
<tile>io.ebean.tile:enhancement:13.6.5</tile>
|
||||
<tile>io.ebean.tile:enhancement:13.10.1</tile>
|
||||
</tiles>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean querybean</name>
|
||||
@@ -17,7 +17,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -63,21 +63,21 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-generator</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>querybean-generator</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<tiles>
|
||||
<tile>io.ebean.tile:enhancement:13.10.0</tile>
|
||||
<tile>io.ebean.tile:enhancement:13.10.1</tile>
|
||||
</tiles>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package io.ebean.typequery;
|
||||
|
||||
|
||||
import io.ebean.Query;
|
||||
|
||||
/**
|
||||
* Base property for all comparable types.
|
||||
*
|
||||
@@ -40,6 +42,17 @@ public class PBaseCompareable<R, T> extends PBaseValueEqual<R, T> {
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Greater than other property.
|
||||
*
|
||||
* @param other the other property to compare
|
||||
* @return the root query bean instance
|
||||
*/
|
||||
public final R gt(TQProperty<?> other) {
|
||||
expr().raw(_name + " > " + other.propertyName());
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Greater than OR Null.
|
||||
*
|
||||
@@ -62,6 +75,17 @@ public class PBaseCompareable<R, T> extends PBaseValueEqual<R, T> {
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Greater than or Equal to other property.
|
||||
*
|
||||
* @param other the other property to compare
|
||||
* @return the root query bean instance
|
||||
*/
|
||||
public final R ge(TQProperty<?> other) {
|
||||
expr().raw(_name + " >= " + other.propertyName());
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Greater than or Equal to OR Null.
|
||||
*
|
||||
@@ -84,6 +108,17 @@ public class PBaseCompareable<R, T> extends PBaseValueEqual<R, T> {
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Less than other property.
|
||||
*
|
||||
* @param other the other property to compare
|
||||
* @return the root query bean instance
|
||||
*/
|
||||
public final R lt(TQProperty<?> other) {
|
||||
expr().raw(_name + " < " + other.propertyName());
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Less than OR Null.
|
||||
*
|
||||
@@ -106,6 +141,17 @@ public class PBaseCompareable<R, T> extends PBaseValueEqual<R, T> {
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Less than or Equal to other property.
|
||||
*
|
||||
* @param other the other property to compare
|
||||
* @return the root query bean instance
|
||||
*/
|
||||
public final R le(TQProperty<?> other) {
|
||||
expr().raw(_name + " <= " + other.propertyName());
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Less than or Equal to.
|
||||
*
|
||||
@@ -156,6 +202,29 @@ public class PBaseCompareable<R, T> extends PBaseValueEqual<R, T> {
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* A Property is in Range between 2 other properties.
|
||||
*
|
||||
* <pre>{@code
|
||||
* var o = QOrder.alias();
|
||||
*
|
||||
* new QOrder()
|
||||
* .orderDate.inRangeWith(o.product.startDate, o.product.endDate)
|
||||
* .findList();
|
||||
*
|
||||
* // which equates to
|
||||
* product.startDate <= orderDate and (product.endDate > orderDate or product.endDate is null)
|
||||
*
|
||||
* }</pre>
|
||||
*
|
||||
* <p>
|
||||
* This is a convenience expression combining a number of simple expressions.
|
||||
*/
|
||||
public final R inRangeWith(TQProperty<?> lowProperty, TQProperty<?> highProperty) {
|
||||
expr().inRangeWithProperties(_name, lowProperty.propertyName(), highProperty.propertyName());
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Between lower and upper values.
|
||||
*
|
||||
@@ -234,4 +303,47 @@ public class PBaseCompareable<R, T> extends PBaseValueEqual<R, T> {
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Property is Less Than or Equal To the result of a sub-query.
|
||||
*
|
||||
* @param subQuery value provided by a subQuery
|
||||
* @return the root query bean instance
|
||||
*/
|
||||
public final R le(Query<?> subQuery) {
|
||||
expr().le(_name, subQuery);
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Property is Less Than the result of a sub-query.
|
||||
*
|
||||
* @param subQuery value provided by a subQuery
|
||||
* @return the root query bean instance
|
||||
*/
|
||||
public final R lt(Query<?> subQuery) {
|
||||
expr().lt(_name, subQuery);
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Property is Greater Than or Equal To the result of a sub-query.
|
||||
*
|
||||
* @param subQuery value provided by a subQuery
|
||||
* @return the root query bean instance
|
||||
*/
|
||||
public final R ge(Query<?> subQuery) {
|
||||
expr().ge(_name, subQuery);
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Property is Greater Than the result of a sub-query.
|
||||
*
|
||||
* @param subQuery value provided by a subQuery
|
||||
* @return the root query bean instance
|
||||
*/
|
||||
public final R gt(Query<?> subQuery) {
|
||||
expr().gt(_name, subQuery);
|
||||
return _root;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,6 +83,17 @@ public abstract class PBaseValueEqual<R, T> extends TQPropertyBase<R> {
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is equal to another property.
|
||||
*
|
||||
* @param other the other property to compare
|
||||
* @return the root query bean instance
|
||||
*/
|
||||
public final R eq(TQProperty<?> other) {
|
||||
expr().raw(_name + " = " + other.propertyName());
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is equal to if value is non-null and otherwise no expression is added to the query.
|
||||
* <p>
|
||||
@@ -135,6 +146,17 @@ public abstract class PBaseValueEqual<R, T> extends TQPropertyBase<R> {
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is not equal to another property.
|
||||
*
|
||||
* @param other the other property to compare
|
||||
* @return the root query bean instance
|
||||
*/
|
||||
public final R ne(TQProperty<?> other) {
|
||||
expr().raw(_name + " <> " + other.propertyName());
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is in a list of values.
|
||||
*
|
||||
@@ -259,7 +281,7 @@ public abstract class PBaseValueEqual<R, T> extends TQPropertyBase<R> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Is in the result of a subquery. Synonym for in().
|
||||
* Is in the result of a sub-query. Synonym for in().
|
||||
*
|
||||
* @param subQuery values provided by a subQuery
|
||||
* @return the root query bean instance
|
||||
@@ -269,7 +291,7 @@ public abstract class PBaseValueEqual<R, T> extends TQPropertyBase<R> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Is NOT in the result of a subquery.
|
||||
* Is NOT in the result of a sub-query.
|
||||
*
|
||||
* @param subQuery values provided by a subQuery
|
||||
* @return the root query bean instance
|
||||
@@ -278,4 +300,26 @@ public abstract class PBaseValueEqual<R, T> extends TQPropertyBase<R> {
|
||||
expr().notIn(_name, subQuery);
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Property is equal to the result of a sub-query.
|
||||
*
|
||||
* @param subQuery value provided by a subQuery
|
||||
* @return the root query bean instance
|
||||
*/
|
||||
public final R eq(Query<?> subQuery) {
|
||||
expr().eq(_name, subQuery);
|
||||
return _root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Property is not equal to the result of a sub-query.
|
||||
*
|
||||
* @param subQuery value provided by a subQuery
|
||||
* @return the root query bean instance
|
||||
*/
|
||||
public final R ne(Query<?> subQuery) {
|
||||
expr().ne(_name, subQuery);
|
||||
return _root;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -693,6 +693,22 @@ public abstract class TQRootBean<T, R> {
|
||||
return root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add EXISTS sub-query predicate.
|
||||
*/
|
||||
public R exists(Query<?> subQuery) {
|
||||
query.where().exists(subQuery);
|
||||
return root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add NOT EXISTS sub-query predicate.
|
||||
*/
|
||||
public R notExists(Query<?> subQuery) {
|
||||
query.where().notExists(subQuery);
|
||||
return root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute using "for update" clause which results in the DB locking the record.
|
||||
*/
|
||||
|
||||
@@ -3,6 +3,8 @@ package org.example.domain;
|
||||
import io.ebean.annotation.DbArray;
|
||||
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -16,7 +18,11 @@ import java.util.Map;
|
||||
public class Contact extends BaseModel {
|
||||
|
||||
@DbArray
|
||||
List<String> phoneNumbers = new ArrayList<>();
|
||||
List<@Size(max=20) String> phoneNumbers = new ArrayList<>();
|
||||
|
||||
@ElementCollection
|
||||
@Size(max=10)
|
||||
List<@Size(max=20) String> paths;
|
||||
|
||||
@Column(length = 50)
|
||||
String firstName;
|
||||
@@ -36,7 +42,7 @@ public class Contact extends BaseModel {
|
||||
Customer customer;
|
||||
|
||||
@OneToMany(mappedBy = "contact")
|
||||
List<ContactNote> notes;
|
||||
List<@NotNull ContactNote> notes;
|
||||
|
||||
@OneToMany(cascade = CascadeType.PERSIST)
|
||||
@MapKey(name = "key")
|
||||
|
||||
@@ -155,6 +155,39 @@ public class QCustomerTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void equalTo_byProperty() {
|
||||
Query<Customer> query = new QCustomer()
|
||||
.select(QCustomer.Alias.id)
|
||||
.billingAddress.city.eq(QCustomer.Alias.shippingAddress.city)
|
||||
.query();
|
||||
|
||||
query.findList();
|
||||
String generatedSql = query.getGeneratedSql();
|
||||
|
||||
// select t0.id from be_customer t0
|
||||
// left join o_address t2 on t2.id = t0.shipping_address_id
|
||||
// left join o_address t1 on t1.id = t0.billing_address_id
|
||||
// where t1.city = t2.city
|
||||
assertThat(generatedSql).contains("where t1.city = t2.city");
|
||||
}
|
||||
|
||||
@Test
|
||||
void notEqual_byProperty() {
|
||||
Query<Customer> query = new QCustomer()
|
||||
.select(QCustomer.Alias.id)
|
||||
.billingAddress.city.ne(QCustomer.Alias.shippingAddress.city)
|
||||
.query();
|
||||
|
||||
query.findList();
|
||||
String generatedSql = query.getGeneratedSql();
|
||||
|
||||
// select t0.id from be_customer t0
|
||||
// left join o_address t2 on t2.id = t0.shipping_address_id
|
||||
// left join o_address t1 on t1.id = t0.billing_address_id
|
||||
// where t1.city <> t2.city
|
||||
assertThat(generatedSql).contains("where t1.city <> t2.city");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isEmpty() {
|
||||
@@ -421,6 +454,7 @@ public class QCustomerTest {
|
||||
assertContains(new QCustomer().registered.lt(new Date()).query(), " where t0.registered < ?");
|
||||
assertContains(new QCustomer().registered.before(new Date()).query(), " where t0.registered < ?");
|
||||
assertContains(new QCustomer().registered.lessThan(new Date()).query(), " where t0.registered < ?");
|
||||
assertContains(new QCustomer().registered.lt(QCustomer.Alias.whenUpdated).query(), " where t0.registered < t0.when_updated");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -428,6 +462,7 @@ public class QCustomerTest {
|
||||
|
||||
assertContains(new QCustomer().registered.le(new Date()).query(), " where t0.registered <= ?");
|
||||
assertContains(new QCustomer().registered.lessOrEqualTo(new Date()).query(), " where t0.registered <= ?");
|
||||
assertContains(new QCustomer().registered.le(QCustomer.Alias.whenUpdated).query(), " where t0.registered <= t0.when_updated");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -435,6 +470,7 @@ public class QCustomerTest {
|
||||
|
||||
assertContains(new QCustomer().registered.after(new Date()).query(), " where t0.registered > ?");
|
||||
assertContains(new QCustomer().registered.gt(new Date()).query(), " where t0.registered > ?");
|
||||
assertContains(new QCustomer().registered.gt(QCustomer.Alias.whenUpdated).query(), " where t0.registered > t0.when_updated");
|
||||
assertContains(new QCustomer().registered.greaterThan(new Date()).query(), " where t0.registered > ?");
|
||||
}
|
||||
|
||||
@@ -444,6 +480,7 @@ public class QCustomerTest {
|
||||
|
||||
assertContains(new QCustomer().registered.ge(new Date()).query(), " where t0.registered >= ?");
|
||||
assertContains(new QCustomer().registered.greaterOrEqualTo(new Date()).query(), " where t0.registered >= ?");
|
||||
assertContains(new QCustomer().registered.ge(QCustomer.Alias.whenUpdated).query(), " where t0.registered >= t0.when_updated");
|
||||
}
|
||||
|
||||
private void assertContains(Query<Customer> query, String match) {
|
||||
@@ -628,6 +665,22 @@ public class QCustomerTest {
|
||||
.findList();
|
||||
}
|
||||
|
||||
@Test
|
||||
void query_inRangeWithOtherProperties() {
|
||||
var c = QCustomer.alias();
|
||||
|
||||
Query<Customer> query = new QCustomer()
|
||||
.select(c.id)
|
||||
.name.inRangeWith(c.contacts.firstName, c.contacts.lastName)
|
||||
.query();
|
||||
|
||||
// select distinct t0.id from be_customer t0
|
||||
// left join be_contact t1 on t1.customer_id = t0.id
|
||||
// where t1.first_name <= t0.name and (t0.name < t1.last_name or t1.last_name is null)
|
||||
query.findList();
|
||||
assertThat(query.getGeneratedSql()).contains(" where t1.first_name <= t0.name and (t0.name < t1.last_name or t1.last_name is null)");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void query_exists() {
|
||||
|
||||
|
||||
@@ -2,12 +2,16 @@ package org.querytest;
|
||||
|
||||
import io.ebean.DB;
|
||||
import io.ebean.FetchGroup;
|
||||
import io.ebean.Query;
|
||||
import io.ebean.test.LoggedSql;
|
||||
import io.ebean.typequery.TQProperty;
|
||||
import org.example.domain.Customer;
|
||||
import org.example.domain.Order;
|
||||
import org.example.domain.OrderDetail;
|
||||
import org.example.domain.otherpackage.PhoneNumber;
|
||||
import org.example.domain.query.QCustomer;
|
||||
import org.example.domain.query.QOrder;
|
||||
import org.example.domain.query.QOrderDetail;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -214,6 +218,152 @@ public class QOrderTest {
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
void geSubQuery() {
|
||||
var subQuery = new QOrder()
|
||||
.select(StdFunctions.max(QOrder.Alias.orderDate))
|
||||
.query();
|
||||
|
||||
var query = new QCustomer()
|
||||
.select(QCustomer.Alias.id)
|
||||
.registered.ge(subQuery)
|
||||
.query();
|
||||
query.findList();
|
||||
|
||||
assertThat(query.getGeneratedSql()).contains("select t0.id from be_customer t0 where t0.registered >= (select max(t0.order_date) from o_order t0)");
|
||||
}
|
||||
|
||||
@Test
|
||||
void gtSubQuery() {
|
||||
var subQuery = new QOrder()
|
||||
.select("max(orderDate)")
|
||||
.query();
|
||||
|
||||
var query = new QCustomer()
|
||||
.select(QCustomer.Alias.id)
|
||||
.registered.gt(subQuery)
|
||||
.query();
|
||||
query.findList();
|
||||
|
||||
assertThat(query.getGeneratedSql()).contains("select t0.id from be_customer t0 where t0.registered > (select max(t0.order_date) from o_order t0)");
|
||||
}
|
||||
|
||||
@Test
|
||||
void leSubQuery() {
|
||||
var subQuery = new QOrder()
|
||||
.select("max(orderDate)")
|
||||
.query();
|
||||
|
||||
var query = new QCustomer()
|
||||
.select(QCustomer.Alias.id)
|
||||
.registered.le(subQuery)
|
||||
.query();
|
||||
query.findList();
|
||||
|
||||
assertThat(query.getGeneratedSql()).contains("select t0.id from be_customer t0 where t0.registered <= (select max(t0.order_date) from o_order t0)");
|
||||
}
|
||||
|
||||
@Test
|
||||
void ltSubQuery() {
|
||||
var subQuery = new QOrder()
|
||||
.select("max(orderDate)")
|
||||
.query();
|
||||
|
||||
var query = new QCustomer()
|
||||
.select(QCustomer.Alias.id)
|
||||
.registered.lt(subQuery)
|
||||
.query();
|
||||
query.findList();
|
||||
|
||||
assertThat(query.getGeneratedSql()).contains("select t0.id from be_customer t0 where t0.registered < (select max(t0.order_date) from o_order t0)");
|
||||
}
|
||||
|
||||
@Test
|
||||
void eqSubQuery() {
|
||||
var subQuery = new QOrder()
|
||||
.select("max(orderDate)")
|
||||
.query();
|
||||
|
||||
var query = new QCustomer()
|
||||
.select(QCustomer.Alias.id)
|
||||
.registered.eq(subQuery)
|
||||
.query();
|
||||
query.findList();
|
||||
|
||||
assertThat(query.getGeneratedSql()).contains("select t0.id from be_customer t0 where t0.registered = (select max(t0.order_date) from o_order t0)");
|
||||
}
|
||||
|
||||
@Test
|
||||
void neSubQuery() {
|
||||
var subQuery = new QOrder()
|
||||
.select(StdFunctions.max(QOrder.Alias.orderDate))
|
||||
.query();
|
||||
|
||||
var query = new QCustomer()
|
||||
.select(QCustomer.Alias.id)
|
||||
.registered.ne(subQuery)
|
||||
.query();
|
||||
query.findList();
|
||||
|
||||
assertThat(query.getGeneratedSql()).contains("select t0.id from be_customer t0 where t0.registered <> (select max(t0.order_date) from o_order t0)");
|
||||
}
|
||||
|
||||
@Test
|
||||
void propertyCompare() {
|
||||
Query<Order> query = new QOrder()
|
||||
.orderDate.lt(QOrder.Alias.customer.registered)
|
||||
.query();
|
||||
|
||||
query.findList();
|
||||
assertThat(query.getGeneratedSql()).contains(" from o_order t0 join be_customer t1 on t1.id = t0.customer_id where t0.order_date < t1.registered");
|
||||
}
|
||||
|
||||
@Test
|
||||
void subQueryExists() {
|
||||
Query<OrderDetail> subQuery = new QOrderDetail()
|
||||
.alias("od")
|
||||
.orderQty.gt(10)
|
||||
.id.eq(QOrder.Alias.details.id)
|
||||
//.where().raw("details.id = od.id")
|
||||
.query();
|
||||
|
||||
Query<Order> query = new QOrder()
|
||||
.exists(subQuery)
|
||||
.orderBy("orderDate").query();
|
||||
|
||||
query.findList();
|
||||
|
||||
// select distinct t0.id, t0.status, t0.order_date, t0.ship_date, t0.version, t0.when_created, t0.when_updated, t0.customer_id, t0.shipping_address_id, t0.order_date
|
||||
// from o_order t0
|
||||
// left join o_order_detail t1 on t1.order_id = t0.id
|
||||
// where exists (select 1 from o_order_detail od where od.order_qty > ? and od.id = t1.id) order by t0.order_date
|
||||
String sql = query.getGeneratedSql();
|
||||
assertThat(sql).contains(" exists (select 1 from o_order_detail od where od.order_qty > ? and od.id = t1.id)");
|
||||
}
|
||||
|
||||
@Test
|
||||
void subQueryNotExists() {
|
||||
Query<OrderDetail> subQuery = new QOrderDetail()
|
||||
.alias("od")
|
||||
.orderQty.gt(10)
|
||||
.id.eq(QOrder.Alias.details.id)
|
||||
//.where().raw("details.id = od.id")
|
||||
.query();
|
||||
|
||||
Query<Order> query = new QOrder()
|
||||
.notExists(subQuery)
|
||||
.orderBy("orderDate")
|
||||
.query();
|
||||
query.findList();
|
||||
|
||||
// select distinct t0.id, t0.status, t0.order_date, t0.ship_date, t0.version, t0.when_created, t0.when_updated, t0.customer_id, t0.shipping_address_id, t0.order_date
|
||||
// from o_order t0
|
||||
// left join o_order_detail t1 on t1.order_id = t0.id
|
||||
// where not exists (select 1 from o_order_detail od where od.order_qty > ? and od.id = t1.id) order by t0.order_date
|
||||
String sql = query.getGeneratedSql();
|
||||
assertThat(sql).contains(" not exists (select 1 from o_order_detail od where od.order_qty > ? and od.id = t1.id)");
|
||||
}
|
||||
|
||||
private static void setupData() {
|
||||
customer = new Customer();
|
||||
customer.name = "Fred";
|
||||
@@ -224,4 +374,10 @@ public class QOrderTest {
|
||||
order.setCustomer(customer);
|
||||
order.save();
|
||||
}
|
||||
|
||||
static class StdFunctions {
|
||||
static String max(TQProperty<?> prop) {
|
||||
return "max(" + prop + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@ datasource.default=h2
|
||||
|
||||
datasource.h2.username=sa
|
||||
datasource.h2.password=
|
||||
datasource.h2.url=jdbc:h2:mem:tests;NON_KEYWORDS=KEY
|
||||
datasource.h2.url=jdbc:h2:mem:tests;NON_KEYWORDS=KEY,VALUE
|
||||
|
||||
datasource.pg.username=sa
|
||||
datasource.pg.password=
|
||||
datasource.pg.url=jdbc:h2:mem:tests;NON_KEYWORDS=KEY
|
||||
datasource.pg.url=jdbc:h2:mem:tests;NON_KEYWORDS=KEY,VALUE
|
||||
|
||||
+7
-7
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-redis</artifactId>
|
||||
@@ -22,35 +22,35 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>querybean-generator</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<tiles>
|
||||
<tile>io.ebean.tile:enhancement:13.6.5</tile>
|
||||
<tile>io.ebean.tile:enhancement:13.10.1</tile>
|
||||
</tiles>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
+10
-10
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean test</name>
|
||||
@@ -28,20 +28,20 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-generator</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -105,28 +105,28 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-joda-time</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-jackson-jsonnode</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-jackson-mapper</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-all</artifactId>
|
||||
<version>13.10.0</version>
|
||||
<version>13.11.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -183,7 +183,7 @@
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>42.5.0</version>
|
||||
<version>42.5.1</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.checkerframework</groupId>
|
||||
@@ -286,7 +286,7 @@
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<tiles>
|
||||
<tile>io.ebean.tile:enhancement:13.10.0</tile>
|
||||
<tile>io.ebean.tile:enhancement:13.10.1</tile>
|
||||
</tiles>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
@@ -18,6 +18,7 @@ import org.tests.model.basic.Customer;
|
||||
import org.tests.model.basic.EBasicLog;
|
||||
import org.tests.model.basic.ResetBasicData;
|
||||
|
||||
import java.sql.Types;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
@@ -366,6 +367,38 @@ class DtoQueryTest extends BaseTestCase {
|
||||
assertThat(list).isNotEmpty();
|
||||
}
|
||||
|
||||
@ForPlatform(Platform.H2)
|
||||
@Test
|
||||
void dto3_setNullByPosition() {
|
||||
ResetBasicData.reset();
|
||||
|
||||
List<DCust3> robs = server().findDto(DCust3.class, "select id, name, nvl(cast(? as int), 42) as totalOrders from o_customer where name like ?")
|
||||
.setNullParameter(1, Types.INTEGER)
|
||||
.setParameter(2, "Rob")
|
||||
.setMaxRows(10)
|
||||
.findList();
|
||||
|
||||
log.info(robs.toString());
|
||||
assertThat(robs).isNotEmpty();
|
||||
assertThat(robs.get(0).getTotalOrders()).isEqualTo(42);
|
||||
}
|
||||
|
||||
@ForPlatform(Platform.H2)
|
||||
@Test
|
||||
void dto3_setNullByName() {
|
||||
ResetBasicData.reset();
|
||||
|
||||
List<DCust3> robs = server().findDto(DCust3.class, "select id, name, nvl(cast(:foo as int), 42) as totalOrders from o_customer where name like :bar")
|
||||
.setNullParameter("foo", Types.INTEGER)
|
||||
.setParameter("bar", "Rob")
|
||||
.setMaxRows(10)
|
||||
.findList();
|
||||
|
||||
log.info(robs.toString());
|
||||
assertThat(robs).isNotEmpty();
|
||||
assertThat(robs.get(0).getTotalOrders()).isEqualTo(42);
|
||||
}
|
||||
|
||||
@Test
|
||||
void dto3_findList_constructorMatch() {
|
||||
ResetBasicData.reset();
|
||||
|
||||
+44
@@ -4,13 +4,53 @@ import io.ebean.Database;
|
||||
import io.ebean.DatabaseFactory;
|
||||
import io.ebean.config.DatabaseConfig;
|
||||
import io.ebean.event.ServerConfigStartup;
|
||||
import io.ebeaninternal.api.SpiLogger;
|
||||
import io.ebeaninternal.api.SpiLoggerFactory;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.tests.model.basic.UTDetail;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class EbeanServerFactory_ServerConfigStart_Test {
|
||||
|
||||
|
||||
/**
|
||||
* Demo, how to intercept logging for a certain database.
|
||||
* In conjunction to ServiceLoader, you can add different loggers to different databases
|
||||
*/
|
||||
private static class MySpiLoggerFactory implements SpiLoggerFactory {
|
||||
Set<String> loggers = new HashSet<>();
|
||||
|
||||
@Override
|
||||
public SpiLogger create(String name) {
|
||||
loggers.add(name);
|
||||
// just return a dummy here
|
||||
return new SpiLogger() {
|
||||
@Override
|
||||
public boolean isDebug() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTrace() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void debug(String msg) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void trace(String msg) {
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test() throws InterruptedException {
|
||||
|
||||
@@ -30,9 +70,13 @@ public class EbeanServerFactory_ServerConfigStart_Test {
|
||||
// act - register an instance
|
||||
OnStartup onStartup = new OnStartup();
|
||||
config.addServerConfigStartup(onStartup);
|
||||
MySpiLoggerFactory loggerFactory = new MySpiLoggerFactory();
|
||||
config.putServiceObject(SpiLoggerFactory.class, loggerFactory);
|
||||
|
||||
Database db = DatabaseFactory.create(config);
|
||||
|
||||
assertThat(loggerFactory.loggers).containsExactlyInAnyOrder("io.ebean.SQL", "io.ebean.SUM", "io.ebean.TXN");
|
||||
|
||||
assertThat(onStartup.calledWithConfig).isSameAs(config);
|
||||
assertThat(OnStartupViaClass.calledWithConfig).isSameAs(config);
|
||||
|
||||
|
||||
+21
@@ -105,4 +105,25 @@ public class JdbcTransactionTest {
|
||||
assertThat(postCommitCallCount.get()).isEqualTo(2); // postcommit executed twice
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFlushInCallback() {
|
||||
try (Transaction transaction = DB.beginTransaction()) {
|
||||
transaction.setBatchMode(true);
|
||||
DB.currentTransaction().register(
|
||||
new TransactionCallbackAdapter() {
|
||||
|
||||
@Override
|
||||
public void preCommit() {
|
||||
EBasic basic = new EBasic("binner1");
|
||||
DB.save(basic);
|
||||
}
|
||||
}
|
||||
);
|
||||
EBasic basic = new EBasic("bouter1");
|
||||
DB.save(basic);
|
||||
transaction.commit(); // transaction will fail if recursive post-commit is failing
|
||||
}
|
||||
assertThat(DB.find(EBasic.class).where().eq("name", "binner1").exists()).isTrue();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package org.tests.basic;
|
||||
|
||||
import io.ebean.annotation.Platform;
|
||||
import io.ebean.xtest.BaseTestCase;
|
||||
import io.ebean.DB;
|
||||
import io.ebean.Query;
|
||||
import io.ebean.xtest.IgnorePlatform;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.tests.model.basic.Order;
|
||||
import org.tests.model.basic.ResetBasicData;
|
||||
@@ -22,6 +24,7 @@ public class TestLimitQuery extends BaseTestCase {
|
||||
rob();
|
||||
}
|
||||
|
||||
@IgnorePlatform({Platform.MYSQL, Platform.MARIADB})
|
||||
@Test
|
||||
public void testMaxRowsZeroWithFirstRow() {
|
||||
|
||||
@@ -40,7 +43,7 @@ public class TestLimitQuery extends BaseTestCase {
|
||||
String sql = query.getGeneratedSql();
|
||||
if (isH2()) {
|
||||
assertThat(sql).contains("offset 3");
|
||||
assertThat(sql).contains("limit 0");
|
||||
assertThat(sql).doesNotContain("limit");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import io.ebean.xtest.BaseTestCase;
|
||||
import io.ebean.xtest.ForPlatform;
|
||||
import io.ebean.annotation.Platform;
|
||||
import io.ebean.test.LoggedSql;
|
||||
import io.ebean.xtest.IgnorePlatform;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.tests.model.basic.Customer;
|
||||
import org.tests.model.basic.EBasic;
|
||||
@@ -19,7 +20,6 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
public class TestQueryForUpdate extends BaseTestCase {
|
||||
|
||||
@Test
|
||||
@ForPlatform({Platform.H2, Platform.ORACLE, Platform.POSTGRES, Platform.SQLSERVER, Platform.MYSQL, Platform.MARIADB})
|
||||
public void testForUpdate() {
|
||||
|
||||
ResetBasicData.reset();
|
||||
@@ -35,13 +35,35 @@ public class TestQueryForUpdate extends BaseTestCase {
|
||||
|
||||
if (isSqlServer()) {
|
||||
assertThat(sqlOf(query)).contains("with (updlock)");
|
||||
} else {
|
||||
} else if (!isDb2()){
|
||||
assertThat(sqlOf(query)).contains("for update");
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@ForPlatform({ Platform.H2, Platform.ORACLE, Platform.POSTGRES, Platform.SQLSERVER, Platform.MYSQL, Platform.MARIADB})
|
||||
public void testForUpdate_withLimit() {
|
||||
ResetBasicData.reset();
|
||||
|
||||
Query<Customer> query;
|
||||
try (final Transaction transaction = DB.beginTransaction()) {
|
||||
query = DB.find(Customer.class)
|
||||
.forUpdate()
|
||||
.setMaxRows(3)
|
||||
.order().desc("id");
|
||||
|
||||
query.findList();
|
||||
}
|
||||
|
||||
if (isSqlServer()) {
|
||||
assertThat(sqlOf(query)).contains("with (updlock)");
|
||||
} else if (!isOracle() && !isDb2()) {
|
||||
// Oracle does not support FOR UPDATE with FETCH
|
||||
assertThat(sqlOf(query)).contains("for update");
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@ForPlatform({Platform.H2, Platform.ORACLE, Platform.POSTGRES, Platform.SQLSERVER, Platform.MYSQL, Platform.MARIADB})
|
||||
public void testForUpdate_when_alreadyInPCAsReference() {
|
||||
ResetBasicData.reset();
|
||||
Order o0 = DB.find(Order.class).orderBy("id").setMaxRows(1).findOne();
|
||||
@@ -75,7 +97,7 @@ public class TestQueryForUpdate extends BaseTestCase {
|
||||
}
|
||||
|
||||
@Test
|
||||
@ForPlatform({ Platform.H2, Platform.ORACLE, Platform.POSTGRES, Platform.SQLSERVER, Platform.MYSQL, Platform.MARIADB})
|
||||
@ForPlatform({Platform.H2, Platform.ORACLE, Platform.POSTGRES, Platform.SQLSERVER, Platform.MYSQL, Platform.MARIADB})
|
||||
public void testForUpdate_when_alreadyInPCAsReference_usingLock() {
|
||||
ResetBasicData.reset();
|
||||
Order o0 = DB.find(Order.class).orderBy("id").setMaxRows(1).findOne();
|
||||
@@ -110,7 +132,7 @@ public class TestQueryForUpdate extends BaseTestCase {
|
||||
}
|
||||
|
||||
@Test
|
||||
@ForPlatform({ Platform.H2, Platform.ORACLE, Platform.POSTGRES, Platform.SQLSERVER, Platform.MYSQL, Platform.MARIADB})
|
||||
@ForPlatform({Platform.H2, Platform.ORACLE, Platform.POSTGRES, Platform.SQLSERVER, Platform.MYSQL, Platform.MARIADB})
|
||||
public void testForUpdate_when_alreadyInPC() {
|
||||
|
||||
EBasic basic = new EBasic("test PC cache");
|
||||
@@ -124,7 +146,7 @@ public class TestQueryForUpdate extends BaseTestCase {
|
||||
assertThat(basic0).isNotNull();
|
||||
|
||||
EBasic basic1 = DB.find(EBasic.class)
|
||||
.setId( basic.getId())
|
||||
.setId(basic.getId())
|
||||
.forUpdate()
|
||||
.findOne();
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package org.tests.basic.encrypt;
|
||||
|
||||
import io.ebean.xtest.BaseTestCase;
|
||||
import io.ebean.DB;
|
||||
import io.ebean.SqlRow;
|
||||
import io.ebean.xtest.ForPlatform;
|
||||
import io.ebean.xtest.IgnorePlatform;
|
||||
import io.ebean.annotation.Platform;
|
||||
import io.ebean.config.dbplatform.DbEncrypt;
|
||||
import io.ebean.test.LoggedSql;
|
||||
import io.ebean.xtest.BaseTestCase;
|
||||
import io.ebean.xtest.ForPlatform;
|
||||
import io.ebean.xtest.IgnorePlatform;
|
||||
import io.ebeaninternal.api.SpiEbeanServer;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.tests.model.basic.EBasicEncrypt;
|
||||
@@ -109,7 +109,8 @@ public class TestEncrypt extends BaseTestCase {
|
||||
EBasicEncrypt e = new EBasicEncrypt();
|
||||
e.setName("testname");
|
||||
e.setDescription("testdesc");
|
||||
e.setDob(new Date(System.currentTimeMillis() - 100000));
|
||||
long refTime = System.currentTimeMillis() - 100000;
|
||||
e.setDob(new Date(refTime));
|
||||
|
||||
DB.save(e);
|
||||
|
||||
@@ -149,9 +150,40 @@ public class TestEncrypt extends BaseTestCase {
|
||||
|
||||
assertEquals(1, list.size());
|
||||
|
||||
list = DB.find(EBasicEncrypt.class).where()
|
||||
.in("description", "moddesc").findList();
|
||||
|
||||
assertEquals(1, list.size());
|
||||
|
||||
list = DB.find(EBasicEncrypt.class).where().startsWith("description", "modde").findList();
|
||||
|
||||
assertEquals(1, list.size());
|
||||
|
||||
// Note, we only have "date" precision (See #2878)
|
||||
list = DB.find(EBasicEncrypt.class).where().between("dob",
|
||||
new Date(refTime - 2 * 86400000), new Date(refTime - 1 * 86400000)).findList();
|
||||
|
||||
assertEquals(0, list.size());
|
||||
|
||||
list = DB.find(EBasicEncrypt.class).where().inRange("dob",
|
||||
new Date(refTime - 2 * 86400000), new Date(refTime - 1 * 86400000)).findList();
|
||||
|
||||
assertEquals(0, list.size());
|
||||
|
||||
list = DB.find(EBasicEncrypt.class).where().between("dob",
|
||||
new Date(refTime - 2 * 86400000), new Date(refTime + 1 * 86400000)).findList();
|
||||
|
||||
assertEquals(1, list.size());
|
||||
|
||||
list = DB.find(EBasicEncrypt.class).where().inRange("dob",
|
||||
new Date(refTime - 2 * 86400000), new Date(refTime + 1 * 86400000)).findList();
|
||||
|
||||
assertEquals(1, list.size());
|
||||
|
||||
|
||||
//list = DB.find(EBasicEncrypt.class).where().inRange("dob", new Date(refTime), new Date(refTime+1)).findList();
|
||||
|
||||
//assertEquals(1, list.size());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.tests.basic.encrypt;
|
||||
|
||||
import io.ebean.xtest.BaseTestCase;
|
||||
import io.ebean.DB;
|
||||
import io.ebean.xtest.BaseTestCase;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.tests.model.basic.EBasicEncryptClient;
|
||||
|
||||
@@ -50,6 +50,16 @@ public class TestEncryptClientSide extends BaseTestCase {
|
||||
assertThat(found).isNotNull();
|
||||
assertThat(found.getDescription()).isEqualTo("goodbye");
|
||||
|
||||
found = DB.find(EBasicEncryptClient.class)
|
||||
.where()
|
||||
.in("description", "goodbye")
|
||||
.in("status", EBasicEncryptClient.Status.TWO)
|
||||
.in("dob", today)
|
||||
.findOne();
|
||||
assertThat(found).isNotNull();
|
||||
assertThat(found.getDescription()).isEqualTo("goodbye");
|
||||
|
||||
|
||||
DB.delete(found);
|
||||
}
|
||||
}
|
||||
|
||||
+45
-17
@@ -3,6 +3,8 @@ package org.tests.cache;
|
||||
import io.ebean.CacheMode;
|
||||
import io.ebean.DB;
|
||||
import io.ebean.ExpressionList;
|
||||
import io.ebean.annotation.Transactional;
|
||||
import io.ebean.annotation.TxIsolation;
|
||||
import io.ebean.bean.BeanCollection;
|
||||
import io.ebean.cache.ServerCache;
|
||||
import io.ebean.test.LoggedSql;
|
||||
@@ -91,12 +93,12 @@ public class TestQueryCache extends BaseTestCase {
|
||||
// ensure that findCount & findSingleAttribute use different
|
||||
// slots in cache. If not a "Cannot cast List to int" should happen.
|
||||
int count = DB
|
||||
.find(EColAB.class)
|
||||
.setUseQueryCache(true)
|
||||
.select("columnA")
|
||||
.where()
|
||||
.eq("columnB", "SingleAttribute")
|
||||
.findCount();
|
||||
.find(EColAB.class)
|
||||
.setUseQueryCache(true)
|
||||
.select("columnA")
|
||||
.where()
|
||||
.eq("columnB", "SingleAttribute")
|
||||
.findCount();
|
||||
assertThat(count).isEqualTo(2);
|
||||
}
|
||||
|
||||
@@ -159,6 +161,32 @@ public class TestQueryCache extends BaseTestCase {
|
||||
assertThat(count2).isEqualTo(count1);
|
||||
sql = LoggedSql.stop();
|
||||
assertThat(sql).hasSize(1);
|
||||
|
||||
LoggedSql.start();
|
||||
findCountNoTxn();
|
||||
sql = LoggedSql.stop();
|
||||
assertThat(sql).hasSize(0);
|
||||
|
||||
// Oracle does not support READ_UNCOMMITTED as expected
|
||||
if (!isOracle()) {
|
||||
LoggedSql.start();
|
||||
findCountTxn();
|
||||
sql = LoggedSql.stop();
|
||||
assertThat(sql).hasSize(0);
|
||||
}
|
||||
}
|
||||
|
||||
private void findCountNoTxn() {
|
||||
DB.find(EColAB.class)
|
||||
.setUseQueryCache(CacheMode.ON)
|
||||
.where()
|
||||
.eq("columnB", "count")
|
||||
.findCount();
|
||||
}
|
||||
|
||||
@Transactional(isolation = TxIsolation.READ_UNCOMMITTED)
|
||||
private void findCountTxn() {
|
||||
findCountNoTxn();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -305,7 +333,7 @@ public class TestQueryCache extends BaseTestCase {
|
||||
assertSame(list, list2B);
|
||||
|
||||
List<Customer> list3 = DB.find(Customer.class).setUseQueryCache(true).setReadOnly(false).where()
|
||||
.ilike("name", "Rob").findList();
|
||||
.ilike("name", "Rob").findList();
|
||||
|
||||
assertNotSame(list, list3);
|
||||
BeanCollection<Customer> bc3 = (BeanCollection<Customer>) list3;
|
||||
@@ -349,10 +377,10 @@ public class TestQueryCache extends BaseTestCase {
|
||||
// and now, ensure that we hit the database
|
||||
LoggedSql.start();
|
||||
colA_second = DB.find(EColAB.class)
|
||||
.setUseQueryCache(CacheMode.PUT)
|
||||
.where()
|
||||
.eq("columnB", "someId")
|
||||
.findIds();
|
||||
.setUseQueryCache(CacheMode.PUT)
|
||||
.where()
|
||||
.eq("columnB", "someId")
|
||||
.findIds();
|
||||
sql = LoggedSql.stop();
|
||||
|
||||
assertThat(sql).hasSize(1);
|
||||
@@ -361,15 +389,15 @@ public class TestQueryCache extends BaseTestCase {
|
||||
@Test
|
||||
public void findCountDifferentQueriesBit() {
|
||||
DB.getDefault().pluginApi().cacheManager().clearAll();
|
||||
differentFindCount(q->q.bitwiseAny("id",1), q->q.bitwiseAny("id",0));
|
||||
differentFindCount(q->q.bitwiseAll("id",1), q->q.bitwiseAll("id",0));
|
||||
differentFindCount(q -> q.bitwiseAny("id", 1), q -> q.bitwiseAny("id", 0));
|
||||
differentFindCount(q -> q.bitwiseAll("id", 1), q -> q.bitwiseAll("id", 0));
|
||||
// differentFindCount(q->q.bitwiseNot("id",1), q->q.bitwiseNot("id",0)); NOT 1 == AND 1 = 0
|
||||
differentFindCount(q->q.bitwiseAnd("id",1, 0), q->q.bitwiseAnd("id",1, 1));
|
||||
differentFindCount(q -> q.bitwiseAnd("id", 1, 0), q -> q.bitwiseAnd("id", 1, 1));
|
||||
|
||||
differentFindCount(q->q.bitwiseAnd("id",2, 0), q->q.bitwiseAnd("id",4, 0));
|
||||
differentFindCount(q->q.bitwiseAnd("id",2, 1), q->q.bitwiseAnd("id",4, 1));
|
||||
differentFindCount(q -> q.bitwiseAnd("id", 2, 0), q -> q.bitwiseAnd("id", 4, 0));
|
||||
differentFindCount(q -> q.bitwiseAnd("id", 2, 1), q -> q.bitwiseAnd("id", 4, 1));
|
||||
// Will produce hash collision
|
||||
differentFindCount(q->q.bitwiseAnd("id",10, 0), q->q.bitwiseAnd("id",0, 928210));
|
||||
differentFindCount(q -> q.bitwiseAnd("id", 10, 0), q -> q.bitwiseAnd("id", 0, 928210));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -302,9 +302,12 @@ class TestDbArray_basic extends BaseTestCase {
|
||||
List<String> phNumbers = bean.getPhoneNumbers();
|
||||
phNumbers.add("4321");
|
||||
phNumbers.add("9823");
|
||||
List<BigDecimal> decimals = bean.getDecimals();
|
||||
assertThat(bean.getDecimals()).isNull();
|
||||
|
||||
List<BigDecimal> decimals = new ArrayList<>();
|
||||
decimals.add(BigDecimal.valueOf(1.23));
|
||||
decimals.add(BigDecimal.valueOf(4.56));
|
||||
bean.setDecimals(decimals);
|
||||
DB.save(bean);
|
||||
// Data is saved correctly
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package org.tests.query;
|
||||
|
||||
import io.ebean.annotation.Platform;
|
||||
import io.ebean.xtest.BaseTestCase;
|
||||
import io.ebean.DB;
|
||||
import io.ebean.PagedList;
|
||||
import io.ebean.test.LoggedSql;
|
||||
import io.ebean.xtest.IgnorePlatform;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.tests.model.basic.Order;
|
||||
import org.tests.model.basic.ResetBasicData;
|
||||
@@ -17,6 +19,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*/
|
||||
public class TestAddOrderByWithFirstRowsMaxRows extends BaseTestCase {
|
||||
|
||||
@IgnorePlatform({Platform.MYSQL, Platform.MARIADB})
|
||||
@Test
|
||||
public void test_firstRows() {
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ public class TestQueryAlias extends BaseTestCase {
|
||||
// where (myt0.one_key) in (select st0.one_key from ckey_parent st0)
|
||||
|
||||
assertThat(sql).contains("ckey_parent myt0");
|
||||
assertThat(sql).contains("(myt0.one_key) in (select st0.one_key from ckey_parent st0)");
|
||||
assertThat(sql).contains("myt0.one_key in (select st0.one_key from ckey_parent st0)");
|
||||
}
|
||||
|
||||
@IgnorePlatform(Platform.COCKROACH)
|
||||
@@ -56,7 +56,7 @@ public class TestQueryAlias extends BaseTestCase {
|
||||
String sql = pq.getGeneratedSql();
|
||||
|
||||
assertThat(sql).contains("ckey_parent myt0");
|
||||
assertThat(sql).contains("(concat(myt0.one_key,myt0.two_key)) in (select concat(st0.one_key,st0.two_key) from ckey_parent st0)");
|
||||
assertThat(sql).contains("concat(myt0.one_key,myt0.two_key) in (select concat(st0.one_key,st0.two_key) from ckey_parent st0)");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -82,7 +82,7 @@ public class TestQueryAlias extends BaseTestCase {
|
||||
// where (myt0.one_key) in (select st0.one_key from ckey_parent st0)
|
||||
|
||||
assertThat(sql).contains("ckey_parent myt0");
|
||||
assertThat(sql).contains("(myt0.one_key) not in (select st0.one_key from ckey_parent st0)");
|
||||
assertThat(sql).contains("myt0.one_key not in (select st0.one_key from ckey_parent st0)");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ public class TestQueryIsNull extends BaseTestCase {
|
||||
ResetBasicData.reset();
|
||||
|
||||
Query<Order> query = DB.find(Order.class).select("id, status")
|
||||
.where().eq("status", null).query();
|
||||
.where().eq("status", (String) null).query();
|
||||
query.findList();
|
||||
|
||||
assertThat(query.getGeneratedSql()).isEqualTo("select t0.id, t0.status from o_order t0 where t0.status is null");
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package org.tests.query;
|
||||
|
||||
import io.ebean.xtest.BaseTestCase;
|
||||
import io.ebean.DB;
|
||||
import io.ebean.Query;
|
||||
import io.ebean.xtest.BaseTestCase;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.tests.model.basic.Order;
|
||||
import org.tests.model.basic.ResetBasicData;
|
||||
@@ -19,13 +19,13 @@ public class TestQueryNullAssocOne extends BaseTestCase {
|
||||
|
||||
ResetBasicData.reset();
|
||||
|
||||
Query<Order> q0 = DB.find(Order.class).where().eq("customer", null).query();
|
||||
Query<Order> q0 = DB.find(Order.class).where().eq("customer", (String) null).query();
|
||||
|
||||
List<Order> orders = q0.findList();
|
||||
assertNotNull(orders);
|
||||
assertTrue(q0.getGeneratedSql().contains("where t0.kcustomer_id is null"));
|
||||
|
||||
Query<Order> q1 = DB.find(Order.class).where().eq("customer.id", null).query();
|
||||
Query<Order> q1 = DB.find(Order.class).where().eq("customer.id", (String) null).query();
|
||||
|
||||
List<Order> o1 = q1.findList();
|
||||
assertTrue(o1.size() == orders.size());
|
||||
|
||||
@@ -28,9 +28,9 @@ public class TestSubQuery extends BaseTestCase {
|
||||
Query<Order> query = DB.find(Order.class).where().in("id", sq).query();
|
||||
query.findList();
|
||||
if (isPostgresCompatible()) {
|
||||
assertThat(query.getGeneratedSql()).isEqualTo("select t0.id, t0.status, t0.order_date, t0.ship_date, t1.name, t0.cretime, t0.updtime, t0.kcustomer_id from o_order t0 join o_customer t1 on t1.id = t0.kcustomer_id where (t0.id) in (select distinct t0.id from o_order t0 join o_order_detail u1 on u1.order_id = t0.id and u1.id > 0 where u1.product_id = any(?))");
|
||||
assertThat(query.getGeneratedSql()).isEqualTo("select t0.id, t0.status, t0.order_date, t0.ship_date, t1.name, t0.cretime, t0.updtime, t0.kcustomer_id from o_order t0 join o_customer t1 on t1.id = t0.kcustomer_id where t0.id in (select distinct t0.id from o_order t0 join o_order_detail u1 on u1.order_id = t0.id and u1.id > 0 where u1.product_id = any(?))");
|
||||
} else {
|
||||
assertThat(query.getGeneratedSql()).isEqualTo("select t0.id, t0.status, t0.order_date, t0.ship_date, t1.name, t0.cretime, t0.updtime, t0.kcustomer_id from o_order t0 join o_customer t1 on t1.id = t0.kcustomer_id where (t0.id) in (select distinct t0.id from o_order t0 join o_order_detail u1 on u1.order_id = t0.id and u1.id > 0 where u1.product_id in (?,?,?))");
|
||||
assertThat(query.getGeneratedSql()).isEqualTo("select t0.id, t0.status, t0.order_date, t0.ship_date, t1.name, t0.cretime, t0.updtime, t0.kcustomer_id from o_order t0 join o_customer t1 on t1.id = t0.kcustomer_id where t0.id in (select distinct t0.id from o_order t0 join o_order_detail u1 on u1.order_id = t0.id and u1.id > 0 where u1.product_id in (?,?,?))");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,9 +84,9 @@ public class TestSubQuery extends BaseTestCase {
|
||||
query.findSingleAttribute();
|
||||
|
||||
if (isPostgresCompatible()) {
|
||||
assertThat(query.getGeneratedSql()).isEqualTo("select t0.ship_date from o_order t0 where (t0.id) in (" + debugSq.getGeneratedSql() + ")");
|
||||
assertThat(query.getGeneratedSql()).isEqualTo("select t0.ship_date from o_order t0 where t0.id in (" + debugSq.getGeneratedSql() + ")");
|
||||
} else {
|
||||
assertSql(query.getGeneratedSql()).isEqualTo("select t0.ship_date from o_order t0 where (t0.id) in (" + trimSql(debugSq.getGeneratedSql()) + ")");
|
||||
assertSql(query.getGeneratedSql()).isEqualTo("select t0.ship_date from o_order t0 where t0.id in (" + trimSql(debugSq.getGeneratedSql()) + ")");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ public class TestSubQuery extends BaseTestCase {
|
||||
Query<Order> query = DB.find(Order.class).select("status").where().isIn("shipDate", sq).query();
|
||||
query.findSingleAttribute();
|
||||
assertSql(query.getGeneratedSql())
|
||||
.isEqualTo("select t0.status from o_order t0 where (t0.ship_date) in (" + trimSql(debugSq.getGeneratedSql()) + ")");
|
||||
.isEqualTo("select t0.status from o_order t0 where t0.ship_date in (" + trimSql(debugSq.getGeneratedSql()) + ")");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -131,7 +131,7 @@ public class TestSubQuery extends BaseTestCase {
|
||||
query.findSingleAttribute();
|
||||
|
||||
assertSql(query.getGeneratedSql())
|
||||
.isEqualTo("select t0.ship_time from or_order_ship t0 where (t0.id) in (" + trimSql(debugSq.getGeneratedSql()) + ")");
|
||||
.isEqualTo("select t0.ship_time from or_order_ship t0 where t0.id in (" + trimSql(debugSq.getGeneratedSql()) + ")");
|
||||
}
|
||||
|
||||
public void testCompositeKey() {
|
||||
@@ -192,7 +192,7 @@ public class TestSubQuery extends BaseTestCase {
|
||||
// TODO: If, after bugfixing, the system still join against vehicle I do not
|
||||
// know now, in our case, it is not necessary if not
|
||||
// using it in the where clause
|
||||
String golden = "(t0.id) in (select t0.vehicle_id from vehicle_driver t0 left join vehicle t1 on t1.id = t0.vehicle_id )";
|
||||
String golden = "t0.id in (select t0.vehicle_id from vehicle_driver t0 left join vehicle t1 on t1.id = t0.vehicle_id )";
|
||||
assertThat(sql).contains(golden);
|
||||
|
||||
}
|
||||
@@ -213,7 +213,7 @@ public class TestSubQuery extends BaseTestCase {
|
||||
pq.findList();
|
||||
|
||||
String sql = pq.getGeneratedSql();
|
||||
String golden = "(t0.id) in (select t0.vehicle_id from vehicle_driver t0 left join vehicle t1 on t1.id = t0.vehicle_id where t1.license_number = ? )";
|
||||
String golden = "t0.id in (select t0.vehicle_id from vehicle_driver t0 left join vehicle t1 on t1.id = t0.vehicle_id where t1.license_number = ? )";
|
||||
assertThat(sql).contains(golden);
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ public class TestSubQuery extends BaseTestCase {
|
||||
|
||||
String sql = pq.getGeneratedSql();
|
||||
|
||||
String golden = "(t0.id) in (select t0.vehicle_id from vehicle_driver t0 left join vehicle t1 on t1.id = t0.vehicle_id )";
|
||||
String golden = "t0.id in (select t0.vehicle_id from vehicle_driver t0 left join vehicle t1 on t1.id = t0.vehicle_id )";
|
||||
assertThat(sql).contains(golden);
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user