mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e4162a5b03 | ||
|
|
23e6b18262 | ||
|
|
c8852c521e | ||
|
|
7351258d99 | ||
|
|
af9f9585fb | ||
|
|
d7f9dd40a0 | ||
|
|
d353b98307 | ||
|
|
3ddd7b4b2b | ||
|
|
3960e1deb5 | ||
|
|
84af78e43c | ||
|
|
cbdbf6d2e0 | ||
|
|
548bf871a9 | ||
|
|
b5245544d2 | ||
|
|
a986d0c8cd | ||
|
|
0e02449f67 | ||
|
|
19389fb9d4 | ||
|
|
ab1a79281b | ||
|
|
073669d312 | ||
|
|
f66662fdfa | ||
|
|
04b0d23932 | ||
|
|
af613d3096 | ||
|
|
ecd27e145e | ||
|
|
5f6b4a7795 | ||
|
|
3d890f5383 | ||
|
|
31a0d9b6a6 | ||
|
|
95fbdf37c6 | ||
|
|
1d09c0864d | ||
|
|
02f7815e73 | ||
|
|
85b700757d | ||
|
|
d5838e3d64 | ||
|
|
01e9eb81cf | ||
|
|
1daad7af06 | ||
|
|
e51d6984fe | ||
|
|
c2777b0e27 | ||
|
|
505f87c524 | ||
|
|
4a372a5dc8 | ||
|
|
8e864897bd | ||
|
|
87b12cff93 | ||
|
|
14ea5521c4 | ||
|
|
e1522df8a5 | ||
|
|
b4f309c219 | ||
|
|
181c6a9d4b | ||
|
|
203aa52c2f | ||
|
|
ad3e88c562 | ||
|
|
adb302059b | ||
|
|
9506e6456c | ||
|
|
4617ea2c1c | ||
|
|
55d7eb55d2 | ||
|
|
7feb193e95 | ||
|
|
ab8915b374 | ||
|
|
79fd689e9a | ||
|
|
a68665a37e | ||
|
|
9ff240dc10 | ||
|
|
9982fa3682 | ||
|
|
f7a11135a5 | ||
|
|
c29a81248a | ||
|
|
ef6d1dbca3 |
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-clickhouse</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,13 +35,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-clickhouse</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-cockroach</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,13 +35,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-db2</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,13 +35,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-db2</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-h2</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,13 +35,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-hana</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,13 +35,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-hana</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-mariadb</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,13 +35,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-mariadb</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-mysql</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,13 +35,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-mysql</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-nuodb</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,13 +35,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-nuodb</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-oracle</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,13 +35,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-oracle</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-postgres</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,13 +35,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-sqlite</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,13 +35,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlite</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-sqlserver</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,13 +35,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlserver</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-yugabyte</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,13 +35,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean (all platforms)</name>
|
||||
@@ -16,31 +16,31 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-joda-time</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-jackson-jsonnode</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-jackson-mapper</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -53,13 +53,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-all</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>composites</artifactId>
|
||||
|
||||
+7
-7
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean api</name>
|
||||
@@ -26,12 +26,6 @@
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.avaje</groupId>
|
||||
<artifactId>avaje-config</artifactId>
|
||||
<version>2.4</version>
|
||||
</dependency>
|
||||
|
||||
<!--
|
||||
Class retention Nonnull and Nullable annotations
|
||||
to assist with IDE auto-completion with Ebean API
|
||||
@@ -42,6 +36,12 @@
|
||||
<version>1.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.avaje</groupId>
|
||||
<artifactId>avaje-config</artifactId>
|
||||
<version>3.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>persistence-api</artifactId>
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
package io.ebean;
|
||||
|
||||
import io.ebean.search.Match;
|
||||
import io.ebean.search.MultiMatch;
|
||||
import io.ebean.search.TextCommonTerms;
|
||||
import io.ebean.search.TextQueryString;
|
||||
import io.ebean.search.TextSimple;
|
||||
import io.ebean.search.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
@@ -423,6 +419,94 @@ public interface ExpressionFactory {
|
||||
*/
|
||||
Expression inOrEmpty(String propertyName, Collection<?> values);
|
||||
|
||||
/**
|
||||
* EXISTS a raw SQL SubQuery.
|
||||
*
|
||||
* @param sqlSubQuery The SQL SubQuery
|
||||
* @param bindValues Optional bind values if the SubQuery uses {@code ? } bind values.
|
||||
*/
|
||||
Expression exists(String sqlSubQuery, Object... bindValues);
|
||||
|
||||
/**
|
||||
* Not EXISTS a raw SQL SubQuery.
|
||||
*
|
||||
* @param sqlSubQuery The SQL SubQuery
|
||||
* @param bindValues Optional bind values if the SubQuery uses {@code ? } bind values.
|
||||
*/
|
||||
Expression notExists(String sqlSubQuery, Object... bindValues);
|
||||
|
||||
/**
|
||||
* IN a raw SQL SubQuery.
|
||||
*
|
||||
* @param propertyName The bean property
|
||||
* @param sqlSubQuery The SQL SubQuery
|
||||
* @param bindValues Optional bind values if the SubQuery uses {@code ? } bind values.
|
||||
*/
|
||||
Expression inSubQuery(String propertyName, String sqlSubQuery, Object... bindValues);
|
||||
|
||||
/**
|
||||
* Not IN a raw SQL SubQuery.
|
||||
*
|
||||
* @param propertyName The bean property
|
||||
* @param sqlSubQuery The SQL SubQuery
|
||||
* @param bindValues Optional bind values if the SubQuery uses {@code ? } bind values.
|
||||
*/
|
||||
Expression notInSubQuery(String propertyName, String sqlSubQuery, Object... bindValues);
|
||||
|
||||
/**
|
||||
* Equal To a raw SQL SubQuery.
|
||||
*
|
||||
* @param propertyName The bean property
|
||||
* @param sqlSubQuery The SQL SubQuery
|
||||
* @param bindValues Optional bind values if the SubQuery uses {@code ? } bind values.
|
||||
*/
|
||||
Expression eqSubQuery(String propertyName, String sqlSubQuery, Object... bindValues);
|
||||
|
||||
/**
|
||||
* Not Equal To a raw SQL SubQuery.
|
||||
*
|
||||
* @param propertyName The bean property
|
||||
* @param sqlSubQuery The SQL SubQuery
|
||||
* @param bindValues Optional bind values if the SubQuery uses {@code ? } bind values.
|
||||
*/
|
||||
Expression neSubQuery(String propertyName, String sqlSubQuery, Object... bindValues);
|
||||
|
||||
/**
|
||||
* Greater Than or Equal To a raw SQL SubQuery.
|
||||
*
|
||||
* @param propertyName The bean property
|
||||
* @param sqlSubQuery The SQL SubQuery
|
||||
* @param bindValues Optional bind values if the SubQuery uses {@code ? } bind values.
|
||||
*/
|
||||
Expression geSubQuery(String propertyName, String sqlSubQuery, Object... bindValues);
|
||||
|
||||
/**
|
||||
* Greater Than a raw SQL SubQuery.
|
||||
*
|
||||
* @param propertyName The bean property
|
||||
* @param sqlSubQuery The SQL SubQuery
|
||||
* @param bindValues Optional bind values if the SubQuery uses {@code ? } bind values.
|
||||
*/
|
||||
Expression gtSubQuery(String propertyName, String sqlSubQuery, Object... bindValues);
|
||||
|
||||
/**
|
||||
* Less Than or Equal To a raw SQL SubQuery.
|
||||
*
|
||||
* @param propertyName The bean property
|
||||
* @param sqlSubQuery The SQL SubQuery
|
||||
* @param bindValues Optional bind values if the SubQuery uses {@code ? } bind values.
|
||||
*/
|
||||
Expression leSubQuery(String propertyName, String sqlSubQuery, Object... bindValues);
|
||||
|
||||
/**
|
||||
* Less Than a raw SQL SubQuery.
|
||||
*
|
||||
* @param propertyName The bean property
|
||||
* @param sqlSubQuery The SQL SubQuery
|
||||
* @param bindValues Optional bind values if the SubQuery uses {@code ? } bind values.
|
||||
*/
|
||||
Expression ltSubQuery(String propertyName, String sqlSubQuery, Object... bindValues);
|
||||
|
||||
/**
|
||||
* Not In - property has a value in the array of values.
|
||||
*/
|
||||
|
||||
@@ -1141,6 +1141,94 @@ public interface ExpressionList<T> {
|
||||
*/
|
||||
ExpressionList<T> inPairs(Pairs pairs);
|
||||
|
||||
/**
|
||||
* EXISTS a raw SQL SubQuery.
|
||||
*
|
||||
* @param sqlSubQuery The SQL SubQuery
|
||||
* @param bindValues Optional bind values if the SubQuery uses {@code ? } bind values.
|
||||
*/
|
||||
ExpressionList<T> exists(String sqlSubQuery, Object... bindValues);
|
||||
|
||||
/**
|
||||
* Not EXISTS a raw SQL SubQuery.
|
||||
*
|
||||
* @param sqlSubQuery The SQL SubQuery
|
||||
* @param bindValues Optional bind values if the SubQuery uses {@code ? } bind values.
|
||||
*/
|
||||
ExpressionList<T> notExists(String sqlSubQuery, Object... bindValues);
|
||||
|
||||
/**
|
||||
* IN a raw SQL SubQuery.
|
||||
*
|
||||
* @param propertyName The bean property
|
||||
* @param sqlSubQuery The SQL SubQuery
|
||||
* @param bindValues Optional bind values if the SubQuery uses {@code ? } bind values.
|
||||
*/
|
||||
ExpressionList<T> inSubQuery(String propertyName, String sqlSubQuery, Object... bindValues);
|
||||
|
||||
/**
|
||||
* Not IN a raw SQL SubQuery.
|
||||
*
|
||||
* @param propertyName The bean property
|
||||
* @param sqlSubQuery The SQL SubQuery
|
||||
* @param bindValues Optional bind values if the SubQuery uses {@code ? } bind values.
|
||||
*/
|
||||
ExpressionList<T> notInSubQuery(String propertyName, String sqlSubQuery, Object... bindValues);
|
||||
|
||||
/**
|
||||
* Equal To a raw SQL SubQuery.
|
||||
*
|
||||
* @param propertyName The bean property
|
||||
* @param sqlSubQuery The SQL SubQuery
|
||||
* @param bindValues Optional bind values if the SubQuery uses {@code ? } bind values.
|
||||
*/
|
||||
ExpressionList<T> eqSubQuery(String propertyName, String sqlSubQuery, Object... bindValues);
|
||||
|
||||
/**
|
||||
* Not Equal To a raw SQL SubQuery.
|
||||
*
|
||||
* @param propertyName The bean property
|
||||
* @param sqlSubQuery The SQL SubQuery
|
||||
* @param bindValues Optional bind values if the SubQuery uses {@code ? } bind values.
|
||||
*/
|
||||
ExpressionList<T> neSubQuery(String propertyName, String sqlSubQuery, Object... bindValues);
|
||||
|
||||
/**
|
||||
* Greater Than a raw SQL SubQuery.
|
||||
*
|
||||
* @param propertyName The bean property
|
||||
* @param sqlSubQuery The SQL SubQuery
|
||||
* @param bindValues Optional bind values if the SubQuery uses {@code ? } bind values.
|
||||
*/
|
||||
ExpressionList<T> gtSubQuery(String propertyName, String sqlSubQuery, Object... bindValues);
|
||||
|
||||
/**
|
||||
* Greater Than or Equal To a raw SQL SubQuery.
|
||||
*
|
||||
* @param propertyName The bean property
|
||||
* @param sqlSubQuery The SQL SubQuery
|
||||
* @param bindValues Optional bind values if the SubQuery uses {@code ? } bind values.
|
||||
*/
|
||||
ExpressionList<T> geSubQuery(String propertyName, String sqlSubQuery, Object... bindValues);
|
||||
|
||||
/**
|
||||
* Less Than a raw SQL SubQuery.
|
||||
*
|
||||
* @param propertyName The bean property
|
||||
* @param sqlSubQuery The SQL SubQuery
|
||||
* @param bindValues Optional bind values if the SubQuery uses {@code ? } bind values.
|
||||
*/
|
||||
ExpressionList<T> ltSubQuery(String propertyName, String sqlSubQuery, Object... bindValues);
|
||||
|
||||
/**
|
||||
* Less Than or Equal To a raw SQL SubQuery.
|
||||
*
|
||||
* @param propertyName The bean property
|
||||
* @param sqlSubQuery The SQL SubQuery
|
||||
* @param bindValues Optional bind values if the SubQuery uses {@code ? } bind values.
|
||||
*/
|
||||
ExpressionList<T> leSubQuery(String propertyName, String sqlSubQuery, Object... bindValues);
|
||||
|
||||
/**
|
||||
* In - using a subQuery.
|
||||
*/
|
||||
|
||||
@@ -77,12 +77,12 @@ public interface BeanCollection<E> extends Serializable, ToStringAware {
|
||||
/**
|
||||
* Return the bean that owns this collection.
|
||||
*/
|
||||
EntityBean getOwnerBean();
|
||||
EntityBean owner();
|
||||
|
||||
/**
|
||||
* Return the bean property name this collection represents.
|
||||
*/
|
||||
String getPropertyName();
|
||||
String propertyName();
|
||||
|
||||
/**
|
||||
* Check after the lazy load that the underlying collection is not null
|
||||
@@ -99,7 +99,7 @@ public interface BeanCollection<E> extends Serializable, ToStringAware {
|
||||
* This is so that the filter can be applied on refresh.
|
||||
* </p>
|
||||
*/
|
||||
ExpressionList<?> getFilterMany();
|
||||
ExpressionList<?> filterMany();
|
||||
|
||||
/**
|
||||
* Set the filter that was used in building this collection.
|
||||
@@ -154,7 +154,7 @@ public interface BeanCollection<E> extends Serializable, ToStringAware {
|
||||
/**
|
||||
* Returns the underlying collection of beans from the Set, Map or List.
|
||||
*/
|
||||
Collection<E> getActualDetails();
|
||||
Collection<E> actualDetails();
|
||||
|
||||
/**
|
||||
* Returns the underlying entries so for Maps this is a collection of
|
||||
@@ -162,7 +162,7 @@ public interface BeanCollection<E> extends Serializable, ToStringAware {
|
||||
* <p>
|
||||
* For maps this returns the entrySet as we need the keys of the map.
|
||||
*/
|
||||
Collection<?> getActualEntries();
|
||||
Collection<?> actualEntries();
|
||||
|
||||
/**
|
||||
* return true if there are real rows held. Return false is this is using
|
||||
@@ -195,7 +195,7 @@ public interface BeanCollection<E> extends Serializable, ToStringAware {
|
||||
/**
|
||||
* Return the current modify listening mode. Can be null for on newly created beans.
|
||||
*/
|
||||
ModifyListenMode getModifyListening();
|
||||
ModifyListenMode modifyListening();
|
||||
|
||||
/**
|
||||
* Add an object to the additions list.
|
||||
@@ -217,13 +217,13 @@ public interface BeanCollection<E> extends Serializable, ToStringAware {
|
||||
* Return the list of objects added to the list set or map. These will used to
|
||||
* insert rows into the intersection table of a ManyToMany.
|
||||
*/
|
||||
Set<E> getModifyAdditions();
|
||||
Set<E> modifyAdditions();
|
||||
|
||||
/**
|
||||
* Return the list of objects removed from the list set or map. These will
|
||||
* used to delete rows from the intersection table of a ManyToMany.
|
||||
*/
|
||||
Set<E> getModifyRemovals();
|
||||
Set<E> modifyRemovals();
|
||||
|
||||
/**
|
||||
* Reset the set of additions and deletions. This is called after the
|
||||
@@ -239,5 +239,5 @@ public interface BeanCollection<E> extends Serializable, ToStringAware {
|
||||
/**
|
||||
* Return a shallow copy of this collection that is modifiable.
|
||||
*/
|
||||
BeanCollection<E> getShallowCopy();
|
||||
BeanCollection<E> shallowCopy();
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ public interface BeanLoader {
|
||||
/**
|
||||
* Return the name of the associated Database.
|
||||
*/
|
||||
String getName();
|
||||
String name();
|
||||
|
||||
/**
|
||||
* Invoke the lazy loading for this bean.
|
||||
|
||||
@@ -8,15 +8,15 @@ public interface CallOrigin {
|
||||
/**
|
||||
* Return the top element. Typically the top stack element with class and line.
|
||||
*/
|
||||
String getTopElement();
|
||||
String top();
|
||||
|
||||
/**
|
||||
* Return the full description of the call origin.
|
||||
*/
|
||||
String getFullDescription();
|
||||
String description();
|
||||
|
||||
/**
|
||||
* Compute and return an origin key based on the query hash.
|
||||
*/
|
||||
String getOriginKey(int queryHash);
|
||||
String key(int queryHash);
|
||||
}
|
||||
|
||||
@@ -41,14 +41,14 @@ public final class CallStack implements Serializable, CallOrigin {
|
||||
public CallStack(List<StackWalker.StackFrame> frames) {
|
||||
this.callStack = frames.toArray(new Object[0]);
|
||||
this.hc = computeHashCode();
|
||||
this.zeroHash = enc(callStack[0].hashCode());
|
||||
this.zeroHash = enc(callStack[0].toString().hashCode());
|
||||
this.pathHash = enc(hc);
|
||||
}
|
||||
|
||||
private int computeHashCode() {
|
||||
int hc = 0;
|
||||
for (Object element : callStack) {
|
||||
hc = 92821 * hc + element.hashCode();
|
||||
hc = 92821 * hc + element.toString().hashCode();
|
||||
}
|
||||
return hc;
|
||||
}
|
||||
@@ -79,7 +79,7 @@ public final class CallStack implements Serializable, CallOrigin {
|
||||
* Return the first element of the call stack.
|
||||
*/
|
||||
@Override
|
||||
public String getTopElement() {
|
||||
public String top() {
|
||||
return callStack[0].toString();
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public final class CallStack implements Serializable, CallOrigin {
|
||||
* Return the call stack lines appended with the given newLine string.
|
||||
*/
|
||||
@Override
|
||||
public String getFullDescription() {
|
||||
public String description() {
|
||||
StringBuilder sb = new StringBuilder(400);
|
||||
for (int i = 0; i < callStack.length; i++) {
|
||||
if (i > 0) {
|
||||
@@ -99,7 +99,7 @@ public final class CallStack implements Serializable, CallOrigin {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOriginKey(int queryHash) {
|
||||
public String key(int queryHash) {
|
||||
return enc(queryHash) + "." + zeroHash + "." + pathHash;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,12 +17,12 @@ public interface EntityBeanIntercept extends Serializable {
|
||||
/**
|
||||
* Return the 'owning' entity bean.
|
||||
*/
|
||||
EntityBean getOwner();
|
||||
EntityBean owner();
|
||||
|
||||
/**
|
||||
* Return the persistenceContext.
|
||||
*/
|
||||
PersistenceContext getPersistenceContext();
|
||||
PersistenceContext persistenceContext();
|
||||
|
||||
/**
|
||||
* Set the persistenceContext.
|
||||
@@ -37,7 +37,7 @@ public interface EntityBeanIntercept extends Serializable {
|
||||
/**
|
||||
* Return the ownerId (IdClass).
|
||||
*/
|
||||
Object getOwnerId();
|
||||
Object ownerId();
|
||||
|
||||
/**
|
||||
* Set the ownerId (IdClass).
|
||||
@@ -47,12 +47,12 @@ public interface EntityBeanIntercept extends Serializable {
|
||||
/**
|
||||
* Return the owning bean for an embedded bean.
|
||||
*/
|
||||
Object getEmbeddedOwner();
|
||||
Object embeddedOwner();
|
||||
|
||||
/**
|
||||
* Return the property index (for the parent) of this embedded bean.
|
||||
*/
|
||||
int getEmbeddedOwnerIndex();
|
||||
int embeddedOwnerIndex();
|
||||
|
||||
/**
|
||||
* Clear the getter callback.
|
||||
@@ -229,7 +229,7 @@ public interface EntityBeanIntercept extends Serializable {
|
||||
/**
|
||||
* Return the original value that was changed via an update.
|
||||
*/
|
||||
Object getOrigValue(int propertyIndex);
|
||||
Object origValue(int propertyIndex);
|
||||
|
||||
/**
|
||||
* Finds the index position of a given property. Returns -1 if the
|
||||
@@ -240,12 +240,12 @@ public interface EntityBeanIntercept extends Serializable {
|
||||
/**
|
||||
* Return the property name for the given property.
|
||||
*/
|
||||
String getProperty(int propertyIndex);
|
||||
String property(int propertyIndex);
|
||||
|
||||
/**
|
||||
* Return the number of properties.
|
||||
*/
|
||||
int getPropertyLength();
|
||||
int propertyLength();
|
||||
|
||||
/**
|
||||
* Set the loaded state of the property given it's name.
|
||||
@@ -321,17 +321,17 @@ public interface EntityBeanIntercept extends Serializable {
|
||||
/**
|
||||
* Return the set of property names for a partially loaded bean.
|
||||
*/
|
||||
Set<String> getLoadedPropertyNames();
|
||||
Set<String> loadedPropertyNames();
|
||||
|
||||
/**
|
||||
* Return the array of flags indicating the dirty properties.
|
||||
*/
|
||||
boolean[] getDirtyProperties();
|
||||
boolean[] dirtyProperties();
|
||||
|
||||
/**
|
||||
* Return the set of dirty properties.
|
||||
*/
|
||||
Set<String> getDirtyPropertyNames();
|
||||
Set<String> dirtyPropertyNames();
|
||||
|
||||
/**
|
||||
* Recursively add dirty properties.
|
||||
@@ -346,7 +346,7 @@ public interface EntityBeanIntercept extends Serializable {
|
||||
/**
|
||||
* Return a map of dirty properties with their new and old values.
|
||||
*/
|
||||
Map<String, ValuePair> getDirtyValues();
|
||||
Map<String, ValuePair> dirtyValues();
|
||||
|
||||
/**
|
||||
* Recursively add dirty properties.
|
||||
@@ -361,7 +361,7 @@ public interface EntityBeanIntercept extends Serializable {
|
||||
/**
|
||||
* Return a dirty property hash taking into account embedded beans.
|
||||
*/
|
||||
StringBuilder getDirtyPropertyKey();
|
||||
StringBuilder dirtyPropertyKey();
|
||||
|
||||
/**
|
||||
* Add and return a dirty property hash.
|
||||
@@ -371,22 +371,22 @@ public interface EntityBeanIntercept extends Serializable {
|
||||
/**
|
||||
* Return a loaded property hash.
|
||||
*/
|
||||
StringBuilder getLoadedPropertyKey();
|
||||
StringBuilder loadedPropertyKey();
|
||||
|
||||
/**
|
||||
* Return the loaded state for all the properties.
|
||||
*/
|
||||
boolean[] getLoaded();
|
||||
boolean[] loaded();
|
||||
|
||||
/**
|
||||
* Return the index of the property that triggered the lazy load.
|
||||
*/
|
||||
int getLazyLoadPropertyIndex();
|
||||
int lazyLoadPropertyIndex();
|
||||
|
||||
/**
|
||||
* Return the property that triggered the lazy load.
|
||||
*/
|
||||
String getLazyLoadProperty();
|
||||
String lazyLoadProperty();
|
||||
|
||||
/**
|
||||
* Load the bean when it is a reference.
|
||||
@@ -497,7 +497,7 @@ public interface EntityBeanIntercept extends Serializable {
|
||||
/**
|
||||
* Return the sort order value for an order column.
|
||||
*/
|
||||
int getSortOrder();
|
||||
int sortOrder();
|
||||
|
||||
/**
|
||||
* Set the sort order value for an order column.
|
||||
@@ -522,7 +522,7 @@ public interface EntityBeanIntercept extends Serializable {
|
||||
/**
|
||||
* Returns the loadErrors.
|
||||
*/
|
||||
Map<String, Exception> getLoadErrors();
|
||||
Map<String, Exception> loadErrors();
|
||||
|
||||
/**
|
||||
* Return true if the property has its changed state set.
|
||||
|
||||
@@ -30,12 +30,12 @@ public class InterceptReadOnly implements EntityBeanIntercept {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityBean getOwner() {
|
||||
public EntityBean owner() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PersistenceContext getPersistenceContext() {
|
||||
public PersistenceContext persistenceContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public class InterceptReadOnly implements EntityBeanIntercept {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOwnerId() {
|
||||
public Object ownerId() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -60,12 +60,12 @@ public class InterceptReadOnly implements EntityBeanIntercept {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getEmbeddedOwner() {
|
||||
public Object embeddedOwner() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEmbeddedOwnerIndex() {
|
||||
public int embeddedOwnerIndex() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -230,7 +230,7 @@ public class InterceptReadOnly implements EntityBeanIntercept {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOrigValue(int propertyIndex) {
|
||||
public Object origValue(int propertyIndex) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -240,12 +240,12 @@ public class InterceptReadOnly implements EntityBeanIntercept {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProperty(int propertyIndex) {
|
||||
public String property(int propertyIndex) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPropertyLength() {
|
||||
public int propertyLength() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -320,17 +320,17 @@ public class InterceptReadOnly implements EntityBeanIntercept {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getLoadedPropertyNames() {
|
||||
public Set<String> loadedPropertyNames() {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean[] getDirtyProperties() {
|
||||
public boolean[] dirtyProperties() {
|
||||
return new boolean[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getDirtyPropertyNames() {
|
||||
public Set<String> dirtyPropertyNames() {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
@@ -345,7 +345,7 @@ public class InterceptReadOnly implements EntityBeanIntercept {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, ValuePair> getDirtyValues() {
|
||||
public Map<String, ValuePair> dirtyValues() {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
@@ -360,7 +360,7 @@ public class InterceptReadOnly implements EntityBeanIntercept {
|
||||
}
|
||||
|
||||
@Override
|
||||
public StringBuilder getDirtyPropertyKey() {
|
||||
public StringBuilder dirtyPropertyKey() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -370,22 +370,22 @@ public class InterceptReadOnly implements EntityBeanIntercept {
|
||||
}
|
||||
|
||||
@Override
|
||||
public StringBuilder getLoadedPropertyKey() {
|
||||
public StringBuilder loadedPropertyKey() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean[] getLoaded() {
|
||||
public boolean[] loaded() {
|
||||
return new boolean[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLazyLoadPropertyIndex() {
|
||||
public int lazyLoadPropertyIndex() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLazyLoadProperty() {
|
||||
public String lazyLoadProperty() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -495,7 +495,7 @@ public class InterceptReadOnly implements EntityBeanIntercept {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSortOrder() {
|
||||
public int sortOrder() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -520,7 +520,7 @@ public class InterceptReadOnly implements EntityBeanIntercept {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Exception> getLoadErrors() {
|
||||
public Map<String, Exception> loadErrors() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ public final class InterceptReadWrite implements EntityBeanIntercept {
|
||||
*/
|
||||
private static final byte FLAG_MUTABLE_HASH_SET = 16;
|
||||
|
||||
private transient final ReentrantLock lock = new ReentrantLock();
|
||||
private final ReentrantLock lock = new ReentrantLock();
|
||||
private transient NodeUsageCollector nodeUsageCollector;
|
||||
private transient PersistenceContext persistenceContext;
|
||||
private transient BeanLoader beanLoader;
|
||||
@@ -128,17 +128,16 @@ public final class InterceptReadWrite implements EntityBeanIntercept {
|
||||
(lazyLoadProperty > -1 ? (", lazyLoadProperty=" + lazyLoadProperty) : "") +
|
||||
", loader=" + beanLoader +
|
||||
(ownerId != null ? (", ownerId=" + ownerId) : "") +
|
||||
", owner=" + owner +
|
||||
'}';
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityBean getOwner() {
|
||||
public EntityBean owner() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PersistenceContext getPersistenceContext() {
|
||||
public PersistenceContext persistenceContext() {
|
||||
return persistenceContext;
|
||||
}
|
||||
|
||||
@@ -153,7 +152,7 @@ public final class InterceptReadWrite implements EntityBeanIntercept {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOwnerId() {
|
||||
public Object ownerId() {
|
||||
return ownerId;
|
||||
}
|
||||
|
||||
@@ -163,12 +162,12 @@ public final class InterceptReadWrite implements EntityBeanIntercept {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getEmbeddedOwner() {
|
||||
public Object embeddedOwner() {
|
||||
return embeddedOwner;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEmbeddedOwnerIndex() {
|
||||
public int embeddedOwnerIndex() {
|
||||
return embeddedOwnerIndex;
|
||||
}
|
||||
|
||||
@@ -192,13 +191,13 @@ public final class InterceptReadWrite implements EntityBeanIntercept {
|
||||
public void setBeanLoader(BeanLoader beanLoader, PersistenceContext ctx) {
|
||||
this.beanLoader = beanLoader;
|
||||
this.persistenceContext = ctx;
|
||||
this.ebeanServerName = beanLoader.getName();
|
||||
this.ebeanServerName = beanLoader.name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanLoader(BeanLoader beanLoader) {
|
||||
this.beanLoader = beanLoader;
|
||||
this.ebeanServerName = beanLoader.getName();
|
||||
this.ebeanServerName = beanLoader.name();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -381,8 +380,7 @@ public final class InterceptReadWrite implements EntityBeanIntercept {
|
||||
@Override
|
||||
public void setEmbeddedLoaded(Object embeddedBean) {
|
||||
if (embeddedBean instanceof EntityBean) {
|
||||
EntityBean eb = (EntityBean) embeddedBean;
|
||||
eb._ebean_getIntercept().setLoaded();
|
||||
((EntityBean) embeddedBean)._ebean_getIntercept().setLoaded();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -402,7 +400,7 @@ public final class InterceptReadWrite implements EntityBeanIntercept {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOrigValue(int propertyIndex) {
|
||||
public Object origValue(int propertyIndex) {
|
||||
if ((flags[propertyIndex] & (FLAG_ORIG_VALUE_SET | FLAG_MUTABLE_HASH_SET)) == FLAG_MUTABLE_HASH_SET) {
|
||||
// mutable hash set, but not ORIG_VALUE
|
||||
setOriginalValue(propertyIndex, mutableInfo[propertyIndex].get());
|
||||
@@ -415,7 +413,7 @@ public final class InterceptReadWrite implements EntityBeanIntercept {
|
||||
|
||||
@Override
|
||||
public int findProperty(String propertyName) {
|
||||
String[] names = owner._ebean_getPropertyNames();
|
||||
final String[] names = owner._ebean_getPropertyNames();
|
||||
for (int i = 0; i < names.length; i++) {
|
||||
if (names[i].equals(propertyName)) {
|
||||
return i;
|
||||
@@ -425,7 +423,7 @@ public final class InterceptReadWrite implements EntityBeanIntercept {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProperty(int propertyIndex) {
|
||||
public String property(int propertyIndex) {
|
||||
if (propertyIndex == -1) {
|
||||
return null;
|
||||
}
|
||||
@@ -433,13 +431,13 @@ public final class InterceptReadWrite implements EntityBeanIntercept {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPropertyLength() {
|
||||
public int propertyLength() {
|
||||
return flags.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPropertyLoaded(String propertyName, boolean loaded) {
|
||||
int position = findProperty(propertyName);
|
||||
final int position = findProperty(propertyName);
|
||||
if (position == -1) {
|
||||
throw new IllegalArgumentException("Property " + propertyName + " not found");
|
||||
}
|
||||
@@ -533,23 +531,23 @@ public final class InterceptReadWrite implements EntityBeanIntercept {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getLoadedPropertyNames() {
|
||||
public Set<String> loadedPropertyNames() {
|
||||
if (fullyLoadedBean) {
|
||||
return null;
|
||||
}
|
||||
Set<String> props = new LinkedHashSet<>();
|
||||
final Set<String> props = new LinkedHashSet<>();
|
||||
for (int i = 0; i < flags.length; i++) {
|
||||
if ((flags[i] & FLAG_LOADED_PROP) != 0) {
|
||||
props.add(getProperty(i));
|
||||
props.add(property(i));
|
||||
}
|
||||
}
|
||||
return props;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean[] getDirtyProperties() {
|
||||
int len = getPropertyLength();
|
||||
boolean[] dirties = new boolean[len];
|
||||
public boolean[] dirtyProperties() {
|
||||
final int len = propertyLength();
|
||||
final boolean[] dirties = new boolean[len];
|
||||
for (int i = 0; i < len; i++) {
|
||||
// this, or an embedded property has been changed - recurse
|
||||
dirties[i] = (flags[i] & (FLAG_CHANGED_PROP + FLAG_EMBEDDED_DIRTY)) != 0;
|
||||
@@ -558,31 +556,31 @@ public final class InterceptReadWrite implements EntityBeanIntercept {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getDirtyPropertyNames() {
|
||||
Set<String> props = new LinkedHashSet<>();
|
||||
public Set<String> dirtyPropertyNames() {
|
||||
final Set<String> props = new LinkedHashSet<>();
|
||||
addDirtyPropertyNames(props, null);
|
||||
return props;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDirtyPropertyNames(Set<String> props, String prefix) {
|
||||
int len = getPropertyLength();
|
||||
final int len = propertyLength();
|
||||
for (int i = 0; i < len; i++) {
|
||||
if (isChangedProp(i)) {
|
||||
// the property has been changed on this bean
|
||||
props.add((prefix == null ? getProperty(i) : prefix + getProperty(i)));
|
||||
props.add((prefix == null ? property(i) : prefix + property(i)));
|
||||
} else if ((flags[i] & FLAG_EMBEDDED_DIRTY) != 0) {
|
||||
// an embedded property has been changed - recurse
|
||||
EntityBean embeddedBean = (EntityBean) owner._ebean_getField(i);
|
||||
embeddedBean._ebean_getIntercept().addDirtyPropertyNames(props, getProperty(i) + ".");
|
||||
final EntityBean embeddedBean = (EntityBean) owner._ebean_getField(i);
|
||||
embeddedBean._ebean_getIntercept().addDirtyPropertyNames(props, property(i) + ".");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasDirtyProperty(Set<String> propertyNames) {
|
||||
String[] names = owner._ebean_getPropertyNames();
|
||||
int len = getPropertyLength();
|
||||
final String[] names = owner._ebean_getPropertyNames();
|
||||
final int len = propertyLength();
|
||||
for (int i = 0; i < len; i++) {
|
||||
if (isChangedProp(i)) {
|
||||
if (propertyNames.contains(names[i])) {
|
||||
@@ -598,46 +596,46 @@ public final class InterceptReadWrite implements EntityBeanIntercept {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, ValuePair> getDirtyValues() {
|
||||
Map<String, ValuePair> dirtyValues = new LinkedHashMap<>();
|
||||
public Map<String, ValuePair> dirtyValues() {
|
||||
final Map<String, ValuePair> dirtyValues = new LinkedHashMap<>();
|
||||
addDirtyPropertyValues(dirtyValues, null);
|
||||
return dirtyValues;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDirtyPropertyValues(Map<String, ValuePair> dirtyValues, String prefix) {
|
||||
int len = getPropertyLength();
|
||||
final int len = propertyLength();
|
||||
for (int i = 0; i < len; i++) {
|
||||
if (isChangedProp(i)) {
|
||||
// the property has been changed on this bean
|
||||
String propName = (prefix == null ? getProperty(i) : prefix + getProperty(i));
|
||||
Object newVal = owner._ebean_getField(i);
|
||||
Object oldVal = getOrigValue(i);
|
||||
final String propName = (prefix == null ? property(i) : prefix + property(i));
|
||||
final Object newVal = owner._ebean_getField(i);
|
||||
final Object oldVal = origValue(i);
|
||||
if (notEqual(oldVal, newVal)) {
|
||||
dirtyValues.put(propName, new ValuePair(newVal, oldVal));
|
||||
}
|
||||
} else if ((flags[i] & FLAG_EMBEDDED_DIRTY) != 0) {
|
||||
// an embedded property has been changed - recurse
|
||||
EntityBean embeddedBean = (EntityBean) owner._ebean_getField(i);
|
||||
embeddedBean._ebean_getIntercept().addDirtyPropertyValues(dirtyValues, getProperty(i) + ".");
|
||||
final EntityBean embeddedBean = (EntityBean) owner._ebean_getField(i);
|
||||
embeddedBean._ebean_getIntercept().addDirtyPropertyValues(dirtyValues, property(i) + ".");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDirtyPropertyValues(BeanDiffVisitor visitor) {
|
||||
int len = getPropertyLength();
|
||||
final int len = propertyLength();
|
||||
for (int i = 0; i < len; i++) {
|
||||
if (isChangedProp(i)) {
|
||||
// the property has been changed on this bean
|
||||
Object newVal = owner._ebean_getField(i);
|
||||
Object oldVal = getOrigValue(i);
|
||||
final Object newVal = owner._ebean_getField(i);
|
||||
final Object oldVal = origValue(i);
|
||||
if (notEqual(oldVal, newVal)) {
|
||||
visitor.visit(i, newVal, oldVal);
|
||||
}
|
||||
} else if ((flags[i] & FLAG_EMBEDDED_DIRTY) != 0) {
|
||||
// an embedded property has been changed - recurse
|
||||
EntityBean embeddedBean = (EntityBean) owner._ebean_getField(i);
|
||||
final EntityBean embeddedBean = (EntityBean) owner._ebean_getField(i);
|
||||
visitor.visitPush(i);
|
||||
embeddedBean._ebean_getIntercept().addDirtyPropertyValues(visitor);
|
||||
visitor.visitPop();
|
||||
@@ -646,8 +644,8 @@ public final class InterceptReadWrite implements EntityBeanIntercept {
|
||||
}
|
||||
|
||||
@Override
|
||||
public StringBuilder getDirtyPropertyKey() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
public StringBuilder dirtyPropertyKey() {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
addDirtyPropertyKey(sb);
|
||||
return sb;
|
||||
}
|
||||
@@ -657,24 +655,23 @@ public final class InterceptReadWrite implements EntityBeanIntercept {
|
||||
if (sortOrder > 0) {
|
||||
sb.append("s,");
|
||||
}
|
||||
int len = getPropertyLength();
|
||||
final int len = propertyLength();
|
||||
for (int i = 0; i < len; i++) {
|
||||
if ((flags[i] & FLAG_CHANGED_PROP) != 0) { // we do not check against mutablecontent here.
|
||||
sb.append(i).append(',');
|
||||
} else if ((flags[i] & FLAG_EMBEDDED_DIRTY) != 0) {
|
||||
// an embedded property has been changed - recurse
|
||||
EntityBean embeddedBean = (EntityBean) owner._ebean_getField(i);
|
||||
sb.append(i).append('[');
|
||||
embeddedBean._ebean_getIntercept().addDirtyPropertyKey(sb);
|
||||
((EntityBean) owner._ebean_getField(i))._ebean_getIntercept().addDirtyPropertyKey(sb);
|
||||
sb.append(']');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public StringBuilder getLoadedPropertyKey() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
int len = getPropertyLength();
|
||||
public StringBuilder loadedPropertyKey() {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
final int len = propertyLength();
|
||||
for (int i = 0; i < len; i++) {
|
||||
if (isLoadedProperty(i)) {
|
||||
sb.append(i).append(',');
|
||||
@@ -684,8 +681,8 @@ public final class InterceptReadWrite implements EntityBeanIntercept {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean[] getLoaded() {
|
||||
boolean[] ret = new boolean[flags.length];
|
||||
public boolean[] loaded() {
|
||||
final boolean[] ret = new boolean[flags.length];
|
||||
for (int i = 0; i < ret.length; i++) {
|
||||
ret[i] = (flags[i] & FLAG_LOADED_PROP) != 0;
|
||||
}
|
||||
@@ -693,13 +690,13 @@ public final class InterceptReadWrite implements EntityBeanIntercept {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLazyLoadPropertyIndex() {
|
||||
public int lazyLoadPropertyIndex() {
|
||||
return lazyLoadProperty;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLazyLoadProperty() {
|
||||
return getProperty(lazyLoadProperty);
|
||||
public String lazyLoadProperty() {
|
||||
return property(lazyLoadProperty);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -839,7 +836,7 @@ public final class InterceptReadWrite implements EntityBeanIntercept {
|
||||
loadBean(propertyIndex);
|
||||
}
|
||||
if (nodeUsageCollector != null) {
|
||||
nodeUsageCollector.addUsed(getProperty(propertyIndex));
|
||||
nodeUsageCollector.addUsed(property(propertyIndex));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -988,7 +985,7 @@ public final class InterceptReadWrite implements EntityBeanIntercept {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSortOrder() {
|
||||
public int sortOrder() {
|
||||
return sortOrder;
|
||||
}
|
||||
|
||||
@@ -1017,19 +1014,19 @@ public final class InterceptReadWrite implements EntityBeanIntercept {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Exception> getLoadErrors() {
|
||||
public Map<String, Exception> loadErrors() {
|
||||
if (loadErrors == null) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
Map<String, Exception> ret = null;
|
||||
int len = getPropertyLength();
|
||||
int len = propertyLength();
|
||||
for (int i = 0; i < len; i++) {
|
||||
Exception loadError = loadErrors[i];
|
||||
final Exception loadError = loadErrors[i];
|
||||
if (loadError != null) {
|
||||
if (ret == null) {
|
||||
ret = new LinkedHashMap<>();
|
||||
}
|
||||
ret.put(getProperty(i), loadError);
|
||||
ret.put(property(i), loadError);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
||||
@@ -8,7 +8,6 @@ import java.util.Objects;
|
||||
* <p>
|
||||
* It represents a location relative to the root of an object graph and specific
|
||||
* to a query and call stack hash.
|
||||
* </p>
|
||||
*/
|
||||
public final class ObjectGraphNode implements Serializable {
|
||||
|
||||
@@ -17,7 +16,7 @@ public final class ObjectGraphNode implements Serializable {
|
||||
/**
|
||||
* Identifies the origin.
|
||||
*/
|
||||
private final ObjectGraphOrigin originQueryPoint;
|
||||
private final ObjectGraphOrigin origin;
|
||||
|
||||
/**
|
||||
* The path relative to the root.
|
||||
@@ -28,26 +27,26 @@ public final class ObjectGraphNode implements Serializable {
|
||||
* Create at a sub level.
|
||||
*/
|
||||
public ObjectGraphNode(ObjectGraphNode parent, String path) {
|
||||
this.originQueryPoint = parent.getOriginQueryPoint();
|
||||
this.path = parent.getChildPath(path);
|
||||
this.origin = parent.origin();
|
||||
this.path = parent.childPath(path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an the root level.
|
||||
*/
|
||||
public ObjectGraphNode(ObjectGraphOrigin originQueryPoint, String path) {
|
||||
this.originQueryPoint = originQueryPoint;
|
||||
public ObjectGraphNode(ObjectGraphOrigin origin, String path) {
|
||||
this.origin = origin;
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the origin query point.
|
||||
*/
|
||||
public ObjectGraphOrigin getOriginQueryPoint() {
|
||||
return originQueryPoint;
|
||||
public ObjectGraphOrigin origin() {
|
||||
return origin;
|
||||
}
|
||||
|
||||
private String getChildPath(String childPath) {
|
||||
private String childPath(String childPath) {
|
||||
if (path == null) {
|
||||
return childPath;
|
||||
} else if (childPath == null) {
|
||||
@@ -60,18 +59,18 @@ public final class ObjectGraphNode implements Serializable {
|
||||
/**
|
||||
* Return the path relative to the root.
|
||||
*/
|
||||
public String getPath() {
|
||||
public String path() {
|
||||
return path;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "origin:" + originQueryPoint + " path[" + path + "]";
|
||||
return "origin:" + origin + " path[" + path + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hc = 92821 * originQueryPoint.hashCode();
|
||||
int hc = 92821 * origin.hashCode();
|
||||
hc = 92821 * hc + (path == null ? 0 : path.hashCode());
|
||||
return hc;
|
||||
}
|
||||
@@ -87,6 +86,6 @@ public final class ObjectGraphNode implements Serializable {
|
||||
|
||||
ObjectGraphNode e = (ObjectGraphNode) obj;
|
||||
return (Objects.equals(e.path, path))
|
||||
&& e.originQueryPoint.equals(originQueryPoint);
|
||||
&& e.origin.equals(origin);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,38 +28,38 @@ public final class ObjectGraphOrigin implements Serializable {
|
||||
this.callOrigin = callOrigin;
|
||||
this.beanType = beanType;
|
||||
this.queryHash = queryHash;
|
||||
this.key = callOrigin.getOriginKey(queryHash);
|
||||
this.key = callOrigin.key(queryHash);
|
||||
}
|
||||
|
||||
/**
|
||||
* The key includes the queryPlan hash and the callStack hash. This becomes
|
||||
* the unique identifier for a query point.
|
||||
*/
|
||||
public String getKey() {
|
||||
public String key() {
|
||||
return key;
|
||||
}
|
||||
|
||||
/**
|
||||
* The type of bean the query is fetching.
|
||||
*/
|
||||
public String getBeanType() {
|
||||
public String beanType() {
|
||||
return beanType;
|
||||
}
|
||||
|
||||
/**
|
||||
* The call stack involved.
|
||||
*/
|
||||
public CallOrigin getCallOrigin() {
|
||||
public CallOrigin callOrigin() {
|
||||
return callOrigin;
|
||||
}
|
||||
|
||||
public String getTopElement() {
|
||||
return callOrigin.getTopElement();
|
||||
public String top() {
|
||||
return callOrigin.top();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "key[" + key + "] type[" + beanType + "] " + callOrigin.getTopElement();
|
||||
return "key[" + key + "] type[" + beanType + "] " + callOrigin.top();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,7 +19,7 @@ public abstract class SingleBeanLoader implements BeanLoader {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
public String name() {
|
||||
return database.name();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package io.ebean.bean;
|
||||
|
||||
import io.ebean.common.BeanMap;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.IdentityHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -59,17 +59,17 @@ abstract class AbstractBeanCollection<E> implements BeanCollection<E> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityBean getOwnerBean() {
|
||||
public EntityBean owner() {
|
||||
return ownerBean;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPropertyName() {
|
||||
public String propertyName() {
|
||||
return propertyName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<?> getFilterMany() {
|
||||
public ExpressionList<?> filterMany() {
|
||||
return filterMany;
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ abstract class AbstractBeanCollection<E> implements BeanCollection<E> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModifyListenMode getModifyListening() {
|
||||
public ModifyListenMode modifyListening() {
|
||||
return modifyListenMode;
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ abstract class AbstractBeanCollection<E> implements BeanCollection<E> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<E> getModifyAdditions() {
|
||||
public Set<E> modifyAdditions() {
|
||||
if (modifyHolder == null) {
|
||||
return null;
|
||||
} else {
|
||||
@@ -191,7 +191,7 @@ abstract class AbstractBeanCollection<E> implements BeanCollection<E> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<E> getModifyRemovals() {
|
||||
public Set<E> modifyRemovals() {
|
||||
if (modifyHolder == null) {
|
||||
return null;
|
||||
} else {
|
||||
@@ -213,7 +213,7 @@ abstract class AbstractBeanCollection<E> implements BeanCollection<E> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Copies all relevant properties for a clone. See {@link #getShallowCopy()}
|
||||
* Copies all relevant properties for a clone. See {@link #shallowCopy()}
|
||||
*/
|
||||
protected void setFromOriginal(AbstractBeanCollection<E> other) {
|
||||
this.disableLazyLoad = other.disableLazyLoad;
|
||||
|
||||
@@ -3,12 +3,7 @@ package io.ebean.common;
|
||||
import io.ebean.bean.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* List capable of lazy loading and modification awareness.
|
||||
@@ -73,7 +68,7 @@ public final class BeanList<E> extends AbstractBeanCollection<E> implements List
|
||||
if (list == null) {
|
||||
list = new ArrayList<>();
|
||||
}
|
||||
list.addAll((Collection<? extends E>) other.getActualDetails());
|
||||
list.addAll((Collection<? extends E>) other.actualDetails());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -159,17 +154,17 @@ public final class BeanList<E> extends AbstractBeanCollection<E> implements List
|
||||
/**
|
||||
* Return the actual underlying list.
|
||||
*/
|
||||
public List<E> getActualList() {
|
||||
public List<E> actualList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<E> getActualDetails() {
|
||||
public Collection<E> actualDetails() {
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<?> getActualEntries() {
|
||||
public Collection<?> actualEntries() {
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -538,7 +533,7 @@ public final class BeanList<E> extends AbstractBeanCollection<E> implements List
|
||||
}
|
||||
|
||||
@Override
|
||||
public BeanCollection<E> getShallowCopy() {
|
||||
public BeanCollection<E> shallowCopy() {
|
||||
BeanList<E> copy = new BeanList<>(new CopyOnFirstWriteList<>(list));
|
||||
copy.setFromOriginal(this);
|
||||
return copy;
|
||||
|
||||
@@ -5,11 +5,7 @@ import io.ebean.bean.BeanCollectionLoader;
|
||||
import io.ebean.bean.EntityBean;
|
||||
import io.ebean.bean.ToStringBuilder;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Map capable of lazy loading and modification aware.
|
||||
@@ -71,7 +67,7 @@ public final class BeanMap<K, E> extends AbstractBeanCollection<E> implements Ma
|
||||
public void loadFrom(BeanCollection<?> other) {
|
||||
BeanMap<K, E> otherMap = (BeanMap<K, E>) other;
|
||||
internalPutNull();
|
||||
map.putAll(otherMap.getActualMap());
|
||||
map.putAll(otherMap.actualMap());
|
||||
}
|
||||
|
||||
public void internalPutNull() {
|
||||
@@ -175,7 +171,7 @@ public final class BeanMap<K, E> extends AbstractBeanCollection<E> implements Ma
|
||||
/**
|
||||
* Return the actual underlying map.
|
||||
*/
|
||||
public Map<K, E> getActualMap() {
|
||||
public Map<K, E> actualMap() {
|
||||
return map;
|
||||
}
|
||||
|
||||
@@ -183,7 +179,7 @@ public final class BeanMap<K, E> extends AbstractBeanCollection<E> implements Ma
|
||||
* Returns the collection of beans (map values).
|
||||
*/
|
||||
@Override
|
||||
public Collection<E> getActualDetails() {
|
||||
public Collection<E> actualDetails() {
|
||||
return map.values();
|
||||
}
|
||||
|
||||
@@ -191,7 +187,7 @@ public final class BeanMap<K, E> extends AbstractBeanCollection<E> implements Ma
|
||||
* Returns the map entrySet.
|
||||
*/
|
||||
@Override
|
||||
public Collection<?> getActualEntries() {
|
||||
public Collection<?> actualEntries() {
|
||||
return map.entrySet();
|
||||
}
|
||||
|
||||
@@ -346,7 +342,7 @@ public final class BeanMap<K, E> extends AbstractBeanCollection<E> implements Ma
|
||||
}
|
||||
|
||||
@Override
|
||||
public BeanCollection<E> getShallowCopy() {
|
||||
public BeanCollection<E> shallowCopy() {
|
||||
BeanMap<K, E> copy = new BeanMap<>(new LinkedHashMap<>(map));
|
||||
copy.setFromOriginal(this);
|
||||
return copy;
|
||||
|
||||
@@ -67,7 +67,7 @@ public final class BeanSet<E> extends AbstractBeanCollection<E> implements Set<E
|
||||
if (set == null) {
|
||||
set = new LinkedHashSet<>();
|
||||
}
|
||||
set.addAll((Collection<? extends E>) other.getActualDetails());
|
||||
set.addAll((Collection<? extends E>) other.actualDetails());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -155,17 +155,17 @@ public final class BeanSet<E> extends AbstractBeanCollection<E> implements Set<E
|
||||
/**
|
||||
* Return the actual underlying set.
|
||||
*/
|
||||
public Set<E> getActualSet() {
|
||||
public Set<E> actualSet() {
|
||||
return set;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<E> getActualDetails() {
|
||||
public Collection<E> actualDetails() {
|
||||
return set;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<?> getActualEntries() {
|
||||
public Collection<?> actualEntries() {
|
||||
return set;
|
||||
}
|
||||
|
||||
@@ -382,7 +382,7 @@ public final class BeanSet<E> extends AbstractBeanCollection<E> implements Set<E
|
||||
}
|
||||
|
||||
@Override
|
||||
public BeanCollection<E> getShallowCopy() {
|
||||
public BeanCollection<E> shallowCopy() {
|
||||
BeanSet<E> copy = new BeanSet<>(new LinkedHashSet<>(set));
|
||||
copy.setFromOriginal(this);
|
||||
return copy;
|
||||
|
||||
@@ -143,7 +143,7 @@ public final class ShutdownManager {
|
||||
}
|
||||
// shutdown any registered servers that have not
|
||||
// already been shutdown manually
|
||||
for (Database server : databases) {
|
||||
for (Database server : new ArrayList<>(databases)) {
|
||||
try {
|
||||
server.shutdown();
|
||||
} catch (Exception ex) {
|
||||
|
||||
@@ -22,6 +22,7 @@ public final class StackWalkFilter {
|
||||
public boolean test(StackWalker.StackFrame stackFrame) {
|
||||
return !stackFrame.getClassName().startsWith("io.ebean")
|
||||
&& !stackFrame.getClassName().startsWith("jdk.")
|
||||
&& !stackFrame.getClassName().startsWith("java.")
|
||||
&& !stackFrame.getMethodName().startsWith("_ebean_");
|
||||
}
|
||||
}
|
||||
|
||||
+12
-5
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</parent>
|
||||
<!-- <parent>-->
|
||||
<!-- <groupId>org.avaje</groupId>-->
|
||||
@@ -26,7 +26,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -59,6 +59,13 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-generator</artifactId>
|
||||
<version>13.17.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.avaje</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
@@ -69,7 +76,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -80,11 +87,11 @@
|
||||
<plugin>
|
||||
<groupId>io.repaint.maven</groupId>
|
||||
<artifactId>tiles-maven-plugin</artifactId>
|
||||
<version>2.24</version>
|
||||
<version>2.34</version>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<tiles>
|
||||
<tile>io.ebean.tile:enhancement:13.12.0</tile>
|
||||
<tile>io.ebean.tile:enhancement:13.17.1</tile>
|
||||
</tiles>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
+4
-4
@@ -97,7 +97,7 @@ public class AutoTuneDiffCollection {
|
||||
OrmQueryDetail profileDetail = entry.getDetail();
|
||||
|
||||
// compare with the existing query tuning entry
|
||||
OrmQueryDetail tuneDetail = queryTuner.get(point.getKey());
|
||||
OrmQueryDetail tuneDetail = queryTuner.get(point.key());
|
||||
if (tuneDetail == null) {
|
||||
addToDocumentNewEntry(entry, point);
|
||||
|
||||
@@ -145,10 +145,10 @@ public class AutoTuneDiffCollection {
|
||||
private Origin createOrigin(AutoTuneCollection.Entry entry, ObjectGraphOrigin point, String query) {
|
||||
|
||||
Origin origin = new Origin();
|
||||
origin.setKey(point.getKey());
|
||||
origin.setBeanType(point.getBeanType());
|
||||
origin.setKey(point.key());
|
||||
origin.setBeanType(point.beanType());
|
||||
origin.setDetail(entry.getDetail().asString());
|
||||
origin.setCallStack(point.getCallOrigin().getFullDescription());
|
||||
origin.setCallStack(point.callOrigin().description());
|
||||
origin.setOriginal(query);
|
||||
|
||||
if (updateTuning) {
|
||||
|
||||
+1
-1
@@ -122,7 +122,7 @@ public class BaseQueryTuner {
|
||||
|
||||
if (queryTuning) {
|
||||
// get current "tuned fetch" for this query point
|
||||
TunedQueryInfo tuneInfo = tunedQueryInfoMap.get(origin.getOriginQueryPoint().getKey());
|
||||
TunedQueryInfo tuneInfo = tunedQueryInfoMap.get(origin.origin().key());
|
||||
return tuneInfo != null && tuneInfo.tuneQuery(query);
|
||||
}
|
||||
return false;
|
||||
|
||||
+7
-7
@@ -46,9 +46,9 @@ public class ProfileManager implements ProfilingListener {
|
||||
|
||||
@Override
|
||||
public boolean isProfileRequest(ObjectGraphNode origin, SpiQuery<?> query) {
|
||||
ProfileOrigin profileOrigin = profileMap.get(origin.getOriginQueryPoint().getKey());
|
||||
ProfileOrigin profileOrigin = profileMap.get(origin.origin().key());
|
||||
if (profileOrigin == null) {
|
||||
profileMap.put(origin.getOriginQueryPoint().getKey(), createProfileOrigin(origin, query));
|
||||
profileMap.put(origin.origin().key(), createProfileOrigin(origin, query));
|
||||
return true;
|
||||
} else {
|
||||
return profileOrigin.isProfile();
|
||||
@@ -62,7 +62,7 @@ public class ProfileManager implements ProfilingListener {
|
||||
* query detail that is specified in the code (as the query might already be manually optimised).
|
||||
*/
|
||||
private ProfileOrigin createProfileOrigin(ObjectGraphNode origin, SpiQuery<?> query) {
|
||||
ProfileOrigin profileOrigin = new ProfileOrigin(origin.getOriginQueryPoint(), queryTuningAddVersion, profilingBase, profilingRate);
|
||||
ProfileOrigin profileOrigin = new ProfileOrigin(origin.origin(), queryTuningAddVersion, profilingBase, profilingRate);
|
||||
// set the current query detail (fetch group) so that we can compare against profiling for new entries
|
||||
profileOrigin.setOriginalQuery(query.getDetail().asString());
|
||||
return profileOrigin;
|
||||
@@ -76,7 +76,7 @@ public class ProfileManager implements ProfilingListener {
|
||||
@Override
|
||||
public void collectQueryInfo(ObjectGraphNode node, long beans, long micros) {
|
||||
if (node != null) {
|
||||
ObjectGraphOrigin origin = node.getOriginQueryPoint();
|
||||
ObjectGraphOrigin origin = node.origin();
|
||||
if (origin != null) {
|
||||
ProfileOrigin stats = getProfileOrigin(origin);
|
||||
stats.collectQueryInfo(node, beans, micros);
|
||||
@@ -92,14 +92,14 @@ public class ProfileManager implements ProfilingListener {
|
||||
*/
|
||||
@Override
|
||||
public void collectNodeUsage(NodeUsageCollector.State usageCollector) {
|
||||
ProfileOrigin profileOrigin = getProfileOrigin(usageCollector.node().getOriginQueryPoint());
|
||||
ProfileOrigin profileOrigin = getProfileOrigin(usageCollector.node().origin());
|
||||
profileOrigin.collectUsageInfo(usageCollector);
|
||||
}
|
||||
|
||||
private ProfileOrigin getProfileOrigin(ObjectGraphOrigin originQueryPoint) {
|
||||
lock.lock();
|
||||
try {
|
||||
return profileMap.computeIfAbsent(originQueryPoint.getKey(), k -> new ProfileOrigin(originQueryPoint, queryTuningAddVersion, profilingBase, profilingRate));
|
||||
return profileMap.computeIfAbsent(originQueryPoint.key(), k -> new ProfileOrigin(originQueryPoint, queryTuningAddVersion, profilingBase, profilingRate));
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
@@ -111,7 +111,7 @@ public class ProfileManager implements ProfilingListener {
|
||||
public AutoTuneCollection profilingCollection(boolean reset) {
|
||||
AutoTuneCollection req = new AutoTuneCollection();
|
||||
for (ProfileOrigin origin : profileMap.values()) {
|
||||
BeanDescriptor<?> desc = server.descriptorById(origin.getOrigin().getBeanType());
|
||||
BeanDescriptor<?> desc = server.descriptorById(origin.getOrigin().beanType());
|
||||
if (desc != null) {
|
||||
origin.profilingCollection(desc, req, reset);
|
||||
}
|
||||
|
||||
+2
-2
@@ -134,7 +134,7 @@ public class ProfileOrigin {
|
||||
*/
|
||||
public void collectQueryInfo(ObjectGraphNode node, long beansLoaded, long micros) {
|
||||
|
||||
String key = node.getPath();
|
||||
String key = node.path();
|
||||
if (key == null) {
|
||||
key = "";
|
||||
}
|
||||
@@ -153,7 +153,7 @@ public class ProfileOrigin {
|
||||
*/
|
||||
public void collectUsageInfo(NodeUsageCollector.State profile) {
|
||||
if (!profile.isEmpty()) {
|
||||
getNodeStats(profile.node().getPath()).collectUsageInfo(profile);
|
||||
getNodeStats(profile.node().path()).collectUsageInfo(profile);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,28 +1,37 @@
|
||||
package org.tests.autofetch;
|
||||
|
||||
import io.ebean.DB;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.tests.model.basic.Order;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MainAutoQueryTune1 {
|
||||
|
||||
// public static void main(String[] args) {
|
||||
//
|
||||
// ResetBasicData.reset();
|
||||
//
|
||||
// MainAutoQueryTune1 me = new MainAutoQueryTune1();
|
||||
// me.tuneJoin();
|
||||
// }
|
||||
//
|
||||
// private void tuneJoin() {
|
||||
// List<Order> list = Ebean.find(Order.class)
|
||||
// .setAutoTune(true)
|
||||
// .fetch("customer")
|
||||
// .where()
|
||||
// .eq("status", Order.Status.NEW)
|
||||
// .eq("customer.name", "Rob")
|
||||
// .order().asc("id")
|
||||
// .findList();
|
||||
//
|
||||
// for (Order order : list) {
|
||||
// order.getId();
|
||||
// order.getOrderDate();
|
||||
// }
|
||||
// }
|
||||
public static void main(String[] args) {
|
||||
MainAutoQueryTune1 me = new MainAutoQueryTune1();
|
||||
me.tuneJoin();
|
||||
}
|
||||
|
||||
@Test
|
||||
void tuneJoin() {
|
||||
TestData.load();
|
||||
|
||||
List<Order> list = DB.find(Order.class)
|
||||
.setAutoTune(true)
|
||||
//.fetch("customer")
|
||||
.where()
|
||||
.eq("status", Order.Status.NEW)
|
||||
.eq("customer.name", "Rob")
|
||||
.order().asc("id")
|
||||
.findList();
|
||||
|
||||
for (Order order : list) {
|
||||
order.getId();
|
||||
order.getOrderDate();
|
||||
order.getCustomer().getName();
|
||||
order.getCustomer().getNote();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package org.tests.autofetch;
|
||||
|
||||
import io.ebean.DB;
|
||||
import org.tests.model.basic.Address;
|
||||
import org.tests.model.basic.Customer;
|
||||
import org.tests.model.basic.Order;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
public class TestData {
|
||||
|
||||
static void load() {
|
||||
if (DB.find(Order.class).findCount() > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var customer = new Customer("Rob");
|
||||
customer.setBillingAddress(new Address("l0", "city0"));
|
||||
DB.save(customer);
|
||||
|
||||
var order = new Order(customer);
|
||||
order.setOrderDate(LocalDate.now());
|
||||
DB.save(order);
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,21 @@
|
||||
package org.tests.model.basic;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name = "address")
|
||||
@Table(name = "o_address")
|
||||
public class Address extends BaseModel {
|
||||
|
||||
String line1;
|
||||
String line2;
|
||||
String city;
|
||||
|
||||
public Address(String line1, String city) {
|
||||
this.line1 = line1;
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
public String getLine1() {
|
||||
return line1;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package org.tests.model.basic;
|
||||
|
||||
import io.ebean.annotation.NotNull;
|
||||
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.Table;
|
||||
@@ -8,13 +11,17 @@ import javax.persistence.Table;
|
||||
@Table(name = "o_customer")
|
||||
public class Customer extends BaseModel {
|
||||
|
||||
String name;
|
||||
@NotNull String name;
|
||||
|
||||
String note;
|
||||
|
||||
@ManyToOne
|
||||
@ManyToOne(cascade = CascadeType.PERSIST)
|
||||
Address billingAddress;
|
||||
|
||||
public Customer(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@@ -1,21 +1,10 @@
|
||||
package org.tests.model.basic;
|
||||
|
||||
import io.ebean.Model;
|
||||
import io.ebean.annotation.WhenModified;
|
||||
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.EnumType;
|
||||
import javax.persistence.Enumerated;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Version;
|
||||
import java.sql.Timestamp;
|
||||
import javax.persistence.*;
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Entity
|
||||
@Table(name = "orders")
|
||||
@Table(name = "o_order")
|
||||
public class Order extends BaseModel {
|
||||
|
||||
public enum Status {
|
||||
@@ -32,7 +21,11 @@ public class Order extends BaseModel {
|
||||
LocalDate orderDate;
|
||||
|
||||
@ManyToOne(cascade = CascadeType.PERSIST)
|
||||
Customer customer;
|
||||
final Customer customer;
|
||||
|
||||
public Order(Customer customer) {
|
||||
this.customer = customer;
|
||||
}
|
||||
|
||||
public Status getStatus() {
|
||||
return status;
|
||||
@@ -54,7 +47,4 @@ public class Order extends BaseModel {
|
||||
return customer;
|
||||
}
|
||||
|
||||
public void setCustomer(Customer customer) {
|
||||
this.customer = customer;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,3 +9,9 @@ datasource.h2.url=jdbc:h2:mem:h2AutoTune
|
||||
datasource.pg.username=sa
|
||||
datasource.pg.password=
|
||||
datasource.pg.url=jdbc:h2:mem:h2AutoTune
|
||||
|
||||
ebean.autoTune.profiling=true
|
||||
ebean.maxCallStack=10
|
||||
|
||||
ebean.autoTune.queryTuning=true
|
||||
ebean.autoTune.queryTuningFile=autotune/my-autotune.xml
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<autotune xmlns="http://ebean-orm.github.io/xml/ns/autotune">
|
||||
<origin key="BmouL7.Bn_jgL.BNY1QD" beanType="org.tests.model.basic.Order" detail="select (orderDate) fetch customer (name,note)" original="">
|
||||
<callStack>org.tests.autofetch.MainAutoQueryTune1.tuneJoin(MainAutoQueryTune1.java:27)
|
||||
org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:725)
|
||||
org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
|
||||
org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
|
||||
org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)
|
||||
org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140)
|
||||
org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84)
|
||||
org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
|
||||
org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
|
||||
org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)</callStack>
|
||||
</origin>
|
||||
</autotune>
|
||||
@@ -12,10 +12,11 @@
|
||||
<appender-ref ref="STDOUT"/>
|
||||
</root>
|
||||
|
||||
<logger name="io.ebeaninternal" level="DEBUG"/>
|
||||
<logger name="io.ebean.docker" level="TRACE"/>
|
||||
<!-- <logger name="io.ebean.DDL" level="DEBUG"/>-->
|
||||
<!-- <logger name="io.ebean.SQL" level="TRACE"/>-->
|
||||
<logger name="io.ebean.SQL" level="TRACE"/>
|
||||
<!-- <logger name="io.ebean.TXN" level="TRACE"/>-->
|
||||
<!-- <logger name="io.ebean.SUM" level="TRACE"/>-->
|
||||
<logger name="io.ebean.SUM" level="TRACE"/>
|
||||
|
||||
</configuration>
|
||||
|
||||
+30
-30
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean bom</name>
|
||||
@@ -89,112 +89,112 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-joda-time</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-jackson-jsonnode</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-jackson-mapper</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-generator</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-externalmapping-api</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-externalmapping-xml</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-autotune</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>querybean-generator</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>kotlin-querybean-generator</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-postgis</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-redis</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-spring-txn</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<!-- platforms -->
|
||||
@@ -202,67 +202,67 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-clickhouse</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-db2</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-h2</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-hana</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-mariadb</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-mysql</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-nuodb</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-oracle</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-postgres</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-sqlite</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-sqlserver</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
@@ -16,7 +16,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
+7
-7
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-core</artifactId>
|
||||
@@ -22,7 +22,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -46,13 +46,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-externalmapping-api</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -143,21 +143,21 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlserver</artifactId>
|
||||
<version>13.15.2</version>
|
||||
<version>13.17.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -23,4 +23,7 @@ public interface LoadBeanBuffer {
|
||||
|
||||
void configureQuery(SpiQuery<?> query, String lazyLoadProperty);
|
||||
|
||||
boolean isCache();
|
||||
|
||||
void loadingStarted();
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ public final class LoadBeanRequest extends LoadRequest {
|
||||
* Construct for lazy load request.
|
||||
*/
|
||||
public LoadBeanRequest(LoadBeanBuffer loadBuffer, EntityBeanIntercept ebi, boolean loadCache) {
|
||||
this(loadBuffer, null, true, ebi.getLazyLoadProperty(), ebi.isLoaded(), loadCache || ebi.isLoadedFromCache());
|
||||
this(loadBuffer, null, true, ebi.lazyLoadProperty(), ebi.isLoaded(), loadCache || ebi.isLoadedFromCache());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -56,6 +56,7 @@ public final class LoadBeanRequest extends LoadRequest {
|
||||
* Return the batch of beans to actually load.
|
||||
*/
|
||||
public Set<EntityBeanIntercept> batch() {
|
||||
loadBuffer.loadingStarted();
|
||||
return batch;
|
||||
}
|
||||
|
||||
@@ -66,7 +67,7 @@ public final class LoadBeanRequest extends LoadRequest {
|
||||
final List<Object> idList = new ArrayList<>(batch.size());
|
||||
final BeanDescriptor<?> desc = loadBuffer.descriptor();
|
||||
for (EntityBeanIntercept ebi : batch) {
|
||||
idList.add(desc.getId(ebi.getOwner()));
|
||||
idList.add(desc.getId(ebi.owner()));
|
||||
}
|
||||
return idList;
|
||||
}
|
||||
@@ -77,7 +78,7 @@ public final class LoadBeanRequest extends LoadRequest {
|
||||
public void configureQuery(SpiQuery<?> query, List<Object> idList) {
|
||||
query.setMode(Mode.LAZYLOAD_BEAN);
|
||||
query.setPersistenceContext(loadBuffer.persistenceContext());
|
||||
query.setLoadDescription(lazy ? "+lazy" : "+query", description());
|
||||
query.setLoadDescription(mode(), description());
|
||||
if (lazy) {
|
||||
query.setLazyLoadBatchSize(loadBuffer.batchSize());
|
||||
if (alreadyLoaded) {
|
||||
@@ -97,6 +98,10 @@ public final class LoadBeanRequest extends LoadRequest {
|
||||
}
|
||||
}
|
||||
|
||||
private String mode() {
|
||||
return lazy ? "+lazy" : loadBuffer.isCache() ? "+cache" : "+query";
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the beans into the L2 cache if that is requested and check for load failures due to deletes.
|
||||
*/
|
||||
@@ -116,10 +121,10 @@ public final class LoadBeanRequest extends LoadRequest {
|
||||
for (EntityBeanIntercept ebi : batch) {
|
||||
// check if the underlying row in DB was deleted. Mark the bean as 'failed' if
|
||||
// necessary but allow processing to continue until it is accessed by client code
|
||||
Object id = desc.getId(ebi.getOwner());
|
||||
Object id = desc.getId(ebi.owner());
|
||||
if (!loadedIds.contains(id)) {
|
||||
// assume this is logically deleted (hence not found)
|
||||
desc.markAsDeleted(ebi.getOwner());
|
||||
desc.markAsDeleted(ebi.owner());
|
||||
missedIds.add(id);
|
||||
missed.add(ebi);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ public interface LoadContext {
|
||||
/**
|
||||
* Return the minimum batch size when using QueryIterator with query joins.
|
||||
*/
|
||||
int getSecondaryQueriesMinBatchSize();
|
||||
int secondaryQueriesMinBatchSize();
|
||||
|
||||
/**
|
||||
* Execute any secondary (+query) queries if there are any defined.
|
||||
@@ -29,12 +29,12 @@ public interface LoadContext {
|
||||
/**
|
||||
* Return the node for a given path which is used by AutoTune profiling.
|
||||
*/
|
||||
ObjectGraphNode getObjectGraphNode(String path);
|
||||
ObjectGraphNode objectGraphNode(String path);
|
||||
|
||||
/**
|
||||
* Return the persistence context used by this query and future lazy loading.
|
||||
*/
|
||||
PersistenceContext getPersistenceContext();
|
||||
PersistenceContext persistenceContext();
|
||||
|
||||
/**
|
||||
* Register a Bean for lazy loading.
|
||||
|
||||
@@ -31,15 +31,15 @@ public interface LoadManyBuffer {
|
||||
*/
|
||||
boolean removeFromBuffer(BeanCollection<?> collection);
|
||||
|
||||
BeanPropertyAssocMany<?> getBeanProperty();
|
||||
BeanPropertyAssocMany<?> beanProperty();
|
||||
|
||||
ObjectGraphNode getObjectGraphNode();
|
||||
ObjectGraphNode objectGraphNode();
|
||||
|
||||
BeanDescriptor<?> getBeanDescriptor();
|
||||
BeanDescriptor<?> descriptor();
|
||||
|
||||
PersistenceContext getPersistenceContext();
|
||||
PersistenceContext persistenceContext();
|
||||
|
||||
String getFullPath();
|
||||
String fullPath();
|
||||
|
||||
void configureQuery(SpiQuery<?> query);
|
||||
|
||||
|
||||
@@ -50,11 +50,11 @@ public final class LoadManyRequest extends LoadRequest {
|
||||
|
||||
@Override
|
||||
public Class<?> beanType() {
|
||||
return loadContext.getBeanDescriptor().type();
|
||||
return loadContext.descriptor().type();
|
||||
}
|
||||
|
||||
public String description() {
|
||||
return loadContext.getFullPath();
|
||||
return loadContext.fullPath();
|
||||
}
|
||||
|
||||
private List<Object> parentIdList(SpiEbeanServer server) {
|
||||
@@ -66,13 +66,13 @@ public final class LoadManyRequest extends LoadRequest {
|
||||
if (lazy && !originIncluded && bc == originCollection) {
|
||||
originIncluded = true;
|
||||
}
|
||||
idList.add(many.parentId(bc.getOwnerBean()));
|
||||
idList.add(many.parentId(bc.owner()));
|
||||
bc.setLoader(server); // don't use the load buffer again
|
||||
}
|
||||
}
|
||||
if (originCollection != null && !originIncluded) {
|
||||
CoreLog.log.log(INFO, "Batch lazy loading including origin collection - size:{0}", idList.size());
|
||||
idList.add(many.parentId(originCollection.getOwnerBean()));
|
||||
idList.add(many.parentId(originCollection.owner()));
|
||||
originCollection.setLoader(server); // don't use the load buffer again
|
||||
}
|
||||
if (many.targetDescriptor().isPadInExpression()) {
|
||||
@@ -82,7 +82,7 @@ public final class LoadManyRequest extends LoadRequest {
|
||||
}
|
||||
|
||||
private BeanPropertyAssocMany<?> many() {
|
||||
return loadContext.getBeanProperty();
|
||||
return loadContext.beanProperty();
|
||||
}
|
||||
|
||||
public SpiQuery<?> createQuery(SpiEbeanServer server) {
|
||||
@@ -100,7 +100,7 @@ public final class LoadManyRequest extends LoadRequest {
|
||||
}
|
||||
query.setLazyLoadForParents(many);
|
||||
many.addWhereParentIdIn(query, parentIdList(server), loadContext.isUseDocStore());
|
||||
query.setPersistenceContext(loadContext.getPersistenceContext());
|
||||
query.setPersistenceContext(loadContext.persistenceContext());
|
||||
query.setLoadDescription(lazy ? "+lazy" : "+query", description());
|
||||
if (lazy) {
|
||||
query.setLazyLoadBatchSize(loadContext.batchSize());
|
||||
@@ -120,7 +120,7 @@ public final class LoadManyRequest extends LoadRequest {
|
||||
* After the query execution check for empty collections and load L2 cache if desired.
|
||||
*/
|
||||
public void postLoad() {
|
||||
BeanDescriptor<?> desc = loadContext.getBeanDescriptor();
|
||||
BeanDescriptor<?> desc = loadContext.descriptor();
|
||||
BeanPropertyAssocMany<?> many = many();
|
||||
// check for BeanCollection's that where never processed
|
||||
// in the +query or +lazy load due to no rows (predicates)
|
||||
@@ -129,12 +129,12 @@ public final class LoadManyRequest extends LoadRequest {
|
||||
if (bc != null) {
|
||||
if (bc.checkEmptyLazyLoad()) {
|
||||
if (log.isLoggable(DEBUG)) {
|
||||
EntityBean ownerBean = bc.getOwnerBean();
|
||||
EntityBean ownerBean = bc.owner();
|
||||
Object parentId = desc.getId(ownerBean);
|
||||
log.log(DEBUG, "BeanCollection after lazy load was empty. type:{0} id:{1} owner:{2}", ownerBean.getClass().getName(), parentId, ownerBean);
|
||||
}
|
||||
} else if (loadCache && many.isUseCache()) {
|
||||
desc.cacheManyPropPut(many, bc, desc.cacheKeyForBean(bc.getOwnerBean()));
|
||||
desc.cacheManyPropPut(many, bc, desc.cacheKeyForBean(bc.owner()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ public interface SpiExpressionRequest {
|
||||
/**
|
||||
* Return the DB specific handler for JSON and ARRAY expressions.
|
||||
*/
|
||||
DbExpressionHandler getDbPlatformHandler();
|
||||
DbExpressionHandler platformHandler();
|
||||
|
||||
/**
|
||||
* Parse the logical property name to the deployment name.
|
||||
@@ -24,17 +24,30 @@ public interface SpiExpressionRequest {
|
||||
/**
|
||||
* Return the bean descriptor for the root type.
|
||||
*/
|
||||
BeanDescriptor<?> getBeanDescriptor();
|
||||
BeanDescriptor<?> descriptor();
|
||||
|
||||
/**
|
||||
* Return the associated QueryRequest.
|
||||
*/
|
||||
SpiOrmQueryRequest<?> getQueryRequest();
|
||||
SpiOrmQueryRequest<?> queryRequest();
|
||||
|
||||
/**
|
||||
* Append to the expression sql.
|
||||
* Append to the expression sql without any parsing.
|
||||
*/
|
||||
SpiExpressionRequest append(String sql);
|
||||
SpiExpressionRequest append(String expression);
|
||||
|
||||
/**
|
||||
* Append to the expression sql with logical property parsing to db columns with logical path prefix.
|
||||
* <p>
|
||||
* This is a fast path case when expression is a bean property path and falls back to using parse()
|
||||
* when that isn't the case.
|
||||
*/
|
||||
SpiExpressionRequest property(String expression);
|
||||
|
||||
/**
|
||||
* Append to the expression sql with logical property parsing to db columns with logical path prefix.
|
||||
*/
|
||||
SpiExpressionRequest parse(String expression);
|
||||
|
||||
/**
|
||||
* Add an encryption key to bind to this request.
|
||||
@@ -49,12 +62,12 @@ public interface SpiExpressionRequest {
|
||||
/**
|
||||
* Return the accumulated expression sql for all expressions in this request.
|
||||
*/
|
||||
String getSql();
|
||||
String sql();
|
||||
|
||||
/**
|
||||
* Return the ordered list of bind values for all expressions in this request.
|
||||
*/
|
||||
List<Object> getBindValues();
|
||||
List<Object> bindValues();
|
||||
|
||||
/**
|
||||
* Increments the parameter index and returns that value.
|
||||
|
||||
@@ -42,7 +42,7 @@ final class DefaultBeanLoader {
|
||||
}
|
||||
|
||||
void loadMany(BeanCollection<?> bc, boolean onlyIds) {
|
||||
loadManyInternal(bc.getOwnerBean(), bc.getPropertyName(), false, onlyIds);
|
||||
loadManyInternal(bc.owner(), bc.propertyName(), false, onlyIds);
|
||||
}
|
||||
|
||||
void refreshMany(EntityBean parentBean, String propertyName) {
|
||||
@@ -51,7 +51,7 @@ final class DefaultBeanLoader {
|
||||
|
||||
private void loadManyInternal(EntityBean parentBean, String propertyName, boolean refresh, boolean onlyIds) {
|
||||
EntityBeanIntercept ebi = parentBean._ebean_getIntercept();
|
||||
PersistenceContext pc = ebi.getPersistenceContext();
|
||||
PersistenceContext pc = ebi.persistenceContext();
|
||||
BeanDescriptor<?> parentDesc = server.descriptor(parentBean.getClass());
|
||||
BeanPropertyAssocMany<?> many = (BeanPropertyAssocMany<?>) parentDesc.beanProperty(propertyName);
|
||||
BeanCollection<?> beanCollection = null;
|
||||
@@ -60,7 +60,7 @@ final class DefaultBeanLoader {
|
||||
Object currentValue = many.getValue(parentBean);
|
||||
if (currentValue instanceof BeanCollection<?>) {
|
||||
beanCollection = (BeanCollection<?>) currentValue;
|
||||
filterMany = beanCollection.getFilterMany();
|
||||
filterMany = beanCollection.filterMany();
|
||||
}
|
||||
|
||||
Object parentId = parentDesc.getId(parentBean);
|
||||
@@ -113,7 +113,7 @@ final class DefaultBeanLoader {
|
||||
if (beanCollection != null) {
|
||||
if (beanCollection.checkEmptyLazyLoad()) {
|
||||
if (log.isLoggable(DEBUG)) {
|
||||
log.log(DEBUG, "BeanCollection after load was empty. Owner:{0}", beanCollection.getOwnerBean());
|
||||
log.log(DEBUG, "BeanCollection after load was empty. Owner:{0}", beanCollection.owner());
|
||||
}
|
||||
} else if (useManyIdCache) {
|
||||
final String parentKey = parentDesc.cacheKey(parentId);
|
||||
@@ -131,6 +131,7 @@ final class DefaultBeanLoader {
|
||||
throw new RuntimeException("Nothing in batch?");
|
||||
}
|
||||
|
||||
final String batchBefore = String.valueOf(batch);
|
||||
final List<Object> ids = loadRequest.ids();
|
||||
if (ids.isEmpty()) {
|
||||
// this should never happen given the batch is not empty
|
||||
@@ -143,7 +144,8 @@ final class DefaultBeanLoader {
|
||||
final List<?> list = executeQuery(loadRequest, query);
|
||||
final LoadBeanRequest.Result result = loadRequest.postLoad(list);
|
||||
if (result.markedDeleted() && CoreLog.markedAsDeleted.isLoggable(DEBUG)) {
|
||||
CoreLog.markedAsDeleted.log(DEBUG, "Loaded bean batch {0}", batch);
|
||||
CoreLog.markedAsDeleted.log(DEBUG, "Loaded bean batch BEFORE {0}", batchBefore);
|
||||
CoreLog.markedAsDeleted.log(DEBUG, "Loaded bean batch AFTER {0}", batch);
|
||||
String msg = MessageFormat.format("Loaded bean marked as deleted for {0} ids:{1} missedIds:{2} loadedIds:{3} sql:{4} loadedList:{5} missed:{6}",
|
||||
loadRequest.beanType(), ids, result.missedIds(), result.loadedIds(), query.getGeneratedSql(), list, result.missed());
|
||||
CoreLog.markedAsDeleted.log(DEBUG, msg, new RuntimeException("LoadBeanRequest markedAsDeleted"));
|
||||
@@ -172,12 +174,12 @@ final class DefaultBeanLoader {
|
||||
}
|
||||
|
||||
void loadBean(EntityBeanIntercept ebi) {
|
||||
refreshBeanInternal(ebi.getOwner(), SpiQuery.Mode.LAZYLOAD_BEAN, -1);
|
||||
refreshBeanInternal(ebi.owner(), SpiQuery.Mode.LAZYLOAD_BEAN, -1);
|
||||
}
|
||||
|
||||
private void refreshBeanInternal(EntityBean bean, SpiQuery.Mode mode, int embeddedOwnerIndex) {
|
||||
EntityBeanIntercept ebi = bean._ebean_getIntercept();
|
||||
PersistenceContext pc = ebi.getPersistenceContext();
|
||||
PersistenceContext pc = ebi.persistenceContext();
|
||||
if (Mode.REFRESH_BEAN == mode) {
|
||||
// need a new PersistenceContext for REFRESH
|
||||
pc = null;
|
||||
@@ -185,8 +187,8 @@ final class DefaultBeanLoader {
|
||||
BeanDescriptor<?> desc = server.descriptor(bean.getClass());
|
||||
if (EntityType.EMBEDDED == desc.entityType()) {
|
||||
// lazy loading on an embedded bean property
|
||||
EntityBean embeddedOwner = (EntityBean) ebi.getEmbeddedOwner();
|
||||
refreshBeanInternal(embeddedOwner, mode, ebi.getEmbeddedOwnerIndex());
|
||||
EntityBean embeddedOwner = (EntityBean) ebi.embeddedOwner();
|
||||
refreshBeanInternal(embeddedOwner, mode, ebi.embeddedOwnerIndex());
|
||||
}
|
||||
Object id = desc.getId(bean);
|
||||
if (pc == null) {
|
||||
@@ -208,14 +210,14 @@ final class DefaultBeanLoader {
|
||||
}
|
||||
}
|
||||
SpiQuery<?> query = server.createQuery(desc.type());
|
||||
query.setLazyLoadProperty(ebi.getLazyLoadProperty());
|
||||
query.setLazyLoadProperty(ebi.lazyLoadProperty());
|
||||
if (draft) {
|
||||
query.asDraft();
|
||||
} else if (mode == SpiQuery.Mode.LAZYLOAD_BEAN && desc.isSoftDelete()) {
|
||||
query.setIncludeSoftDeletes();
|
||||
}
|
||||
if (embeddedOwnerIndex > -1) {
|
||||
query.select(ebi.getProperty(embeddedOwnerIndex));
|
||||
query.select(ebi.property(embeddedOwnerIndex));
|
||||
}
|
||||
// don't collect AutoTune usage profiling information
|
||||
// as we just copy the data out of these fetched beans
|
||||
|
||||
@@ -46,17 +46,17 @@ public final class DefaultBeanState implements BeanState {
|
||||
|
||||
@Override
|
||||
public Set<String> loadedProps() {
|
||||
return intercept.getLoadedPropertyNames();
|
||||
return intercept.loadedPropertyNames();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> changedProps() {
|
||||
return intercept.getDirtyPropertyNames();
|
||||
return intercept.dirtyPropertyNames();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, ValuePair> dirtyValues() {
|
||||
return intercept.getDirtyValues();
|
||||
return intercept.dirtyValues();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -91,11 +91,11 @@ public final class DefaultBeanState implements BeanState {
|
||||
|
||||
@Override
|
||||
public Map<String, Exception> loadErrors() {
|
||||
return intercept.getLoadErrors();
|
||||
return intercept.loadErrors();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int sortOrder() {
|
||||
return intercept.getSortOrder();
|
||||
return intercept.sortOrder();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -354,50 +354,35 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
|
||||
@Override
|
||||
public void shutdown() {
|
||||
lock.lock();
|
||||
try {
|
||||
shutdownInternal(true, false);
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
shutdown(true, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Shutting down manually.
|
||||
*/
|
||||
@Override
|
||||
public void shutdown(boolean shutdownDataSource, boolean deregisterDriver) {
|
||||
lock.lock();
|
||||
try {
|
||||
ShutdownManager.unregisterDatabase(this);
|
||||
shutdownInternal(shutdownDataSource, deregisterDriver);
|
||||
log.log(TRACE, "shutting down instance {0}", serverName);
|
||||
if (shutdown) {
|
||||
// already shutdown
|
||||
return;
|
||||
}
|
||||
shutdownPlugins();
|
||||
autoTuneService.shutdown();
|
||||
// shutdown background threads
|
||||
backgroundExecutor.shutdown();
|
||||
// shutdown DataSource (if its an Ebean one)
|
||||
transactionManager.shutdown(shutdownDataSource, deregisterDriver);
|
||||
dumpMetrics();
|
||||
shutdown = true;
|
||||
if (shutdownDataSource) {
|
||||
config.setDataSource(null);
|
||||
}
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Shutdown the services like threads and DataSource.
|
||||
*/
|
||||
private void shutdownInternal(boolean shutdownDataSource, boolean deregisterDriver) {
|
||||
log.log(TRACE, "shutting down instance {0}", serverName);
|
||||
if (shutdown) {
|
||||
// already shutdown
|
||||
return;
|
||||
}
|
||||
shutdownPlugins();
|
||||
autoTuneService.shutdown();
|
||||
// shutdown background threads
|
||||
backgroundExecutor.shutdown();
|
||||
// shutdown DataSource (if its an Ebean one)
|
||||
transactionManager.shutdown(shutdownDataSource, deregisterDriver);
|
||||
dumpMetrics();
|
||||
shutdown = true;
|
||||
if (shutdownDataSource) {
|
||||
config.setDataSource(null);
|
||||
}
|
||||
}
|
||||
|
||||
private void dumpMetrics() {
|
||||
if (config.isDumpMetricsOnShutdown()) {
|
||||
new DumpMetrics(this, config.getDumpMetricsOptions()).dump();
|
||||
|
||||
@@ -19,7 +19,7 @@ final class DefaultSlowQueryListener implements SlowQueryListener {
|
||||
String firstStack = "";
|
||||
ObjectGraphNode node = event.getOriginNode();
|
||||
if (node != null) {
|
||||
firstStack = node.getOriginQueryPoint().getTopElement();
|
||||
firstStack = node.origin().top();
|
||||
}
|
||||
log.log(WARNING, "Slow query warning - millis:{0} rows:{1} caller[{2}] sql[{3}]", event.getTimeMillis(), event.getRowCount(), firstStack, event.getSql());
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public final class DiffHelp {
|
||||
}
|
||||
}
|
||||
if (oldBean == null) {
|
||||
return ((EntityBean) newBean)._ebean_getIntercept().getDirtyValues();
|
||||
return ((EntityBean) newBean)._ebean_getIntercept().dirtyValues();
|
||||
}
|
||||
return desc.diff((EntityBean) newBean, (EntityBean) oldBean);
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ public final class OrmQueryRequest<T> extends BeanRequest implements SpiOrmQuery
|
||||
* iteration is fine.
|
||||
*/
|
||||
public int secondaryQueriesMinBatchSize() {
|
||||
return loadContext.getSecondaryQueriesMinBatchSize();
|
||||
return loadContext.secondaryQueriesMinBatchSize();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -529,7 +529,7 @@ public final class OrmQueryRequest<T> extends BeanRequest implements SpiOrmQuery
|
||||
OrderBy<T> orderBy = query.getOrderBy();
|
||||
if (orderBy != null && !orderBy.isEmpty()) {
|
||||
// in memory sort after merging the cache hits with the DB hits
|
||||
beanDescriptor.sort(((BeanList<T>) result).getActualList(), orderBy.toStringFormat());
|
||||
beanDescriptor.sort(((BeanList<T>) result).actualList(), orderBy.toStringFormat());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -646,7 +646,7 @@ public final class OrmQueryRequest<T> extends BeanRequest implements SpiOrmQuery
|
||||
if (cached != null && isAuditReads() && readAuditQueryType()) {
|
||||
if (cached instanceof BeanCollection) {
|
||||
// raw sql can't use L2 cache so normal queries only in here
|
||||
Collection<T> actualDetails = ((BeanCollection<T>) cached).getActualDetails();
|
||||
Collection<T> actualDetails = ((BeanCollection<T>) cached).actualDetails();
|
||||
List<Object> ids = new ArrayList<>(actualDetails.size());
|
||||
for (T bean : actualDetails) {
|
||||
ids.add(beanDescriptor.idForJson(bean));
|
||||
@@ -657,7 +657,7 @@ public final class OrmQueryRequest<T> extends BeanRequest implements SpiOrmQuery
|
||||
if (Boolean.FALSE.equals(query.isReadOnly())) {
|
||||
// return shallow copies if readonly is explicitly set to false
|
||||
if (cached instanceof BeanCollection) {
|
||||
cached = ((BeanCollection<?>) cached).getShallowCopy();
|
||||
cached = ((BeanCollection<?>) cached).shallowCopy();
|
||||
} else if (cached instanceof List) {
|
||||
cached = new CopyOnFirstWriteList<>((List<?>) cached);
|
||||
} else if (cached instanceof Set) {
|
||||
|
||||
@@ -281,7 +281,7 @@ public final class PersistRequestBean<T> extends PersistRequest implements BeanP
|
||||
|
||||
private void onFailedUpdateUndoGeneratedProperties() {
|
||||
for (BeanProperty prop : beanDescriptor.propertiesGenUpdate()) {
|
||||
Object oldVal = intercept.getOrigValue(prop.propertyIndex());
|
||||
Object oldVal = intercept.origValue(prop.propertyIndex());
|
||||
prop.setValue(entityBean, oldVal);
|
||||
}
|
||||
}
|
||||
@@ -372,12 +372,12 @@ public final class PersistRequestBean<T> extends PersistRequest implements BeanP
|
||||
|
||||
@Override
|
||||
public Set<String> loadedProperties() {
|
||||
return intercept.getLoadedPropertyNames();
|
||||
return intercept.loadedPropertyNames();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> updatedProperties() {
|
||||
return intercept.getDirtyPropertyNames();
|
||||
return intercept.dirtyPropertyNames();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -410,7 +410,7 @@ public final class PersistRequestBean<T> extends PersistRequest implements BeanP
|
||||
|
||||
@Override
|
||||
public Map<String, ValuePair> updatedValues() {
|
||||
return intercept.getDirtyValues();
|
||||
return intercept.dirtyValues();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -713,7 +713,7 @@ public final class PersistRequestBean<T> extends PersistRequest implements BeanP
|
||||
* Return the original / old value for the given property.
|
||||
*/
|
||||
public Object getOrigValue(BeanProperty prop) {
|
||||
return intercept.getOrigValue(prop.propertyIndex());
|
||||
return intercept.origValue(prop.propertyIndex());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -867,7 +867,7 @@ public final class PersistRequestBean<T> extends PersistRequest implements BeanP
|
||||
boolean isChangeLog = beanDescriptor.isChangeLog();
|
||||
if (type == Type.UPDATE && (isChangeLog || notifyCache || docStoreMode == DocStoreMode.UPDATE)) {
|
||||
// get the dirty properties for update notification to the doc store
|
||||
dirtyProperties = intercept.getDirtyProperties();
|
||||
dirtyProperties = intercept.dirtyProperties();
|
||||
}
|
||||
if (isChangeLog) {
|
||||
changeLog();
|
||||
@@ -1142,9 +1142,9 @@ public final class PersistRequestBean<T> extends PersistRequest implements BeanP
|
||||
public String updatePlanHash() {
|
||||
StringBuilder key;
|
||||
if (determineUpdateAllLoadedProperties()) {
|
||||
key = intercept.getLoadedPropertyKey();
|
||||
key = intercept.loadedPropertyKey();
|
||||
} else {
|
||||
key = intercept.getDirtyPropertyKey();
|
||||
key = intercept.dirtyPropertyKey();
|
||||
}
|
||||
BeanProperty versionProperty = beanDescriptor.versionProperty();
|
||||
if (versionProperty != null) {
|
||||
@@ -1237,7 +1237,7 @@ public final class PersistRequestBean<T> extends PersistRequest implements BeanP
|
||||
public void docStorePersist() {
|
||||
idValue = beanDescriptor.getId(entityBean);
|
||||
if (type == Type.UPDATE) {
|
||||
dirtyProperties = intercept.getDirtyProperties();
|
||||
dirtyProperties = intercept.dirtyProperties();
|
||||
}
|
||||
// processing now so set IGNORE (unlike DB + DocStore processing with post-commit)
|
||||
docStoreMode = DocStoreMode.IGNORE;
|
||||
|
||||
@@ -45,7 +45,7 @@ abstract class BaseCollectionHelp<T> implements BeanCollectionHelp<T> {
|
||||
@Override
|
||||
public final Collection underlying(Object value) {
|
||||
if (value instanceof BeanCollection) {
|
||||
return ((BeanCollection)value).getActualDetails();
|
||||
return ((BeanCollection)value).actualDetails();
|
||||
} else {
|
||||
return (Collection)value;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public final class BeanCollectionUtil {
|
||||
}
|
||||
// For maps this is a collection of Map.Entry, otherwise it
|
||||
// returns a collection of beans
|
||||
return bc.getActualEntries();
|
||||
return bc.actualEntries();
|
||||
}
|
||||
if (o instanceof Collection<?>) {
|
||||
return ((Collection<?>) o);
|
||||
@@ -61,7 +61,7 @@ public final class BeanCollectionUtil {
|
||||
}
|
||||
// For maps this is a collection of Map.Entry, otherwise it
|
||||
// returns a collection of beans
|
||||
return bc.getActualDetails();
|
||||
return bc.actualDetails();
|
||||
}
|
||||
if (o instanceof Map<?, ?>) {
|
||||
// yes, we want the entrySet (to set the keys)
|
||||
|
||||
@@ -29,6 +29,7 @@ import io.ebeaninternal.api.*;
|
||||
import io.ebeaninternal.api.TransactionEventTable.TableIUD;
|
||||
import io.ebeaninternal.api.json.SpiJsonReader;
|
||||
import io.ebeaninternal.api.json.SpiJsonWriter;
|
||||
import io.ebeaninternal.server.bind.DataBind;
|
||||
import io.ebeaninternal.server.cache.CacheChangeSet;
|
||||
import io.ebeaninternal.server.cache.CachedBeanData;
|
||||
import io.ebeaninternal.server.cache.CachedManyIds;
|
||||
@@ -45,7 +46,6 @@ import io.ebeaninternal.server.querydefn.DefaultOrmQuery;
|
||||
import io.ebeaninternal.server.querydefn.OrmQueryDetail;
|
||||
import io.ebeaninternal.server.querydefn.OrmQueryProperties;
|
||||
import io.ebeaninternal.server.rawsql.SpiRawSql;
|
||||
import io.ebeaninternal.server.bind.DataBind;
|
||||
import io.ebeaninternal.util.SortByClause;
|
||||
import io.ebeaninternal.util.SortByClauseParser;
|
||||
import io.ebeanservice.docstore.api.DocStoreBeanAdapter;
|
||||
@@ -350,9 +350,9 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
this.idPropertyIndex = (idProperty == null) ? -1 : ebi.findProperty(idProperty.name());
|
||||
this.versionPropertyIndex = (versionProperty == null) ? -1 : ebi.findProperty(versionProperty.name());
|
||||
this.unloadProperties = derivePropertiesToUnload(prototypeEntityBean);
|
||||
this.propertiesIndex = new BeanProperty[ebi.getPropertyLength()];
|
||||
this.propertiesIndex = new BeanProperty[ebi.propertyLength()];
|
||||
for (int i = 0; i < propertiesIndex.length; i++) {
|
||||
propertiesIndex[i] = propMap.get(ebi.getProperty(i));
|
||||
propertiesIndex[i] = propMap.get(ebi.property(i));
|
||||
}
|
||||
}
|
||||
idSelect = initIdSelect();
|
||||
@@ -400,7 +400,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
* These properties need to be unloaded when populating beans for queries.
|
||||
*/
|
||||
private int[] derivePropertiesToUnload(EntityBean prototypeEntityBean) {
|
||||
boolean[] loaded = prototypeEntityBean._ebean_getIntercept().getLoaded();
|
||||
boolean[] loaded = prototypeEntityBean._ebean_getIntercept().loaded();
|
||||
int[] props = new int[loaded.length];
|
||||
int pos = 0;
|
||||
// collect the positions of the properties initialised in the default constructor.
|
||||
@@ -711,7 +711,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
public void merge(EntityBean bean, EntityBean existing) {
|
||||
EntityBeanIntercept fromEbi = bean._ebean_getIntercept();
|
||||
EntityBeanIntercept toEbi = existing._ebean_getIntercept();
|
||||
int propertyLength = toEbi.getPropertyLength();
|
||||
int propertyLength = toEbi.propertyLength();
|
||||
String[] names = properties();
|
||||
for (int i = 0; i < propertyLength; i++) {
|
||||
if (fromEbi.isLoadedProperty(i)) {
|
||||
@@ -2217,12 +2217,12 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
}
|
||||
|
||||
public boolean lazyLoadMany(EntityBeanIntercept ebi, LoadBeanContext parent) {
|
||||
int lazyLoadProperty = ebi.getLazyLoadPropertyIndex();
|
||||
int lazyLoadProperty = ebi.lazyLoadPropertyIndex();
|
||||
if (lazyLoadProperty == -1) {
|
||||
return false;
|
||||
}
|
||||
if (inheritInfo != null) {
|
||||
return descOf(ebi.getOwner().getClass()).lazyLoadMany(ebi, lazyLoadProperty, parent);
|
||||
return descOf(ebi.owner().getClass()).lazyLoadMany(ebi, lazyLoadProperty, parent);
|
||||
}
|
||||
return lazyLoadMany(ebi, lazyLoadProperty, parent);
|
||||
}
|
||||
@@ -2241,7 +2241,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
BeanProperty lazyLoadBeanProp = propertiesIndex[lazyLoadProperty];
|
||||
if (lazyLoadBeanProp instanceof BeanPropertyAssocMany<?>) {
|
||||
BeanPropertyAssocMany<?> manyProp = (BeanPropertyAssocMany<?>) lazyLoadBeanProp;
|
||||
final BeanCollection<?> collection = manyProp.createReference(ebi.getOwner());
|
||||
final BeanCollection<?> collection = manyProp.createReference(ebi.owner());
|
||||
ebi.setLoadedLazy();
|
||||
if (loadBeanContext != null) {
|
||||
loadBeanContext.register(manyProp, collection);
|
||||
@@ -3076,7 +3076,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
// not using Id generator so just base on isLoaded()
|
||||
return !ebi.isLoaded();
|
||||
}
|
||||
if (!hasIdValue(ebi.getOwner())) {
|
||||
if (!hasIdValue(ebi.owner())) {
|
||||
// No Id property means it must be an insert
|
||||
return true;
|
||||
}
|
||||
@@ -3139,7 +3139,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
for (BeanProperty beanProperty : propertiesMutable) {
|
||||
int propertyIndex = beanProperty.propertyIndex();
|
||||
if (ebi.isLoadedProperty(propertyIndex)) {
|
||||
Object value = beanProperty.getValue(ebi.getOwner());
|
||||
Object value = beanProperty.getValue(ebi.owner());
|
||||
if (beanProperty.checkMutable(value, ebi.isDirtyProperty(propertyIndex), ebi)) {
|
||||
// mutable scalar value which is considered dirty so mark
|
||||
// it as such so that it is included in an update
|
||||
@@ -3156,7 +3156,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
for (BeanProperty beanProperty : propertiesMutable) {
|
||||
int propertyIndex = beanProperty.propertyIndex();
|
||||
if (ebi.isLoadedProperty(propertyIndex)) {
|
||||
Object value = beanProperty.getValue(ebi.getOwner());
|
||||
Object value = beanProperty.getValue(ebi.owner());
|
||||
if (beanProperty.checkMutable(value, ebi.isDirtyProperty(propertyIndex), ebi)) {
|
||||
ebi.markPropertyAsChanged(propertyIndex);
|
||||
return;
|
||||
|
||||
+7
-7
@@ -271,9 +271,9 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
// not in cache so return unsuccessful
|
||||
return false;
|
||||
}
|
||||
EntityBean ownerBean = bc.getOwnerBean();
|
||||
EntityBean ownerBean = bc.owner();
|
||||
EntityBeanIntercept ebi = ownerBean._ebean_getIntercept();
|
||||
PersistenceContext persistenceContext = ebi.getPersistenceContext();
|
||||
PersistenceContext persistenceContext = ebi.persistenceContext();
|
||||
BeanDescriptor<?> targetDescriptor = many.targetDescriptor();
|
||||
|
||||
List<Object> idList = entry.getIdList();
|
||||
@@ -696,7 +696,7 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
Set<EntityBeanIntercept> beanCacheLoadAll(Set<EntityBeanIntercept> batch, PersistenceContext context, int lazyLoadProperty, String propertyName) {
|
||||
Map<Object, EntityBeanIntercept> ebis = new HashMap<>();
|
||||
for (EntityBeanIntercept ebi : batch) {
|
||||
ebis.put(desc.cacheKeyForBean(ebi.getOwner()), ebi);
|
||||
ebis.put(desc.cacheKeyForBean(ebi.owner()), ebi);
|
||||
}
|
||||
|
||||
Map<Object, Object> hits = getBeanCache().getAll(ebis.keySet());
|
||||
@@ -715,7 +715,7 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
beanLog.log(TRACE, " load {0}({1}) - cache miss on property({2})", cacheName, key, propertyName);
|
||||
}
|
||||
} else {
|
||||
CachedBeanDataToBean.load(desc, ebi.getOwner(), cacheData, context);
|
||||
CachedBeanDataToBean.load(desc, ebi.owner(), cacheData, context);
|
||||
loaded.add(ebi);
|
||||
if (beanLog.isLoggable(DEBUG)) {
|
||||
beanLog.log(DEBUG, " load {0}({1}) - hit", cacheName, key);
|
||||
@@ -739,10 +739,10 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
int lazyLoadProperty = ebi.getLazyLoadPropertyIndex();
|
||||
if (lazyLoadProperty > -1 && !cacheData.isLoaded(ebi.getLazyLoadProperty())) {
|
||||
int lazyLoadProperty = ebi.lazyLoadPropertyIndex();
|
||||
if (lazyLoadProperty > -1 && !cacheData.isLoaded(ebi.lazyLoadProperty())) {
|
||||
if (beanLog.isLoggable(TRACE)) {
|
||||
beanLog.log(TRACE, " LOAD {0}({1}) - cache miss on property({2})", cacheName, key, ebi.getLazyLoadProperty());
|
||||
beanLog.log(TRACE, " LOAD {0}({1}) - cache miss on property({2})", cacheName, key, ebi.lazyLoadProperty());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -932,7 +932,7 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy
|
||||
// define the TableJoin
|
||||
DeployTableJoin oneToManyJoin = oneToMany.getTableJoin();
|
||||
if (!oneToManyJoin.hasJoinColumns()) {
|
||||
throw new RuntimeException("No join columns");
|
||||
throw new RuntimeException("No join columns found to satisfy the relationship " + oneToMany);
|
||||
}
|
||||
createUnidirectional(targetDesc, owningType, beanTable, oneToManyJoin);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public class BeanListHelp<T> extends BaseCollectionHelp<T> {
|
||||
public final BeanCollectionAdd getBeanCollectionAdd(Object bc, String mapKey) {
|
||||
if (bc instanceof BeanList<?>) {
|
||||
BeanList<?> bl = (BeanList<?>) bc;
|
||||
if (bl.getActualList() == null) {
|
||||
if (bl.actualList() == null) {
|
||||
bl.setActualList(new ArrayList<>());
|
||||
}
|
||||
return bl;
|
||||
@@ -85,7 +85,7 @@ public class BeanListHelp<T> extends BaseCollectionHelp<T> {
|
||||
} else if (currentList instanceof BeanList<?>) {
|
||||
// normally this case, replace just the underlying list
|
||||
BeanList<?> currentBeanList = (BeanList<?>) currentList;
|
||||
currentBeanList.setActualList(newBeanList.getActualList());
|
||||
currentBeanList.setActualList(newBeanList.actualList());
|
||||
currentBeanList.setModifyListening(many.modifyListenMode());
|
||||
|
||||
} else {
|
||||
@@ -108,7 +108,7 @@ public class BeanListHelp<T> extends BaseCollectionHelp<T> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
list = beanList.getActualList();
|
||||
list = beanList.actualList();
|
||||
} else {
|
||||
list = (List<?>) collection;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public class BeanMapHelp<T> extends BaseCollectionHelp<T> {
|
||||
BeanProperty beanProp = targetDescriptor.beanProperty(mapKey);
|
||||
if (bc instanceof BeanMap<?, ?>) {
|
||||
BeanMap<Object, Object> bm = (BeanMap<Object, Object>) bc;
|
||||
Map<Object, Object> actualMap = bm.getActualMap();
|
||||
Map<Object, Object> actualMap = bm.actualMap();
|
||||
if (actualMap == null) {
|
||||
actualMap = new LinkedHashMap<>();
|
||||
bm.setActualMap(actualMap);
|
||||
@@ -132,7 +132,7 @@ public class BeanMapHelp<T> extends BaseCollectionHelp<T> {
|
||||
} else if (current instanceof BeanMap<?, ?>) {
|
||||
// normally this case, replace just the underlying list
|
||||
BeanMap<?, ?> currentBeanMap = (BeanMap<?, ?>) current;
|
||||
currentBeanMap.setActualMap(newBeanMap.getActualMap());
|
||||
currentBeanMap.setActualMap(newBeanMap.actualMap());
|
||||
currentBeanMap.setModifyListening(many.modifyListenMode());
|
||||
|
||||
} else {
|
||||
@@ -155,7 +155,7 @@ public class BeanMapHelp<T> extends BaseCollectionHelp<T> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
map = bc.getActualMap();
|
||||
map = bc.actualMap();
|
||||
} else {
|
||||
map = (Map<?, ?>) collection;
|
||||
}
|
||||
|
||||
@@ -700,7 +700,7 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
|
||||
* Return the bean cache value for this property using original values.
|
||||
*/
|
||||
public Object getCacheDataValueOrig(EntityBeanIntercept ebi) {
|
||||
return cacheDataConvert(ebi.getOrigValue(propertyIndex));
|
||||
return cacheDataConvert(ebi.origValue(propertyIndex));
|
||||
}
|
||||
|
||||
private Object cacheDataConvert(Object value) {
|
||||
|
||||
@@ -416,8 +416,8 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
|
||||
public String assocIsEmpty(SpiExpressionRequest request, String path) {
|
||||
boolean softDelete = targetDescriptor.isSoftDelete();
|
||||
boolean needsX2Table = softDelete || extraWhere() != null;
|
||||
StringBuilder sb = new StringBuilder(50);
|
||||
SpiQuery<?> query = request.getQueryRequest().query();
|
||||
StringBuilder sb = new StringBuilder(50).append("from "); // use from to stop parsing on table name
|
||||
SpiQuery<?> query = request.queryRequest().query();
|
||||
if (hasJoinTable()) {
|
||||
sb.append(query.isAsDraft() ? intersectionDraftTable : intersectionPublishTable);
|
||||
} else {
|
||||
@@ -875,7 +875,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
|
||||
|
||||
// publish from each draft to live bean creating new live beans as required
|
||||
draftVal.size();
|
||||
Collection<T> actualDetails = draftVal.getActualDetails();
|
||||
Collection<T> actualDetails = draftVal.actualDetails();
|
||||
for (T bean : actualDetails) {
|
||||
Object id = targetDescriptor.id(bean);
|
||||
T liveBean = liveBeansAsMap.remove(id);
|
||||
@@ -904,7 +904,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
|
||||
@SuppressWarnings("unchecked")
|
||||
private Map<Object, T> liveBeansAsMap(BeanCollection<?> liveVal) {
|
||||
liveVal.size();
|
||||
Collection<?> liveBeans = liveVal.getActualDetails();
|
||||
Collection<?> liveBeans = liveVal.actualDetails();
|
||||
Map<Object, T> liveMap = new LinkedHashMap<>();
|
||||
for (Object liveBean : liveBeans) {
|
||||
Object id = targetDescriptor.id(liveBean);
|
||||
|
||||
@@ -408,7 +408,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
|
||||
*/
|
||||
@Override
|
||||
public Object getCacheDataValueOrig(EntityBeanIntercept ebi) {
|
||||
return cacheDataConvert(ebi.getOrigValue(propertyIndex));
|
||||
return cacheDataConvert(ebi.origValue(propertyIndex));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -25,12 +25,12 @@ public final class BeanPropertyIdClass extends BeanPropertyAssocOne {
|
||||
|
||||
@Override
|
||||
public Object getValue(EntityBean bean) {
|
||||
return bean._ebean_getIntercept().getOwnerId();
|
||||
return bean._ebean_getIntercept().ownerId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValueIntercept(EntityBean bean) {
|
||||
return bean._ebean_getIntercept().getOwnerId();
|
||||
return bean._ebean_getIntercept().ownerId();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -16,12 +16,12 @@ public final class BeanPropertyOrderColumn extends BeanProperty {
|
||||
|
||||
@Override
|
||||
public Object getValue(EntityBean bean) {
|
||||
return bean._ebean_getIntercept().getSortOrder();
|
||||
return bean._ebean_getIntercept().sortOrder();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValueIntercept(EntityBean bean) {
|
||||
return bean._ebean_getIntercept().getSortOrder();
|
||||
return bean._ebean_getIntercept().sortOrder();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -37,7 +37,7 @@ public class BeanSetHelp<T> extends BaseCollectionHelp<T> {
|
||||
public final BeanCollectionAdd getBeanCollectionAdd(Object bc, String mapKey) {
|
||||
if (bc instanceof BeanSet<?>) {
|
||||
BeanSet<?> beanSet = (BeanSet<?>) bc;
|
||||
if (beanSet.getActualSet() == null) {
|
||||
if (beanSet.actualSet() == null) {
|
||||
beanSet.setActualSet(new LinkedHashSet<>());
|
||||
}
|
||||
return beanSet;
|
||||
@@ -90,7 +90,7 @@ public class BeanSetHelp<T> extends BaseCollectionHelp<T> {
|
||||
} else if (current instanceof BeanSet<?>) {
|
||||
// normally this case, replace just the underlying list
|
||||
BeanSet<?> currentBeanSet = (BeanSet<?>) current;
|
||||
currentBeanSet.setActualSet(newBeanSet.getActualSet());
|
||||
currentBeanSet.setActualSet(newBeanSet.actualSet());
|
||||
currentBeanSet.setModifyListening(many.modifyListenMode());
|
||||
|
||||
} else {
|
||||
@@ -113,7 +113,7 @@ public class BeanSetHelp<T> extends BaseCollectionHelp<T> {
|
||||
return;
|
||||
}
|
||||
}
|
||||
set = bc.getActualSet();
|
||||
set = bc.actualSet();
|
||||
} else {
|
||||
set = (Set<?>) collection;
|
||||
}
|
||||
|
||||
@@ -89,6 +89,14 @@ public interface DbReadContext {
|
||||
*/
|
||||
boolean isDisableLazyLoading();
|
||||
|
||||
/**
|
||||
* Return true if the beans that already exist in the persistence context
|
||||
* should have data from the database loaded into them.
|
||||
* <p>
|
||||
* This is the case for REFRESH and forUpdate queries.
|
||||
*/
|
||||
boolean isLoadContextBean();
|
||||
|
||||
/**
|
||||
* Handles a load error on given property.
|
||||
*/
|
||||
|
||||
@@ -46,25 +46,37 @@ public abstract class DeployParser {
|
||||
|
||||
protected abstract String convertWord();
|
||||
|
||||
public abstract String getDeployWord(String expression);
|
||||
public abstract String deployWord(String expression);
|
||||
|
||||
/**
|
||||
* Return the join includes.
|
||||
*/
|
||||
public abstract Set<String> getIncludes();
|
||||
public abstract Set<String> includes();
|
||||
|
||||
public void setEncrypted(boolean encrypted) {
|
||||
this.encrypted = encrypted;
|
||||
}
|
||||
|
||||
public String parse(String source) {
|
||||
if (source == null) {
|
||||
/**
|
||||
* Fast path parse() which first checks that the source is a bean property.
|
||||
*/
|
||||
public String property(String expression) {
|
||||
String deployWord = deployWord(expression);
|
||||
if (deployWord != null) {
|
||||
return deployWord;
|
||||
}
|
||||
// fallback to use parse()
|
||||
return parse(expression);
|
||||
}
|
||||
|
||||
public String parse(String expression) {
|
||||
if (expression == null) {
|
||||
return null;
|
||||
}
|
||||
pos = -1;
|
||||
this.source = source;
|
||||
this.sourceLength = source.length();
|
||||
this.sb = new StringBuilder(source.length() + 20);
|
||||
this.source = expression;
|
||||
this.sourceLength = expression.length();
|
||||
this.sb = new StringBuilder(expression.length() + 20);
|
||||
while (nextWord()) {
|
||||
if (skipWordConvert()) {
|
||||
sb.append(word);
|
||||
|
||||
@@ -37,12 +37,12 @@ public final class DeployPropertyParser extends DeployParser {
|
||||
/**
|
||||
* Return the first property found by the parser.
|
||||
*/
|
||||
public ElPropertyDeploy getFirstProp() {
|
||||
public ElPropertyDeploy firstProp() {
|
||||
return firstProp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getIncludes() {
|
||||
public Set<String> includes() {
|
||||
return includes;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public final class DeployPropertyParser extends DeployParser {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDeployWord(String expression) {
|
||||
public String deployWord(String expression) {
|
||||
ElPropertyDeploy elProp = beanDescriptor.elPropertyDeploy(expression);
|
||||
if (elProp == null) {
|
||||
return null;
|
||||
@@ -70,7 +70,7 @@ public final class DeployPropertyParser extends DeployParser {
|
||||
|
||||
@Override
|
||||
public String convertWord() {
|
||||
String r = getDeployWord(word);
|
||||
String r = deployWord(word);
|
||||
return r == null ? word : r;
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -19,18 +19,18 @@ public class DeployPropertyParserMap extends DeployParser {
|
||||
* Returns null for raw sql queries.
|
||||
*/
|
||||
@Override
|
||||
public Set<String> getIncludes() {
|
||||
public Set<String> includes() {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String convertWord() {
|
||||
String r = getDeployWord(word);
|
||||
String r = deployWord(word);
|
||||
return r == null ? word : r;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDeployWord(String expression) {
|
||||
public String deployWord(String expression) {
|
||||
return map.get(expression);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,13 +19,13 @@ public final class DeployUpdateParser extends DeployParser {
|
||||
* Return null as not used for updates.
|
||||
*/
|
||||
@Override
|
||||
public Set<String> getIncludes() {
|
||||
public Set<String> includes() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String convertWord() {
|
||||
String dbWord = getDeployWord(word);
|
||||
String dbWord = deployWord(word);
|
||||
if (dbWord != null) {
|
||||
return dbWord;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ public final class DeployUpdateParser extends DeployParser {
|
||||
start = dotPos + 1;
|
||||
String remainder = currentWord.substring(start);
|
||||
|
||||
String dbWord = getDeployWord(remainder);
|
||||
String dbWord = deployWord(remainder);
|
||||
if (dbWord != null) {
|
||||
// we have found a match for the remainder
|
||||
localBuffer.append(dbWord);
|
||||
@@ -72,7 +72,7 @@ public final class DeployUpdateParser extends DeployParser {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDeployWord(String expression) {
|
||||
public String deployWord(String expression) {
|
||||
if (expression.equalsIgnoreCase(beanDescriptor.name())) {
|
||||
return beanDescriptor.baseTable();
|
||||
}
|
||||
|
||||
+10
-1
@@ -2,14 +2,18 @@ package io.ebeaninternal.server.deploy;
|
||||
|
||||
import io.ebeaninternal.server.query.SqlBeanLoad;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public final class DynamicPropertyAggregationFormulaMTO extends DynamicPropertyAggregationFormula {
|
||||
|
||||
private final BeanPropertyAssocOne prop;
|
||||
private final Set<String> includes;
|
||||
|
||||
DynamicPropertyAggregationFormulaMTO(BeanPropertyAssocOne prop, String name, String parsedFormula, boolean aggregate, BeanProperty asTarget, String alias) {
|
||||
DynamicPropertyAggregationFormulaMTO(BeanPropertyAssocOne prop, String name, String parsedFormula, boolean aggregate, BeanProperty asTarget, String alias, Set<String> includes) {
|
||||
super(name, prop.idScalarType(), parsedFormula, aggregate, asTarget, alias);
|
||||
this.prop = prop;
|
||||
this.includes = includes;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -17,6 +21,11 @@ public final class DynamicPropertyAggregationFormulaMTO extends DynamicPropertyA
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void extraIncludes(Set<String> predicateIncludes) {
|
||||
predicateIncludes.addAll(includes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load(SqlBeanLoad sqlBeanLoad) {
|
||||
Object value;
|
||||
|
||||
@@ -5,6 +5,7 @@ import io.ebeaninternal.server.el.ElPropertyDeploy;
|
||||
import io.ebeaninternal.server.query.STreeProperty;
|
||||
|
||||
import java.sql.Types;
|
||||
import java.util.Set;
|
||||
|
||||
final class FormulaPropertyPath {
|
||||
|
||||
@@ -18,6 +19,7 @@ final class FormulaPropertyPath {
|
||||
private final String internalExpression;
|
||||
private final ElPropertyDeploy firstProp;
|
||||
private final String parsedAggregation;
|
||||
private final Set<String> includes;
|
||||
private boolean countDistinct;
|
||||
private String cast;
|
||||
private String alias;
|
||||
@@ -47,8 +49,9 @@ final class FormulaPropertyPath {
|
||||
// fetch("machineStats", "sum(hours), sum(totalKms)")
|
||||
parsed = parsed.replace("${}", "${" + path + "}");
|
||||
}
|
||||
this.includes = parser.includes();
|
||||
this.parsedAggregation = buildFormula(parsed);
|
||||
this.firstProp = parser.getFirstProp();
|
||||
this.firstProp = parser.firstProp();
|
||||
}
|
||||
|
||||
private void parseSuffix(String suffix) {
|
||||
@@ -129,7 +132,7 @@ final class FormulaPropertyPath {
|
||||
@SuppressWarnings("rawtypes")
|
||||
private DynamicPropertyAggregationFormula createManyToOne(BeanProperty property) {
|
||||
String logicalName = logicalName();
|
||||
return new DynamicPropertyAggregationFormulaMTO((BeanPropertyAssocOne) property, logicalName, parsedAggregation, isAggregate(), target(logicalName), alias);
|
||||
return new DynamicPropertyAggregationFormulaMTO((BeanPropertyAssocOne) property, logicalName, parsedAggregation, isAggregate(), target(logicalName), alias, includes);
|
||||
}
|
||||
|
||||
private BeanProperty target(String logicalName) {
|
||||
|
||||
@@ -82,9 +82,9 @@ public final class IntersectionRow {
|
||||
idIn.addSqlNoAlias(er);
|
||||
idIn.addBindValues(er);
|
||||
sb.append(" and not ( ");
|
||||
sb.append(er.getSql());
|
||||
sb.append(er.sql());
|
||||
sb.append(" ) ");
|
||||
List<Object> bindValues = er.getBindValues();
|
||||
List<Object> bindValues = er.bindValues();
|
||||
for (Object bindValue : bindValues) {
|
||||
bindParams.setParameter(++count, bindValue);
|
||||
}
|
||||
|
||||
+4
-27
@@ -8,31 +8,14 @@ import io.ebean.config.DatabaseConfig;
|
||||
import io.ebean.config.TableName;
|
||||
import io.ebean.config.dbplatform.IdType;
|
||||
import io.ebean.config.dbplatform.PlatformIdGenerator;
|
||||
import io.ebean.event.BeanFindController;
|
||||
import io.ebean.event.BeanPersistController;
|
||||
import io.ebean.event.BeanPersistListener;
|
||||
import io.ebean.event.BeanPostConstructListener;
|
||||
import io.ebean.event.BeanPostLoad;
|
||||
import io.ebean.event.BeanQueryAdapter;
|
||||
import io.ebean.event.*;
|
||||
import io.ebean.event.changelog.ChangeLogFilter;
|
||||
import io.ebean.text.PathProperties;
|
||||
import io.ebean.util.SplitName;
|
||||
import io.ebeaninternal.api.ConcurrencyMode;
|
||||
import io.ebeaninternal.server.core.CacheOptions;
|
||||
import io.ebeaninternal.server.deploy.BeanDescriptor.EntityType;
|
||||
import io.ebeaninternal.server.deploy.BeanDescriptorManager;
|
||||
import io.ebeaninternal.server.deploy.ChainedBeanPersistController;
|
||||
import io.ebeaninternal.server.deploy.ChainedBeanPersistListener;
|
||||
import io.ebeaninternal.server.deploy.ChainedBeanPostConstructListener;
|
||||
import io.ebeaninternal.server.deploy.ChainedBeanPostLoad;
|
||||
import io.ebeaninternal.server.deploy.ChainedBeanQueryAdapter;
|
||||
import io.ebeaninternal.server.deploy.DeployPropertyParserMap;
|
||||
import io.ebeaninternal.server.deploy.IdentityMode;
|
||||
import io.ebeaninternal.server.deploy.IndexDefinition;
|
||||
import io.ebeaninternal.server.deploy.InheritInfo;
|
||||
import io.ebeaninternal.server.deploy.PartitionMeta;
|
||||
import io.ebeaninternal.server.deploy.TableJoin;
|
||||
import io.ebeaninternal.server.deploy.TablespaceMeta;
|
||||
import io.ebeaninternal.server.deploy.*;
|
||||
import io.ebeaninternal.server.deploy.parse.DeployBeanInfo;
|
||||
import io.ebeaninternal.server.idgen.UuidV1IdGenerator;
|
||||
import io.ebeaninternal.server.idgen.UuidV1RndIdGenerator;
|
||||
@@ -41,13 +24,7 @@ import io.ebeaninternal.server.rawsql.SpiRawSql;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.MappedSuperclass;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Describes Beans including their deployment information.
|
||||
@@ -1102,7 +1079,7 @@ public class DeployBeanDescriptor<T> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDeployWord(String expression) {
|
||||
public String deployWord(String expression) {
|
||||
return descriptor.getDeployWord(expression);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,11 +2,7 @@ package io.ebeaninternal.server.expression;
|
||||
|
||||
import io.ebean.event.BeanQueryRequest;
|
||||
import io.ebean.util.SplitName;
|
||||
import io.ebeaninternal.api.ManyWhereJoins;
|
||||
import io.ebeaninternal.api.NaturalKeyQueryData;
|
||||
import io.ebeaninternal.api.SpiExpression;
|
||||
import io.ebeaninternal.api.SpiExpressionRequest;
|
||||
import io.ebeaninternal.api.SpiExpressionValidation;
|
||||
import io.ebeaninternal.api.*;
|
||||
import io.ebeaninternal.server.deploy.BeanDescriptor;
|
||||
import io.ebeaninternal.server.el.ElPropertyDeploy;
|
||||
import io.ebeaninternal.server.el.ElPropertyValue;
|
||||
@@ -102,6 +98,6 @@ abstract class AbstractExpression implements SpiExpression {
|
||||
}
|
||||
|
||||
protected final ElPropertyValue getElProp(SpiExpressionRequest request) {
|
||||
return request.getBeanDescriptor().elGetValue(propName);
|
||||
return request.descriptor().elGetValue(propName);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-6
@@ -1,10 +1,6 @@
|
||||
package io.ebeaninternal.server.expression;
|
||||
|
||||
import io.ebeaninternal.api.BindValuesKey;
|
||||
import io.ebeaninternal.api.ManyWhereJoins;
|
||||
import io.ebeaninternal.api.SpiExpression;
|
||||
import io.ebeaninternal.api.SpiExpressionRequest;
|
||||
import io.ebeaninternal.api.SpiExpressionValidation;
|
||||
import io.ebeaninternal.api.*;
|
||||
import io.ebeaninternal.server.deploy.BeanDescriptor;
|
||||
import io.ebeaninternal.server.el.ElPropertyDeploy;
|
||||
|
||||
@@ -80,7 +76,7 @@ final class AllEqualsExpression extends NonPrepareExpression {
|
||||
if (count > 0) {
|
||||
request.append("and ");
|
||||
}
|
||||
request.append(name(propName));
|
||||
request.property(name(propName));
|
||||
if (value == null) {
|
||||
request.append(" is null ");
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ final class ArrayContainsExpression extends AbstractExpression {
|
||||
|
||||
@Override
|
||||
public void addSql(SpiExpressionRequest request) {
|
||||
request.getDbPlatformHandler().arrayContains(request, propName, contains, values);
|
||||
request.platformHandler().arrayContains(request, propName, contains, values);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ final class ArrayIsEmptyExpression extends AbstractExpression {
|
||||
|
||||
@Override
|
||||
public void addSql(SpiExpressionRequest request) {
|
||||
request.getDbPlatformHandler().arrayIsEmpty(request, propName, empty);
|
||||
request.platformHandler().arrayIsEmpty(request, propName, empty);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -52,7 +52,7 @@ final class BetweenExpression extends AbstractExpression {
|
||||
if (prop != null && prop.isDbEncrypted()) {
|
||||
pname = prop.beanProperty().decryptProperty(propName);
|
||||
}
|
||||
request.append(pname).append(_BETWEEN);
|
||||
request.property(pname).append(_BETWEEN);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-6
@@ -1,11 +1,7 @@
|
||||
package io.ebeaninternal.server.expression;
|
||||
|
||||
import io.ebean.util.SplitName;
|
||||
import io.ebeaninternal.api.BindValuesKey;
|
||||
import io.ebeaninternal.api.ManyWhereJoins;
|
||||
import io.ebeaninternal.api.SpiExpression;
|
||||
import io.ebeaninternal.api.SpiExpressionRequest;
|
||||
import io.ebeaninternal.api.SpiExpressionValidation;
|
||||
import io.ebeaninternal.api.*;
|
||||
import io.ebeaninternal.server.deploy.BeanDescriptor;
|
||||
import io.ebeaninternal.server.el.ElPropertyDeploy;
|
||||
|
||||
@@ -85,7 +81,7 @@ final class BetweenPropertyExpression extends NonPrepareExpression {
|
||||
|
||||
@Override
|
||||
public void addSql(SpiExpressionRequest request) {
|
||||
request.append(" ?").append(BETWEEN).append(name(lowProperty)).append(" and ").append(name(highProperty));
|
||||
request.append(" ?").append(BETWEEN).property(name(lowProperty)).append(" and ").property(name(highProperty));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -48,7 +48,7 @@ final class BitwiseExpression extends AbstractExpression {
|
||||
@Override
|
||||
public void addSql(SpiExpressionRequest request) {
|
||||
// Use DB specific expression handling
|
||||
request.getDbPlatformHandler().bitwise(request, propName, operator, flags, compare, match);
|
||||
request.platformHandler().bitwise(request, propName, operator, flags, compare, match);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-2
@@ -52,9 +52,9 @@ final class CaseInsensitiveEqualExpression extends AbstractValueExpression {
|
||||
pname = prop.beanProperty().decryptProperty(propName);
|
||||
}
|
||||
if (not) {
|
||||
request.append("lower(").append(pname).append(") != ?");
|
||||
request.append("lower(").property(pname).append(") != ?");
|
||||
} else {
|
||||
request.append("lower(").append(pname).append(") = ?");
|
||||
request.append("lower(").property(pname).append(") = ?");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+64
-9
@@ -5,7 +5,6 @@ import io.ebean.bean.EntityBean;
|
||||
import io.ebean.search.*;
|
||||
import io.ebeaninternal.api.SpiExpressionFactory;
|
||||
import io.ebeaninternal.api.SpiQuery;
|
||||
import io.ebeaninternal.server.expression.SubQueryExpression.SQOp;
|
||||
import io.ebeaninternal.server.grammer.EqlParser;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -149,7 +148,7 @@ public class DefaultExpressionFactory implements SpiExpressionFactory {
|
||||
|
||||
@Override
|
||||
public Expression eq(String propertyName, Query<?> subQuery) {
|
||||
return new SubQueryExpression(SQOp.EQ, propertyName, (SpiQuery<?>) subQuery);
|
||||
return new SubQueryExpression(SubQueryOp.EQ, propertyName, (SpiQuery<?>) subQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -170,7 +169,7 @@ public class DefaultExpressionFactory implements SpiExpressionFactory {
|
||||
|
||||
@Override
|
||||
public Expression ne(String propertyName, Query<?> subQuery) {
|
||||
return new SubQueryExpression(SQOp.NE, propertyName, (SpiQuery<?>) subQuery);
|
||||
return new SubQueryExpression(SubQueryOp.NE, propertyName, (SpiQuery<?>) subQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -260,7 +259,7 @@ public class DefaultExpressionFactory implements SpiExpressionFactory {
|
||||
|
||||
@Override
|
||||
public Expression gt(String propertyName, Query<?> subQuery) {
|
||||
return new SubQueryExpression(SQOp.GT, propertyName, (SpiQuery<?>) subQuery);
|
||||
return new SubQueryExpression(SubQueryOp.GT, propertyName, (SpiQuery<?>) subQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -286,7 +285,7 @@ public class DefaultExpressionFactory implements SpiExpressionFactory {
|
||||
|
||||
@Override
|
||||
public Expression ge(String propertyName, Query<?> subQuery) {
|
||||
return new SubQueryExpression(SQOp.GE, propertyName, (SpiQuery<?>) subQuery);
|
||||
return new SubQueryExpression(SubQueryOp.GE, propertyName, (SpiQuery<?>) subQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -313,7 +312,7 @@ public class DefaultExpressionFactory implements SpiExpressionFactory {
|
||||
|
||||
@Override
|
||||
public Expression lt(String propertyName, Query<?> subQuery) {
|
||||
return new SubQueryExpression(SQOp.LT, propertyName, (SpiQuery<?>) subQuery);
|
||||
return new SubQueryExpression(SubQueryOp.LT, propertyName, (SpiQuery<?>) subQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -326,7 +325,7 @@ public class DefaultExpressionFactory implements SpiExpressionFactory {
|
||||
|
||||
@Override
|
||||
public Expression le(String propertyName, Query<?> subQuery) {
|
||||
return new SubQueryExpression(SQOp.LE, propertyName, (SpiQuery<?>) subQuery);
|
||||
return new SubQueryExpression(SubQueryOp.LE, propertyName, (SpiQuery<?>) subQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -480,12 +479,68 @@ public class DefaultExpressionFactory implements SpiExpressionFactory {
|
||||
return new InExpression(propertyName, values, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* In - using a subQuery.
|
||||
*/
|
||||
@Override
|
||||
public Expression exists(String subQuery, Object... bindValues) {
|
||||
return new ExistsSqlQueryExpression(false, subQuery, bindValues);
|
||||
}
|
||||
|
||||
/**
|
||||
* In - using a subQuery.
|
||||
*/
|
||||
@Override
|
||||
public Expression notExists(String subQuery, Object... bindValues) {
|
||||
return new ExistsSqlQueryExpression(true, subQuery, bindValues);
|
||||
}
|
||||
|
||||
/**
|
||||
* In - using a subQuery.
|
||||
*/
|
||||
@Override
|
||||
public Expression in(String propertyName, Query<?> subQuery) {
|
||||
return new SubQueryExpression(SQOp.IN, propertyName, (SpiQuery<?>) subQuery);
|
||||
return new SubQueryExpression(SubQueryOp.IN, propertyName, (SpiQuery<?>) subQuery);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Expression inSubQuery(String propertyName, String subQuery, Object... bindValues) {
|
||||
return new SubQueryRawExpression(SubQueryOp.IN, propertyName, subQuery, bindValues);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Expression notInSubQuery(String propertyName, String subQuery, Object... bindValues) {
|
||||
return new SubQueryRawExpression(SubQueryOp.NOTIN, propertyName, subQuery, bindValues);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Expression eqSubQuery(String propertyName, String subQuery, Object... bindValues) {
|
||||
return new SubQueryRawExpression(SubQueryOp.EQ, propertyName, subQuery, bindValues);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Expression neSubQuery(String propertyName, String subQuery, Object... bindValues) {
|
||||
return new SubQueryRawExpression(SubQueryOp.NE, propertyName, subQuery, bindValues);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Expression geSubQuery(String propertyName, String subQuery, Object... bindValues) {
|
||||
return new SubQueryRawExpression(SubQueryOp.GE, propertyName, subQuery, bindValues);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Expression gtSubQuery(String propertyName, String subQuery, Object... bindValues) {
|
||||
return new SubQueryRawExpression(SubQueryOp.GT, propertyName, subQuery, bindValues);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Expression leSubQuery(String propertyName, String subQuery, Object... bindValues) {
|
||||
return new SubQueryRawExpression(SubQueryOp.LE, propertyName, subQuery, bindValues);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Expression ltSubQuery(String propertyName, String subQuery, Object... bindValues) {
|
||||
return new SubQueryRawExpression(SubQueryOp.LT, propertyName, subQuery, bindValues);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -527,7 +582,7 @@ public class DefaultExpressionFactory implements SpiExpressionFactory {
|
||||
*/
|
||||
@Override
|
||||
public Expression notIn(String propertyName, Query<?> subQuery) {
|
||||
return new SubQueryExpression(SQOp.NOTIN, propertyName, (SpiQuery<?>) subQuery);
|
||||
return new SubQueryExpression(SubQueryOp.NOTIN, propertyName, (SpiQuery<?>) subQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+55
-39
@@ -2,51 +2,16 @@ package io.ebeaninternal.server.expression;
|
||||
|
||||
import io.avaje.lang.NonNullApi;
|
||||
import io.avaje.lang.Nullable;
|
||||
import io.ebean.CacheMode;
|
||||
import io.ebean.CountDistinctOrder;
|
||||
import io.ebean.DtoQuery;
|
||||
import io.ebean.Expression;
|
||||
import io.ebean.ExpressionFactory;
|
||||
import io.ebean.ExpressionList;
|
||||
import io.ebean.FetchGroup;
|
||||
import io.ebean.FetchPath;
|
||||
import io.ebean.FutureIds;
|
||||
import io.ebean.FutureList;
|
||||
import io.ebean.FutureRowCount;
|
||||
import io.ebean.Junction;
|
||||
import io.ebean.OrderBy;
|
||||
import io.ebean.PagedList;
|
||||
import io.ebean.Pairs;
|
||||
import io.ebean.Query;
|
||||
import io.ebean.QueryIterator;
|
||||
import io.ebean.Transaction;
|
||||
import io.ebean.UpdateQuery;
|
||||
import io.ebean.Version;
|
||||
import io.ebean.*;
|
||||
import io.ebean.event.BeanQueryRequest;
|
||||
import io.ebean.search.Match;
|
||||
import io.ebean.search.MultiMatch;
|
||||
import io.ebean.search.TextCommonTerms;
|
||||
import io.ebean.search.TextQueryString;
|
||||
import io.ebean.search.TextSimple;
|
||||
import io.ebeaninternal.api.BindValuesKey;
|
||||
import io.ebeaninternal.api.ManyWhereJoins;
|
||||
import io.ebeaninternal.api.NaturalKeyQueryData;
|
||||
import io.ebeaninternal.api.SpiExpression;
|
||||
import io.ebeaninternal.api.SpiExpressionList;
|
||||
import io.ebeaninternal.api.SpiExpressionRequest;
|
||||
import io.ebeaninternal.api.SpiExpressionValidation;
|
||||
import io.ebeaninternal.api.SpiJunction;
|
||||
import io.ebean.search.*;
|
||||
import io.ebeaninternal.api.*;
|
||||
import io.ebeaninternal.server.deploy.BeanDescriptor;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.Connection;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
@@ -953,6 +918,57 @@ public class DefaultExpressionList<T> implements SpiExpressionList<T> {
|
||||
return add(expr.inPairs(pairs));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> exists(String sqlSubQuery, Object... bindValues) {
|
||||
return add(expr.exists(sqlSubQuery, bindValues));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> notExists(String sqlSubQuery, Object... bindValues) {
|
||||
return add(expr.notExists(sqlSubQuery, bindValues));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> inSubQuery(String propertyName, String sqlSubQuery, Object... bindValues) {
|
||||
return add(expr.inSubQuery(propertyName, sqlSubQuery, bindValues));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> notInSubQuery(String propertyName, String sqlSubQuery, Object... bindValues) {
|
||||
return add(expr.notInSubQuery(propertyName, sqlSubQuery, bindValues));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> eqSubQuery(String propertyName, String sqlSubQuery, Object... bindValues) {
|
||||
return add(expr.eqSubQuery(propertyName, sqlSubQuery, bindValues));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> neSubQuery(String propertyName, String sqlSubQuery, Object... bindValues) {
|
||||
return add(expr.neSubQuery(propertyName, sqlSubQuery, bindValues));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> gtSubQuery(String propertyName, String sqlSubQuery, Object... bindValues) {
|
||||
return add(expr.gtSubQuery(propertyName, sqlSubQuery, bindValues));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> geSubQuery(String propertyName, String sqlSubQuery, Object... bindValues) {
|
||||
return add(expr.geSubQuery(propertyName, sqlSubQuery, bindValues));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> ltSubQuery(String propertyName, String sqlSubQuery, Object... bindValues) {
|
||||
return add(expr.ltSubQuery(propertyName, sqlSubQuery, bindValues));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> leSubQuery(String propertyName, String sqlSubQuery, Object... bindValues) {
|
||||
return add(expr.leSubQuery(propertyName, sqlSubQuery, bindValues));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpressionList<T> in(String propertyName, Query<?> subQuery) {
|
||||
return add(expr.in(propertyName, subQuery));
|
||||
|
||||
+30
-11
@@ -2,12 +2,12 @@ package io.ebeaninternal.server.expression;
|
||||
|
||||
import io.ebeaninternal.api.SpiExpressionList;
|
||||
import io.ebeaninternal.api.SpiExpressionRequest;
|
||||
import io.ebeaninternal.server.bind.DataBind;
|
||||
import io.ebeaninternal.server.core.SpiOrmQueryRequest;
|
||||
import io.ebeaninternal.server.deploy.BeanDescriptor;
|
||||
import io.ebeaninternal.server.deploy.DeployParser;
|
||||
import io.ebeaninternal.server.expression.platform.DbExpressionHandler;
|
||||
import io.ebeaninternal.server.persist.Binder;
|
||||
import io.ebeaninternal.server.bind.DataBind;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
@@ -67,14 +67,13 @@ public final class DefaultExpressionRequest implements SpiExpressionRequest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public DbExpressionHandler getDbPlatformHandler() {
|
||||
public DbExpressionHandler platformHandler() {
|
||||
return binder.getDbExpressionHandler();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String parseDeploy(String logicalProp) {
|
||||
|
||||
String s = deployParser.getDeployWord(logicalProp);
|
||||
String s = deployParser.deployWord(logicalProp);
|
||||
return s == null ? logicalProp : s;
|
||||
}
|
||||
|
||||
@@ -102,12 +101,12 @@ public final class DefaultExpressionRequest implements SpiExpressionRequest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BeanDescriptor<?> getBeanDescriptor() {
|
||||
public BeanDescriptor<?> descriptor() {
|
||||
return beanDescriptor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpiOrmQueryRequest<?> getQueryRequest() {
|
||||
public SpiOrmQueryRequest<?> queryRequest() {
|
||||
return queryRequest;
|
||||
}
|
||||
|
||||
@@ -115,8 +114,28 @@ public final class DefaultExpressionRequest implements SpiExpressionRequest {
|
||||
* Append text the underlying sql expression.
|
||||
*/
|
||||
@Override
|
||||
public SpiExpressionRequest append(String sqlExpression) {
|
||||
sql.append(sqlExpression);
|
||||
public SpiExpressionRequest append(String expression) {
|
||||
sql.append(expression);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpiExpressionRequest property(String expression) {
|
||||
if (deployParser == null) {
|
||||
sql.append(expression);
|
||||
} else {
|
||||
sql.append(deployParser.property(expression));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpiExpressionRequest parse(String expression) {
|
||||
if (deployParser == null) {
|
||||
sql.append(expression);
|
||||
} else {
|
||||
sql.append(deployParser.parse(expression));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -143,17 +162,17 @@ public final class DefaultExpressionRequest implements SpiExpressionRequest {
|
||||
}
|
||||
}
|
||||
|
||||
public String getBindLog() {
|
||||
public String bindLog() {
|
||||
return bindLog == null ? "" : bindLog.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSql() {
|
||||
public String sql() {
|
||||
return sql.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Object> getBindValues() {
|
||||
public List<Object> bindValues() {
|
||||
return bindValues;
|
||||
}
|
||||
|
||||
|
||||
+2
-4
@@ -93,11 +93,9 @@ final class ExistsQueryExpression implements SpiExpression, UnsupportedDocStoreE
|
||||
@Override
|
||||
public void addSql(SpiExpressionRequest request) {
|
||||
if (not) {
|
||||
request.append(" not");
|
||||
request.append("not ");
|
||||
}
|
||||
request.append(" exists (");
|
||||
request.append(sql);
|
||||
request.append(")");
|
||||
request.append("exists (").parse(sql).append(")");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
package io.ebeaninternal.server.expression;
|
||||
|
||||
import io.ebean.event.BeanQueryRequest;
|
||||
import io.ebeaninternal.api.*;
|
||||
import io.ebeaninternal.server.deploy.BeanDescriptor;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
final class ExistsSqlQueryExpression implements SpiExpression, UnsupportedDocStoreExpression {
|
||||
|
||||
private final boolean not;
|
||||
private final String subQuery;
|
||||
private final Object[] bindParams;
|
||||
|
||||
ExistsSqlQueryExpression(boolean not, String subQuery, Object[] bindParams) {
|
||||
this.not = not;
|
||||
this.subQuery = subQuery;
|
||||
this.bindParams = bindParams;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void prefixProperty(String path) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean naturalKey(NaturalKeyQueryData<?> data) {
|
||||
// can't use naturalKey cache
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void simplify() {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeDocQuery(DocQueryContext context) {
|
||||
throw new IllegalStateException("Not supported");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getIdEqualTo(String idName) {
|
||||
// always return null for this expression
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void prepareExpression(BeanQueryRequest<?> request) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpiExpression copyForPlanKey() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void queryPlanHash(StringBuilder builder) {
|
||||
builder.append("ExistsSqlQuery[").append(" not:").append(not);
|
||||
builder.append(" sql:").append(subQuery).append(" ?:").append(bindParams.length).append("]");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void queryBindKey(BindValuesKey key) {
|
||||
for (Object value : bindParams) {
|
||||
key.add(value);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addSql(SpiExpressionRequest request) {
|
||||
if (not) {
|
||||
request.append("not ");
|
||||
}
|
||||
request.append("exists (").parse(subQuery).append(")");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBindValues(SpiExpressionRequest request) {
|
||||
for (Object bindParam : bindParams) {
|
||||
request.addBindValue(bindParam);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSameByBind(SpiExpression other) {
|
||||
final ExistsSqlQueryExpression that = (ExistsSqlQueryExpression) other;
|
||||
return Arrays.equals(bindParams, that.bindParams);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String nestedPath(BeanDescriptor<?> desc) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void containsMany(BeanDescriptor<?> desc, ManyWhereJoins whereManyJoins) {
|
||||
// Nothing to do for exists expression
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(SpiExpressionValidation validation) {
|
||||
// Nothing to do for exists expression
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,6 @@
|
||||
package io.ebeaninternal.server.expression;
|
||||
|
||||
import io.ebeaninternal.api.BindValuesKey;
|
||||
import io.ebeaninternal.api.ManyWhereJoins;
|
||||
import io.ebeaninternal.api.SpiExpression;
|
||||
import io.ebeaninternal.api.SpiExpressionRequest;
|
||||
import io.ebeaninternal.api.SpiExpressionValidation;
|
||||
import io.ebeaninternal.api.*;
|
||||
import io.ebeaninternal.server.deploy.BeanDescriptor;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -50,23 +46,16 @@ final class IdExpression extends NonPrepareExpression implements SpiExpression {
|
||||
|
||||
@Override
|
||||
public void addBindValues(SpiExpressionRequest request) {
|
||||
|
||||
// 'flatten' EmbeddedId and multiple ID cases
|
||||
// into an array of the underlying scalar field values
|
||||
DefaultExpressionRequest r = (DefaultExpressionRequest) request;
|
||||
Object[] bindIdValues = r.getBeanDescriptor().bindIdValues(value);
|
||||
for (Object bindIdValue : bindIdValues) {
|
||||
for (Object bindIdValue : request.descriptor().bindIdValues(value)) {
|
||||
request.addBindValue(bindIdValue);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addSql(SpiExpressionRequest request) {
|
||||
|
||||
DefaultExpressionRequest r = (DefaultExpressionRequest) request;
|
||||
String idSql = r.getBeanDescriptor().idBinderIdSql(null);
|
||||
|
||||
request.append(idSql);
|
||||
request.parse(request.descriptor().idBinderIdSql(null));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user