mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Compare commits
46
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac3f4ca369 | ||
|
|
10133e6040 | ||
|
|
321fb26df3 | ||
|
|
28bd018d1f | ||
|
|
cceb29313b | ||
|
|
530bfa982e | ||
|
|
3cfa636e88 | ||
|
|
a2e8f098cf | ||
|
|
9e42cfd7d7 | ||
|
|
a3c54d4d20 | ||
|
|
1d48e2afb3 | ||
|
|
d84c9dc1a9 | ||
|
|
6165bf5a6c | ||
|
|
712d3ea78f | ||
|
|
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 | ||
|
|
359f8b41fe |
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-clickhouse</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-clickhouse</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.2</tag>
|
||||
<tag>ebean-parent-13.11.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-cockroach</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.2</tag>
|
||||
<tag>ebean-parent-13.11.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-db2</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-db2</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.2</tag>
|
||||
<tag>ebean-parent-13.11.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-h2</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.2</tag>
|
||||
<tag>ebean-parent-13.11.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-hana</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-hana</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.2</tag>
|
||||
<tag>ebean-parent-13.11.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-mariadb</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-mariadb</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.2</tag>
|
||||
<tag>ebean-parent-13.11.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-mysql</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-mysql</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.2</tag>
|
||||
<tag>ebean-parent-13.11.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-nuodb</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-nuodb</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.2</tag>
|
||||
<tag>ebean-parent-13.11.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-oracle</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-oracle</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.2</tag>
|
||||
<tag>ebean-parent-13.11.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-postgres</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.2</tag>
|
||||
<tag>ebean-parent-13.11.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-sqlite</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlite</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.2</tag>
|
||||
<tag>ebean-parent-13.11.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-sqlserver</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlserver</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.2</tag>
|
||||
<tag>ebean-parent-13.11.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-yugabyte</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.2</tag>
|
||||
<tag>ebean-parent-13.11.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean (all platforms)</name>
|
||||
@@ -16,31 +16,31 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-joda-time</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-jackson-jsonnode</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-jackson-mapper</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -53,18 +53,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-all</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.2</tag>
|
||||
<tag>ebean-parent-13.11.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>composites</artifactId>
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</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>
|
||||
|
||||
<!--
|
||||
|
||||
+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.2</version>
|
||||
<version>13.11.1</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.2</tag>
|
||||
<tag>ebean-parent-13.11.1</tag>
|
||||
</scm>
|
||||
|
||||
<name>ebean autotune</name>
|
||||
@@ -26,7 +26,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
+33
-33
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean bom</name>
|
||||
@@ -89,192 +89,192 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-joda-time</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-jackson-jsonnode</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-jackson-mapper</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-generator</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-externalmapping-api</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-externalmapping-xml</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-autotune</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>querybean-generator</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>kotlin-querybean-generator</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-postgis</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-redis</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- platforms -->
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-all</artifactId>
|
||||
<version>13.10.2-SNAPSHOT</version>
|
||||
<version>13.11.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-clickhouse</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-db2</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-h2</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-hana</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-hsqldb</artifactId>
|
||||
<version>13.10.2-SNAPSHOT</version>
|
||||
<version>13.11.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-mariadb</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-mysql</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-nuodb</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-oracle</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-postgres</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-sqlanywhere</artifactId>
|
||||
<version>13.10.2-SNAPSHOT</version>
|
||||
<version>13.11.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-sqlite</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-sqlserver</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
@@ -16,7 +16,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</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.2</version>
|
||||
<version>13.11.1</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.2</tag>
|
||||
<tag>ebean-parent-13.11.1</tag>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -46,13 +46,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-externalmapping-api</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</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.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlserver</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -160,6 +160,8 @@ public final class DefaultContainer implements SpiContainer {
|
||||
*/
|
||||
private BootupClasses bootupClasses(DatabaseConfig config) {
|
||||
BootupClasses bootup = bootupClasses1(config);
|
||||
bootup.addServerConfigStartup(config.getServerConfigStartupListeners());
|
||||
bootup.runServerConfigStartup(config);
|
||||
bootup.addIdGenerators(config.getIdGenerators());
|
||||
bootup.addPersistControllers(config.getPersistControllers());
|
||||
bootup.addPostLoaders(config.getPostLoaders());
|
||||
@@ -167,9 +169,7 @@ public final class DefaultContainer implements SpiContainer {
|
||||
bootup.addFindControllers(config.getFindControllers());
|
||||
bootup.addPersistListeners(config.getPersistListeners());
|
||||
bootup.addQueryAdapters(config.getQueryAdapters());
|
||||
bootup.addServerConfigStartup(config.getServerConfigStartupListeners());
|
||||
bootup.addChangeLogInstances(config);
|
||||
bootup.runServerConfigStartup(config);
|
||||
return bootup;
|
||||
}
|
||||
|
||||
|
||||
@@ -1091,7 +1091,13 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
@Override
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
public <T> Set<T> findSet(Query<T> query, Transaction transaction) {
|
||||
SpiOrmQueryRequest request = createQueryRequest(Type.SET, query, transaction);
|
||||
SpiOrmQueryRequest request = buildQueryRequest(Type.SET, query, transaction);
|
||||
request.resetBeanCacheAutoMode(false);
|
||||
if ((transaction == null || !transaction.isSkipCache()) && request.getFromBeanCache()) {
|
||||
// hit bean cache and got all results from cache
|
||||
return request.beanCacheHitsAsSet();
|
||||
}
|
||||
request.prepareQuery();
|
||||
Object result = request.getFromQueryCache();
|
||||
if (result != null) {
|
||||
return (Set<T>) result;
|
||||
@@ -1107,12 +1113,13 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
@Override
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
public <K, T> Map<K, T> findMap(Query<T> query, @Nullable Transaction transaction) {
|
||||
SpiOrmQueryRequest request = createQueryRequest(Type.MAP, query, transaction);
|
||||
SpiOrmQueryRequest request = buildQueryRequest(Type.MAP, query, transaction);
|
||||
request.resetBeanCacheAutoMode(false);
|
||||
if ((transaction == null || !transaction.isSkipCache()) && request.getFromBeanCache()) {
|
||||
// hit bean cache and got all results from cache
|
||||
return request.beanCacheHitsAsMap();
|
||||
}
|
||||
request.prepareQuery();
|
||||
Object result = request.getFromQueryCache();
|
||||
if (result != null) {
|
||||
return (Map<K, T>) result;
|
||||
|
||||
@@ -515,12 +515,12 @@ public final class OrmQueryRequest<T> extends BeanRequest implements SpiOrmQuery
|
||||
if (query.getType() == Type.MAP) {
|
||||
mergeCacheHitsToMap(result);
|
||||
} else {
|
||||
mergeCacheHitsToList(result);
|
||||
mergeCacheHitsToCollection(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void mergeCacheHitsToList(BeanCollection<T> result) {
|
||||
private void mergeCacheHitsToCollection(BeanCollection<T> result) {
|
||||
for (T hit : cacheBeans) {
|
||||
result.internalAdd(hit);
|
||||
}
|
||||
@@ -579,6 +579,15 @@ public final class OrmQueryRequest<T> extends BeanRequest implements SpiOrmQuery
|
||||
return property;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<T> beanCacheHitsAsSet() {
|
||||
OrderBy<T> orderBy = query.getOrderBy();
|
||||
if (orderBy != null && !orderBy.isEmpty()) {
|
||||
beanDescriptor.sort(cacheBeans, orderBy.toStringFormat());
|
||||
}
|
||||
return new LinkedHashSet<>(cacheBeans);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getFromBeanCache() {
|
||||
if (!query.isBeanCacheGet()) {
|
||||
|
||||
@@ -153,6 +153,11 @@ public interface SpiOrmQueryRequest<T> extends BeanQueryRequest<T>, DocQueryRequ
|
||||
*/
|
||||
<K> Map<K,T> beanCacheHitsAsMap();
|
||||
|
||||
/**
|
||||
* Return the bean cache hits for findMap (when all hits / no misses).
|
||||
*/
|
||||
Set<T> beanCacheHitsAsSet();
|
||||
|
||||
/**
|
||||
* Reset Bean cache mode AUTO - require explicit setting for bean cache use with findList().
|
||||
*/
|
||||
|
||||
@@ -342,8 +342,9 @@ public class BootupClasses implements Predicate<Class<?>> {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private boolean isInterestingInterface(Class<?> cls) {
|
||||
if (Modifier.isAbstract(cls.getModifiers())) {
|
||||
// do not include abstract classes as we can
|
||||
if (Modifier.isAbstract(cls.getModifiers())
|
||||
|| !(Modifier.isPublic(cls.getModifiers()) || Modifier.isProtected(cls.getModifiers()))) {
|
||||
// do not include abstract and non pupbic/protected classes as we can
|
||||
// not instantiate them
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
|
||||
/**
|
||||
* Flag to mark this is the id property.
|
||||
*/
|
||||
private final boolean id;
|
||||
protected final boolean id;
|
||||
private final boolean importedPrimaryKey;
|
||||
/**
|
||||
* Flag to make this as a dummy property for unidirecitonal relationships.
|
||||
|
||||
@@ -655,7 +655,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
|
||||
@Override
|
||||
public void setValue(EntityBean bean, Object value) {
|
||||
super.setValue(bean, value);
|
||||
if (embedded && value instanceof EntityBean) {
|
||||
if (!id && embedded && value instanceof EntityBean) {
|
||||
setEmbeddedOwner(bean, value);
|
||||
}
|
||||
}
|
||||
@@ -663,7 +663,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
|
||||
@Override
|
||||
public void setValueIntercept(EntityBean bean, Object value) {
|
||||
super.setValueIntercept(bean, value);
|
||||
if (embedded && value instanceof EntityBean) {
|
||||
if (!id && embedded && value instanceof EntityBean) {
|
||||
setEmbeddedOwner(bean, value);
|
||||
}
|
||||
}
|
||||
@@ -675,8 +675,10 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
|
||||
Object emb = getValue(owner);
|
||||
if (emb != null) {
|
||||
EntityBean embeddedBean = (EntityBean) emb;
|
||||
embeddedBean._ebean_getIntercept().setEmbeddedOwner(owner, propertyIndex);
|
||||
targetDescriptor.setAllLoaded(embeddedBean);
|
||||
if (!id) {
|
||||
embeddedBean._ebean_getIntercept().setEmbeddedOwner(owner, propertyIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+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,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-csv-reader</artifactId>
|
||||
@@ -14,21 +14,21 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean ddl generation</name>
|
||||
@@ -28,14 +28,14 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-all</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean external mapping api</name>
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<scm>
|
||||
<developerConnection>scm:git:git@github.com:ebean-orm/ebean.git</developerConnection>
|
||||
<tag>ebean-parent-13.10.2</tag>
|
||||
<tag>ebean-parent-13.11.1</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.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -54,21 +54,21 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-generator</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-jackson-jsonnode</artifactId>
|
||||
@@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2-SNAPSHOT</version>
|
||||
<version>13.11.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-kotlin</artifactId>
|
||||
@@ -28,7 +28,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.2-SNAPSHOT</version>
|
||||
<version>13.11.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>13.10.2-SNAPSHOT</version>
|
||||
<version>13.11.1-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean postgis</name>
|
||||
@@ -22,14 +22,14 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- provided scope -->
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</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.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean querybean</name>
|
||||
@@ -17,7 +17,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -63,21 +63,21 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-generator</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>querybean-generator</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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
|
||||
|
||||
+6
-6
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-redis</artifactId>
|
||||
@@ -22,35 +22,35 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>querybean-generator</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
+9
-9
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean test</name>
|
||||
@@ -28,20 +28,20 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-generator</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -105,28 +105,28 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-joda-time</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-jackson-jsonnode</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-jackson-mapper</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-all</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</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>
|
||||
|
||||
@@ -15,7 +15,6 @@ import org.tests.model.basic.ECustomId;
|
||||
import org.tests.model.controller.FindControllerMain;
|
||||
import org.tests.model.controller.SoftRefA;
|
||||
import org.tests.model.controller.SoftRefB;
|
||||
import org.tests.model.controller.TestBeanFindController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
+3
-2
@@ -1,16 +1,17 @@
|
||||
package org.tests.model.controller;
|
||||
package io.ebean.xtest.event;
|
||||
|
||||
import io.ebean.bean.BeanCollection;
|
||||
import io.ebean.event.BeanFindController;
|
||||
import io.ebean.event.BeanQueryRequest;
|
||||
import io.ebean.plugin.BeanType;
|
||||
import org.tests.model.controller.FindControllerMain;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class TestBeanFindController implements BeanFindController {
|
||||
class TestBeanFindController implements BeanFindController {
|
||||
|
||||
@Override
|
||||
public boolean isRegisterFor(final Class<?> cls) {
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package org.tests.basic;
|
||||
|
||||
import io.ebean.xtest.BaseTestCase;
|
||||
import io.ebean.DB;
|
||||
import io.ebean.DatabaseFactory;
|
||||
import io.ebean.QueryIterator;
|
||||
import io.ebean.Transaction;
|
||||
import io.ebean.config.DatabaseConfig;
|
||||
import io.ebean.xtest.BaseTestCase;
|
||||
import io.ebeaninternal.api.SpiPersistenceContext;
|
||||
import io.ebeaninternal.api.SpiTransaction;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
@@ -12,15 +15,17 @@ import org.tests.model.basic.Customer;
|
||||
import org.tests.model.basic.Order;
|
||||
import org.tests.model.basic.ResetBasicData;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.WeakHashMap;
|
||||
import javax.persistence.Embeddable;
|
||||
import javax.persistence.EmbeddedId;
|
||||
import javax.persistence.Entity;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
class TestPersistenceContext extends BaseTestCase {
|
||||
public class TestPersistenceContext extends BaseTestCase {
|
||||
|
||||
@Test
|
||||
void testReload() {
|
||||
@@ -191,29 +196,135 @@ class TestPersistenceContext extends BaseTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
@Disabled // run manually
|
||||
@Test
|
||||
void testPcScopes_with_findEachFindList() {
|
||||
for (int i = 0; i < 5000; i++) {
|
||||
Customer c = new Customer();
|
||||
c.setName("Customer #" + i);
|
||||
DB.save(c);
|
||||
Order o = new Order();
|
||||
o.setCustomer(c);
|
||||
DB.save(o);
|
||||
@Embeddable
|
||||
public static class TmId {
|
||||
private final UUID id1;
|
||||
private final UUID id2;
|
||||
|
||||
public TmId(UUID id1, UUID id2) {
|
||||
this.id1 = id1;
|
||||
this.id2 = id2;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 1000; i++) {
|
||||
try (Transaction txn = DB.beginTransaction()) {
|
||||
List<Customer> customers = new ArrayList<>();
|
||||
DB.find(Customer.class).select("id").findEach(customers::add);
|
||||
SpiPersistenceContext pc = ((SpiTransaction) txn).getPersistenceContext();
|
||||
assertThat(pc.toString()).contains("Customer=size:5000 (5000 weak)");
|
||||
customers.clear();
|
||||
customers = DB.find(Customer.class).select("id").findList();
|
||||
public UUID getId1() {
|
||||
return id1;
|
||||
}
|
||||
|
||||
assertThat(pc.toString()).contains("Customer=size:5000"); // We expect ALWAYS 5000 entries in the PC
|
||||
}
|
||||
public UUID getId2() {
|
||||
return id2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
TmId tmId = (TmId) o;
|
||||
return Objects.equals(id1, tmId.id1) && Objects.equals(id2, tmId.id2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id1, id2);
|
||||
}
|
||||
}
|
||||
|
||||
@Entity
|
||||
// @Cache(enableQueryCache = true, enableBeanCache = false)
|
||||
public static class TestModel2 {
|
||||
|
||||
@EmbeddedId
|
||||
private TmId id;
|
||||
@Size(max = 255)
|
||||
private String someData;
|
||||
|
||||
public String getSomeData() {
|
||||
return someData;
|
||||
}
|
||||
|
||||
public void setSomeData(String someData) {
|
||||
this.someData = someData;
|
||||
}
|
||||
|
||||
public TmId getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(TmId id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@Disabled
|
||||
void initDb() {
|
||||
DatabaseConfig config = new DatabaseConfig();
|
||||
config.setName("h2-batch");
|
||||
config.loadFromProperties();
|
||||
config.setDdlExtra(false);
|
||||
config.getDataSourceConfig().setUsername("sa");
|
||||
config.getDataSourceConfig().setPassword("sa");
|
||||
config.getDataSourceConfig().setUrl("jdbc:h2:file:./testsFile3;DB_CLOSE_ON_EXIT=FALSE;NON_KEYWORDS=KEY,VALUE");
|
||||
config.addClass(TestModel2.class);
|
||||
config.addClass(TmId.class);
|
||||
DatabaseFactory.create(config);
|
||||
|
||||
String base = "x".repeat(240);
|
||||
// 10 mio TestModel - each needs about 1/4 kbytes -> 2,5 GB in total
|
||||
List<TestModel2> batch = new ArrayList<>();
|
||||
for (int i = 0; i < 1_000_000; i++) {
|
||||
TestModel2 m = new TestModel2();
|
||||
TmId id = new TmId(UUID.randomUUID(), UUID.randomUUID());
|
||||
m.setId(id);
|
||||
m.setSomeData(base + i); // ensure we have not duplicates
|
||||
batch.add(m);
|
||||
if (i % 1000 == 0) {
|
||||
DB.saveAll(batch);
|
||||
batch.clear();
|
||||
}
|
||||
if (i % 100000 == 0) {
|
||||
System.out.println(i);
|
||||
}
|
||||
}
|
||||
DB.saveAll(batch);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Disabled
|
||||
void testFindEachFindList() {
|
||||
DatabaseConfig config = new DatabaseConfig();
|
||||
config.setName("h2-batch");
|
||||
config.loadFromProperties();
|
||||
config.setDdlRun(false);
|
||||
config.getDataSourceConfig().setUsername("sa");
|
||||
config.getDataSourceConfig().setPassword("sa");
|
||||
config.getDataSourceConfig().setUrl("jdbc:h2:file:./testsFile3;DB_CLOSE_ON_EXIT=FALSE;NON_KEYWORDS=KEY,VALUE");
|
||||
config.addClass(TestModel2.class);
|
||||
config.addClass(TmId.class);
|
||||
DatabaseFactory.create(config);
|
||||
|
||||
AtomicInteger i = new AtomicInteger();
|
||||
System.out.println("Doing findEach");
|
||||
DB.find(TestModel2.class).select("*").findEach(c -> {
|
||||
i.incrementAndGet();
|
||||
});
|
||||
System.out.println("Read " + i + " entries");
|
||||
|
||||
i.set(0);
|
||||
System.out.println("Doing findStream");
|
||||
DB.find(TestModel2.class).select("*").findStream().forEach(c -> i.incrementAndGet());
|
||||
System.out.println("Read " + i + " entries");
|
||||
|
||||
i.set(0);
|
||||
System.out.println("Doing findIterate");
|
||||
QueryIterator<TestModel2> iter = DB.find(TestModel2.class).select("*").findIterate();
|
||||
while (iter.hasNext()) {
|
||||
iter.next();
|
||||
i.incrementAndGet();
|
||||
}
|
||||
System.out.println("Read " + i + " entries");
|
||||
|
||||
System.out.println("Doing FindList, will hold all entries in memory. Expect OOM with -Xmx100m.");
|
||||
List<TestModel2> lst = DB.find(TestModel2.class).select("*").findList();
|
||||
System.out.println("Read " + lst.size() + " entries");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
+108
-3
@@ -1,11 +1,12 @@
|
||||
package org.tests.cache;
|
||||
|
||||
import io.ebean.xtest.BaseTestCase;
|
||||
import io.ebean.DB;
|
||||
import io.ebean.Query;
|
||||
import io.ebean.Transaction;
|
||||
import io.ebean.cache.ServerCache;
|
||||
import io.ebean.cache.ServerCacheStatistics;
|
||||
import io.ebean.test.LoggedSql;
|
||||
import io.ebean.xtest.BaseTestCase;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -15,6 +16,7 @@ import org.tests.model.basic.OCachedBean;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
@@ -54,10 +56,39 @@ public class TestBeanCache extends BaseTestCase {
|
||||
assertThat(sql).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void idsInFindMap() {
|
||||
|
||||
List<OCachedBean> beans = createBeans(Arrays.asList("m0", "m1", "m2", "m3", "m4", "m5", "m6"));
|
||||
List<Long> ids = beans.stream().map(OCachedBean::getId).collect(Collectors.toList());
|
||||
beanCache.clear();
|
||||
beanCache.statistics(true);
|
||||
Query<OCachedBean> query = DB.find(OCachedBean.class).setUseCache(true);
|
||||
|
||||
// Test findIds
|
||||
LoggedSql.start();
|
||||
query.copy()
|
||||
.where().idIn(ids.subList(0, 1))
|
||||
.findMap(); // cache key is: 3/d[{/c1000}]/w[List[IdIn[?1],]]
|
||||
assertThat(LoggedSql.stop().get(0)).contains("in (?)");
|
||||
|
||||
LoggedSql.start();
|
||||
query.copy()
|
||||
.where().idIn(ids.subList(0, 4))
|
||||
.findMap(); // cache key is: 3/d[{/c1000}]/w[List[IdIn[?5],]]
|
||||
assertThat(LoggedSql.stop().get(0)).contains("in (?,?,?,?,?)");
|
||||
|
||||
LoggedSql.start();
|
||||
query.copy()
|
||||
.where().idIn(ids.subList(2, 6))
|
||||
.findMap(); // same cache key as above and same SQL above
|
||||
assertThat(LoggedSql.stop().get(0)).contains("in (?,?,?,?,?)");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void idsIn_explicitCache_expect_cachePut() {
|
||||
|
||||
List<OCachedBean> beans = createBeans(Arrays.asList("k0","k1"));
|
||||
List<OCachedBean> beans = createBeans(Arrays.asList("k0", "k1"));
|
||||
List<Long> ids = beans.stream().map(OCachedBean::getId).collect(Collectors.toList());
|
||||
|
||||
beanCache.clear();
|
||||
@@ -157,6 +188,80 @@ public class TestBeanCache extends BaseTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFindSet() {
|
||||
|
||||
List<OCachedBean> beans = createBeans(Arrays.asList("z0", "z1", "z2"));
|
||||
List<Long> ids = beans.stream().map(OCachedBean::getId).collect(Collectors.toList());
|
||||
|
||||
beanCache.clear();
|
||||
beanCache.statistics(true);
|
||||
|
||||
LoggedSql.start();
|
||||
|
||||
log.info("All misses (0 of 3) ...");
|
||||
Set<OCachedBean> set = DB.find(OCachedBean.class)
|
||||
.where().idIn(ids)
|
||||
.setUseCache(true)
|
||||
.findSet();
|
||||
|
||||
assertThat(set).hasSize(3);
|
||||
assertBeanCacheHitMiss(0, 3);
|
||||
List<String> sql = LoggedSql.collect();
|
||||
assertThat(sql).hasSize(1);
|
||||
if (isH2()) {
|
||||
assertSql(sql.get(0)).contains("from o_cached_bean t0 where t0.id in (?,?,?,?,?)");
|
||||
}
|
||||
|
||||
log.info("All hits (3 of 3) ...");
|
||||
set = DB.find(OCachedBean.class)
|
||||
.where().idIn(ids)
|
||||
.setUseCache(true)
|
||||
.findSet();
|
||||
|
||||
assertBeanCacheHitMiss(3, 0);
|
||||
assertThat(set).hasSize(3);
|
||||
sql = LoggedSql.collect();
|
||||
assertThat(sql).hasSize(0); // no misses
|
||||
|
||||
// remove a bean so that we get a "partial" hit (2 out of 3 in cache)
|
||||
beanCache.remove(beans.get(0).getId().toString());
|
||||
|
||||
log.info("Partial hits (2 of 3) ...");
|
||||
set = DB.find(OCachedBean.class)
|
||||
.where().idIn(ids)
|
||||
.setUseCache(true)
|
||||
.findSet();
|
||||
|
||||
assertBeanCacheHitMiss(2, 1);
|
||||
assertThat(set).hasSize(3);
|
||||
sql = LoggedSql.collect();
|
||||
assertThat(sql).hasSize(1);
|
||||
if (isH2()) {
|
||||
// fetch the miss from DB
|
||||
assertSql(sql.get(0)).contains("from o_cached_bean t0 where t0.id in (?)");
|
||||
}
|
||||
|
||||
// remove beans so that we get a "partial" hit (1 out of 3 in cache)
|
||||
beanCache.remove(beans.get(1).getId().toString());
|
||||
beanCache.remove(beans.get(2).getId().toString());
|
||||
|
||||
log.info("Partial hits (1 of 3) ...");
|
||||
set = DB.find(OCachedBean.class)
|
||||
.where().idIn(ids)
|
||||
.setUseCache(true)
|
||||
.findSet();
|
||||
|
||||
assertBeanCacheHitMiss(1, 2);
|
||||
assertThat(set).hasSize(3);
|
||||
sql = LoggedSql.stop();
|
||||
assertThat(sql).hasSize(1);
|
||||
if (isH2()) {
|
||||
// fetch the misses from DB
|
||||
assertSql(sql.get(0)).contains("from o_cached_bean t0 where t0.id in (?,?,?,?,?)");
|
||||
}
|
||||
}
|
||||
|
||||
private void assertBeanCacheHitMiss(int hitCount, int missCount) {
|
||||
ServerCacheStatistics statistics = beanCache.statistics(true);
|
||||
assertThat(statistics.getHitCount()).isEqualTo(hitCount);
|
||||
@@ -183,7 +288,7 @@ public class TestBeanCache extends BaseTestCase {
|
||||
|
||||
Country country = DB.find(Country.class)
|
||||
.where()
|
||||
.eq("name","NotValid")
|
||||
.eq("name", "NotValid")
|
||||
.findOne();
|
||||
|
||||
assertThat(country).isNull();
|
||||
|
||||
@@ -162,16 +162,18 @@ public class TestQueryCache extends BaseTestCase {
|
||||
sql = LoggedSql.stop();
|
||||
assertThat(sql).hasSize(1);
|
||||
|
||||
|
||||
LoggedSql.start();
|
||||
findCountNoTxn();
|
||||
sql = LoggedSql.stop();
|
||||
assertThat(sql).hasSize(0);
|
||||
|
||||
LoggedSql.start();
|
||||
findCountTxn();
|
||||
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() {
|
||||
|
||||
@@ -189,7 +189,7 @@ public class TestChangeLog extends BaseTestCase {
|
||||
return DatabaseFactory.create(config);
|
||||
}
|
||||
|
||||
public static class TDChangeLogPrepare implements ChangeLogPrepare {
|
||||
static class TDChangeLogPrepare implements ChangeLogPrepare {
|
||||
@Override
|
||||
public boolean prepare(ChangeSet changes) {
|
||||
changes.setUserId("appUser1");
|
||||
@@ -198,7 +198,7 @@ public class TestChangeLog extends BaseTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
public static class TDChangeLogListener implements ChangeLogListener {
|
||||
static class TDChangeLogListener implements ChangeLogListener {
|
||||
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
@@ -226,7 +226,7 @@ public class TestChangeLog extends BaseTestCase {
|
||||
|
||||
}
|
||||
|
||||
public static class TDChangeLogRegister implements ChangeLogRegister {
|
||||
static class TDChangeLogRegister implements ChangeLogRegister {
|
||||
|
||||
@Override
|
||||
public ChangeLogFilter getChangeFilter(Class<?> beanType) {
|
||||
|
||||
@@ -29,7 +29,7 @@ public class MyEBasicConfigStartup implements ServerConfigStartup {
|
||||
serverConfig.add(new EbasicBulkListener());
|
||||
}
|
||||
|
||||
public static class EbasicBulkListener implements BulkTableEventListener {
|
||||
private static class EbasicBulkListener implements BulkTableEventListener {
|
||||
|
||||
final Set<String> s = new HashSet<>();
|
||||
|
||||
@@ -49,7 +49,7 @@ public class MyEBasicConfigStartup implements ServerConfigStartup {
|
||||
|
||||
}
|
||||
|
||||
public static class EbasicPersistList extends AbstractBeanPersistListener {
|
||||
private static class EbasicPersistList extends AbstractBeanPersistListener {
|
||||
|
||||
@Override
|
||||
public boolean isRegisterFor(Class<?> cls) {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<name>kotlin querybean generator</name>
|
||||
@@ -29,7 +29,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -64,14 +64,14 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-generator</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
+22
-20
@@ -146,6 +146,15 @@ class ProcessingContext implements Constants {
|
||||
}
|
||||
}
|
||||
|
||||
private String trimAnnotations(String type) {
|
||||
int pos = type.indexOf("@");
|
||||
if (pos == -1) {
|
||||
return type;
|
||||
}
|
||||
String remainder = type.substring(0, pos) + type.substring(type.indexOf(' ') + 1);
|
||||
return trimAnnotations(remainder);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gather all the fields (properties) for the given bean element.
|
||||
*/
|
||||
@@ -159,7 +168,6 @@ class ProcessingContext implements Constants {
|
||||
* Recursively gather all the fields (properties) for the given bean element.
|
||||
*/
|
||||
private void gatherProperties(List<VariableElement> fields, Element element) {
|
||||
|
||||
TypeElement typeElement = (TypeElement) element;
|
||||
TypeMirror superclass = typeElement.getSuperclass();
|
||||
Element mappedSuper = typeUtils.asElement(superclass);
|
||||
@@ -253,9 +261,17 @@ class ProcessingContext implements Constants {
|
||||
}
|
||||
|
||||
PropertyType getPropertyType(VariableElement field) {
|
||||
|
||||
TypeMirror typeMirror = field.asType();
|
||||
|
||||
if (dbJsonField(field)) {
|
||||
return propertyTypeMap.getDbJsonType();
|
||||
}
|
||||
if (dbArrayField(field)) {
|
||||
// get generic parameter type
|
||||
DeclaredType declaredType = (DeclaredType) field.asType();
|
||||
String fullType = typeDef(declaredType.getTypeArguments().get(0));
|
||||
String shortName = langShortType(Split.shortName(fullType));
|
||||
return new PropertyTypeArray(fullType, shortName);
|
||||
}
|
||||
final TypeMirror typeMirror = field.asType();
|
||||
TypeMirror currentType = typeMirror;
|
||||
while (currentType != null) {
|
||||
PropertyType type = propertyTypeMap.getType(typeDef(currentType));
|
||||
@@ -268,18 +284,6 @@ class ProcessingContext implements Constants {
|
||||
currentType = (fieldType == null) ? null : fieldType.getSuperclass();
|
||||
}
|
||||
|
||||
if (dbJsonField(field)) {
|
||||
return propertyTypeMap.getDbJsonType();
|
||||
}
|
||||
|
||||
if (dbArrayField(field)) {
|
||||
// get generic parameter type
|
||||
DeclaredType declaredType = (DeclaredType) typeMirror;
|
||||
String fullType = typeDef(declaredType.getTypeArguments().get(0));
|
||||
String shortName = langShortType(Split.shortName(fullType));
|
||||
return new PropertyTypeArray(fullType, shortName);
|
||||
}
|
||||
|
||||
Element fieldType = typeUtils.asElement(typeMirror);
|
||||
if (fieldType == null) {
|
||||
return null;
|
||||
@@ -324,9 +328,9 @@ class ProcessingContext implements Constants {
|
||||
}
|
||||
|
||||
if (typeInstanceOf(typeMirror, "java.lang.Comparable")) {
|
||||
return new PropertyTypeScalarComparable(typeMirror.toString());
|
||||
return new PropertyTypeScalarComparable(trimAnnotations(typeMirror.toString()));
|
||||
} else {
|
||||
return new PropertyTypeScalar(typeMirror.toString());
|
||||
return new PropertyTypeScalar(trimAnnotations(typeMirror.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -383,7 +387,6 @@ class ProcessingContext implements Constants {
|
||||
* Create the QAssoc PropertyType.
|
||||
*/
|
||||
private PropertyType createPropertyTypeAssoc(String fullName) {
|
||||
|
||||
String[] split = Split.split(fullName);
|
||||
String propertyName = "QAssoc" + split[1];
|
||||
String packageName = packageAppend(split[0]);
|
||||
@@ -436,7 +439,6 @@ class ProcessingContext implements Constants {
|
||||
* Register an entity with optional dbName.
|
||||
*/
|
||||
void addEntity(String beanFullName, String dbName) {
|
||||
|
||||
loaded.add(beanFullName);
|
||||
final String pkg = packageOf(beanFullName);
|
||||
if (pkg != null) {
|
||||
|
||||
+15
-15
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>platforms</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-platform-all</artifactId>
|
||||
@@ -14,72 +14,72 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-clickhouse</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-db2</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-hana</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-hsqldb</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-mysql</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-mariadb</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-nuodb</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-oracle</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlanywhere</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlite</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlserver</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.2</tag>
|
||||
<tag>ebean-parent-13.11.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>platforms</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-platform-clickhouse</artifactId>
|
||||
@@ -14,12 +14,12 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.2</tag>
|
||||
<tag>ebean-parent-13.11.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>platforms</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-platform-db2</artifactId>
|
||||
@@ -14,12 +14,12 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.2</tag>
|
||||
<tag>ebean-parent-13.11.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -2,11 +2,7 @@ package io.ebean.platform.db2;
|
||||
|
||||
import io.ebean.BackgroundExecutor;
|
||||
import io.ebean.annotation.Platform;
|
||||
import io.ebean.config.dbplatform.DatabasePlatform;
|
||||
import io.ebean.config.dbplatform.DbPlatformType;
|
||||
import io.ebean.config.dbplatform.DbType;
|
||||
import io.ebean.config.dbplatform.PlatformIdGenerator;
|
||||
import io.ebean.config.dbplatform.SqlErrorCodes;
|
||||
import io.ebean.config.dbplatform.*;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.sql.Types;
|
||||
@@ -22,7 +18,7 @@ public abstract class BaseDB2Platform extends DatabasePlatform {
|
||||
this.supportsNativeJavaTime = false;
|
||||
this.truncateTable = "truncate table %s reuse storage ignore delete triggers immediate";
|
||||
this.likeClauseRaw = "like ?";
|
||||
this.sqlLimiter = new Db2SqlLimiter();
|
||||
this.sqlLimiter = new AnsiSqlRowsLimiter();
|
||||
|
||||
this.dbIdentity.setSupportsGetGeneratedKeys(true);
|
||||
this.dbIdentity.setSupportsSequence(true);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>platforms</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
@@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Provided scope so that the H2HistoryTrigger can live in Ebean core
|
||||
@@ -36,6 +36,6 @@
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.2</tag>
|
||||
<tag>ebean-parent-13.11.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>platforms</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-platform-hana</artifactId>
|
||||
@@ -14,12 +14,12 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.2</tag>
|
||||
<tag>ebean-parent-13.11.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -5,17 +5,13 @@ import io.ebean.Query.LockWait;
|
||||
import io.ebean.annotation.PersistBatch;
|
||||
import io.ebean.annotation.Platform;
|
||||
import io.ebean.config.PlatformConfig;
|
||||
import io.ebean.config.dbplatform.DatabasePlatform;
|
||||
import io.ebean.config.dbplatform.DbPlatformType;
|
||||
import io.ebean.config.dbplatform.DbType;
|
||||
import io.ebean.config.dbplatform.IdType;
|
||||
import io.ebean.config.dbplatform.SqlErrorCodes;
|
||||
import io.ebean.config.dbplatform.*;
|
||||
|
||||
public class HanaPlatform extends DatabasePlatform {
|
||||
|
||||
public HanaPlatform() {
|
||||
this.platform = Platform.HANA;
|
||||
this.sqlLimiter = new HanaSqlLimiter();
|
||||
this.sqlLimiter = new LimitOffsetSqlLimiter();
|
||||
this.persistBatchOnCascade = PersistBatch.NONE;
|
||||
this.supportsResultSetConcurrencyModeUpdatable = false;
|
||||
this.historySupport = new HanaHistorySupport();
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
package io.ebean.platform.hana;
|
||||
|
||||
import io.ebean.config.dbplatform.SqlLimitRequest;
|
||||
import io.ebean.config.dbplatform.SqlLimitResponse;
|
||||
import io.ebean.config.dbplatform.SqlLimiter;
|
||||
|
||||
public class HanaSqlLimiter 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) {
|
||||
sb.append(" ").append("limit ").append(maxRows);
|
||||
if (firstRow > 0) {
|
||||
sb.append(" ").append("offset ");
|
||||
sb.append(firstRow);
|
||||
}
|
||||
}
|
||||
|
||||
String sql = request.getDbPlatform().completeSql(sb.toString(), request.getOrmQuery());
|
||||
return new SqlLimitResponse(sql);
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>platforms</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-platform-hsqldb</artifactId>
|
||||
@@ -14,12 +14,12 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.2</tag>
|
||||
<tag>ebean-parent-13.11.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>platforms</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-platform-mariadb</artifactId>
|
||||
@@ -14,18 +14,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-mysql</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.2</tag>
|
||||
<tag>ebean-parent-13.11.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>platforms</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-platform-mysql</artifactId>
|
||||
@@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -27,6 +27,6 @@
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.2</tag>
|
||||
<tag>ebean-parent-13.11.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>platforms</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-platform-nuodb</artifactId>
|
||||
@@ -14,12 +14,12 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.2</tag>
|
||||
<tag>ebean-parent-13.11.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>platforms</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-platform-oracle</artifactId>
|
||||
@@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -27,6 +27,6 @@
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.2</tag>
|
||||
<tag>ebean-parent-13.11.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
+4
-5
@@ -7,27 +7,26 @@ import io.ebean.config.dbplatform.SqlLimiter;
|
||||
/**
|
||||
* Use ANSI offset rows syntax.
|
||||
*/
|
||||
class OracleAnsiSqlRowsLimiter implements SqlLimiter {
|
||||
final class OracleAnsiSqlRowsLimiter implements SqlLimiter {
|
||||
|
||||
@Override
|
||||
public SqlLimitResponse limit(SqlLimitRequest request) {
|
||||
|
||||
String dbSql = request.getDbSql();
|
||||
StringBuilder sb = new StringBuilder(50 + dbSql.length());
|
||||
int firstRow = request.getFirstRow();
|
||||
int maxRows = request.getMaxRows();
|
||||
|
||||
sb.append("select ");
|
||||
if (request.isDistinct()) {
|
||||
sb.append("distinct ");
|
||||
}
|
||||
sb.append(dbSql);
|
||||
int firstRow = request.getFirstRow();
|
||||
if (firstRow > 0) {
|
||||
sb.append(" offset ").append(firstRow).append(" rows");
|
||||
}
|
||||
int maxRows = request.getMaxRows();
|
||||
if (maxRows > 0) {
|
||||
sb.append(" fetch next ").append(maxRows).append(" rows only");
|
||||
}
|
||||
// Oracle does not support FOR UPDATE clause with limit offset
|
||||
return new SqlLimitResponse(sb.toString());
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ class OracleRownumSqlLimiter implements SqlLimiter {
|
||||
|
||||
@Override
|
||||
public SqlLimitResponse limit(SqlLimitRequest request) {
|
||||
|
||||
// select *
|
||||
// from ( select /*+ FIRST_ROWS(n) */ a.*, ROWNUM rnum
|
||||
// from ( your_query_goes_here,
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>platforms</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>platforms</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
@@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -27,7 +27,7 @@
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>42.5.0</version>
|
||||
<version>42.5.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -41,6 +41,6 @@
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.2</tag>
|
||||
<tag>ebean-parent-13.11.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>platforms</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-platform-sqlanywhere</artifactId>
|
||||
@@ -14,12 +14,12 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.2</tag>
|
||||
<tag>ebean-parent-13.11.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
+3
-8
@@ -7,18 +7,12 @@ import io.ebean.config.dbplatform.SqlLimiter;
|
||||
/**
|
||||
* Use top xx and start at xx to limit sql results.
|
||||
*/
|
||||
public class SqlAnywhereLimiter implements SqlLimiter {
|
||||
public final class SqlAnywhereLimiter implements SqlLimiter {
|
||||
|
||||
@Override
|
||||
public SqlLimitResponse limit(SqlLimitRequest request) {
|
||||
|
||||
String dbSql = request.getDbSql();
|
||||
|
||||
StringBuilder sb = new StringBuilder(60 + dbSql.length());
|
||||
|
||||
int firstRow = request.getFirstRow();
|
||||
int maxRows = request.getMaxRows();
|
||||
|
||||
/*
|
||||
* SELECT TOP xx START AT xx ... FROM ...
|
||||
*/
|
||||
@@ -26,14 +20,15 @@ public class SqlAnywhereLimiter implements SqlLimiter {
|
||||
if (request.isDistinct()) {
|
||||
sb.append("distinct ");
|
||||
}
|
||||
int maxRows = request.getMaxRows();
|
||||
if (maxRows > 0) {
|
||||
sb.append("top ").append(maxRows).append(" ");
|
||||
}
|
||||
int firstRow = request.getFirstRow();
|
||||
if (firstRow > 0) {
|
||||
sb.append("start at ").append(firstRow + 1).append(" ");
|
||||
}
|
||||
sb.append(dbSql);
|
||||
|
||||
String sql = request.getDbPlatform().completeSql(sb.toString(), request.getOrmQuery());
|
||||
return new SqlLimitResponse(sql);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>platforms</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-platform-sqlite</artifactId>
|
||||
@@ -14,12 +14,12 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.2</tag>
|
||||
<tag>ebean-parent-13.11.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>platforms</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-platform-sqlserver</artifactId>
|
||||
@@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -27,6 +27,6 @@
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.10.2</tag>
|
||||
<tag>ebean-parent-13.11.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
+1
-9
@@ -7,20 +7,14 @@ import io.ebean.config.dbplatform.SqlLimiter;
|
||||
/**
|
||||
* Use ANSI offset rows syntax or top n - SQL Server 2012 onwards.
|
||||
*/
|
||||
public class SqlServerSqlLimiter implements SqlLimiter {
|
||||
|
||||
public SqlServerSqlLimiter() {
|
||||
}
|
||||
public final class SqlServerSqlLimiter implements SqlLimiter {
|
||||
|
||||
@Override
|
||||
public SqlLimitResponse limit(SqlLimitRequest request) {
|
||||
|
||||
String dbSql = request.getDbSql();
|
||||
StringBuilder sb = new StringBuilder(50 + dbSql.length());
|
||||
|
||||
int firstRow = request.getFirstRow();
|
||||
int maxRows = request.getMaxRows();
|
||||
|
||||
if (firstRow < 1) {
|
||||
// just use top n
|
||||
sb.append("select ");
|
||||
@@ -31,12 +25,10 @@ public class SqlServerSqlLimiter implements SqlLimiter {
|
||||
sb.append(dbSql);
|
||||
return new SqlLimitResponse(sb.toString());
|
||||
}
|
||||
|
||||
sb.append("select ");
|
||||
if (request.isDistinct()) {
|
||||
sb.append("distinct ");
|
||||
}
|
||||
|
||||
sb.append(dbSql);
|
||||
sb.append(" ").append("offset");
|
||||
sb.append(" ").append(firstRow).append(" rows");
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>ebean parent</name>
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
<scm>
|
||||
<developerConnection>scm:git:git@github.com:ebean-orm/ebean.git</developerConnection>
|
||||
<tag>ebean-parent-13.10.2</tag>
|
||||
<tag>ebean-parent-13.11.1</tag>
|
||||
</scm>
|
||||
|
||||
<licenses>
|
||||
@@ -49,8 +49,8 @@
|
||||
<ebean-migration.version>13.6.0</ebean-migration.version>
|
||||
<ebean-test-containers.version>6.3</ebean-test-containers.version>
|
||||
<ebean-datasource.version>8.4</ebean-datasource.version>
|
||||
<ebean-agent.version>13.10.2</ebean-agent.version>
|
||||
<ebean-maven-plugin.version>13.10.2</ebean-maven-plugin.version>
|
||||
<ebean-agent.version>13.11.1</ebean-agent.version>
|
||||
<ebean-maven-plugin.version>13.11.1</ebean-maven-plugin.version>
|
||||
<surefire.useModulePath>false</surefire.useModulePath>
|
||||
</properties>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.10.2</version>
|
||||
<version>13.11.1</version>
|
||||
</parent>
|
||||
|
||||
<name>querybean generator</name>
|
||||
|
||||
+21
-21
@@ -4,7 +4,6 @@ import javax.annotation.processing.Filer;
|
||||
import javax.annotation.processing.FilerException;
|
||||
import javax.annotation.processing.Messager;
|
||||
import javax.annotation.processing.ProcessingEnvironment;
|
||||
import javax.lang.model.SourceVersion;
|
||||
import javax.lang.model.element.AnnotationMirror;
|
||||
import javax.lang.model.element.AnnotationValue;
|
||||
import javax.lang.model.element.Element;
|
||||
@@ -126,7 +125,6 @@ class ProcessingContext implements Constants {
|
||||
* Recursively gather all the fields (properties) for the given bean element.
|
||||
*/
|
||||
private void gatherProperties(List<VariableElement> fields, Element element) {
|
||||
|
||||
TypeElement typeElement = (TypeElement) element;
|
||||
TypeMirror superclass = typeElement.getSuperclass();
|
||||
Element mappedSuper = typeUtils.asElement(superclass);
|
||||
@@ -231,10 +229,26 @@ class ProcessingContext implements Constants {
|
||||
}
|
||||
}
|
||||
|
||||
private String trimAnnotations(String type) {
|
||||
int pos = type.indexOf("@");
|
||||
if (pos == -1) {
|
||||
return type;
|
||||
}
|
||||
String remainder = type.substring(0, pos) + type.substring(type.indexOf(' ') + 1);
|
||||
return trimAnnotations(remainder);
|
||||
}
|
||||
|
||||
PropertyType getPropertyType(VariableElement field) {
|
||||
|
||||
TypeMirror typeMirror = field.asType();
|
||||
|
||||
if (dbJsonField(field)) {
|
||||
return propertyTypeMap.getDbJsonType();
|
||||
}
|
||||
if (dbArrayField(field)) {
|
||||
// get generic parameter type
|
||||
DeclaredType declaredType = (DeclaredType) field.asType();
|
||||
String fullType = typeDef(declaredType.getTypeArguments().get(0));
|
||||
return new PropertyTypeArray(fullType, Split.shortName(fullType));
|
||||
}
|
||||
final TypeMirror typeMirror = field.asType();
|
||||
TypeMirror currentType = typeMirror;
|
||||
while (currentType != null) {
|
||||
PropertyType type = propertyTypeMap.getType(typeDef(currentType));
|
||||
@@ -247,17 +261,6 @@ class ProcessingContext implements Constants {
|
||||
currentType = (fieldType == null) ? null : fieldType.getSuperclass();
|
||||
}
|
||||
|
||||
if (dbJsonField(field)) {
|
||||
return propertyTypeMap.getDbJsonType();
|
||||
}
|
||||
|
||||
if (dbArrayField(field)) {
|
||||
// get generic parameter type
|
||||
DeclaredType declaredType = (DeclaredType) typeMirror;
|
||||
String fullType = typeDef(declaredType.getTypeArguments().get(0));
|
||||
return new PropertyTypeArray(fullType, Split.shortName(fullType));
|
||||
}
|
||||
|
||||
Element fieldType = typeUtils.asElement(typeMirror);
|
||||
if (fieldType == null) {
|
||||
return null;
|
||||
@@ -265,7 +268,6 @@ class ProcessingContext implements Constants {
|
||||
|
||||
// workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=544288
|
||||
fieldType = elementUtils.getTypeElement(fieldType.toString());
|
||||
|
||||
if (fieldType.getKind() == ElementKind.ENUM) {
|
||||
String fullType = typeDef(typeMirror);
|
||||
return new PropertyTypeEnum(fullType, Split.shortName(fullType));
|
||||
@@ -296,9 +298,9 @@ class ProcessingContext implements Constants {
|
||||
return result;
|
||||
} else {
|
||||
if (typeInstanceOf(typeMirror, "java.lang.Comparable")) {
|
||||
return new PropertyTypeScalarComparable(typeMirror.toString());
|
||||
return new PropertyTypeScalarComparable(trimAnnotations(typeMirror.toString()));
|
||||
} else {
|
||||
return new PropertyTypeScalar(typeMirror.toString());
|
||||
return new PropertyTypeScalar(trimAnnotations(typeMirror.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -358,7 +360,6 @@ class ProcessingContext implements Constants {
|
||||
* Create the QAssoc PropertyType.
|
||||
*/
|
||||
private PropertyType createPropertyTypeAssoc(String fullName) {
|
||||
|
||||
String[] split = Split.split(fullName);
|
||||
String propertyName = "QAssoc" + split[1];
|
||||
String packageName = packageAppend(split[0]);
|
||||
@@ -415,7 +416,6 @@ class ProcessingContext implements Constants {
|
||||
* Register an entity with optional dbName.
|
||||
*/
|
||||
void addEntity(String beanFullName, String dbName) {
|
||||
|
||||
loaded.add(beanFullName);
|
||||
final String pkg = packageOf(beanFullName);
|
||||
if (pkg != null) {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean</artifactId>
|
||||
<version>13.10.2-SNAPSHOT</version>
|
||||
<version>13.11.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -27,7 +27,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>13.10.2-SNAPSHOT</version>
|
||||
<version>13.11.1-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
<path>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>querybean-generator</artifactId>
|
||||
<version>13.10.2-SNAPSHOT</version>
|
||||
<version>13.11.1-SNAPSHOT</version>
|
||||
</path>
|
||||
</annotationProcessorPaths>
|
||||
</configuration>
|
||||
|
||||
@@ -35,14 +35,14 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>13.10.2-SNAPSHOT</version>
|
||||
<version>13.11.1-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.10.2-SNAPSHOT</version>
|
||||
<version>13.11.1-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user