mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Compare commits
73
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5414fa17cf | ||
|
|
807b017463 | ||
|
|
6c7cedc1f1 | ||
|
|
01155c3466 | ||
|
|
c297ebda5a | ||
|
|
cec7492c10 | ||
|
|
4252445eb4 | ||
|
|
a23f241fff | ||
|
|
d145e6494d | ||
|
|
2563d52ecf | ||
|
|
8632aef268 | ||
|
|
f827a292ff | ||
|
|
a027c630b1 | ||
|
|
ab1a49abee | ||
|
|
bc5cf0e326 | ||
|
|
348535ec6c | ||
|
|
273f994cdf | ||
|
|
c0a3f7e05d | ||
|
|
1bc9bab988 | ||
|
|
dc730fd97b | ||
|
|
6c15115530 | ||
|
|
841b268fc7 | ||
|
|
6c8db9dec7 | ||
|
|
51d2f52d19 | ||
|
|
ff45f9ab63 | ||
|
|
507027df0a | ||
|
|
50d45c6da9 | ||
|
|
f5e9356451 | ||
|
|
dfe46cc011 | ||
|
|
34cdbc5620 | ||
|
|
595c057964 | ||
|
|
73bc9e516e | ||
|
|
6a4cfb231d | ||
|
|
4523db85c3 | ||
|
|
d703709f14 | ||
|
|
e8afba7ed2 | ||
|
|
dd5bb3edff | ||
|
|
475b05052e | ||
|
|
4cc012b974 | ||
|
|
c214fe52f0 | ||
|
|
4f57bd3511 | ||
|
|
82dc2d031a | ||
|
|
a831ee9ac9 | ||
|
|
e01b20aecb | ||
|
|
58713c7083 | ||
|
|
2df6f2e5fb | ||
|
|
19724e71db | ||
|
|
1a74c7ca85 | ||
|
|
0356f595c8 | ||
|
|
b12a9adf46 | ||
|
|
2b874189a2 | ||
|
|
f2d95cf012 | ||
|
|
d4825cd72c | ||
|
|
c7bd6c8bde | ||
|
|
c9b3a91539 | ||
|
|
565f6c5ac6 | ||
|
|
356b5e58d9 | ||
|
|
094fc3f4b8 | ||
|
|
cfb9d860f9 | ||
|
|
2f7b553d7c | ||
|
|
ec9481420c | ||
|
|
797e1f4bd2 | ||
|
|
a14507e563 | ||
|
|
732f0e13e2 | ||
|
|
a6304ebe8b | ||
|
|
4050d5e900 | ||
|
|
87cc95f60d | ||
|
|
e8d663c94e | ||
|
|
ed830aeb0c | ||
|
|
54cbdae22d | ||
|
|
bb77d6588a | ||
|
|
1d9db88050 | ||
|
|
2d65a3f1c9 |
@@ -16,9 +16,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
## valhalla - failing on javadoc with:
|
||||
## javadoc: error - The code being documented uses packages in the unnamed module, but the packages defined in https://ebean.io/platforms/ebean-platform-h2/apidocs/ are in named modules.
|
||||
java_version: [GA,EA,loom,metropolis,panama]
|
||||
java_version: [GA,EA]
|
||||
os: [ubuntu-latest]
|
||||
|
||||
steps:
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-clickhouse</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-clickhouse</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.6.6</tag>
|
||||
<tag>ebean-parent-13.8.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-cockroach</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.6.6</tag>
|
||||
<tag>ebean-parent-13.8.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-db2</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-db2</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.6.6</tag>
|
||||
<tag>ebean-parent-13.8.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-h2</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.6.6</tag>
|
||||
<tag>ebean-parent-13.8.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-hana</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-hana</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.6.6</tag>
|
||||
<tag>ebean-parent-13.8.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-mariadb</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-mariadb</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.6.6</tag>
|
||||
<tag>ebean-parent-13.8.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-mysql</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-mysql</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.6.6</tag>
|
||||
<tag>ebean-parent-13.8.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-nuodb</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-nuodb</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.6.6</tag>
|
||||
<tag>ebean-parent-13.8.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-oracle</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-oracle</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.6.6</tag>
|
||||
<tag>ebean-parent-13.8.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-postgres</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.6.6</tag>
|
||||
<tag>ebean-parent-13.8.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-sqlite</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlite</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.6.6</tag>
|
||||
<tag>ebean-parent-13.8.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-sqlserver</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlserver</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.6.6</tag>
|
||||
<tag>ebean-parent-13.8.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean-yugabyte</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.6.6</tag>
|
||||
<tag>ebean-parent-13.8.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>composites</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean (all platforms)</name>
|
||||
@@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -35,18 +35,18 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-all</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<scm>
|
||||
<tag>ebean-parent-13.6.6</tag>
|
||||
<tag>ebean-parent-13.8.1</tag>
|
||||
</scm>
|
||||
</project>
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>composites</artifactId>
|
||||
|
||||
+22
-18
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean api</name>
|
||||
@@ -13,15 +13,17 @@
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!--
|
||||
Projects are expected to explicit depend on version
|
||||
of slf4j that they want to use
|
||||
-->
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<version>1.7.36</version>
|
||||
<scope>provided</scope>
|
||||
<groupId>io.avaje</groupId>
|
||||
<artifactId>avaje-applog</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- exclude avaje-applog-slf4j to direct logging to something else -->
|
||||
<dependency>
|
||||
<groupId>io.avaje</groupId>
|
||||
<artifactId>avaje-applog-slf4j</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -30,12 +32,6 @@
|
||||
<version>2.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.avaje</groupId>
|
||||
<artifactId>avaje-applog-slf4j</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
|
||||
<!--
|
||||
Class retention Nonnull and Nullable annotations
|
||||
to assist with IDE auto-completion with Ebean API
|
||||
@@ -49,19 +45,19 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>persistence-api</artifactId>
|
||||
<version>3.0</version>
|
||||
<version>${ebean-persistence-api.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-annotation</artifactId>
|
||||
<version>8.1</version>
|
||||
<version>${ebean-annotation.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-types</artifactId>
|
||||
<version>3.0</version>
|
||||
<version>${ebean-types.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -70,6 +66,14 @@
|
||||
<version>${ebean-datasource.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Support MdcBackgroundExecutorWrapper -->
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<version>1.7.36</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<!-- Jackson core used internally by Ebean -->
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
|
||||
@@ -2,20 +2,21 @@ package io.ebean;
|
||||
|
||||
import io.ebean.config.BeanNotEnhancedException;
|
||||
import io.ebean.datasource.DataSourceConfigurationException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
import java.util.HashMap;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import static java.lang.System.Logger.Level.ERROR;
|
||||
|
||||
/**
|
||||
* Holds Database instances.
|
||||
*/
|
||||
final class DbContext {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger("io.ebean");
|
||||
private static final System.Logger log = EbeanVersion.log;
|
||||
|
||||
static {
|
||||
EbeanVersion.getVersion();
|
||||
}
|
||||
@@ -52,7 +53,7 @@ final class DbContext {
|
||||
throw new DataSourceConfigurationException(msg, e);
|
||||
|
||||
} catch (Throwable e) {
|
||||
log.error("Error trying to create the default Database", e);
|
||||
log.log(ERROR, "Error trying to create the default Database", e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
package io.ebean;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import io.avaje.applog.AppLog;
|
||||
|
||||
import java.io.*;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.LineNumberReader;
|
||||
import java.util.Properties;
|
||||
|
||||
import static java.lang.System.Logger.Level.*;
|
||||
|
||||
/**
|
||||
* Class to determine the ebean version.
|
||||
*
|
||||
@@ -13,7 +17,7 @@ import java.util.Properties;
|
||||
*/
|
||||
public final class EbeanVersion {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger("io.ebean");
|
||||
public static final System.Logger log = AppLog.getLogger("io.ebean");
|
||||
|
||||
/**
|
||||
* Maintain the minimum ebean-agent version manually based on required ebean-agent bug fixes.
|
||||
@@ -21,6 +25,7 @@ public final class EbeanVersion {
|
||||
private static final int MIN_AGENT_MAJOR_VERSION = 12;
|
||||
private static final int MIN_AGENT_MINOR_VERSION = 12;
|
||||
private static String version = "unknown";
|
||||
|
||||
static {
|
||||
readVersion();
|
||||
checkAgentVersion();
|
||||
@@ -32,12 +37,12 @@ public final class EbeanVersion {
|
||||
if (in != null) {
|
||||
try (LineNumberReader reader = new LineNumberReader(new InputStreamReader(in))) {
|
||||
version = reader.readLine();
|
||||
log.log(INFO, "ebean version: {0}", version);
|
||||
}
|
||||
}
|
||||
}
|
||||
log.info("ebean version: {}", version);
|
||||
} catch (IOException e) {
|
||||
log.warn("Could not determine ebean version: {}", e.getMessage());
|
||||
log.log(WARNING, "Could not determine ebean version: {0}", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,13 +54,13 @@ public final class EbeanVersion {
|
||||
String agentVersion = readVersion(in);
|
||||
if (agentVersion != null) {
|
||||
if (checkMinAgentVersion(agentVersion)) {
|
||||
log.error("Expected minimum ebean-agent version {}.{}.0 but we have {}, please update the ebean-agent", MIN_AGENT_MAJOR_VERSION, MIN_AGENT_MINOR_VERSION, agentVersion);
|
||||
log.log(ERROR, "Expected minimum ebean-agent version {0}.{1}.0 but we have {2}, please update the ebean-agent", MIN_AGENT_MAJOR_VERSION, MIN_AGENT_MINOR_VERSION, agentVersion);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.warn("Could not check minimum ebean-agent version {}.{}.0 required due to - {}", MIN_AGENT_MAJOR_VERSION, MIN_AGENT_MINOR_VERSION, e.getMessage());
|
||||
log.log(WARNING, "Could not check minimum ebean-agent version {0}.{1}.0 required due to - {2}", MIN_AGENT_MAJOR_VERSION, MIN_AGENT_MINOR_VERSION, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package io.ebean;
|
||||
|
||||
import io.avaje.lang.Nullable;
|
||||
|
||||
import javax.persistence.NonUniqueResultException;
|
||||
import java.time.Clock;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -15,470 +14,182 @@ import java.util.stream.Stream;
|
||||
/**
|
||||
* The extended API for Database.
|
||||
* <p>
|
||||
* Deprecated in favour of using {@link Query#usingTransaction(Transaction)} instead.
|
||||
* <p>
|
||||
* This provides the finder methods that take an explicit transaction rather than obtaining
|
||||
* the transaction from the usual mechanism (which is ThreadLocal based).
|
||||
* </p>
|
||||
* <p>
|
||||
* In general we only want to use this ExtendedServer API when we want to avoid / bypass
|
||||
* the use of the mechanism to get the current transaction and instead explicitly supply
|
||||
* the transaction to use.
|
||||
* </p>
|
||||
* <p>
|
||||
* Note that in all cases the transaction supplied can be null and in this case the Database
|
||||
* will use the normal mechanism to obtain the transaction to use.
|
||||
* </p>
|
||||
*/
|
||||
public interface ExtendedServer {
|
||||
|
||||
/**
|
||||
* Return the NOW time from the Clock.
|
||||
*/
|
||||
long clockNow();
|
||||
|
||||
/**
|
||||
* Deprecated but no yet determined suitable replacement (to support testing only change of clock).
|
||||
* <p>
|
||||
* Set the Clock to use for <code>@WhenCreated</code> and <code>@WhenModified</code>.
|
||||
* <p>
|
||||
* Note that we only expect to change the Clock for testing purposes.
|
||||
* </p>
|
||||
*/
|
||||
@Deprecated
|
||||
void setClock(Clock clock);
|
||||
|
||||
/**
|
||||
* Execute the query returning true if a row is found.
|
||||
* <p>
|
||||
* The query is executed using max rows of 1 and will only select the id property.
|
||||
* This method is really just a convenient way to optimise a query to perform a
|
||||
* 'does a row exist in the db' check.
|
||||
* </p>
|
||||
*
|
||||
* <h2>Example:</h2>
|
||||
* <pre>{@code
|
||||
*
|
||||
* boolean userExists = query().where().eq("email", "rob@foo.com").exists();
|
||||
*
|
||||
* }</pre>
|
||||
*
|
||||
* <h2>Example using a query bean:</h2>
|
||||
* <pre>{@code
|
||||
*
|
||||
* boolean userExists = new QContact().email.equalTo("rob@foo.com").exists();
|
||||
*
|
||||
* }</pre>
|
||||
*
|
||||
* @return True if the query finds a matching row in the database
|
||||
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
|
||||
*/
|
||||
@Deprecated
|
||||
<T> boolean exists(Query<T> ormQuery, Transaction transaction);
|
||||
|
||||
/**
|
||||
* Return the number of 'top level' or 'root' entities this query should return.
|
||||
*
|
||||
* @see Query#findCount()
|
||||
* @see Query#findFutureCount()
|
||||
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
|
||||
*/
|
||||
@Deprecated
|
||||
<T> int findCount(Query<T> query, Transaction transaction);
|
||||
|
||||
/**
|
||||
* Return the Id values of the query as a List.
|
||||
*
|
||||
* @see Query#findIds()
|
||||
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
|
||||
*/
|
||||
@Deprecated
|
||||
<A, T> List<A> findIds(Query<T> query, Transaction transaction);
|
||||
|
||||
/**
|
||||
* Return a QueryIterator for the query.
|
||||
* <p>
|
||||
* Generally using {@link #findEach(Query, Consumer, Transaction)} or
|
||||
* {@link #findEachWhile(Query, Predicate, Transaction)} is preferred
|
||||
* to findIterate(). The reason is that those methods automatically take care of
|
||||
* closing the queryIterator (and the underlying jdbc statement and resultSet).
|
||||
* <p>
|
||||
* This is similar to findEach in that not all the result beans need to be held
|
||||
* in memory at the same time and as such is good for processing large queries.
|
||||
*
|
||||
* @see Query#findIterate()
|
||||
* @see Query#findEach(Consumer)
|
||||
* @see Query#findEachWhile(Predicate)
|
||||
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
|
||||
*/
|
||||
@Deprecated
|
||||
<T> QueryIterator<T> findIterate(Query<T> query, Transaction transaction);
|
||||
|
||||
/**
|
||||
* Execute the query returning the result as a Stream.
|
||||
* <p>
|
||||
* Note that this can support very large queries iterating any number of results.
|
||||
* To do so internally it can use multiple persistence contexts.
|
||||
* <p>
|
||||
* Note that the stream needs to be closed so use with try with resources.
|
||||
* </p>
|
||||
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
|
||||
*/
|
||||
@Deprecated
|
||||
<T> Stream<T> findStream(Query<T> query, Transaction transaction);
|
||||
|
||||
/**
|
||||
* Execute the query visiting the each bean one at a time.
|
||||
* <p>
|
||||
* Unlike findList() this is suitable for processing a query that will return
|
||||
* a very large resultSet. The reason is that not all the result beans need to be
|
||||
* held in memory at the same time and instead processed one at a time.
|
||||
* </p>
|
||||
* <p>
|
||||
* Internally this query using a PersistenceContext scoped to each bean (and the
|
||||
* beans associated object graph).
|
||||
* </p>
|
||||
* <p>
|
||||
* <pre>{@code
|
||||
*
|
||||
* DB.find(Order.class)
|
||||
* .where().eq("status", Order.Status.NEW)
|
||||
* .order().asc("id")
|
||||
* .findEach((Order order) -> {
|
||||
*
|
||||
* // do something with the order bean
|
||||
* System.out.println(" -- processing order ... " + order);
|
||||
* });
|
||||
*
|
||||
* }</pre>
|
||||
*
|
||||
* @see Query#findEach(Consumer)
|
||||
* @see Query#findEachWhile(Predicate)
|
||||
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
|
||||
*/
|
||||
@Deprecated
|
||||
<T> void findEach(Query<T> query, Consumer<T> consumer, Transaction transaction);
|
||||
|
||||
/**
|
||||
* Execute findEach with batch consumer.
|
||||
*
|
||||
* @see Query#findEach(int, Consumer)
|
||||
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
|
||||
*/
|
||||
@Deprecated
|
||||
<T> void findEach(Query<T> query, int batch, Consumer<List<T>> consumer, Transaction t);
|
||||
|
||||
/**
|
||||
* Execute the query visiting the each bean one at a time.
|
||||
* <p>
|
||||
* Compared to findEach() this provides the ability to stop processing the query
|
||||
* results early by returning false for the Predicate.
|
||||
* </p>
|
||||
* <p>
|
||||
* Unlike findList() this is suitable for processing a query that will return
|
||||
* a very large resultSet. The reason is that not all the result beans need to be
|
||||
* held in memory at the same time and instead processed one at a time.
|
||||
* </p>
|
||||
* <p>
|
||||
* Internally this query using a PersistenceContext scoped to each bean (and the
|
||||
* beans associated object graph).
|
||||
* </p>
|
||||
* <p>
|
||||
* <pre>{@code
|
||||
*
|
||||
* DB.find(Order.class)
|
||||
* .where().eq("status", Order.Status.NEW)
|
||||
* .order().asc("id")
|
||||
* .findEachWhile((Order order) -> {
|
||||
*
|
||||
* // do something with the order bean
|
||||
* System.out.println(" -- processing order ... " + order);
|
||||
*
|
||||
* boolean carryOnProcessing = ...
|
||||
* return carryOnProcessing;
|
||||
* });
|
||||
*
|
||||
* }</pre>
|
||||
*
|
||||
* @see Query#findEach(Consumer)
|
||||
* @see Query#findEachWhile(Predicate)
|
||||
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
|
||||
*/
|
||||
@Deprecated
|
||||
<T> void findEachWhile(Query<T> query, Predicate<T> consumer, Transaction transaction);
|
||||
|
||||
/**
|
||||
* Return versions of a @History entity bean.
|
||||
* <p>
|
||||
* Generally this query is expected to be a find by id or unique predicates query.
|
||||
* It will execute the query against the history returning the versions of the bean.
|
||||
* </p>
|
||||
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
|
||||
*/
|
||||
@Deprecated
|
||||
<T> List<Version<T>> findVersions(Query<T> query, Transaction transaction);
|
||||
|
||||
/**
|
||||
* Execute a query returning a list of beans.
|
||||
* <p>
|
||||
* Generally you are able to use {@link Query#findList()} rather than
|
||||
* explicitly calling this method. You could use this method if you wish to
|
||||
* explicitly control the transaction used for the query.
|
||||
* </p>
|
||||
* <p>
|
||||
* <pre>{@code
|
||||
*
|
||||
* List<Customer> customers = DB.find(Customer.class)
|
||||
* .where().ilike("name", "rob%")
|
||||
* .findList();
|
||||
*
|
||||
* }</pre>
|
||||
*
|
||||
* @param <T> the type of entity bean to fetch.
|
||||
* @param query the query to execute.
|
||||
* @param transaction the transaction to use (can be null).
|
||||
* @return the list of fetched beans.
|
||||
* @see Query#findList()
|
||||
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
|
||||
*/
|
||||
@Deprecated
|
||||
<T> List<T> findList(Query<T> query, Transaction transaction);
|
||||
|
||||
/**
|
||||
* Execute find row count query in a background thread.
|
||||
* <p>
|
||||
* This returns a Future object which can be used to cancel, check the
|
||||
* execution status (isDone etc) and get the value (with or without a
|
||||
* timeout).
|
||||
* </p>
|
||||
*
|
||||
* @param query the query to execute the row count on
|
||||
* @param transaction the transaction (can be null).
|
||||
* @return a Future object for the row count query
|
||||
* @see Query#findFutureCount()
|
||||
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
|
||||
*/
|
||||
@Deprecated
|
||||
<T> FutureRowCount<T> findFutureCount(Query<T> query, Transaction transaction);
|
||||
|
||||
/**
|
||||
* Execute find Id's query in a background thread.
|
||||
* <p>
|
||||
* This returns a Future object which can be used to cancel, check the
|
||||
* execution status (isDone etc) and get the value (with or without a
|
||||
* timeout).
|
||||
* </p>
|
||||
*
|
||||
* @param query the query to execute the fetch Id's on
|
||||
* @param transaction the transaction (can be null).
|
||||
* @return a Future object for the list of Id's
|
||||
* @see Query#findFutureIds()
|
||||
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
|
||||
*/
|
||||
@Deprecated
|
||||
<T> FutureIds<T> findFutureIds(Query<T> query, Transaction transaction);
|
||||
|
||||
/**
|
||||
* Execute find list query in a background thread returning a FutureList object.
|
||||
* <p>
|
||||
* This returns a Future object which can be used to cancel, check the
|
||||
* execution status (isDone etc) and get the value (with or without a timeout).
|
||||
* <p>
|
||||
* This query will execute in it's own PersistenceContext and using its own transaction.
|
||||
* What that means is that it will not share any bean instances with other queries.
|
||||
*
|
||||
* @param query the query to execute in the background
|
||||
* @param transaction the transaction (can be null).
|
||||
* @return a Future object for the list result of the query
|
||||
* @see Query#findFutureList()
|
||||
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
|
||||
*/
|
||||
@Deprecated
|
||||
<T> FutureList<T> findFutureList(Query<T> query, Transaction transaction);
|
||||
|
||||
/**
|
||||
* Return a PagedList for this query using firstRow and maxRows.
|
||||
* <p>
|
||||
* The benefit of using this over findList() is that it provides functionality to get the
|
||||
* total row count etc.
|
||||
* </p>
|
||||
* <p>
|
||||
* If maxRows is not set on the query prior to calling findPagedList() then a
|
||||
* PersistenceException is thrown.
|
||||
* </p>
|
||||
* <p>
|
||||
* <pre>{@code
|
||||
*
|
||||
* PagedList<Order> pagedList = DB.find(Order.class)
|
||||
* .setFirstRow(50)
|
||||
* .setMaxRows(20)
|
||||
* .findPagedList();
|
||||
*
|
||||
* // fetch the total row count in the background
|
||||
* pagedList.loadRowCount();
|
||||
*
|
||||
* List<Order> orders = pagedList.getList();
|
||||
* int totalRowCount = pagedList.getTotalRowCount();
|
||||
*
|
||||
* }</pre>
|
||||
*
|
||||
* @return The PagedList
|
||||
* @see Query#findPagedList()
|
||||
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
|
||||
*/
|
||||
@Deprecated
|
||||
<T> PagedList<T> findPagedList(Query<T> query, Transaction transaction);
|
||||
|
||||
/**
|
||||
* Execute the query returning a set of entity beans.
|
||||
* <p>
|
||||
* Generally you are able to use {@link Query#findSet()} rather than
|
||||
* explicitly calling this method. You could use this method if you wish to
|
||||
* explicitly control the transaction used for the query.
|
||||
* </p>
|
||||
* <p>
|
||||
* <pre>{@code
|
||||
*
|
||||
* Set<Customer> customers = DB.find(Customer.class)
|
||||
* .where().ilike("name", "rob%")
|
||||
* .findSet();
|
||||
*
|
||||
* }</pre>
|
||||
*
|
||||
* @param <T> the type of entity bean to fetch.
|
||||
* @param query the query to execute
|
||||
* @param transaction the transaction to use (can be null).
|
||||
* @return the set of fetched beans.
|
||||
* @see Query#findSet()
|
||||
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
|
||||
*/
|
||||
@Deprecated
|
||||
<T> Set<T> findSet(Query<T> query, Transaction transaction);
|
||||
|
||||
/**
|
||||
* Execute the query returning the entity beans in a Map.
|
||||
* <p>
|
||||
* Generally you are able to use {@link Query#findMap()} rather than
|
||||
* explicitly calling this method. You could use this method if you wish to
|
||||
* explicitly control the transaction used for the query.
|
||||
* </p>
|
||||
*
|
||||
* @param <T> the type of entity bean to fetch.
|
||||
* @param query the query to execute.
|
||||
* @param transaction the transaction to use (can be null).
|
||||
* @return the map of fetched beans.
|
||||
* @see Query#findMap()
|
||||
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
|
||||
*/
|
||||
@Deprecated
|
||||
<K, T> Map<K, T> findMap(Query<T> query, Transaction transaction);
|
||||
|
||||
/**
|
||||
* Execute the query returning a list of values for a single property.
|
||||
* <p>
|
||||
* <h3>Example 1:</h3>
|
||||
* <pre>{@code
|
||||
*
|
||||
* List<String> names =
|
||||
* DB.find(Customer.class)
|
||||
* .select("name")
|
||||
* .order().asc("name")
|
||||
* .findSingleAttributeList();
|
||||
*
|
||||
* }</pre>
|
||||
* <h3>Example 2:</h3>
|
||||
* <pre>{@code
|
||||
*
|
||||
* List<String> names =
|
||||
* DB.find(Customer.class)
|
||||
* .setDistinct(true)
|
||||
* .select("name")
|
||||
* .where().eq("status", Customer.Status.NEW)
|
||||
* .order().asc("name")
|
||||
* .setMaxRows(100)
|
||||
* .findSingleAttributeList();
|
||||
*
|
||||
* }</pre>
|
||||
*
|
||||
* @return the list of values for the selected property
|
||||
* @see Query#findSingleAttributeList()
|
||||
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
|
||||
*/
|
||||
@Deprecated
|
||||
<A, T> List<A> findSingleAttributeList(Query<T> query, Transaction transaction);
|
||||
|
||||
/**
|
||||
* Execute the query returning a hashset of values for a single property.
|
||||
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
|
||||
*/
|
||||
@Deprecated
|
||||
<A, T> Set<A> findSingleAttributeSet(Query<T> query, Transaction transaction);
|
||||
|
||||
/**
|
||||
* Execute the query returning at most one entity bean or null (if no matching
|
||||
* bean is found).
|
||||
* <p>
|
||||
* This will throw a NonUniqueResultException if the query finds more than one result.
|
||||
* </p>
|
||||
* <p>
|
||||
* Generally you are able to use {@link Query#findOne()} rather than
|
||||
* explicitly calling this method. You could use this method if you wish to
|
||||
* explicitly control the transaction used for the query.
|
||||
* </p>
|
||||
*
|
||||
* @param <T> the type of entity bean to fetch.
|
||||
* @param query the query to execute.
|
||||
* @param transaction the transaction to use (can be null).
|
||||
* @return the list of fetched beans.
|
||||
* @throws NonUniqueResultException if more than one result was found
|
||||
* @see Query#findOne()
|
||||
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
|
||||
*/
|
||||
@Deprecated
|
||||
@Nullable
|
||||
<T> T findOne(Query<T> query, Transaction transaction);
|
||||
|
||||
/**
|
||||
* Similar to findOne() but returns an Optional (rather than nullable).
|
||||
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
|
||||
*/
|
||||
@Deprecated
|
||||
<T> Optional<T> findOneOrEmpty(Query<T> query, Transaction transaction);
|
||||
|
||||
/**
|
||||
* Execute as a delete query deleting the 'root level' beans that match the predicates
|
||||
* in the query.
|
||||
* <p>
|
||||
* Note that if the query includes joins then the generated delete statement may not be
|
||||
* optimal depending on the database platform.
|
||||
* </p>
|
||||
*
|
||||
* @param query the query used for the delete
|
||||
* @param transaction the transaction to use (can be null)
|
||||
* @param <T> the type of entity bean to fetch.
|
||||
* @return the number of beans/rows that were deleted
|
||||
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
|
||||
*/
|
||||
@Deprecated
|
||||
<T> int delete(Query<T> query, Transaction transaction);
|
||||
|
||||
/**
|
||||
* Execute the update query returning the number of rows updated.
|
||||
* <p>
|
||||
* The update query must be created using {@link Database#update(Class)}.
|
||||
* </p>
|
||||
*
|
||||
* @param query the update query to execute
|
||||
* @param transaction the optional transaction to use for the update (can be null)
|
||||
* @param <T> the type of entity bean
|
||||
* @return The number of rows updated
|
||||
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
|
||||
*/
|
||||
@Deprecated
|
||||
<T> int update(Query<T> query, Transaction transaction);
|
||||
|
||||
/**
|
||||
* Execute the sql query returning a list of MapBean.
|
||||
* <p>
|
||||
* Generally you are able to use {@link SqlQuery#findList()} rather than
|
||||
* explicitly calling this method. You could use this method if you wish to
|
||||
* explicitly control the transaction used for the query.
|
||||
* </p>
|
||||
*
|
||||
* @param query the query to execute.
|
||||
* @param transaction the transaction to use (can be null).
|
||||
* @return the list of fetched MapBean.
|
||||
* @see SqlQuery#findList()
|
||||
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
|
||||
*/
|
||||
@Deprecated
|
||||
List<SqlRow> findList(SqlQuery query, Transaction transaction);
|
||||
|
||||
/**
|
||||
* Execute the SqlQuery iterating a row at a time.
|
||||
* <p>
|
||||
* This streaming type query is useful for large query execution as only 1 row needs to be held in memory.
|
||||
* </p>
|
||||
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
|
||||
*/
|
||||
@Deprecated
|
||||
void findEach(SqlQuery query, Consumer<SqlRow> consumer, Transaction transaction);
|
||||
|
||||
/**
|
||||
* Execute the SqlQuery iterating a row at a time with the ability to stop consuming part way through.
|
||||
* <p>
|
||||
* Returning false after processing a row stops the iteration through the query results.
|
||||
* </p>
|
||||
* <p>
|
||||
* This streaming type query is useful for large query execution as only 1 row needs to be held in memory.
|
||||
* </p>
|
||||
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
|
||||
*/
|
||||
@Deprecated
|
||||
void findEachWhile(SqlQuery query, Predicate<SqlRow> consumer, Transaction transaction);
|
||||
|
||||
/**
|
||||
* Execute the sql query returning a single MapBean or null.
|
||||
* <p>
|
||||
* This will throw a PersistenceException if the query found more than one
|
||||
* result.
|
||||
* </p>
|
||||
* <p>
|
||||
* Generally you are able to use {@link SqlQuery#findOne()} rather than
|
||||
* explicitly calling this method. You could use this method if you wish to
|
||||
* explicitly control the transaction used for the query.
|
||||
* </p>
|
||||
*
|
||||
* @param query the query to execute.
|
||||
* @param transaction the transaction to use (can be null).
|
||||
* @return the fetched MapBean or null if none was found.
|
||||
* @see SqlQuery#findOne()
|
||||
* Deprecated migrate to using {@link SqlQuery#usingTransaction(Transaction)}.
|
||||
*/
|
||||
@Deprecated
|
||||
@Nullable
|
||||
SqlRow findOne(SqlQuery query, Transaction transaction);
|
||||
|
||||
|
||||
@@ -931,7 +931,7 @@ public interface Query<T> extends CancelableQuery {
|
||||
<A> Set<A> findSingleAttributeSet();
|
||||
|
||||
/**
|
||||
* Execute a query returning a single value of a single property/column.
|
||||
* Execute a query returning a single value or null for a single property/column.
|
||||
* <p>
|
||||
* <pre>{@code
|
||||
*
|
||||
@@ -943,6 +943,7 @@ public interface Query<T> extends CancelableQuery {
|
||||
*
|
||||
* }</pre>
|
||||
*/
|
||||
@Nullable
|
||||
<A> A findSingleAttribute();
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,8 +2,8 @@ package io.ebean;
|
||||
|
||||
import io.avaje.lang.NonNullApi;
|
||||
import io.avaje.lang.Nullable;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Consumer;
|
||||
@@ -40,6 +40,11 @@ import java.util.function.Predicate;
|
||||
@NonNullApi
|
||||
public interface SqlQuery extends Serializable, CancelableQuery {
|
||||
|
||||
/**
|
||||
* Execute the query using the given transaction.
|
||||
*/
|
||||
SqlQuery usingTransaction(Transaction transaction);
|
||||
|
||||
/**
|
||||
* Execute the query returning a list.
|
||||
*/
|
||||
@@ -298,6 +303,11 @@ public interface SqlQuery extends Serializable, CancelableQuery {
|
||||
*/
|
||||
interface TypeQuery<T> {
|
||||
|
||||
/**
|
||||
* Execute the query using the given transaction.
|
||||
*/
|
||||
TypeQuery<T> usingTransaction(Transaction transaction);
|
||||
|
||||
/**
|
||||
* Return the single value.
|
||||
*/
|
||||
|
||||
@@ -16,6 +16,7 @@ import io.ebean.event.changelog.ChangeLogPrepare;
|
||||
import io.ebean.event.changelog.ChangeLogRegister;
|
||||
import io.ebean.event.readaudit.ReadAuditLogger;
|
||||
import io.ebean.event.readaudit.ReadAuditPrepare;
|
||||
import io.ebean.meta.MetricNamingMatch;
|
||||
import io.ebean.util.StringHelper;
|
||||
|
||||
import javax.persistence.EnumType;
|
||||
@@ -24,6 +25,7 @@ import java.time.Clock;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* The configuration used for creating a Database.
|
||||
@@ -115,9 +117,9 @@ public class DatabaseConfig {
|
||||
private TenantCatalogProvider tenantCatalogProvider;
|
||||
|
||||
/**
|
||||
* When true will load entity classes via ModuleInfoLoader.
|
||||
* When true will load entity classes via EntityClassRegister.
|
||||
* <p>
|
||||
* NB: ModuleInfoLoader implementations are generated by querybean generator.
|
||||
* NB: EntityClassRegister implementations are generated by querybean generator.
|
||||
* Having this on and registering entity classes means we don't need to manually
|
||||
* write that code or use classpath scanning to find entity classes.
|
||||
*/
|
||||
@@ -546,6 +548,8 @@ public class DatabaseConfig {
|
||||
|
||||
private String dumpMetricsOptions;
|
||||
|
||||
private Function<String, String> metricNaming = MetricNamingMatch.INSTANCE;
|
||||
|
||||
/**
|
||||
* Construct a Database Configuration for programmatically creating an Database.
|
||||
*/
|
||||
@@ -3376,7 +3380,7 @@ public class DatabaseConfig {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if entity classes should be loaded and registered via ModuleInfoLoader.
|
||||
* Return true if entity classes should be loaded and registered via EntityClassRegister.
|
||||
* <p>
|
||||
* When false we either register entity classes via application code or use classpath
|
||||
* scanning to find and register entity classes.
|
||||
@@ -3396,6 +3400,20 @@ public class DatabaseConfig {
|
||||
this.loadModuleInfo = loadModuleInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the naming convention to apply to metrics names.
|
||||
*/
|
||||
public Function<String, String> getMetricNaming() {
|
||||
return metricNaming;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the naming convention to apply to metrics names.
|
||||
*/
|
||||
public void setMetricNaming(Function<String, String> metricNaming) {
|
||||
this.metricNaming = metricNaming;
|
||||
}
|
||||
|
||||
public enum UuidVersion {
|
||||
VERSION4,
|
||||
VERSION1,
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import java.util.List;
|
||||
/**
|
||||
* Loads and returns entity classes to register with Ebean databases.
|
||||
*/
|
||||
public interface ModuleInfoLoader {
|
||||
public interface EntityClassRegister {
|
||||
|
||||
/**
|
||||
* Return entity classes to register for a named DB (not default DB).
|
||||
@@ -1,32 +1,26 @@
|
||||
package io.ebean.config.dbplatform;
|
||||
|
||||
import io.ebean.BackgroundExecutor;
|
||||
import io.ebean.EbeanVersion;
|
||||
import io.ebean.Query;
|
||||
import io.ebean.annotation.PartitionMode;
|
||||
import io.ebean.annotation.PersistBatch;
|
||||
import io.ebean.annotation.Platform;
|
||||
import io.ebean.config.CustomDbTypeMapping;
|
||||
import io.ebean.config.PlatformConfig;
|
||||
import io.ebean.util.JdbcClose;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
import javax.sql.DataSource;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DatabaseMetaData;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.sql.Types;
|
||||
import java.sql.*;
|
||||
|
||||
import static java.lang.System.Logger.Level.*;
|
||||
|
||||
/**
|
||||
* Database platform specific settings.
|
||||
*/
|
||||
public class DatabasePlatform {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger("io.ebean");
|
||||
private static final System.Logger log = EbeanVersion.log;
|
||||
|
||||
/**
|
||||
* Behavior used when ending a query only transaction (at read committed isolation level).
|
||||
@@ -60,7 +54,7 @@ public class DatabasePlatform {
|
||||
* Can we use native java time API objects in
|
||||
* {@link ResultSet#getObject(int, Class)} and
|
||||
* {@link PreparedStatement#setObject(int, Object)}.
|
||||
*
|
||||
* <p>
|
||||
* Not all drivers (DB2 e.g.) will support this.
|
||||
*/
|
||||
protected boolean supportsNativeJavaTime = true;
|
||||
@@ -146,11 +140,6 @@ public class DatabasePlatform {
|
||||
*/
|
||||
protected int clobDbType = Types.CLOB;
|
||||
|
||||
/**
|
||||
* For Oracle treat empty strings as null.
|
||||
*/
|
||||
protected boolean treatEmptyStringsAsNull;
|
||||
|
||||
/**
|
||||
* The database platform name.
|
||||
*/
|
||||
@@ -165,7 +154,7 @@ public class DatabasePlatform {
|
||||
* want to use quoted identifiers for. The backticks get converted to the
|
||||
* appropriate characters in convertQuotedIdentifiers
|
||||
*/
|
||||
private static final char[] QUOTED_IDENTIFIERS = new char[] { '"', '\'', '[', ']', '`' };
|
||||
private static final char[] QUOTED_IDENTIFIERS = new char[]{'"', '\'', '[', ']', '`'};
|
||||
|
||||
/**
|
||||
* The non-escaped like clause (to stop slash being escaped on some platforms).
|
||||
@@ -548,15 +537,6 @@ public class DatabasePlatform {
|
||||
return clobDbType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if empty strings should be treated as null.
|
||||
*
|
||||
* @return true, if checks if is treat empty strings as null
|
||||
*/
|
||||
public boolean isTreatEmptyStringsAsNull() {
|
||||
return treatEmptyStringsAsNull;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if a compound ID in (...) type expression needs to be in
|
||||
* expanded form of (a=? and b=?) or (a=? and b=?) or ... rather than (a,b) in
|
||||
@@ -666,7 +646,7 @@ public class DatabasePlatform {
|
||||
if (isQuote(dbName.charAt(dbName.length() - 1))) {
|
||||
return openQuote + dbName.substring(1, dbName.length() - 1) + closeQuote;
|
||||
} else {
|
||||
log.error("Missing backquote on [" + dbName + "]");
|
||||
log.log(ERROR, "Missing backquote on [" + dbName + "]");
|
||||
}
|
||||
} else if (allQuotedIdentifiers) {
|
||||
return openQuote + dbName + closeQuote;
|
||||
@@ -676,8 +656,8 @@ public class DatabasePlatform {
|
||||
}
|
||||
|
||||
private boolean isQuote(char ch) {
|
||||
for (char identifer : QUOTED_IDENTIFIERS) {
|
||||
if (identifer == ch) {
|
||||
for (char identifier : QUOTED_IDENTIFIERS) {
|
||||
if (identifier == ch) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -729,7 +709,7 @@ public class DatabasePlatform {
|
||||
|
||||
protected String withForUpdate(String sql, Query.LockWait lockWait, Query.LockType lockType) {
|
||||
// silently assume the database does not support the "for update" clause.
|
||||
log.info("it seems your database does not support the 'for update' clause");
|
||||
log.log(INFO, "it seems your database does not support the 'for update' clause");
|
||||
return sql;
|
||||
}
|
||||
|
||||
@@ -763,7 +743,7 @@ public class DatabasePlatform {
|
||||
if (!schemaExists(dbSchema, connection)) {
|
||||
Statement query = connection.createStatement();
|
||||
try {
|
||||
log.debug("create schema:{}", dbSchema);
|
||||
log.log(DEBUG, "create schema:{0}", dbSchema);
|
||||
query.executeUpdate("create schema " + dbSchema);
|
||||
} finally {
|
||||
JdbcClose.close(query);
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
package io.ebean.config.dbplatform;
|
||||
|
||||
import io.avaje.applog.AppLog;
|
||||
import io.ebean.BackgroundExecutor;
|
||||
import io.ebean.Transaction;
|
||||
import io.ebean.util.JdbcClose;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
import javax.sql.DataSource;
|
||||
@@ -19,12 +18,15 @@ import java.util.TreeSet;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import static java.lang.System.Logger.Level.DEBUG;
|
||||
import static java.lang.System.Logger.Level.ERROR;
|
||||
|
||||
/**
|
||||
* Database sequence based IdGenerator.
|
||||
*/
|
||||
public abstract class SequenceIdGenerator implements PlatformIdGenerator {
|
||||
|
||||
protected static final Logger log = LoggerFactory.getLogger("io.ebean.SEQ");
|
||||
protected static final System.Logger log = AppLog.getLogger("io.ebean.SEQ");
|
||||
|
||||
private final ReentrantLock lock = new ReentrantLock();
|
||||
protected final String seqName;
|
||||
@@ -120,7 +122,7 @@ public abstract class SequenceIdGenerator implements PlatformIdGenerator {
|
||||
protected void loadInBackground(final int requestSize) {
|
||||
if (currentlyBackgroundLoading.get()) {
|
||||
// skip as already background loading
|
||||
log.debug("... skip background sequence load (another load in progress)");
|
||||
log.log(DEBUG, "... skip background sequence load (another load in progress)");
|
||||
return;
|
||||
}
|
||||
currentlyBackgroundLoading.set(true);
|
||||
@@ -152,9 +154,6 @@ public abstract class SequenceIdGenerator implements PlatformIdGenerator {
|
||||
resultSet = statement.executeQuery();
|
||||
|
||||
List<Long> newIds = readIds(resultSet, requestSize);
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace("seq:{} loaded:{} sql:{}", seqName, newIds.size(), sql);
|
||||
}
|
||||
if (newIds.isEmpty()) {
|
||||
throw new PersistenceException("Always expecting more than 1 row from " + sql);
|
||||
}
|
||||
@@ -164,7 +163,7 @@ public abstract class SequenceIdGenerator implements PlatformIdGenerator {
|
||||
} catch (SQLException e) {
|
||||
if (e.getMessage().contains("Database is already closed")) {
|
||||
String msg = "Error getting SEQ when DB shutting down " + e.getMessage();
|
||||
log.error(msg);
|
||||
log.log(ERROR, msg);
|
||||
System.out.println(msg);
|
||||
return Collections.emptyList();
|
||||
} else {
|
||||
|
||||
@@ -32,7 +32,12 @@ public class SqlCodeTranslator implements SqlExceptionTranslator {
|
||||
}
|
||||
|
||||
private DataErrorType getErrorType(SQLException e) {
|
||||
DataErrorType errorType = map.get(e.getSQLState());
|
||||
String sqlState = e.getSQLState();
|
||||
while (sqlState == null && e.getCause() instanceof SQLException) {
|
||||
e = (SQLException)e.getCause();
|
||||
sqlState = e.getSQLState();
|
||||
}
|
||||
DataErrorType errorType = map.get(sqlState);
|
||||
if (errorType == null) {
|
||||
// fall back to error code
|
||||
errorType = map.get(String.valueOf(e.getErrorCode()));
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
package io.ebean.event;
|
||||
|
||||
import io.ebean.Database;
|
||||
import io.ebean.EbeanVersion;
|
||||
import io.ebean.service.SpiContainer;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.sql.Driver;
|
||||
import java.sql.DriverManager;
|
||||
@@ -13,6 +12,8 @@ import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import static java.lang.System.Logger.Level.*;
|
||||
|
||||
/**
|
||||
* Manages the shutdown of Ebean.
|
||||
* <p>
|
||||
@@ -20,13 +21,14 @@ import java.util.concurrent.locks.ReentrantLock;
|
||||
*/
|
||||
public final class ShutdownManager {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger("io.ebean");
|
||||
private static final System.Logger log = EbeanVersion.log;
|
||||
private static final ReentrantLock lock = new ReentrantLock();
|
||||
private static final List<Database> databases = new ArrayList<>();
|
||||
private static final ShutdownHook shutdownHook = new ShutdownHook();
|
||||
|
||||
private static boolean stopping;
|
||||
private static SpiContainer container;
|
||||
|
||||
static {
|
||||
// Register the Shutdown hook
|
||||
registerShutdownHook();
|
||||
@@ -120,8 +122,8 @@ public final class ShutdownManager {
|
||||
// Already run shutdown...
|
||||
return;
|
||||
}
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Ebean shutting down");
|
||||
if (log.isLoggable(DEBUG)) {
|
||||
log.log(DEBUG, "Ebean shutting down");
|
||||
}
|
||||
stopping = true;
|
||||
deregisterShutdownHook();
|
||||
@@ -133,7 +135,7 @@ public final class ShutdownManager {
|
||||
Runnable r = (Runnable) ClassUtil.newInstance(shutdownRunner);
|
||||
r.run();
|
||||
} catch (Exception e) {
|
||||
log.error("Error running custom shutdown runnable", e);
|
||||
log.log(ERROR, "Error running custom shutdown runnable", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,7 +149,7 @@ public final class ShutdownManager {
|
||||
try {
|
||||
server.shutdown();
|
||||
} catch (Exception ex) {
|
||||
log.error("Error executing shutdown runnable", ex);
|
||||
log.log(ERROR, "Error executing shutdown runnable", ex);
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
@@ -165,10 +167,10 @@ public final class ShutdownManager {
|
||||
while (drivers.hasMoreElements()) {
|
||||
Driver driver = drivers.nextElement();
|
||||
try {
|
||||
log.info("De-registering jdbc driver: " + driver);
|
||||
log.log(INFO, "De-registering jdbc driver: " + driver);
|
||||
DriverManager.deregisterDriver(driver);
|
||||
} catch (SQLException e) {
|
||||
log.error("Error de-registering driver " + driver, e);
|
||||
log.log(ERROR, "Error de-registering driver " + driver, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -204,6 +206,7 @@ public final class ShutdownManager {
|
||||
private ShutdownHook() {
|
||||
super("EbeanHook");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
ShutdownManager.shutdown();
|
||||
|
||||
@@ -2,6 +2,7 @@ package io.ebean.meta;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* A simple MetricVisitor that can collect the desired metrics into lists.
|
||||
@@ -9,27 +10,29 @@ import java.util.List;
|
||||
public class BasicMetricVisitor extends AbstractMetricVisitor implements ServerMetrics {
|
||||
|
||||
private final String name;
|
||||
private final Function<String,String> naming;
|
||||
private final List<MetaTimedMetric> timed = new ArrayList<>();
|
||||
private final List<MetaQueryMetric> query = new ArrayList<>();
|
||||
private final List<MetaCountMetric> count = new ArrayList<>();
|
||||
|
||||
public BasicMetricVisitor() {
|
||||
this("db");
|
||||
this("db", MetricNamingMatch.INSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct to reset and collect everything.
|
||||
*/
|
||||
public BasicMetricVisitor(String name) {
|
||||
this(name, true, true, true, true);
|
||||
public BasicMetricVisitor(String name, Function<String,String> naming) {
|
||||
this(name, naming, true, true, true, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct specifying reset and what to collect.
|
||||
*/
|
||||
public BasicMetricVisitor(String name, boolean reset, boolean collectTransactionMetrics, boolean collectQueryMetrics, boolean collectL2Metrics) {
|
||||
public BasicMetricVisitor(String name, Function<String,String> naming, boolean reset, boolean collectTransactionMetrics, boolean collectQueryMetrics, boolean collectL2Metrics) {
|
||||
super(reset, collectTransactionMetrics, collectQueryMetrics, collectL2Metrics);
|
||||
this.name = name;
|
||||
this.naming = naming;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -37,6 +40,11 @@ public class BasicMetricVisitor extends AbstractMetricVisitor implements ServerM
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Function<String, String> namingConvention() {
|
||||
return naming;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServerMetricsAsJson asJson() {
|
||||
return new MetricsAsJson(this);
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package io.ebean.meta;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* Metric naming convention that is exact match.
|
||||
*/
|
||||
public final class MetricNamingMatch implements Function<String, String> {
|
||||
|
||||
public static final Function<String, String> INSTANCE = new MetricNamingMatch();
|
||||
|
||||
@Override
|
||||
public String apply(String name) {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,17 @@
|
||||
package io.ebean.meta;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* Defines visitor to read and report the transaction and query metrics.
|
||||
*/
|
||||
public interface MetricVisitor {
|
||||
|
||||
/**
|
||||
* Return the naming convention that should be applied to the reported metric names.
|
||||
*/
|
||||
Function<String, String> namingConvention();
|
||||
|
||||
/**
|
||||
* Return true if the metrics should be reset.
|
||||
*/
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package io.ebean.text.csv;
|
||||
|
||||
import io.ebean.Database;
|
||||
import io.ebean.EbeanVersion;
|
||||
import io.ebean.Transaction;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import static java.lang.System.Logger.Level.DEBUG;
|
||||
import static java.lang.System.Logger.Level.INFO;
|
||||
|
||||
/**
|
||||
* Provides the default implementation of CsvCallback.
|
||||
@@ -20,7 +22,7 @@ import org.slf4j.LoggerFactory;
|
||||
*/
|
||||
public class DefaultCsvCallback<T> implements CsvCallback<T> {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(DefaultCsvCallback.class);
|
||||
private static final System.Logger log = EbeanVersion.log;
|
||||
|
||||
/**
|
||||
* The transaction to use (if not using CsvCallback).
|
||||
@@ -128,7 +130,7 @@ public class DefaultCsvCallback<T> implements CsvCallback<T> {
|
||||
// related beans (e.g. customer -> customer.billingAddress
|
||||
server.save(bean, transaction);
|
||||
if (logInfoFrequency > 0 && (row % logInfoFrequency == 0)) {
|
||||
log.debug("processed {} rows", row);
|
||||
log.log(DEBUG, "processed {0} rows", row);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,7 +141,7 @@ public class DefaultCsvCallback<T> implements CsvCallback<T> {
|
||||
public void end(int row) {
|
||||
commitTransactionIfCreated();
|
||||
exeTime = System.currentTimeMillis() - startTime;
|
||||
log.info("Csv finished, rows[{}] exeMillis[{}]", row, exeTime);
|
||||
log.log(INFO, "Csv finished, rows[{0}] exeMillis[{1}]", row, exeTime);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -160,7 +162,6 @@ public class DefaultCsvCallback<T> implements CsvCallback<T> {
|
||||
transaction = server.beginTransaction();
|
||||
createdTransaction = true;
|
||||
if (persistBatchSize > 1) {
|
||||
log.debug("Creating transaction, batchSize[{}]", persistBatchSize);
|
||||
transaction.setBatchMode(true);
|
||||
transaction.setBatchSize(persistBatchSize);
|
||||
transaction.setGetGeneratedKeys(false);
|
||||
@@ -168,7 +169,6 @@ public class DefaultCsvCallback<T> implements CsvCallback<T> {
|
||||
// explicitly turn off JDBC batching in case
|
||||
// is has been turned on globally
|
||||
transaction.setBatchMode(false);
|
||||
log.debug("Creating transaction with no JDBC batching");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -180,7 +180,6 @@ public class DefaultCsvCallback<T> implements CsvCallback<T> {
|
||||
protected void commitTransactionIfCreated() {
|
||||
if (createdTransaction) {
|
||||
transaction.commit();
|
||||
log.debug("Committed transaction");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,7 +190,6 @@ public class DefaultCsvCallback<T> implements CsvCallback<T> {
|
||||
protected void rollbackTransactionIfCreated(Throwable e) {
|
||||
if (createdTransaction) {
|
||||
transaction.rollback(e);
|
||||
log.debug("Rolled back transaction");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
package io.ebean.util;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import io.ebean.EbeanVersion;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
|
||||
import static java.lang.System.Logger.Level.WARNING;
|
||||
|
||||
/**
|
||||
* Utility for closing raw Jdbc resources.
|
||||
*/
|
||||
public final class JdbcClose {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger("io.ebean");
|
||||
private static final System.Logger log = EbeanVersion.log;
|
||||
|
||||
/**
|
||||
* Close the resultSet logging if an error occurs.
|
||||
@@ -24,7 +25,7 @@ public final class JdbcClose {
|
||||
statement.close();
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
log.warn("Error closing statement", e);
|
||||
log.log(WARNING, "Error closing statement", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +38,7 @@ public final class JdbcClose {
|
||||
resultSet.close();
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
log.warn("Error closing resultSet", e);
|
||||
log.log(WARNING, "Error closing resultSet", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +51,7 @@ public final class JdbcClose {
|
||||
connection.close();
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
log.warn("Error closing connection", e);
|
||||
log.log(WARNING, "Error closing connection", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +64,7 @@ public final class JdbcClose {
|
||||
connection.rollback();
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
log.warn("Error on connection rollback", e);
|
||||
log.log(WARNING, "Error on connection rollback", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +77,7 @@ public final class JdbcClose {
|
||||
stmt.cancel();
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
log.warn("Error on cancelling statement", e);
|
||||
log.log(WARNING, "Error on cancelling statement", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,8 +15,9 @@ module io.ebean.api {
|
||||
requires transitive persistence.api;
|
||||
requires transitive io.ebean.annotation;
|
||||
requires transitive io.ebean.datasource.api;
|
||||
requires transitive org.slf4j;
|
||||
requires transitive io.avaje.applog;
|
||||
|
||||
requires static org.slf4j;
|
||||
requires static io.ebean.types;
|
||||
requires static com.fasterxml.jackson.core;
|
||||
requires static com.fasterxml.jackson.databind;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</parent>
|
||||
<!-- <parent>-->
|
||||
<!-- <groupId>org.avaje</groupId>-->
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
<scm>
|
||||
<developerConnection>scm:git:git@github.com:ebean-orm/ebean.git</developerConnection>
|
||||
<tag>ebean-parent-13.6.6</tag>
|
||||
<tag>ebean-parent-13.8.1</tag>
|
||||
</scm>
|
||||
|
||||
<name>ebean autotune</name>
|
||||
@@ -26,7 +26,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
+15
-14
@@ -1,5 +1,6 @@
|
||||
package io.ebeaninternal.server.autotune.service;
|
||||
|
||||
import io.avaje.applog.AppLog;
|
||||
import io.ebean.config.AutoTuneConfig;
|
||||
import io.ebean.config.DatabaseConfig;
|
||||
import io.ebeaninternal.api.SpiEbeanServer;
|
||||
@@ -7,8 +8,6 @@ import io.ebeaninternal.api.SpiQuery;
|
||||
import io.ebeaninternal.server.autotune.AutoTuneService;
|
||||
import io.ebeaninternal.server.autotune.model.Autotune;
|
||||
import io.ebeaninternal.server.autotune.model.Origin;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -16,12 +15,14 @@ import java.io.InputStream;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import static java.lang.System.Logger.Level.*;
|
||||
|
||||
/**
|
||||
* Implementation of the AutoTuneService which is comprised of profiling and query tuning.
|
||||
*/
|
||||
public class DefaultAutoTuneService implements AutoTuneService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(DefaultAutoTuneService.class);
|
||||
private static final System.Logger logger = AppLog.getLogger(DefaultAutoTuneService.class);
|
||||
|
||||
private final ReentrantLock lock = new ReentrantLock();
|
||||
|
||||
@@ -111,7 +112,7 @@ public class DefaultAutoTuneService implements AutoTuneService {
|
||||
if (stream != null) {
|
||||
loadAutoTuneProfiling(AutoTuneXmlReader.read(stream));
|
||||
} else {
|
||||
logger.warn("AutoTune file {} not found - no initial automatic query tuning", tuningFile);
|
||||
logger.log(WARNING, "AutoTune file {0} not found - no initial automatic query tuning", tuningFile);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new IllegalStateException("Error on auto close of " + tuningFile, e);
|
||||
@@ -120,7 +121,7 @@ public class DefaultAutoTuneService implements AutoTuneService {
|
||||
}
|
||||
|
||||
private void loadAutoTuneProfiling(Autotune profiling) {
|
||||
logger.info("AutoTune loading {} tuning entries", profiling.getOrigin().size());
|
||||
logger.log(INFO, "AutoTune loading {0} tuning entries", profiling.getOrigin().size());
|
||||
for (Origin origin : profiling.getOrigin()) {
|
||||
queryTuner.put(origin);
|
||||
}
|
||||
@@ -141,17 +142,17 @@ public class DefaultAutoTuneService implements AutoTuneService {
|
||||
event.process();
|
||||
if (event.isEmpty()) {
|
||||
long exeMillis = System.currentTimeMillis() - start;
|
||||
logger.debug("No query tuning updates for server:{} executionMillis:{}", serverName, exeMillis);
|
||||
logger.log(DEBUG, "No query tuning updates for server:{0} executionMillis:{1}", serverName, exeMillis);
|
||||
|
||||
} else {
|
||||
// report the query tuning changes that have been made
|
||||
runtimeChangeCount += event.getChangeCount();
|
||||
event.writeFile(profilingFile + "-" + serverName + "-update");
|
||||
long exeMillis = System.currentTimeMillis() - start;
|
||||
logger.info("query tuning updates - new:{} diff:{} for server:{} executionMillis:{}", event.getNewCount(), event.getDiffCount(), serverName, exeMillis);
|
||||
logger.log(INFO, "query tuning updates - new:{0} diff:{1} for server:{2} executionMillis:{3}", event.getNewCount(), event.getDiffCount(), serverName, exeMillis);
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
logger.error("Error collecting or applying automatic query tuning", e);
|
||||
logger.log(ERROR, "Error collecting or applying automatic query tuning", e);
|
||||
}
|
||||
} finally {
|
||||
lock.unlock();
|
||||
@@ -172,11 +173,11 @@ public class DefaultAutoTuneService implements AutoTuneService {
|
||||
AutoTuneDiffCollection event = new AutoTuneDiffCollection(profiling, queryTuner, false);
|
||||
event.process();
|
||||
if (event.isEmpty()) {
|
||||
logger.info("No new or diff entries for profiling server:{}", serverName);
|
||||
logger.log(INFO, "No new or diff entries for profiling server:{0}", serverName);
|
||||
|
||||
} else {
|
||||
event.writeFile(profilingFile + "-" + serverName);
|
||||
logger.info("writing new:{} diff:{} profiling entries for server:{}", event.getNewCount(), event.getDiffCount(), serverName);
|
||||
logger.log(INFO, "writing new:{0} diff:{1} profiling entries for server:{2}", event.getNewCount(), event.getDiffCount(), serverName);
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
@@ -196,7 +197,7 @@ public class DefaultAutoTuneService implements AutoTuneService {
|
||||
private void outputAllTuning() {
|
||||
|
||||
if (runtimeChangeCount == 0) {
|
||||
logger.info("no runtime query tuning changes for server:{}", serverName);
|
||||
logger.log(INFO, "no runtime query tuning changes for server:{0}", serverName);
|
||||
|
||||
} else {
|
||||
AutoTuneAllCollection event = new AutoTuneAllCollection(queryTuner);
|
||||
@@ -205,12 +206,12 @@ public class DefaultAutoTuneService implements AutoTuneService {
|
||||
if (existingTuning.exists()) {
|
||||
// rename the existing autotune.xml file (appending 'now')
|
||||
if (!existingTuning.renameTo(new File(tuningFile + "." + AutoTuneXmlWriter.now()))) {
|
||||
logger.warn("Failed to rename autotune file [{}]", tuningFile);
|
||||
logger.log(WARNING, "Failed to rename autotune file [{0}]", tuningFile);
|
||||
}
|
||||
}
|
||||
|
||||
event.writeFile(tuningFile, false);
|
||||
logger.info("query tuning detected [{}] changes, writing all [{}] tuning entries for server:{}", runtimeChangeCount, size, serverName);
|
||||
logger.log(INFO, "query tuning detected [{0}] changes, writing all [{1}] tuning entries for server:{2}", runtimeChangeCount, size, serverName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,7 +280,7 @@ public class DefaultAutoTuneService implements AutoTuneService {
|
||||
} catch (InterruptedException e) {
|
||||
// restore the interrupted status
|
||||
Thread.currentThread().interrupt();
|
||||
logger.warn("Error while sleeping after System.gc() request.", e);
|
||||
logger.log(WARNING, "Error while sleeping after System.gc() request.", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+6
-5
@@ -1,5 +1,6 @@
|
||||
package io.ebeaninternal.server.autotune.service;
|
||||
|
||||
import io.avaje.applog.AppLog;
|
||||
import io.ebean.bean.NodeUsageCollector;
|
||||
import io.ebean.text.PathProperties;
|
||||
import io.ebean.util.SplitName;
|
||||
@@ -7,19 +8,19 @@ import io.ebeaninternal.server.deploy.BeanDescriptor;
|
||||
import io.ebeaninternal.server.deploy.BeanProperty;
|
||||
import io.ebeaninternal.server.deploy.BeanPropertyAssoc;
|
||||
import io.ebeaninternal.server.el.ElPropertyValue;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import static java.lang.System.Logger.Level.WARNING;
|
||||
|
||||
/**
|
||||
* Collects usages statistics for a given node in the object graph.
|
||||
*/
|
||||
public class ProfileOriginNodeUsage {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(ProfileOriginNodeUsage.class);
|
||||
private static final System.Logger logger = AppLog.getLogger(ProfileOriginNodeUsage.class);
|
||||
|
||||
private final ReentrantLock lock = new ReentrantLock();
|
||||
|
||||
@@ -45,7 +46,7 @@ public class ProfileOriginNodeUsage {
|
||||
if (path != null) {
|
||||
ElPropertyValue elGetValue = rootDesc.elGetValue(path);
|
||||
if (elGetValue == null) {
|
||||
logger.warn("AutoTune: Can't find join for path[" + path + "] for " + rootDesc.name());
|
||||
logger.log(WARNING, "AutoTune: Can't find join for path[" + path + "] for " + rootDesc.name());
|
||||
return;
|
||||
} else {
|
||||
BeanProperty beanProperty = elGetValue.beanProperty();
|
||||
@@ -61,7 +62,7 @@ public class ProfileOriginNodeUsage {
|
||||
for (String propName : aggregateUsed) {
|
||||
BeanProperty beanProp = desc.findPropertyFromPath(propName);
|
||||
if (beanProp == null) {
|
||||
logger.warn("AutoTune: Can't find property[" + propName + "] for " + desc.name());
|
||||
logger.log(WARNING, "AutoTune: Can't find property[" + propName + "] for " + desc.name());
|
||||
|
||||
} else {
|
||||
if (beanProp.isId()) {
|
||||
|
||||
+33
-15
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean bom</name>
|
||||
@@ -18,6 +18,24 @@
|
||||
|
||||
<!-- dependencies external to this ebean.git build -->
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>persistence-api</artifactId>
|
||||
<version>${ebean-persistence-api.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-annotation</artifactId>
|
||||
<version>${ebean-annotation.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-types</artifactId>
|
||||
<version>${ebean-types.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-runner</artifactId>
|
||||
@@ -71,88 +89,88 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-generator</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-externalmapping-api</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-externalmapping-xml</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-autotune</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>querybean-generator</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>kotlin-querybean-generator</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-postgis</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-redis</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
@@ -16,7 +16,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
+9
-9
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-core</artifactId>
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
<scm>
|
||||
<developerConnection>scm:git:git@github.com:ebean-orm/ebean.git</developerConnection>
|
||||
<tag>ebean-parent-13.6.6</tag>
|
||||
<tag>ebean-parent-13.8.1</tag>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
@@ -41,19 +41,19 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-externalmapping-api</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -136,7 +136,7 @@
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>42.3.3</version>
|
||||
<version>42.4.1</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
@@ -144,21 +144,21 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlserver</artifactId>
|
||||
<version>13.6.6</version>
|
||||
<version>13.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ public interface CQueryPlanKey {
|
||||
* Used by read audit such that we can log read audit entries without the full sql
|
||||
* (which would make the read audit logs verbose).
|
||||
*/
|
||||
String getPartialKey();
|
||||
String partialKey();
|
||||
|
||||
/**
|
||||
* Return a query plan key taking into account persist cascading.
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
package io.ebeaninternal.api;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import io.avaje.applog.AppLog;
|
||||
|
||||
/**
|
||||
* Common loggers used in ebean-core.
|
||||
*/
|
||||
public final class CoreLog {
|
||||
|
||||
public static final Logger log = LoggerFactory.getLogger("io.ebean.core");
|
||||
public static final Logger internal = LoggerFactory.getLogger("io.ebean.internal");
|
||||
public static final System.Logger log = AppLog.getLogger("io.ebean.core");
|
||||
public static final System.Logger internal = AppLog.getLogger("io.ebean.internal");
|
||||
}
|
||||
|
||||
@@ -7,17 +7,18 @@ import io.ebeaninternal.server.core.BindPadding;
|
||||
import io.ebeaninternal.server.core.OrmQueryRequest;
|
||||
import io.ebeaninternal.server.deploy.BeanDescriptor;
|
||||
import io.ebeaninternal.server.deploy.BeanPropertyAssocMany;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static java.lang.System.Logger.Level.DEBUG;
|
||||
|
||||
/**
|
||||
* Request for loading Associated Many Beans.
|
||||
*/
|
||||
public final class LoadManyRequest extends LoadRequest {
|
||||
|
||||
private static final Logger log = CoreLog.log;
|
||||
private static final System.Logger log = CoreLog.log;
|
||||
|
||||
private final List<BeanCollection<?>> batch;
|
||||
private final LoadManyBuffer loadContext;
|
||||
@@ -113,10 +114,10 @@ public final class LoadManyRequest extends LoadRequest {
|
||||
// in the +query or +lazy load due to no rows (predicates)
|
||||
for (BeanCollection<?> bc : batch) {
|
||||
if (bc.checkEmptyLazyLoad()) {
|
||||
if (log.isDebugEnabled()) {
|
||||
if (log.isLoggable(DEBUG)) {
|
||||
EntityBean ownerBean = bc.getOwnerBean();
|
||||
Object parentId = desc.getId(ownerBean);
|
||||
log.debug("BeanCollection after lazy load was empty. type:" + ownerBean.getClass().getName() + " id:" + parentId + " owner:" + ownerBean);
|
||||
log.log(DEBUG, "BeanCollection after lazy load was empty. type:" + ownerBean.getClass().getName() + " id:" + parentId + " owner:" + ownerBean);
|
||||
}
|
||||
} else if (loadCache && many.isUseCache()) {
|
||||
desc.cacheManyPropPut(many, bc, desc.getId(bc.getOwnerBean()));
|
||||
|
||||
@@ -25,6 +25,11 @@ import java.util.stream.Stream;
|
||||
*/
|
||||
public interface SpiEbeanServer extends SpiServer, ExtendedServer, BeanCollectionLoader {
|
||||
|
||||
/**
|
||||
* Return the NOW time from the Clock.
|
||||
*/
|
||||
long clockNow();
|
||||
|
||||
/**
|
||||
* Return true if the L2 cache has been disabled.
|
||||
*/
|
||||
|
||||
@@ -417,6 +417,8 @@ public interface SpiQuery<T> extends Query<T>, SpiQueryFetch, TxnProfileEventCod
|
||||
|
||||
/**
|
||||
* Return a copy of the query.
|
||||
* <p>
|
||||
* Note that this does NOT copy the forUpdate property. See #2762.
|
||||
*/
|
||||
@Override
|
||||
SpiQuery<T> copy();
|
||||
|
||||
@@ -10,27 +10,27 @@ public interface SpiQueryPlan {
|
||||
/**
|
||||
* The related entity bean type
|
||||
*/
|
||||
Class<?> getBeanType();
|
||||
Class<?> beanType();
|
||||
|
||||
/**
|
||||
* The plan name.
|
||||
*/
|
||||
String getName();
|
||||
String name();
|
||||
|
||||
/**
|
||||
* The hash of the sql.
|
||||
*/
|
||||
String getHash();
|
||||
String hash();
|
||||
|
||||
/**
|
||||
* The SQL for the query plan.
|
||||
*/
|
||||
String getSql();
|
||||
String sql();
|
||||
|
||||
/**
|
||||
* The related profile location.
|
||||
*/
|
||||
ProfileLocation getProfileLocation();
|
||||
ProfileLocation profileLocation();
|
||||
|
||||
/**
|
||||
* Initiate bind capture with the give threshold.
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
package io.ebeaninternal.api;
|
||||
|
||||
import io.avaje.lang.Nullable;
|
||||
import io.ebean.SqlQuery;
|
||||
import io.ebean.Transaction;
|
||||
|
||||
/**
|
||||
* SQL query - Internal extension to SqlQuery.
|
||||
*/
|
||||
public interface SpiSqlQuery extends SqlQuery, SpiSqlBinding {
|
||||
|
||||
/**
|
||||
* Return the transaction explicitly associated to the query.
|
||||
*/
|
||||
@Nullable
|
||||
Transaction transaction();
|
||||
}
|
||||
|
||||
+8
-6
@@ -1,5 +1,6 @@
|
||||
package io.ebeaninternal.server.cache;
|
||||
|
||||
import io.avaje.applog.AppLog;
|
||||
import io.ebean.annotation.Cache;
|
||||
import io.ebean.annotation.CacheBeanTuning;
|
||||
import io.ebean.annotation.CacheQueryTuning;
|
||||
@@ -7,20 +8,21 @@ import io.ebean.cache.*;
|
||||
import io.ebean.config.CurrentTenantProvider;
|
||||
import io.ebean.meta.MetricVisitor;
|
||||
import io.ebean.util.AnnotationUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentSkipListSet;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import static java.lang.System.Logger.Level.DEBUG;
|
||||
import static java.lang.System.Logger.Level.TRACE;
|
||||
|
||||
/**
|
||||
* Manages the construction of caches.
|
||||
*/
|
||||
final class DefaultCacheHolder {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger("io.ebean.cache.ALL");
|
||||
private static final System.Logger log = AppLog.getLogger("io.ebean.cache.ALL");
|
||||
|
||||
private final ReentrantLock lock = new ReentrantLock();
|
||||
private final ConcurrentHashMap<String, ServerCache> allCaches = new ConcurrentHashMap<>();
|
||||
@@ -89,7 +91,7 @@ final class DefaultCacheHolder {
|
||||
}
|
||||
|
||||
void clearAll() {
|
||||
log.debug("clearAll");
|
||||
log.log(DEBUG, "clearAll");
|
||||
for (ServerCache serverCache : allCaches.values()) {
|
||||
serverCache.clear();
|
||||
}
|
||||
@@ -97,7 +99,7 @@ final class DefaultCacheHolder {
|
||||
|
||||
|
||||
public void clear(String name) {
|
||||
log.debug("clear {}", name);
|
||||
log.log(DEBUG, "clear {0}", name);
|
||||
clearIfExists(key(name, ServerCacheType.QUERY));
|
||||
clearIfExists(key(name, ServerCacheType.BEAN));
|
||||
clearIfExists(key(name, ServerCacheType.NATURAL_KEY));
|
||||
@@ -112,7 +114,7 @@ final class DefaultCacheHolder {
|
||||
private void clearIfExists(String fullKey) {
|
||||
ServerCache cache = allCaches.get(fullKey);
|
||||
if (cache != null) {
|
||||
log.trace("clear cache {}", fullKey);
|
||||
log.log(TRACE, "clear cache {0}", fullKey);
|
||||
cache.clear();
|
||||
}
|
||||
}
|
||||
|
||||
+8
-6
@@ -1,13 +1,12 @@
|
||||
package io.ebeaninternal.server.cache;
|
||||
|
||||
import io.avaje.applog.AppLog;
|
||||
import io.ebean.BackgroundExecutor;
|
||||
import io.ebean.cache.ServerCache;
|
||||
import io.ebean.cache.ServerCacheStatistics;
|
||||
import io.ebean.meta.MetricVisitor;
|
||||
import io.ebean.metric.CountMetric;
|
||||
import io.ebean.metric.MetricFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.lang.ref.SoftReference;
|
||||
@@ -16,6 +15,9 @@ import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import static java.lang.System.Logger.Level.TRACE;
|
||||
import static java.lang.System.Logger.Level.WARNING;
|
||||
|
||||
/**
|
||||
* The default cache implementation.
|
||||
* <p>
|
||||
@@ -25,7 +27,7 @@ import java.util.concurrent.locks.ReentrantLock;
|
||||
*/
|
||||
public class DefaultServerCache implements ServerCache {
|
||||
|
||||
protected static final Logger logger = LoggerFactory.getLogger(DefaultServerCache.class);
|
||||
protected static final System.Logger logger = AppLog.getLogger(DefaultServerCache.class);
|
||||
|
||||
/**
|
||||
* Compare by last access time (for LRU eviction).
|
||||
@@ -287,13 +289,13 @@ public class DefaultServerCache implements ServerCache {
|
||||
evictCount.add(trimmedByGC);
|
||||
evictCount.add(trimmedByTTL);
|
||||
evictCount.add(trimmedByLRU);
|
||||
if (logger.isTraceEnabled()) {
|
||||
if (logger.isLoggable(TRACE)) {
|
||||
long exeMicros = TimeUnit.MICROSECONDS.convert(System.nanoTime() - startNanos, TimeUnit.NANOSECONDS);
|
||||
logger.trace("Executed trim of cache {} in [{}]millis idle[{}] timeToLive[{}] accessTime[{}] gc[{}]",
|
||||
logger.log(TRACE, "Executed trim of cache {0} in [{1}]millis idle[{2}] timeToLive[{3}] accessTime[{4}] gc[{5}]",
|
||||
name, exeMicros, trimmedByIdle, trimmedByTTL, trimmedByLRU, trimmedByGC);
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
logger.warn("Error during trim of DefaultServerCache [" + name + "]. Cache might be bigger than desired.", e);
|
||||
logger.log(WARNING, "Error during trim of DefaultServerCache [" + name + "]. Cache might be bigger than desired.", e);
|
||||
}
|
||||
} finally {
|
||||
lock.unlock();
|
||||
|
||||
+9
-7
@@ -1,5 +1,6 @@
|
||||
package io.ebeaninternal.server.cache;
|
||||
|
||||
import io.avaje.applog.AppLog;
|
||||
import io.ebean.cache.ServerCache;
|
||||
import io.ebean.cache.ServerCacheRegion;
|
||||
import io.ebean.cache.ServerCacheType;
|
||||
@@ -7,17 +8,18 @@ import io.ebean.meta.MetricVisitor;
|
||||
import io.ebeaninternal.api.SpiCacheRegion;
|
||||
import io.ebeaninternal.server.cluster.ClusterManager;
|
||||
import io.ebeaninternal.server.deploy.DCacheRegion;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import static java.lang.System.Logger.Level.DEBUG;
|
||||
import static java.lang.System.Logger.Level.INFO;
|
||||
|
||||
/**
|
||||
* Manages the bean and query caches.
|
||||
*/
|
||||
public final class DefaultServerCacheManager implements SpiCacheManager {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger("io.ebean.cache.REGION");
|
||||
private static final System.Logger log = AppLog.getLogger("io.ebean.cache.REGION");
|
||||
|
||||
private final Map<String, SpiCacheRegion> regionMap = new HashMap<>();
|
||||
private final ClusterManager clusterManager;
|
||||
@@ -65,23 +67,23 @@ public final class DefaultServerCacheManager implements SpiCacheManager {
|
||||
enabled.add(region.name());
|
||||
if (!region.isEnabled()) {
|
||||
region.setEnabled(true);
|
||||
log.debug("Cache region[{}] enabled", region.name());
|
||||
log.log(DEBUG, "Cache region[{0}] enabled", region.name());
|
||||
}
|
||||
} else {
|
||||
disabled.add(region.name());
|
||||
if (region.isEnabled()) {
|
||||
region.setEnabled(false);
|
||||
log.debug("Cache region[{}] disabled", region.name());
|
||||
log.log(DEBUG, "Cache region[{0}] disabled", region.name());
|
||||
}
|
||||
}
|
||||
}
|
||||
log.info("Cache regions enabled:{} disabled:{}", enabled, disabled);
|
||||
log.log(INFO, "Cache regions enabled:{0} disabled:{1}", enabled, disabled);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAllRegionsEnabled(boolean enabled) {
|
||||
log.debug("All cache regions enabled[{}]", enabled);
|
||||
log.log(DEBUG, "All cache regions enabled[{0}]", enabled);
|
||||
for (SpiCacheRegion region : regionMap.values()) {
|
||||
region.setEnabled(enabled);
|
||||
}
|
||||
|
||||
+7
-5
@@ -1,5 +1,6 @@
|
||||
package io.ebeaninternal.server.changelog;
|
||||
|
||||
import io.avaje.applog.AppLog;
|
||||
import io.ebean.event.changelog.BeanChange;
|
||||
import io.ebean.event.changelog.ChangeLogListener;
|
||||
import io.ebean.event.changelog.ChangeSet;
|
||||
@@ -7,12 +8,13 @@ import io.ebean.event.changelog.ChangeType;
|
||||
import io.ebean.plugin.Plugin;
|
||||
import io.ebean.plugin.SpiServer;
|
||||
import io.ebeaninternal.api.CoreLog;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.StringWriter;
|
||||
import java.util.Properties;
|
||||
|
||||
import static java.lang.System.Logger.Level.ERROR;
|
||||
import static java.lang.System.Logger.Level.INFO;
|
||||
|
||||
/**
|
||||
* Simply logs the change sets in JSON form to logger named <code>io.ebean.ChangeLog</code>.
|
||||
*/
|
||||
@@ -21,7 +23,7 @@ public final class DefaultChangeLogListener implements ChangeLogListener, Plugin
|
||||
/**
|
||||
* The named logger we send the change set payload to. Can be externally configured as desired.
|
||||
*/
|
||||
private static final Logger changeLog = LoggerFactory.getLogger("io.ebean.ChangeLog");
|
||||
private static final System.Logger changeLog = AppLog.getLogger("io.ebean.ChangeLog");
|
||||
|
||||
/**
|
||||
* Used to build the JSON.
|
||||
@@ -65,9 +67,9 @@ public final class DefaultChangeLogListener implements ChangeLogListener, Plugin
|
||||
try {
|
||||
StringWriter writer = new StringWriter(getBufferSize(beanChange));
|
||||
jsonBuilder.writeBeanJson(writer, beanChange, changeSet);
|
||||
changeLog.info(writer.toString());
|
||||
changeLog.log(INFO, writer.toString());
|
||||
} catch (Exception e) {
|
||||
CoreLog.log.error("Exception logging beanChange " + beanChange, e);
|
||||
CoreLog.log.log(ERROR, "Exception logging beanChange " + beanChange, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
package io.ebeaninternal.server.cluster;
|
||||
|
||||
import io.avaje.applog.AppLog;
|
||||
import io.ebean.Database;
|
||||
import io.ebean.config.ContainerConfig;
|
||||
import io.ebeaninternal.server.transaction.RemoteTransactionEvent;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.ServiceLoader;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import static java.lang.System.Logger.Level.DEBUG;
|
||||
|
||||
/**
|
||||
* Manages the cluster service.
|
||||
*/
|
||||
public class ClusterManager implements ServerLookup {
|
||||
|
||||
private static final Logger clusterLogger = LoggerFactory.getLogger("io.ebean.Cluster");
|
||||
private static final System.Logger clusterLogger = AppLog.getLogger("io.ebean.Cluster");
|
||||
|
||||
private final ReentrantLock lock = new ReentrantLock();
|
||||
|
||||
@@ -112,8 +113,8 @@ public class ClusterManager implements ServerLookup {
|
||||
*/
|
||||
public void broadcast(RemoteTransactionEvent event) {
|
||||
if (broadcast != null) {
|
||||
if (clusterLogger.isDebugEnabled()) {
|
||||
clusterLogger.debug("sending: {}", event);
|
||||
if (clusterLogger.isLoggable(DEBUG)) {
|
||||
clusterLogger.log(DEBUG, "sending: {0}", event);
|
||||
}
|
||||
broadcast.broadcast(event);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ import io.ebeaninternal.api.SpiEbeanServer;
|
||||
import io.ebeaninternal.api.SpiTransaction;
|
||||
import io.ebeaninternal.server.core.timezone.DataTimeZone;
|
||||
|
||||
import static java.lang.System.Logger.Level.ERROR;
|
||||
|
||||
/**
|
||||
* Base class for find and persist requests.
|
||||
*/
|
||||
@@ -61,7 +63,7 @@ public abstract class BeanRequest {
|
||||
// Just log this and carry on. A previous exception has been
|
||||
// thrown and if this rollback throws exception it likely means
|
||||
// that the connection is broken (and the dataSource and db will cleanup)
|
||||
CoreLog.log.error("Error trying to rollback a transaction (after a prior exception thrown)", e);
|
||||
CoreLog.log.log(ERROR, "Error trying to rollback a transaction (after a prior exception thrown)", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,9 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ServiceLoader;
|
||||
|
||||
import static java.lang.System.Logger.Level.DEBUG;
|
||||
import static java.lang.System.Logger.Level.INFO;
|
||||
|
||||
/**
|
||||
* Create a DatabasePlatform from the configuration.
|
||||
* <p>
|
||||
@@ -38,7 +41,7 @@ public class DatabasePlatformFactory {
|
||||
try {
|
||||
String offlinePlatform = DbOffline.getPlatform();
|
||||
if (offlinePlatform != null) {
|
||||
CoreLog.log.info("offline platform [{}]", offlinePlatform);
|
||||
CoreLog.log.log(INFO, "offline platform [{0}]", offlinePlatform);
|
||||
return byDatabaseName(offlinePlatform);
|
||||
}
|
||||
if (config.getDatabasePlatformName() != null) {
|
||||
@@ -87,7 +90,7 @@ public class DatabasePlatformFactory {
|
||||
String dbProductName = metaData.getDatabaseProductName().toLowerCase();
|
||||
final int majorVersion = metaData.getDatabaseMajorVersion();
|
||||
final int minorVersion = metaData.getDatabaseMinorVersion();
|
||||
CoreLog.log.debug("platform for productName[{}] version[{}.{}]", dbProductName, majorVersion, minorVersion);
|
||||
CoreLog.log.log(DEBUG, "platform for productName[{0}] version[{1}.{2}]", dbProductName, majorVersion, minorVersion);
|
||||
for (DatabasePlatformProvider provider : providers) {
|
||||
if (provider.matchByProductName(dbProductName)) {
|
||||
return provider.create(majorVersion, minorVersion, metaData, connection);
|
||||
|
||||
@@ -12,18 +12,19 @@ import io.ebeaninternal.server.deploy.BeanDescriptor;
|
||||
import io.ebeaninternal.server.deploy.BeanDescriptor.EntityType;
|
||||
import io.ebeaninternal.server.deploy.BeanPropertyAssocMany;
|
||||
import io.ebeaninternal.server.transaction.DefaultPersistenceContext;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import javax.persistence.EntityNotFoundException;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static java.lang.System.Logger.Level.DEBUG;
|
||||
|
||||
/**
|
||||
* Helper to handle lazy loading and refreshing of beans.
|
||||
*/
|
||||
final class DefaultBeanLoader {
|
||||
|
||||
private static final Logger log = CoreLog.internal;
|
||||
private static final System.Logger log = CoreLog.internal;
|
||||
|
||||
private final DefaultServer server;
|
||||
private final boolean onIterateUseExtraTxn;
|
||||
@@ -108,8 +109,8 @@ final class DefaultBeanLoader {
|
||||
server.findOne(query, null);
|
||||
if (beanCollection != null) {
|
||||
if (beanCollection.checkEmptyLazyLoad()) {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("BeanCollection after load was empty. Owner:" + beanCollection.getOwnerBean());
|
||||
if (log.isLoggable(DEBUG)) {
|
||||
log.log(DEBUG, "BeanCollection after load was empty. Owner:" + beanCollection.getOwnerBean());
|
||||
}
|
||||
} else if (useManyIdCache) {
|
||||
parentDesc.cacheManyPropPut(many, beanCollection, parentId);
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
package io.ebeaninternal.server.core;
|
||||
|
||||
import io.ebean.config.BackgroundExecutorWrapper;
|
||||
import io.ebean.config.ContainerConfig;
|
||||
import io.ebean.config.DatabaseConfig;
|
||||
import io.ebean.config.DatabaseConfigProvider;
|
||||
import io.ebean.config.ModuleInfoLoader;
|
||||
import io.ebean.config.TenantMode;
|
||||
import io.ebean.config.UnderscoreNamingConvention;
|
||||
import io.ebean.config.*;
|
||||
import io.ebean.config.dbplatform.DatabasePlatform;
|
||||
import io.ebean.event.ShutdownManager;
|
||||
import io.ebean.service.SpiContainer;
|
||||
@@ -18,7 +12,6 @@ import io.ebeaninternal.server.cluster.ClusterManager;
|
||||
import io.ebeaninternal.server.core.bootup.BootupClassPathSearch;
|
||||
import io.ebeaninternal.server.core.bootup.BootupClasses;
|
||||
import io.ebeaninternal.server.executor.DefaultBackgroundExecutor;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
import java.net.URL;
|
||||
@@ -28,12 +21,14 @@ import java.util.List;
|
||||
import java.util.ServiceLoader;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import static java.lang.System.Logger.Level.*;
|
||||
|
||||
/**
|
||||
* Default Server side implementation of ServerFactory.
|
||||
*/
|
||||
public final class DefaultContainer implements SpiContainer {
|
||||
|
||||
private static final Logger log = CoreLog.log;
|
||||
private static final System.Logger log = CoreLog.log;
|
||||
|
||||
private final ReentrantLock lock = new ReentrantLock();
|
||||
private final ClusterManager clusterManager;
|
||||
@@ -113,7 +108,7 @@ public final class DefaultContainer implements SpiContainer {
|
||||
startServer(online, server);
|
||||
}
|
||||
DbOffline.reset();
|
||||
log.info("Started database[{}] platform[{}] in {}ms", config.getName(), config.getDatabasePlatform().getPlatform(), System.currentTimeMillis() - start);
|
||||
log.log(INFO, "Started database[{0}] platform[{1}] in {2}ms", config.getName(), config.getDatabasePlatform().getPlatform(), System.currentTimeMillis() - start);
|
||||
return server;
|
||||
} finally {
|
||||
lock.unlock();
|
||||
@@ -129,7 +124,7 @@ public final class DefaultContainer implements SpiContainer {
|
||||
if (config.isAutoLoadModuleInfo()) {
|
||||
// auto register entity classes
|
||||
boolean found = false;
|
||||
for (ModuleInfoLoader loader : ServiceLoader.load(ModuleInfoLoader.class)) {
|
||||
for (EntityClassRegister loader : ServiceLoader.load(EntityClassRegister.class)) {
|
||||
config.addAll(loader.classesFor(config.getName(), config.isDefaultServer()));
|
||||
found = true;
|
||||
}
|
||||
@@ -140,9 +135,9 @@ public final class DefaultContainer implements SpiContainer {
|
||||
}
|
||||
|
||||
private void checkMissingModulePathProvides() {
|
||||
URL servicesFile = ClassLoader.getSystemResource("META-INF/services/io.ebean.config.ModuleInfoLoader");
|
||||
URL servicesFile = ClassLoader.getSystemResource("META-INF/services/io.ebean.config.EntityClassRegister");
|
||||
if (servicesFile != null) {
|
||||
log.error("module-info.java is probably missing 'provides io.ebean.config.ModuleInfoLoader with _Ebean$ModuleInfo' clause. ModuleInfoLoader exists but was not service loaded.");
|
||||
log.log(ERROR, "module-info.java is probably missing 'provides io.ebean.config.EntityClassRegister with EbeanEntityRegister' clause. EntityClassRegister exists but was not service loaded.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,7 +201,7 @@ public final class DefaultContainer implements SpiContainer {
|
||||
DatabasePlatform platform = config.getDatabasePlatform();
|
||||
if (platform == null) {
|
||||
if (config.getTenantMode().isDynamicDataSource()) {
|
||||
throw new IllegalStateException("DatabasePlatform must be explicitly set on DatabaseConfig for TenantMode "+config.getTenantMode());
|
||||
throw new IllegalStateException("DatabasePlatform must be explicitly set on DatabaseConfig for TenantMode " + config.getTenantMode());
|
||||
}
|
||||
// automatically determine the platform
|
||||
platform = new DatabasePlatformFactory().create(config);
|
||||
@@ -220,7 +215,7 @@ public final class DefaultContainer implements SpiContainer {
|
||||
*/
|
||||
private void setDataSource(DatabaseConfig config) {
|
||||
if (isOfflineMode(config)) {
|
||||
log.debug("... DbOffline using platform [{}]", DbOffline.getPlatform());
|
||||
log.log(DEBUG, "... DbOffline using platform [{0}]", DbOffline.getPlatform());
|
||||
} else {
|
||||
InitDataSource.init(config);
|
||||
}
|
||||
@@ -256,7 +251,7 @@ public final class DefaultContainer implements SpiContainer {
|
||||
}
|
||||
try (Connection connection = config.getDataSource().getConnection()) {
|
||||
if (connection.getAutoCommit()) {
|
||||
log.warn("DataSource [{}] has autoCommit defaulting to true!", config.getName());
|
||||
log.log(WARNING, "DataSource [{0}] has autoCommit defaulting to true!", config.getName());
|
||||
}
|
||||
return true;
|
||||
} catch (SQLException ex) {
|
||||
|
||||
@@ -1,20 +1,9 @@
|
||||
package io.ebeaninternal.server.core;
|
||||
|
||||
import io.ebean.meta.AbstractMetricVisitor;
|
||||
import io.ebean.meta.BasicMetricVisitor;
|
||||
import io.ebean.meta.MetaCountMetric;
|
||||
import io.ebean.meta.MetaInfoManager;
|
||||
import io.ebean.meta.MetaQueryMetric;
|
||||
import io.ebean.meta.MetaQueryPlan;
|
||||
import io.ebean.meta.MetaTimedMetric;
|
||||
import io.ebean.meta.MetricData;
|
||||
import io.ebean.meta.MetricVisitor;
|
||||
import io.ebean.meta.QueryPlanInit;
|
||||
import io.ebean.meta.QueryPlanRequest;
|
||||
import io.ebean.meta.ServerMetrics;
|
||||
import io.ebean.meta.ServerMetricsAsJson;
|
||||
import io.ebean.meta.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* DefaultServer based implementation of MetaInfoManager.
|
||||
@@ -22,9 +11,11 @@ import java.util.List;
|
||||
final class DefaultMetaInfoManager implements MetaInfoManager {
|
||||
|
||||
private final DefaultServer server;
|
||||
private final Function<String, String> naming;
|
||||
|
||||
DefaultMetaInfoManager(DefaultServer server) {
|
||||
DefaultMetaInfoManager(DefaultServer server, Function<String, String> naming) {
|
||||
this.server = server;
|
||||
this.naming = naming;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -49,7 +40,7 @@ final class DefaultMetaInfoManager implements MetaInfoManager {
|
||||
|
||||
@Override
|
||||
public BasicMetricVisitor visitBasic() {
|
||||
BasicMetricVisitor basic = new BasicMetricVisitor(server.name());
|
||||
BasicMetricVisitor basic = new BasicMetricVisitor(server.name(), naming);
|
||||
visitMetrics(basic);
|
||||
return basic;
|
||||
}
|
||||
@@ -68,6 +59,11 @@ final class DefaultMetaInfoManager implements MetaInfoManager {
|
||||
super(true, true, true, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Function<String, String> namingConvention() {
|
||||
return MetricNamingMatch.INSTANCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitTimed(MetaTimedMetric metric) {
|
||||
// ignore
|
||||
|
||||
@@ -1,23 +1,24 @@
|
||||
package io.ebeaninternal.server.core;
|
||||
|
||||
import io.avaje.applog.AppLog;
|
||||
import io.ebean.config.QueryPlanCapture;
|
||||
import io.ebean.config.QueryPlanListener;
|
||||
import io.ebean.meta.MetaQueryPlan;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import static java.lang.System.Logger.Level.INFO;
|
||||
|
||||
final class DefaultQueryPlanListener implements QueryPlanListener {
|
||||
|
||||
static final QueryPlanListener INSTANT = new DefaultQueryPlanListener();
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger("io.ebean.QUERYPLAN");
|
||||
private static final System.Logger log = AppLog.getLogger("io.ebean.QUERYPLAN");
|
||||
|
||||
@Override
|
||||
public void process(QueryPlanCapture capture) {
|
||||
// better to log this in JSON form?
|
||||
String dbName = capture.database().name();
|
||||
for (MetaQueryPlan plan : capture.plans()) {
|
||||
log.info("queryPlan db:{} label:{} queryTimeMicros:{} loc:{} sql:{} bind:{} plan:{}",
|
||||
log.log(INFO, "queryPlan db:{0} label:{1} queryTimeMicros:{2} loc:{3} sql:{4} bind:{5} plan:{6}",
|
||||
dbName, plan.label(), plan.queryTimeMicros(), plan.profileLocation(),
|
||||
plan.sql(), plan.bind(), plan.plan());
|
||||
}
|
||||
|
||||
@@ -2,49 +2,11 @@ package io.ebeaninternal.server.core;
|
||||
|
||||
import io.avaje.lang.NonNullApi;
|
||||
import io.avaje.lang.Nullable;
|
||||
import io.ebean.AutoTune;
|
||||
import io.ebean.BackgroundExecutor;
|
||||
import io.ebean.BeanState;
|
||||
import io.ebean.CallableSql;
|
||||
import io.ebean.DocumentStore;
|
||||
import io.ebean.DtoQuery;
|
||||
import io.ebean.ExpressionFactory;
|
||||
import io.ebean.ExpressionList;
|
||||
import io.ebean.ExtendedServer;
|
||||
import io.ebean.Filter;
|
||||
import io.ebean.FutureIds;
|
||||
import io.ebean.FutureList;
|
||||
import io.ebean.FutureRowCount;
|
||||
import io.ebean.MergeOptions;
|
||||
import io.ebean.MergeOptionsBuilder;
|
||||
import io.ebean.PagedList;
|
||||
import io.ebean.PersistenceContextScope;
|
||||
import io.ebean.ProfileLocation;
|
||||
import io.ebean.Query;
|
||||
import io.ebean.QueryIterator;
|
||||
import io.ebean.RowConsumer;
|
||||
import io.ebean.RowMapper;
|
||||
import io.ebean.ScriptRunner;
|
||||
import io.ebean.SqlQuery;
|
||||
import io.ebean.SqlRow;
|
||||
import io.ebean.SqlUpdate;
|
||||
import io.ebean.Transaction;
|
||||
import io.ebean.TransactionCallback;
|
||||
import io.ebean.TxScope;
|
||||
import io.ebean.Update;
|
||||
import io.ebean.UpdateQuery;
|
||||
import io.ebean.ValuePair;
|
||||
import io.ebean.Version;
|
||||
import io.ebean.*;
|
||||
import io.ebean.annotation.Platform;
|
||||
import io.ebean.annotation.TxIsolation;
|
||||
import io.ebean.bean.BeanCollection;
|
||||
import io.ebean.bean.BeanLoader;
|
||||
import io.ebean.bean.CallOrigin;
|
||||
import io.ebean.bean.EntityBean;
|
||||
import io.ebean.bean.EntityBeanIntercept;
|
||||
import io.ebean.bean.PersistenceContext;
|
||||
import io.ebean.bean.*;
|
||||
import io.ebean.bean.PersistenceContext.WithOption;
|
||||
import io.ebean.bean.SingleBeanLoader;
|
||||
import io.ebean.cache.ServerCacheManager;
|
||||
import io.ebean.common.CopyOnFirstWriteList;
|
||||
import io.ebean.config.*;
|
||||
@@ -53,11 +15,7 @@ import io.ebean.event.BeanPersistController;
|
||||
import io.ebean.event.ShutdownManager;
|
||||
import io.ebean.event.readaudit.ReadAuditLogger;
|
||||
import io.ebean.event.readaudit.ReadAuditPrepare;
|
||||
import io.ebean.meta.MetaInfoManager;
|
||||
import io.ebean.meta.MetaQueryPlan;
|
||||
import io.ebean.meta.MetricVisitor;
|
||||
import io.ebean.meta.QueryPlanInit;
|
||||
import io.ebean.meta.QueryPlanRequest;
|
||||
import io.ebean.meta.*;
|
||||
import io.ebean.migration.auto.AutoMigrationRunner;
|
||||
import io.ebean.plugin.BeanType;
|
||||
import io.ebean.plugin.Plugin;
|
||||
@@ -78,21 +36,8 @@ import io.ebeaninternal.server.dto.DtoBeanDescriptor;
|
||||
import io.ebeaninternal.server.dto.DtoBeanManager;
|
||||
import io.ebeaninternal.server.el.ElFilter;
|
||||
import io.ebeaninternal.server.grammer.EqlParser;
|
||||
import io.ebeaninternal.server.query.CQuery;
|
||||
import io.ebeaninternal.server.query.CQueryEngine;
|
||||
import io.ebeaninternal.server.query.CallableQueryCount;
|
||||
import io.ebeaninternal.server.query.CallableQueryIds;
|
||||
import io.ebeaninternal.server.query.CallableQueryList;
|
||||
import io.ebeaninternal.server.query.DtoQueryEngine;
|
||||
import io.ebeaninternal.server.query.LimitOffsetPagedList;
|
||||
import io.ebeaninternal.server.query.QueryFutureIds;
|
||||
import io.ebeaninternal.server.query.QueryFutureList;
|
||||
import io.ebeaninternal.server.query.QueryFutureRowCount;
|
||||
import io.ebeaninternal.server.querydefn.DefaultDtoQuery;
|
||||
import io.ebeaninternal.server.querydefn.DefaultOrmQuery;
|
||||
import io.ebeaninternal.server.querydefn.DefaultOrmUpdate;
|
||||
import io.ebeaninternal.server.querydefn.DefaultRelationalQuery;
|
||||
import io.ebeaninternal.server.querydefn.DefaultUpdateQuery;
|
||||
import io.ebeaninternal.server.query.*;
|
||||
import io.ebeaninternal.server.querydefn.*;
|
||||
import io.ebeaninternal.server.rawsql.SpiRawSql;
|
||||
import io.ebeaninternal.server.text.csv.TCsvReader;
|
||||
import io.ebeaninternal.server.transaction.DefaultPersistenceContext;
|
||||
@@ -101,7 +46,6 @@ import io.ebeaninternal.server.transaction.TransactionManager;
|
||||
import io.ebeaninternal.util.ParamTypeHelper;
|
||||
import io.ebeaninternal.util.ParamTypeHelper.TypeInfo;
|
||||
import io.ebeanservice.docstore.api.DocStoreIntegration;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import javax.persistence.NonUniqueResultException;
|
||||
import javax.persistence.OptimisticLockException;
|
||||
@@ -120,6 +64,7 @@ import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static java.lang.System.Logger.Level.*;
|
||||
import static java.util.Spliterators.spliteratorUnknownSize;
|
||||
import static java.util.stream.StreamSupport.stream;
|
||||
|
||||
@@ -129,7 +74,7 @@ import static java.util.stream.StreamSupport.stream;
|
||||
@NonNullApi
|
||||
public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
|
||||
private static final Logger log = CoreLog.internal;
|
||||
private static final System.Logger log = CoreLog.internal;
|
||||
|
||||
private final ReentrantLock lock = new ReentrantLock();
|
||||
private final DatabaseConfig config;
|
||||
@@ -213,7 +158,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
this.transactionManager = config.createTransactionManager(this, docStoreComponents.updateProcessor());
|
||||
this.documentStore = docStoreComponents.documentStore();
|
||||
this.queryPlanManager = config.initQueryPlanManager(transactionManager);
|
||||
this.metaInfoManager = new DefaultMetaInfoManager(this);
|
||||
this.metaInfoManager = new DefaultMetaInfoManager(this, this.config.getMetricNaming());
|
||||
this.serverPlugins = config.getPlugins();
|
||||
this.ddlGenerator = config.initDdlGenerator(this);
|
||||
this.scriptRunner = new DScriptRunner(this);
|
||||
@@ -386,7 +331,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
if (config.isQueryPlanCapture()) {
|
||||
long secs = config.getQueryPlanCapturePeriodSecs();
|
||||
if (secs > 10) {
|
||||
log.info("capture query plan enabled, every {}secs", secs);
|
||||
log.log(INFO, "capture query plan enabled, every {0}secs", secs);
|
||||
backgroundExecutor.scheduleWithFixedDelay(this::collectQueryPlans, secs, secs, TimeUnit.SECONDS);
|
||||
}
|
||||
}
|
||||
@@ -434,7 +379,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
* Shutdown the services like threads and DataSource.
|
||||
*/
|
||||
private void shutdownInternal(boolean shutdownDataSource, boolean deregisterDriver) {
|
||||
log.trace("shutting down instance {}", serverName);
|
||||
log.log(TRACE, "shutting down instance {0}", serverName);
|
||||
if (shutdown) {
|
||||
// already shutdown
|
||||
return;
|
||||
@@ -463,7 +408,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
try {
|
||||
plugin.shutdown();
|
||||
} catch (Exception e) {
|
||||
log.error("Error when shutting down plugin", e);
|
||||
log.log(ERROR, "Error when shutting down plugin", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1330,7 +1275,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
copy.setFutureFetch(true);
|
||||
Transaction newTxn = createTransaction();
|
||||
QueryFutureRowCount<T> queryFuture = new QueryFutureRowCount<>(new CallableQueryCount<>(this, copy, newTxn));
|
||||
backgroundExecutor.execute(queryFuture.getFutureTask());
|
||||
backgroundExecutor.execute(queryFuture.futureTask());
|
||||
return queryFuture;
|
||||
}
|
||||
|
||||
@@ -1340,7 +1285,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
copy.setFutureFetch(true);
|
||||
Transaction newTxn = createTransaction();
|
||||
QueryFutureIds<T> queryFuture = new QueryFutureIds<>(new CallableQueryIds<>(this, copy, newTxn));
|
||||
backgroundExecutor.execute(queryFuture.getFutureTask());
|
||||
backgroundExecutor.execute(queryFuture.futureTask());
|
||||
return queryFuture;
|
||||
}
|
||||
|
||||
@@ -1357,7 +1302,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
// Create a new transaction solely to execute the findList() at some future time
|
||||
Transaction newTxn = createTransaction();
|
||||
QueryFutureList<T> queryFuture = new QueryFutureList<>(new CallableQueryList<>(this, spiQuery, newTxn));
|
||||
backgroundExecutor.execute(queryFuture.getFutureTask());
|
||||
backgroundExecutor.execute(queryFuture.futureTask());
|
||||
return queryFuture;
|
||||
}
|
||||
|
||||
@@ -1514,7 +1459,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
}
|
||||
|
||||
private <P> P executeSqlQuery(Function<RelationalQueryRequest, P> fun, SpiSqlQuery query) {
|
||||
RelationalQueryRequest request = new RelationalQueryRequest(this, relationalQueryEngine, query, null);
|
||||
RelationalQueryRequest request = new RelationalQueryRequest(this, relationalQueryEngine, query, query.transaction());
|
||||
try {
|
||||
request.initTransIfRequired();
|
||||
return fun.apply(request);
|
||||
@@ -2038,7 +1983,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
return desc(bean.getClass()).getId(eb);
|
||||
}
|
||||
|
||||
private <T> BeanDescriptor<T> desc(Class<T> beanClass) {
|
||||
private <T> BeanDescriptor<T> desc(Class<T> beanClass) {
|
||||
BeanDescriptor<T> desc = descriptorManager.descriptor(beanClass);
|
||||
if (desc == null) {
|
||||
throw new PersistenceException(beanClass.getName() + " is NOT an Entity Bean registered with this server?");
|
||||
@@ -2130,7 +2075,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
try {
|
||||
serverCacheManager.clearLocal(Class.forName(cache));
|
||||
} catch (Exception e) {
|
||||
log.error("Error clearing local cache for type " + cache, e);
|
||||
log.log(ERROR, "Error clearing local cache for type " + cache, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
package io.ebeaninternal.server.core;
|
||||
|
||||
import io.avaje.applog.AppLog;
|
||||
import io.ebean.bean.ObjectGraphNode;
|
||||
import io.ebean.config.SlowQueryEvent;
|
||||
import io.ebean.config.SlowQueryListener;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import static java.lang.System.Logger.Level.WARNING;
|
||||
|
||||
/**
|
||||
* Default slow query listener implementation that logs a warning message.
|
||||
*/
|
||||
final class DefaultSlowQueryListener implements SlowQueryListener {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger("io.ebean.SlowQuery");
|
||||
private static final System.Logger log = AppLog.getLogger("io.ebean.SlowQuery");
|
||||
|
||||
@Override
|
||||
public void process(SlowQueryEvent event) {
|
||||
@@ -20,6 +21,6 @@ final class DefaultSlowQueryListener implements SlowQueryListener {
|
||||
if (node != null) {
|
||||
firstStack = node.getOriginQueryPoint().getTopElement();
|
||||
}
|
||||
log.warn("Slow query warning - millis:{} rows:{} caller[{}] sql[{}]", event.getTimeMillis(), event.getRowCount(), firstStack, event.getSql());
|
||||
log.log(WARNING, "Slow query warning - millis:{0} rows:{1} caller[{2}] sql[{3}]", event.getTimeMillis(), event.getRowCount(), firstStack, event.getSql());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,38 +1,14 @@
|
||||
package io.ebeaninternal.server.core;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
/**
|
||||
* Used to reduce memory consumption of strings used in deployment processing.
|
||||
* <p>
|
||||
* Using this for now instead of String.intern() to avoid any unexpected
|
||||
* increase in PermGen space.
|
||||
*/
|
||||
public final class InternString {
|
||||
|
||||
private static final HashMap<String, String> map = new HashMap<>();
|
||||
|
||||
private static final ReentrantLock lock = new ReentrantLock();
|
||||
|
||||
/**
|
||||
* Return the shared instance of this string.
|
||||
*/
|
||||
public static String intern(String s) {
|
||||
if (s == null) {
|
||||
return null;
|
||||
}
|
||||
lock.lock();
|
||||
try {
|
||||
String v = map.get(s);
|
||||
if (v != null) {
|
||||
return v;
|
||||
} else {
|
||||
map.put(s, s);
|
||||
return s;
|
||||
}
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
return s == null ? null : s.intern();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static java.lang.System.Logger.Level.ERROR;
|
||||
|
||||
/**
|
||||
* Reads the Xml deployment information.
|
||||
*/
|
||||
@@ -55,7 +57,7 @@ final class InternalConfigXmlMap {
|
||||
try {
|
||||
dtoClass = Class.forName(dto.getClazz(), false, classLoader);
|
||||
} catch (Exception e) {
|
||||
CoreLog.internal.error("Could not load dto bean class " + dto.getClazz() + " for ebean xml entry");
|
||||
CoreLog.internal.log(ERROR, "Could not load dto bean class " + dto.getClazz() + " for ebean xml entry");
|
||||
return;
|
||||
}
|
||||
DtoNamedQueries namedQueries = dtoNamedQueries.computeIfAbsent(dtoClass, aClass -> new DtoNamedQueries());
|
||||
|
||||
@@ -56,17 +56,18 @@ import io.ebeanservice.docstore.api.DocStoreFactory;
|
||||
import io.ebeanservice.docstore.api.DocStoreIntegration;
|
||||
import io.ebeanservice.docstore.api.DocStoreUpdateProcessor;
|
||||
import io.ebeanservice.docstore.none.NoneDocStoreFactory;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import static java.lang.System.Logger.Level.*;
|
||||
|
||||
/**
|
||||
* Used to extend the DatabaseConfig with additional objects used to configure and
|
||||
* construct an Database.
|
||||
*/
|
||||
public final class InternalConfiguration {
|
||||
|
||||
private static final Logger log = CoreLog.internal;
|
||||
private static final System.Logger log = CoreLog.internal;
|
||||
|
||||
private final TableModState tableModState;
|
||||
private final boolean online;
|
||||
@@ -246,7 +247,7 @@ public final class InternalConfiguration {
|
||||
*/
|
||||
ReadAuditLogger getReadAuditLogger() {
|
||||
ReadAuditLogger found = bootupClasses.getReadAuditLogger();
|
||||
return plugin(found != null ? found : jacksonCorePresent? new DefaultReadAuditLogger(): null);
|
||||
return plugin(found != null ? found : jacksonCorePresent ? new DefaultReadAuditLogger() : null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -433,7 +434,7 @@ public final class InternalConfiguration {
|
||||
externalTransactionManager = new JtaTransactionManager();
|
||||
}
|
||||
if (externalTransactionManager != null) {
|
||||
log.info("Using Transaction Manager [" + externalTransactionManager.getClass() + "]");
|
||||
log.log(INFO, "Using Transaction Manager {0}", externalTransactionManager.getClass());
|
||||
return new ExternalTransactionScopeManager(externalTransactionManager);
|
||||
} else {
|
||||
return new DefaultTransactionScopeManager();
|
||||
@@ -523,7 +524,7 @@ public final class InternalConfiguration {
|
||||
if (iterator.hasNext()) {
|
||||
// use the cacheFactory (via classpath service loader)
|
||||
plugin = iterator.next();
|
||||
log.debug("using ServerCacheFactory {}", plugin.getClass());
|
||||
log.log(DEBUG, "using ServerCacheFactory {0}", plugin.getClass());
|
||||
} else {
|
||||
// use the built in default l2 caching which is local cache based
|
||||
localL2Caching = true;
|
||||
@@ -605,6 +606,7 @@ public final class InternalConfiguration {
|
||||
|
||||
private static class NoopDdl implements SpiDdlGenerator {
|
||||
private final boolean ddlRun;
|
||||
|
||||
NoopDdl(boolean ddlRun) {
|
||||
this.ddlRun = ddlRun;
|
||||
}
|
||||
@@ -612,7 +614,7 @@ public final class InternalConfiguration {
|
||||
@Override
|
||||
public void execute(boolean online) {
|
||||
if (online && ddlRun) {
|
||||
CoreLog.log.error("Configured to run DDL but ebean-ddl-generator is not in the classpath (or ebean-test in the test classpath?)");
|
||||
CoreLog.log.log(ERROR, "Configured to run DDL but ebean-ddl-generator is not in the classpath (or ebean-test in the test classpath?)");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,4 +73,6 @@ public interface OrmQueryEngine {
|
||||
* Return true if multi-value bind is supported for this type (and current platform).
|
||||
*/
|
||||
boolean isMultiValueSupported(Class<?> valueType);
|
||||
|
||||
int forwardOnlyFetchSize();
|
||||
}
|
||||
|
||||
@@ -24,6 +24,8 @@ import java.util.*;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import static java.lang.System.Logger.Level.ERROR;
|
||||
|
||||
/**
|
||||
* Wraps the objects involved in executing a Query.
|
||||
*/
|
||||
@@ -244,7 +246,7 @@ public final class OrmQueryRequest<T> extends BeanRequest implements SpiOrmQuery
|
||||
// Just log this and carry on. A previous exception has been
|
||||
// thrown and if this rollback throws exception it likely means
|
||||
// that the connection is broken (and the dataSource and db will cleanup)
|
||||
CoreLog.log.error("Error trying to rollback a transaction (after a prior exception thrown)", e);
|
||||
CoreLog.log.log(ERROR, "Error trying to rollback a transaction (after a prior exception thrown)", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -639,7 +641,7 @@ public final class OrmQueryRequest<T> extends BeanRequest implements SpiOrmQuery
|
||||
for (T bean : actualDetails) {
|
||||
ids.add(beanDescriptor.idForJson(bean));
|
||||
}
|
||||
beanDescriptor.readAuditMany(queryPlanKey.getPartialKey(), "l2-query-cache", ids);
|
||||
beanDescriptor.readAuditMany(queryPlanKey.partialKey(), "l2-query-cache", ids);
|
||||
}
|
||||
}
|
||||
if (Boolean.FALSE.equals(query.isReadOnly())) {
|
||||
@@ -761,4 +763,8 @@ public final class OrmQueryRequest<T> extends BeanRequest implements SpiOrmQuery
|
||||
public boolean isInlineSqlUpdateLimit() {
|
||||
return query.getMaxRows() < 1 || server.databasePlatform().isInlineSqlUpdateLimit();
|
||||
}
|
||||
|
||||
public int forwardOnlyFetchSize() {
|
||||
return queryEngine.forwardOnlyFetchSize();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,9 +22,6 @@ public final class RelationalQueryRequest extends AbstractSqlQueryRequest {
|
||||
private int estimateCapacity;
|
||||
private int rows;
|
||||
|
||||
/**
|
||||
* Create the BeanFindRequest.
|
||||
*/
|
||||
RelationalQueryRequest(SpiEbeanServer server, RelationalQueryEngine engine, SqlQuery q, Transaction t) {
|
||||
super(server, (SpiSqlBinding) q, t);
|
||||
this.queryEngine = engine;
|
||||
|
||||
+4
-4
@@ -4,17 +4,18 @@ import io.avaje.classpath.scanner.ClassPathScanner;
|
||||
import io.ebean.config.DatabaseConfig;
|
||||
import io.ebeaninternal.api.CoreLog;
|
||||
import io.ebeaninternal.server.core.ClassPathScanners;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static java.lang.System.Logger.Level.DEBUG;
|
||||
|
||||
/**
|
||||
* Searches for interesting classes such as Entities, Embedded and ScalarTypes.
|
||||
*/
|
||||
public class BootupClassPathSearch {
|
||||
|
||||
private static final Logger log = CoreLog.internal;
|
||||
private static final System.Logger log = CoreLog.internal;
|
||||
|
||||
private final List<String> packages;
|
||||
private final List<ClassPathScanner> scanners;
|
||||
@@ -42,7 +43,6 @@ public class BootupClassPathSearch {
|
||||
* Search the classPath for the classes we are interested in.
|
||||
*/
|
||||
private BootupClasses getBootupClasses() {
|
||||
|
||||
try {
|
||||
BootupClasses bc = new BootupClasses();
|
||||
|
||||
@@ -59,7 +59,7 @@ public class BootupClassPathSearch {
|
||||
}
|
||||
|
||||
long searchTime = System.currentTimeMillis() - st;
|
||||
log.debug("Classpath search entities[{}] searchTime[{}] in packages[{}]", bc.getEntities().size(), searchTime, packages);
|
||||
log.log(DEBUG, "Classpath search entities[{0}] searchTime[{1}] in packages[{2}]", bc.getEntities().size(), searchTime, packages);
|
||||
return bc;
|
||||
|
||||
} catch (Exception ex) {
|
||||
|
||||
@@ -13,7 +13,6 @@ import io.ebean.event.readaudit.ReadAuditLogger;
|
||||
import io.ebean.event.readaudit.ReadAuditPrepare;
|
||||
import io.ebean.util.AnnotationUtil;
|
||||
import io.ebeaninternal.api.CoreLog;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import javax.persistence.AttributeConverter;
|
||||
import javax.persistence.Embeddable;
|
||||
@@ -25,13 +24,16 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import static java.lang.System.Logger.Level.DEBUG;
|
||||
import static java.lang.System.Logger.Level.ERROR;
|
||||
|
||||
/**
|
||||
* Interesting classes for a EbeanServer such as Embeddable, Entity,
|
||||
* ScalarTypes, Finders, Listeners and Controllers.
|
||||
*/
|
||||
public class BootupClasses implements Predicate<Class<?>> {
|
||||
|
||||
private static final Logger log = CoreLog.internal;
|
||||
private static final System.Logger log = CoreLog.internal;
|
||||
|
||||
private final List<Class<?>> embeddableList = new ArrayList<>();
|
||||
private final List<Class<?>> entityList = new ArrayList<>();
|
||||
@@ -205,13 +207,13 @@ public class BootupClasses implements Predicate<Class<?>> {
|
||||
try {
|
||||
return cls.getConstructor().newInstance();
|
||||
} catch (NoSuchMethodException e) {
|
||||
log.debug("Ignore/expected - no default constructor: " +e.getMessage());
|
||||
log.log(DEBUG, "Ignore/expected - no default constructor: " + e.getMessage());
|
||||
return null;
|
||||
|
||||
} catch (Exception e) {
|
||||
if (logOnException) {
|
||||
// not expected but we log and carry on
|
||||
log.error("Error creating " + cls, e);
|
||||
log.log(ERROR, "Error creating " + cls, e);
|
||||
return null;
|
||||
|
||||
} else {
|
||||
|
||||
@@ -3,7 +3,6 @@ package io.ebeaninternal.server.core.bootup;
|
||||
import io.ebean.util.StringHelper;
|
||||
import io.ebeaninternal.api.CoreLog;
|
||||
import io.ebeaninternal.util.UrlHelper;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
@@ -15,12 +14,14 @@ import java.util.Set;
|
||||
import java.util.jar.Attributes;
|
||||
import java.util.jar.Manifest;
|
||||
|
||||
import static java.lang.System.Logger.Level.WARNING;
|
||||
|
||||
/**
|
||||
* Reads all the META-INF/ebean.mf resources with the package locations of entity beans.
|
||||
*/
|
||||
class ManifestReader {
|
||||
|
||||
private static final Logger log = CoreLog.internal;
|
||||
private static final System.Logger log = CoreLog.internal;
|
||||
|
||||
private final Set<String> packageSet = new HashSet<>();
|
||||
private final ClassLoader classLoader;
|
||||
@@ -55,7 +56,6 @@ class ManifestReader {
|
||||
* Read all the specific manifest files and return the set of packages containing type query beans.
|
||||
*/
|
||||
private Set<String> read(ClassLoader classLoader, String resourcePath) {
|
||||
|
||||
try {
|
||||
Enumeration<URL> resources = classLoader.getResources(resourcePath);
|
||||
while (resources.hasMoreElements()) {
|
||||
@@ -64,7 +64,7 @@ class ManifestReader {
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.warn("Error reading " + resourcePath + " manifest resources", e);
|
||||
log.log(WARNING, "Error reading " + resourcePath + " manifest resources", e);
|
||||
}
|
||||
return packageSet;
|
||||
}
|
||||
@@ -73,7 +73,6 @@ class ManifestReader {
|
||||
* Read the entity packages from the manifest.
|
||||
*/
|
||||
private void read(Manifest manifest) throws IOException {
|
||||
|
||||
Attributes attributes = manifest.getMainAttributes();
|
||||
String agentOnlyUse = attributes.getValue("agent-use-only");
|
||||
if (agentOnlyUse == null || !"true".equalsIgnoreCase(agentOnlyUse.trim())) {
|
||||
|
||||
@@ -61,7 +61,7 @@ abstract class AssocOneHelp {
|
||||
if (id == null) {
|
||||
return null;
|
||||
}
|
||||
PersistenceContext pc = ctx.getPersistenceContext();
|
||||
PersistenceContext pc = ctx.persistenceContext();
|
||||
Object existing = target.contextGet(pc, id);
|
||||
if (existing != null) {
|
||||
return existing;
|
||||
|
||||
+2
-2
@@ -22,7 +22,7 @@ final class AssocOneHelpRefExported extends AssocOneHelp {
|
||||
@Override
|
||||
void appendSelect(DbSqlContext ctx, boolean subQuery) {
|
||||
// set appropriate tableAlias for the exported id columns
|
||||
String relativePrefix = ctx.getRelativePrefix(property.name());
|
||||
String relativePrefix = ctx.relativePrefix(property.name());
|
||||
ctx.pushTableAlias(relativePrefix);
|
||||
property.targetIdBinder.appendSelect(ctx, subQuery);
|
||||
ctx.popTableAlias();
|
||||
@@ -30,7 +30,7 @@ final class AssocOneHelpRefExported extends AssocOneHelp {
|
||||
|
||||
@Override
|
||||
void appendFrom(DbSqlContext ctx, SqlJoinType joinType) {
|
||||
String relativePrefix = ctx.getRelativePrefix(property.name());
|
||||
String relativePrefix = ctx.relativePrefix(property.name());
|
||||
if (softDelete && !ctx.isIncludeSoftDelete()) {
|
||||
property.tableJoin.addJoin(joinType, relativePrefix, ctx, softDeletePredicate);
|
||||
} else {
|
||||
|
||||
@@ -22,7 +22,7 @@ final class AssocOneHelpRefInherit extends AssocOneHelp {
|
||||
@Override
|
||||
void loadIgnore(DbReadContext ctx) {
|
||||
property.targetIdBinder.loadIgnore(ctx);
|
||||
ctx.getDataReader().incrementPos(1);
|
||||
ctx.dataReader().incrementPos(1);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -47,7 +47,7 @@ final class AssocOneHelpRefInherit extends AssocOneHelp {
|
||||
return null;
|
||||
}
|
||||
// check transaction context to see if it already exists
|
||||
PersistenceContext pc = ctx.getPersistenceContext();
|
||||
PersistenceContext pc = ctx.persistenceContext();
|
||||
Object existing = desc.contextGet(pc, id);
|
||||
if (existing != null) {
|
||||
return existing;
|
||||
@@ -63,7 +63,7 @@ final class AssocOneHelpRefInherit extends AssocOneHelp {
|
||||
|
||||
void appendFrom(DbSqlContext ctx, SqlJoinType joinType) {
|
||||
// add join to support the discriminator column
|
||||
String relativePrefix = ctx.getRelativePrefix(property.name);
|
||||
String relativePrefix = ctx.relativePrefix(property.name);
|
||||
ctx.addExtraJoin(new Extra(relativePrefix, joinType));
|
||||
}
|
||||
|
||||
@@ -92,8 +92,8 @@ final class AssocOneHelpRefInherit extends AssocOneHelp {
|
||||
void appendSelect(DbSqlContext ctx, boolean subQuery) {
|
||||
if (!subQuery) {
|
||||
// add discriminator column
|
||||
String relativePrefix = ctx.getRelativePrefix(property.name());
|
||||
String tableAlias = ctx.getTableAlias(relativePrefix);
|
||||
String relativePrefix = ctx.relativePrefix(property.name());
|
||||
String tableAlias = ctx.tableAlias(relativePrefix);
|
||||
ctx.appendColumn(tableAlias, property.targetInheritInfo.getDiscriminatorColumn());
|
||||
}
|
||||
property.importedId.sqlAppend(ctx);
|
||||
|
||||
@@ -54,7 +54,6 @@ import io.ebeanservice.docstore.api.DocStoreUpdates;
|
||||
import io.ebeanservice.docstore.api.mapping.DocMappingBuilder;
|
||||
import io.ebeanservice.docstore.api.mapping.DocPropertyMapping;
|
||||
import io.ebeanservice.docstore.api.mapping.DocumentMapping;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
import java.io.IOException;
|
||||
@@ -68,13 +67,15 @@ import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static io.ebeaninternal.server.persist.DmlUtil.isNullOrZero;
|
||||
import static java.lang.System.Logger.Level.ERROR;
|
||||
import static java.lang.System.Logger.Level.INFO;
|
||||
|
||||
/**
|
||||
* Describes Beans including their deployment information.
|
||||
*/
|
||||
public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
|
||||
private static final Logger log = CoreLog.internal;
|
||||
private static final System.Logger log = CoreLog.internal;
|
||||
|
||||
public enum EntityType {
|
||||
ORM, EMBEDDED, VIEW, SQL, DOC
|
||||
@@ -494,9 +495,6 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
* as they are used to get the imported and exported properties.
|
||||
*/
|
||||
void initialiseId(BeanDescriptorInitContext initContext) {
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace("BeanDescriptor initialise " + fullName);
|
||||
}
|
||||
if (draftable) {
|
||||
initContext.addDraft(baseTable, draftTable);
|
||||
}
|
||||
@@ -795,7 +793,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
changeJson.flush();
|
||||
return beanChange(ChangeType.UPDATE, request.beanId(), changeJson.newJson(), changeJson.oldJson());
|
||||
} catch (RuntimeException e) {
|
||||
log.error("Failed to write ChangeLog entry for update", e);
|
||||
log.log(ERROR, "Failed to write ChangeLog entry for update", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -811,7 +809,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
jsonWriter.flush();
|
||||
return beanChange(ChangeType.INSERT, request.beanId(), writer.toString(), null);
|
||||
} catch (IOException e) {
|
||||
log.error("Failed to write ChangeLog entry for insert", e);
|
||||
log.log(ERROR, "Failed to write ChangeLog entry for insert", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1468,7 +1466,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
|
||||
void queryPlanInit(QueryPlanInit request, List<MetaQueryPlan> list) {
|
||||
for (CQueryPlan queryPlan : queryPlanCache.values()) {
|
||||
if (request.includeHash(queryPlan.getHash())) {
|
||||
if (request.includeHash(queryPlan.hash())) {
|
||||
queryPlan.queryPlanInit(request.thresholdMicros());
|
||||
list.add(queryPlan.createMeta(null, null));
|
||||
}
|
||||
@@ -1482,7 +1480,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
iudMetrics.visit(visitor);
|
||||
for (CQueryPlan queryPlan : queryPlanCache.values()) {
|
||||
if (!queryPlan.isEmptyStats()) {
|
||||
visitor.visitQuery(queryPlan.getSnapshot(visitor.reset()));
|
||||
visitor.visitQuery(queryPlan.visit(visitor));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1500,7 +1498,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
* Trim query plans not used since the passed in epoch time.
|
||||
*/
|
||||
void trimQueryPlans(long unusedSince) {
|
||||
queryPlanCache.values().removeIf(queryPlan -> queryPlan.getLastQueryTime() < unusedSince);
|
||||
queryPlanCache.values().removeIf(queryPlan -> queryPlan.lastQueryTime() < unusedSince);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2291,11 +2289,11 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
private ElComparator<T> createPropertyComparator(SortByClause.Property sortProp) {
|
||||
ElPropertyValue elGetValue = elGetValue(sortProp.getName());
|
||||
if (elGetValue == null) {
|
||||
log.error("Sort property [" + sortProp + "] not found in " + beanType + ". Cannot sort.");
|
||||
log.log(ERROR, "Sort property [" + sortProp + "] not found in " + beanType + ". Cannot sort.");
|
||||
return new ElComparatorNoop<>();
|
||||
}
|
||||
if (elGetValue.isAssocMany()) {
|
||||
log.error("Sort property [" + sortProp + "] in " + beanType + " is a many-property. Cannot sort.");
|
||||
log.log(ERROR, "Sort property [" + sortProp + "] in " + beanType + " is a many-property. Cannot sort.");
|
||||
return new ElComparatorNoop<>();
|
||||
}
|
||||
Boolean nullsHigh = sortProp.getNullsHigh();
|
||||
@@ -2771,7 +2769,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
public void markAsDeleted(EntityBean bean) {
|
||||
if (softDeleteProperty == null) {
|
||||
Object id = getId(bean);
|
||||
log.info("(Lazy) loading unsuccessful for type:{} id:{} - expecting when bean has been deleted", name(), id);
|
||||
log.log(INFO, "(Lazy) loading unsuccessful for type:{0} id:{1} - expecting when bean has been deleted", name(), id);
|
||||
bean._ebean_getIntercept().setLazyLoadFailure(id);
|
||||
} else {
|
||||
softDeleteValue(bean);
|
||||
|
||||
+74
-73
@@ -1,5 +1,6 @@
|
||||
package io.ebeaninternal.server.deploy;
|
||||
|
||||
import io.avaje.applog.AppLog;
|
||||
import io.ebean.bean.BeanCollection;
|
||||
import io.ebean.bean.EntityBean;
|
||||
import io.ebean.bean.EntityBeanIntercept;
|
||||
@@ -13,12 +14,12 @@ import io.ebeaninternal.server.core.CacheOptions;
|
||||
import io.ebeaninternal.server.core.PersistRequest;
|
||||
import io.ebeaninternal.server.core.PersistRequestBean;
|
||||
import io.ebeaninternal.server.transaction.DefaultPersistenceContext;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
import static java.lang.System.Logger.Level.*;
|
||||
|
||||
/**
|
||||
* Helper for BeanDescriptor that manages the bean, query and collection caches.
|
||||
*
|
||||
@@ -26,12 +27,12 @@ import java.util.*;
|
||||
*/
|
||||
final class BeanDescriptorCacheHelp<T> {
|
||||
|
||||
private static final Logger log = CoreLog.internal;
|
||||
private static final System.Logger log = CoreLog.internal;
|
||||
|
||||
private static final Logger queryLog = LoggerFactory.getLogger("io.ebean.cache.QUERY");
|
||||
private static final Logger beanLog = LoggerFactory.getLogger("io.ebean.cache.BEAN");
|
||||
private static final Logger manyLog = LoggerFactory.getLogger("io.ebean.cache.COLL");
|
||||
private static final Logger natLog = LoggerFactory.getLogger("io.ebean.cache.NATKEY");
|
||||
private static final System.Logger queryLog = AppLog.getLogger("io.ebean.cache.QUERY");
|
||||
private static final System.Logger beanLog = AppLog.getLogger("io.ebean.cache.BEAN");
|
||||
private static final System.Logger manyLog = AppLog.getLogger("io.ebean.cache.COLL");
|
||||
private static final System.Logger natLog = AppLog.getLogger("io.ebean.cache.NATKEY");
|
||||
|
||||
private final BeanDescriptor<T> desc;
|
||||
private final SpiCacheManager cacheManager;
|
||||
@@ -104,10 +105,10 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
void deriveNotifyFlags() {
|
||||
cacheNotifyOnAll = (invalidateQueryCache || beanCache != null || queryCache != null);
|
||||
cacheNotifyOnDelete = !cacheNotifyOnAll && isNotifyOnDeletes();
|
||||
if (log.isDebugEnabled()) {
|
||||
if (log.isLoggable(DEBUG)) {
|
||||
if (cacheNotifyOnAll || cacheNotifyOnDelete) {
|
||||
String notifyMode = cacheNotifyOnAll ? "All" : "Delete";
|
||||
log.debug("l2 caching on {} - beanCaching:{} queryCaching:{} notifyMode:{} ",
|
||||
log.log(DEBUG, "l2 caching on {0} - beanCaching:{1} queryCaching:{2} notifyMode:{3} ",
|
||||
desc.fullName(), isBeanCaching(), isQueryCaching(), notifyMode);
|
||||
}
|
||||
}
|
||||
@@ -178,8 +179,8 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
*/
|
||||
void queryCacheClear() {
|
||||
if (queryCache != null) {
|
||||
if (queryLog.isDebugEnabled()) {
|
||||
queryLog.debug(" CLEAR {}", cacheName);
|
||||
if (queryLog.isLoggable(DEBUG)) {
|
||||
queryLog.log(DEBUG, " CLEAR {0}", cacheName);
|
||||
}
|
||||
queryCache.clear();
|
||||
}
|
||||
@@ -202,11 +203,11 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
throw new IllegalStateException("No query cache enabled on " + desc + ". Need explicit @Cache(enableQueryCache=true)");
|
||||
}
|
||||
Object queryResult = queryCache.get(id);
|
||||
if (queryLog.isDebugEnabled()) {
|
||||
if (queryLog.isLoggable(DEBUG)) {
|
||||
if (queryResult == null) {
|
||||
queryLog.debug(" GET {}({}) - cache miss", cacheName, id);
|
||||
queryLog.log(DEBUG, " GET {0}({1}) - cache miss", cacheName, id);
|
||||
} else {
|
||||
queryLog.debug(" GET {}({}) - hit", cacheName, id);
|
||||
queryLog.log(DEBUG, " GET {0}({1}) - hit", cacheName, id);
|
||||
}
|
||||
}
|
||||
return queryResult;
|
||||
@@ -219,8 +220,8 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
if (queryCache == null) {
|
||||
throw new IllegalStateException("No query cache enabled on " + desc + ". Need explicit @Cache(enableQueryCache=true)");
|
||||
}
|
||||
if (queryLog.isDebugEnabled()) {
|
||||
queryLog.debug(" PUT {}({})", cacheName, id);
|
||||
if (queryLog.isLoggable(DEBUG)) {
|
||||
queryLog.log(DEBUG, " PUT {0}({1})", cacheName, id);
|
||||
}
|
||||
queryCache.put(id, entry);
|
||||
}
|
||||
@@ -228,16 +229,16 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
|
||||
void manyPropRemove(String propertyName, Object parentId) {
|
||||
ServerCache collectionIdsCache = cacheManager.getCollectionIdsCache(beanType, propertyName);
|
||||
if (manyLog.isTraceEnabled()) {
|
||||
manyLog.trace(" REMOVE {}({}).{}", cacheName, parentId, propertyName);
|
||||
if (manyLog.isLoggable(TRACE)) {
|
||||
manyLog.log(TRACE, " REMOVE {0}({1}).{2}", cacheName, parentId, propertyName);
|
||||
}
|
||||
collectionIdsCache.remove(parentId);
|
||||
}
|
||||
|
||||
void manyPropClear(String propertyName) {
|
||||
ServerCache collectionIdsCache = cacheManager.getCollectionIdsCache(beanType, propertyName);
|
||||
if (manyLog.isDebugEnabled()) {
|
||||
manyLog.debug(" CLEAR {}(*).{} ", cacheName, propertyName);
|
||||
if (manyLog.isLoggable(DEBUG)) {
|
||||
manyLog.log(DEBUG, " CLEAR {0}(*).{1} ", cacheName, propertyName);
|
||||
}
|
||||
collectionIdsCache.clear();
|
||||
}
|
||||
@@ -249,11 +250,11 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
ServerCache collectionIdsCache = cacheManager.getCollectionIdsCache(beanType, propertyName);
|
||||
CachedManyIds entry = (CachedManyIds) collectionIdsCache.get(parentId);
|
||||
if (entry == null) {
|
||||
if (manyLog.isTraceEnabled()) {
|
||||
manyLog.trace(" GET {}({}).{} - cache miss", cacheName, parentId, propertyName);
|
||||
if (manyLog.isLoggable(TRACE)) {
|
||||
manyLog.log(TRACE, " GET {0}({1}).{2} - cache miss", cacheName, parentId, propertyName);
|
||||
}
|
||||
} else if (manyLog.isDebugEnabled()) {
|
||||
manyLog.debug(" GET {}({}).{} - hit", cacheName, parentId, propertyName);
|
||||
} else if (manyLog.isLoggable(DEBUG)) {
|
||||
manyLog.log(DEBUG, " GET {0}({1}).{2} - hit", cacheName, parentId, propertyName);
|
||||
}
|
||||
return entry;
|
||||
}
|
||||
@@ -303,12 +304,12 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
changes.put(many.name(), asJson);
|
||||
|
||||
CachedBeanData newData = data.update(changes, data.getVersion());
|
||||
if (beanLog.isDebugEnabled()) {
|
||||
beanLog.debug(" UPDATE {}({}) changes:{}", cacheName, parentId, changes);
|
||||
if (beanLog.isLoggable(DEBUG)) {
|
||||
beanLog.log(DEBUG, " UPDATE {0}({1}) changes:{2}", cacheName, parentId, changes);
|
||||
}
|
||||
beanCache.put(parentId, newData);
|
||||
} catch (IOException e) {
|
||||
log.error("Error updating L2 cache", e);
|
||||
log.log(ERROR, "Error updating L2 cache", e);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -321,8 +322,8 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
|
||||
void cachePutManyIds(Object parentId, String manyName, CachedManyIds entry) {
|
||||
ServerCache collectionIdsCache = cacheManager.getCollectionIdsCache(beanType, manyName);
|
||||
if (manyLog.isDebugEnabled()) {
|
||||
manyLog.debug(" PUT {}({}).{} - ids:{}", cacheName, parentId, manyName, entry);
|
||||
if (manyLog.isLoggable(DEBUG)) {
|
||||
manyLog.log(DEBUG, " PUT {0}({1}).{2} - ids:{3}", cacheName, parentId, manyName, entry);
|
||||
}
|
||||
collectionIdsCache.put(parentId, entry);
|
||||
}
|
||||
@@ -353,8 +354,8 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
return new BeanCacheResult<>();
|
||||
}
|
||||
Map<Object, Object> beanDataMap = beanCache.getAll(keys);
|
||||
if (beanLog.isTraceEnabled()) {
|
||||
beanLog.trace(" MGET {}({}) - hits:{}", cacheName, ids, beanDataMap.keySet());
|
||||
if (beanLog.isLoggable(TRACE)) {
|
||||
beanLog.log(TRACE, " MGET {0}({1}) - hits:{2}", cacheName, ids, beanDataMap.keySet());
|
||||
}
|
||||
BeanCacheResult<T> result = new BeanCacheResult<>();
|
||||
for (Map.Entry<Object, Object> entry : beanDataMap.entrySet()) {
|
||||
@@ -375,8 +376,8 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
|
||||
// naturalKey -> Id map
|
||||
Map<Object, Object> naturalKeyMap = naturalKeyCache.getAll(keys);
|
||||
if (natLog.isTraceEnabled()) {
|
||||
natLog.trace(" MLOOKUP {}({}) - hits:{}", cacheName, keys, naturalKeyMap);
|
||||
if (natLog.isLoggable(TRACE)) {
|
||||
natLog.log(TRACE, " MLOOKUP {0}({1}) - hits:{2}", cacheName, keys, naturalKeyMap);
|
||||
}
|
||||
|
||||
BeanCacheResult<T> result = new BeanCacheResult<>();
|
||||
@@ -392,8 +393,8 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
|
||||
Set<Object> ids = new HashSet<>(naturalKeyMap.values());
|
||||
Map<Object, Object> beanDataMap = beanCache.getAll(ids);
|
||||
if (beanLog.isTraceEnabled()) {
|
||||
beanLog.trace(" MGET {}({}) - hits:{}", cacheName, ids, beanDataMap.keySet());
|
||||
if (beanLog.isLoggable(TRACE)) {
|
||||
beanLog.log(TRACE, " MGET {0}({1}) - hits:{2}", cacheName, ids, beanDataMap.keySet());
|
||||
}
|
||||
// process the hits into beans etc
|
||||
for (Map.Entry<Object, Object> entry : beanDataMap.entrySet()) {
|
||||
@@ -437,8 +438,8 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
*/
|
||||
void beanCacheClear() {
|
||||
if (beanCache != null) {
|
||||
if (beanLog.isDebugEnabled()) {
|
||||
beanLog.debug(" CLEAR {}", cacheName);
|
||||
if (beanLog.isLoggable(DEBUG)) {
|
||||
beanLog.log(DEBUG, " CLEAR {0}", cacheName);
|
||||
}
|
||||
beanCache.clear();
|
||||
}
|
||||
@@ -507,14 +508,14 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (beanLog.isDebugEnabled()) {
|
||||
beanLog.debug(" MPUT {}({})", cacheName, map.keySet());
|
||||
if (beanLog.isLoggable(DEBUG)) {
|
||||
beanLog.log(DEBUG, " MPUT {0}({1})", cacheName, map.keySet());
|
||||
}
|
||||
getBeanCache().putAll(map);
|
||||
|
||||
if (natKeys != null && !natKeys.isEmpty()) {
|
||||
if (natLog.isDebugEnabled()) {
|
||||
natLog.debug(" MPUT {}({}, {})", cacheName, naturalKey, natKeys.keySet());
|
||||
if (natLog.isLoggable(DEBUG)) {
|
||||
natLog.log(DEBUG, " MPUT {0}({1}, {2})", cacheName, naturalKey, natKeys.keySet());
|
||||
}
|
||||
naturalKeyCache.putAll(natKeys);
|
||||
}
|
||||
@@ -526,15 +527,15 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
void beanCachePutDirect(EntityBean bean) {
|
||||
CachedBeanData beanData = beanExtractData(desc, bean);
|
||||
String key = desc.cacheKeyForBean(bean);
|
||||
if (beanLog.isDebugEnabled()) {
|
||||
beanLog.debug(" PUT {}({}) data:{}", cacheName, key, beanData);
|
||||
if (beanLog.isLoggable(DEBUG)) {
|
||||
beanLog.log(DEBUG, " PUT {0}({1}) data:{2}", cacheName, key, beanData);
|
||||
}
|
||||
getBeanCache().put(key, beanData);
|
||||
if (naturalKey != null) {
|
||||
String naturalKey = calculateNaturalKey(beanData);
|
||||
if (naturalKey != null) {
|
||||
if (natLog.isDebugEnabled()) {
|
||||
natLog.debug(" PUT {}({}, {})", cacheName, naturalKey, key);
|
||||
if (natLog.isLoggable(DEBUG)) {
|
||||
natLog.log(DEBUG, " PUT {0}({1}, {2})", cacheName, naturalKey, key);
|
||||
}
|
||||
naturalKeyCache.put(naturalKey, key);
|
||||
}
|
||||
@@ -575,13 +576,13 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
private T beanCacheGetInternal(String key, Boolean readOnly, PersistenceContext context) {
|
||||
CachedBeanData data = (CachedBeanData) getBeanCache().get(key);
|
||||
if (data == null) {
|
||||
if (beanLog.isTraceEnabled()) {
|
||||
beanLog.trace(" GET {}({}) - cache miss", cacheName, key);
|
||||
if (beanLog.isLoggable(TRACE)) {
|
||||
beanLog.log(TRACE, " GET {0}({1}) - cache miss", cacheName, key);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
if (beanLog.isTraceEnabled()) {
|
||||
beanLog.trace(" GET {}({}) - hit", cacheName, key);
|
||||
if (beanLog.isLoggable(TRACE)) {
|
||||
beanLog.log(TRACE, " GET {0}({1}) - hit", cacheName, key);
|
||||
}
|
||||
return convertToBean(key, readOnly, context, data);
|
||||
}
|
||||
@@ -591,8 +592,8 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
if (cacheSharableBeans && !Boolean.FALSE.equals(readOnly)) {
|
||||
Object bean = data.getSharableBean();
|
||||
if (bean != null) {
|
||||
if (beanLog.isTraceEnabled()) {
|
||||
beanLog.trace(" GET {}({}) - hit shared bean", cacheName, id);
|
||||
if (beanLog.isLoggable(TRACE)) {
|
||||
beanLog.log(TRACE, " GET {0}({1}) - hit shared bean", cacheName, id);
|
||||
}
|
||||
if (desc.isReadAuditing()) {
|
||||
desc.readAuditBean("l2", "", bean);
|
||||
@@ -680,8 +681,8 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
*/
|
||||
void beanCacheApplyInvalidate(Collection<String> keys) {
|
||||
if (beanCache != null) {
|
||||
if (beanLog.isDebugEnabled()) {
|
||||
beanLog.debug(" MREMOVE {}({})", cacheName, keys);
|
||||
if (beanLog.isLoggable(DEBUG)) {
|
||||
beanLog.log(DEBUG, " MREMOVE {0}({1})", cacheName, keys);
|
||||
}
|
||||
beanCache.removeAll(new HashSet<>(keys));
|
||||
}
|
||||
@@ -700,8 +701,8 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
}
|
||||
|
||||
Map<Object, Object> hits = getBeanCache().getAll(ebis.keySet());
|
||||
if (beanLog.isTraceEnabled()) {
|
||||
beanLog.trace(" MLOAD {}({}) - got hits ({})", cacheName, ebis.keySet(), hits.size());
|
||||
if (beanLog.isLoggable(TRACE)) {
|
||||
beanLog.log(TRACE, " MLOAD {0}({1}) - got hits ({2})", cacheName, ebis.keySet(), hits.size());
|
||||
}
|
||||
|
||||
Set<EntityBeanIntercept> loaded = new HashSet<>();
|
||||
@@ -713,19 +714,19 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
CachedBeanData cacheData = (CachedBeanData) hit.getValue();
|
||||
|
||||
if (lazyLoadProperty > -1 && !cacheData.isLoaded(propertyName)) {
|
||||
if (beanLog.isTraceEnabled()) {
|
||||
beanLog.trace(" load {}({}) - cache miss on property({})", cacheName, key, propertyName);
|
||||
if (beanLog.isLoggable(TRACE)) {
|
||||
beanLog.log(TRACE, " load {0}({1}) - cache miss on property({2})", cacheName, key, propertyName);
|
||||
}
|
||||
} else {
|
||||
CachedBeanDataToBean.load(desc, ebi.getOwner(), cacheData, context);
|
||||
loaded.add(ebi);
|
||||
if (beanLog.isDebugEnabled()) {
|
||||
beanLog.debug(" load {}({}) - hit", cacheName, key);
|
||||
if (beanLog.isLoggable(DEBUG)) {
|
||||
beanLog.log(DEBUG, " load {0}({1}) - hit", cacheName, key);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!ebis.isEmpty() && beanLog.isTraceEnabled()) {
|
||||
beanLog.trace(" load {}({}) - cache miss", cacheName, ebis.keySet());
|
||||
if (!ebis.isEmpty() && beanLog.isLoggable(TRACE)) {
|
||||
beanLog.log(TRACE, " load {0}({1}) - cache miss", cacheName, ebis.keySet());
|
||||
}
|
||||
return loaded;
|
||||
}
|
||||
@@ -736,21 +737,21 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
boolean beanCacheLoad(EntityBean bean, EntityBeanIntercept ebi, String key, PersistenceContext context) {
|
||||
CachedBeanData cacheData = (CachedBeanData) getBeanCache().get(key);
|
||||
if (cacheData == null) {
|
||||
if (beanLog.isTraceEnabled()) {
|
||||
beanLog.trace(" LOAD {}({}) - cache miss", cacheName, key);
|
||||
if (beanLog.isLoggable(TRACE)) {
|
||||
beanLog.log(TRACE, " LOAD {0}({1}) - cache miss", cacheName, key);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
int lazyLoadProperty = ebi.getLazyLoadPropertyIndex();
|
||||
if (lazyLoadProperty > -1 && !cacheData.isLoaded(ebi.getLazyLoadProperty())) {
|
||||
if (beanLog.isTraceEnabled()) {
|
||||
beanLog.trace(" LOAD {}({}) - cache miss on property({})", cacheName, key, ebi.getLazyLoadProperty());
|
||||
if (beanLog.isLoggable(TRACE)) {
|
||||
beanLog.log(TRACE, " LOAD {0}({1}) - cache miss on property({2})", cacheName, key, ebi.getLazyLoadProperty());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
CachedBeanDataToBean.load(desc, bean, cacheData, context);
|
||||
if (beanLog.isDebugEnabled()) {
|
||||
beanLog.debug(" LOAD {}({}) - hit", cacheName, key);
|
||||
if (beanLog.isLoggable(DEBUG)) {
|
||||
beanLog.log(DEBUG, " LOAD {0}({1}) - hit", cacheName, key);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -874,8 +875,8 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
if (existingData != null) {
|
||||
long currentVersion = existingData.getVersion();
|
||||
if (version > 0 && version < currentVersion) {
|
||||
if (beanLog.isDebugEnabled()) {
|
||||
beanLog.debug(" REMOVE {}({}) - version conflict old:{} new:{}", cacheName, key, currentVersion, version);
|
||||
if (beanLog.isLoggable(DEBUG)) {
|
||||
beanLog.log(DEBUG, " REMOVE {0}({1}) - version conflict old:{2} new:{3}", cacheName, key, currentVersion, version);
|
||||
}
|
||||
cache.remove(key);
|
||||
} else {
|
||||
@@ -883,16 +884,16 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
version = currentVersion;
|
||||
}
|
||||
CachedBeanData newData = existingData.update(changes, version);
|
||||
if (beanLog.isDebugEnabled()) {
|
||||
beanLog.debug(" UPDATE {}({}) changes:{}", cacheName, key, changes);
|
||||
if (beanLog.isLoggable(DEBUG)) {
|
||||
beanLog.log(DEBUG, " UPDATE {0}({1}) changes:{2}", cacheName, key, changes);
|
||||
}
|
||||
cache.put(key, newData);
|
||||
}
|
||||
if (updateNaturalKey) {
|
||||
Object oldKey = calculateNaturalKey(existingData);
|
||||
if (oldKey != null) {
|
||||
if (natLog.isDebugEnabled()) {
|
||||
natLog.debug(".. update {} REMOVE({}) - old key for ({})", cacheName, oldKey, key);
|
||||
if (natLog.isLoggable(DEBUG)) {
|
||||
natLog.log(DEBUG, ".. update {0} REMOVE({1}) - old key for ({2})", cacheName, oldKey, key);
|
||||
}
|
||||
naturalKeyCache.remove(oldKey);
|
||||
}
|
||||
|
||||
+18
-17
@@ -41,7 +41,6 @@ import io.ebeaninternal.xmapping.api.XmapNamedQuery;
|
||||
import io.ebeaninternal.xmapping.api.XmapRawSql;
|
||||
import io.ebeanservice.docstore.api.DocStoreBeanAdapter;
|
||||
import io.ebeanservice.docstore.api.DocStoreFactory;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import javax.persistence.MappedSuperclass;
|
||||
import javax.persistence.PersistenceException;
|
||||
@@ -53,12 +52,14 @@ import java.lang.reflect.Modifier;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static java.lang.System.Logger.Level.*;
|
||||
|
||||
/**
|
||||
* Creates BeanDescriptors.
|
||||
*/
|
||||
public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTypeManager {
|
||||
|
||||
private static final Logger log = CoreLog.internal;
|
||||
private static final System.Logger log = CoreLog.internal;
|
||||
|
||||
private static final BeanDescComparator beanDescComparator = new BeanDescComparator();
|
||||
public static final String JAVA_LANG_RECORD = "java.lang.Record";
|
||||
@@ -309,7 +310,7 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy
|
||||
} catch (BeanNotEnhancedException e) {
|
||||
throw e;
|
||||
} catch (RuntimeException e) {
|
||||
log.error("Error in deployment", e);
|
||||
log.log(ERROR, "Error in deployment", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
@@ -332,13 +333,13 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy
|
||||
try {
|
||||
entityClass = Class.forName(entityClassName, false, classLoader);
|
||||
} catch (Exception e) {
|
||||
log.error("Could not load entity bean class " + entityClassName + " for ebean.xml entry");
|
||||
log.log(ERROR, "Could not load entity bean class " + entityClassName + " for ebean.xml entry");
|
||||
return;
|
||||
}
|
||||
|
||||
DeployBeanInfo<?> info = deployInfoMap.get(entityClass);
|
||||
if (info == null) {
|
||||
log.error("No entity bean for ebean.xml entry " + entityClassName);
|
||||
log.log(ERROR, "No entity bean for ebean.xml entry " + entityClassName);
|
||||
|
||||
} else {
|
||||
for (XmapRawSql sql : entityDeploy.getRawSql()) {
|
||||
@@ -578,8 +579,8 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy
|
||||
}
|
||||
|
||||
private <T> String errNothingRegistered() {
|
||||
return "There are no registered entities. If using query beans, that generates _Ebean$ModuleInfo.java into " +
|
||||
"generated sources and is service loaded. If using module-info.java, then probably missing 'provides io.ebean.config.ModuleInfoLoader with _Ebean$ModuleInfo' clause.";
|
||||
return "There are no registered entities. If using query beans, that generates EbeanEntityRegister.java into " +
|
||||
"generated sources and is service loaded. If using module-info.java, then probably missing 'provides io.ebean.config.EntityClassRegister with EbeanEntityRegister' clause.";
|
||||
}
|
||||
|
||||
private String errNotRegistered(Class<?> beanClass) {
|
||||
@@ -601,11 +602,11 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy
|
||||
int pc = postConstructManager.getRegisterCount();
|
||||
int lc = persistListenerManager.getRegisterCount();
|
||||
int fc = beanFinderManager.getRegisterCount();
|
||||
log.debug("BeanPersistControllers[{}] BeanFinders[{}] BeanPersistListeners[{}] BeanQueryAdapters[{}] BeanPostLoaders[{}] BeanPostConstructors[{}]", cc, fc, lc, qa, pl, pc);
|
||||
log.log(DEBUG, "BeanPersistControllers[{0}] BeanFinders[{1}] BeanPersistListeners[{2}] BeanQueryAdapters[{3}] BeanPostLoaders[{4}] BeanPostConstructors[{5}]", cc, fc, lc, qa, pl, pc);
|
||||
}
|
||||
|
||||
private void logStatus() {
|
||||
log.debug("Entities[{}]", entityBeanCount);
|
||||
log.log(DEBUG, "Entities[{0}]", entityBeanCount);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -865,13 +866,13 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy
|
||||
for (String possibleMappedBy : matchSet) {
|
||||
String possibleLower = possibleMappedBy.toLowerCase();
|
||||
if (possibleLower.contains(searchName)) {
|
||||
// we have a match..
|
||||
// we have a match
|
||||
prop.setMappedBy(possibleMappedBy);
|
||||
|
||||
String m = "Implicitly found mappedBy for " + targetDesc + "." + prop;
|
||||
m += " by searching for [" + searchName + "] against " + matchSet;
|
||||
log.debug(m);
|
||||
|
||||
if (log.isLoggable(DEBUG)) {
|
||||
String m = "Implicitly found mappedBy for " + targetDesc + "." + prop;
|
||||
m += " by searching for [" + searchName + "] against " + matchSet;
|
||||
log.log(DEBUG, m);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1207,12 +1208,12 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy
|
||||
final DeployIdentityMode identityMode = desc.getIdentityMode();
|
||||
if (identityMode.isSequence() && !dbIdentity.isSupportsSequence()) {
|
||||
// explicit sequence but not supported by the DatabasePlatform
|
||||
log.info("Explicit sequence on " + desc.getFullName() + " but not supported by DB Platform - ignored");
|
||||
log.log(INFO, "Explicit sequence on {0} but not supported by DB Platform - ignored", desc.getFullName());
|
||||
identityMode.setIdType(IdType.AUTO);
|
||||
}
|
||||
if (identityMode.isIdentity() && !dbIdentity.isSupportsIdentity()) {
|
||||
// explicit identity but not supported by the DatabasePlatform
|
||||
log.info("Explicit Identity on " + desc.getFullName() + " but not supported by DB Platform - ignored");
|
||||
log.log(INFO, "Explicit Identity on {0} but not supported by DB Platform - ignored", desc.getFullName());
|
||||
identityMode.setIdType(IdType.AUTO);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,16 +4,17 @@ import io.ebean.event.BeanFindController;
|
||||
import io.ebeaninternal.api.CoreLog;
|
||||
import io.ebeaninternal.server.core.bootup.BootupClasses;
|
||||
import io.ebeaninternal.server.deploy.meta.DeployBeanDescriptor;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static java.lang.System.Logger.Level.DEBUG;
|
||||
|
||||
/**
|
||||
* Default implementation for BeanFinderFactory.
|
||||
*/
|
||||
final class BeanFinderManager {
|
||||
|
||||
private static final Logger log = CoreLog.internal;
|
||||
private static final System.Logger log = CoreLog.internal;
|
||||
|
||||
private final List<BeanFindController> list;
|
||||
|
||||
@@ -31,7 +32,7 @@ final class BeanFinderManager {
|
||||
void addFindControllers(DeployBeanDescriptor<?> deployDesc) {
|
||||
for (BeanFindController c : list) {
|
||||
if (c.isRegisterFor(deployDesc.getBeanType())) {
|
||||
log.debug("BeanFindController on[{}] {}", deployDesc.getFullName(), c.getClass().getName());
|
||||
log.log(DEBUG, "BeanFindController on[{0}] {1}", deployDesc.getFullName(), c.getClass().getName());
|
||||
deployDesc.setBeanFinder(c);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,6 +51,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import static java.lang.System.Logger.Level.ERROR;
|
||||
|
||||
/**
|
||||
* Description of a property of a bean. Includes its deployment information such
|
||||
* as database column mapping information.
|
||||
@@ -455,7 +457,7 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
|
||||
if (formula && sqlFormulaJoin != null) {
|
||||
ctx.appendFormulaJoin(sqlFormulaJoin, joinType, manyWhere);
|
||||
} else if (secondaryTableJoin != null) {
|
||||
String relativePrefix = ctx.getRelativePrefix(secondaryTableJoinPrefix);
|
||||
String relativePrefix = ctx.relativePrefix(secondaryTableJoinPrefix);
|
||||
secondaryTableJoin.addJoin(joinType, relativePrefix, ctx);
|
||||
}
|
||||
}
|
||||
@@ -481,7 +483,7 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
|
||||
ctx.appendFormulaSelect(sqlFormulaSelect);
|
||||
} else if (!isTransient && !ignoreDraftOnlyProperty(ctx.isDraftQuery())) {
|
||||
if (secondaryTableJoin != null) {
|
||||
ctx.pushTableAlias(ctx.getRelativePrefix(secondaryTableJoinPrefix));
|
||||
ctx.pushTableAlias(ctx.relativePrefix(secondaryTableJoinPrefix));
|
||||
}
|
||||
if (dbEncrypted) {
|
||||
ctx.appendRawColumn(decryptSqlWithColumnAlias(ctx.peekTableAlias()));
|
||||
@@ -506,7 +508,7 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
|
||||
|
||||
@Override
|
||||
public void loadIgnore(DbReadContext ctx) {
|
||||
scalarType.loadIgnore(ctx.getDataReader());
|
||||
scalarType.loadIgnore(ctx.dataReader());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -541,11 +543,11 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
|
||||
}
|
||||
|
||||
public Object read(DbReadContext ctx) throws SQLException {
|
||||
return scalarType.read(ctx.getDataReader());
|
||||
return scalarType.read(ctx.dataReader());
|
||||
}
|
||||
|
||||
public Object readSet(DbReadContext ctx, EntityBean bean) throws SQLException {
|
||||
return readSet(ctx.getDataReader(), bean);
|
||||
return readSet(ctx.dataReader(), bean);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -1433,7 +1435,7 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
|
||||
objValue = null;
|
||||
String msg = "Error trying to use Jackson ObjectMapper to read transient property "
|
||||
+ fullName() + " - consider marking this property with @JsonIgnore";
|
||||
CoreLog.log.error(msg, e);
|
||||
CoreLog.log.log(ERROR, msg, e);
|
||||
}
|
||||
}
|
||||
if (jsonDeserialize) {
|
||||
|
||||
@@ -30,6 +30,8 @@ import javax.persistence.PersistenceException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static java.lang.System.Logger.Level.ERROR;
|
||||
|
||||
/**
|
||||
* Abstract base for properties mapped to an associated bean, list, set or map.
|
||||
*/
|
||||
@@ -432,7 +434,7 @@ public abstract class BeanPropertyAssoc<T> extends BeanProperty implements STree
|
||||
if (!idProp.isEmbedded()) {
|
||||
// simple single scalar id
|
||||
if (cols.length != 1) {
|
||||
CoreLog.log.error("No Imported Id column for [" + idProp + "] in table [" + join.getTable() + "]");
|
||||
CoreLog.log.log(ERROR, "No Imported Id column for [" + idProp + "] in table [" + join.getTable() + "]");
|
||||
return null;
|
||||
} else {
|
||||
BeanProperty[] idProps = {idProp};
|
||||
|
||||
@@ -26,6 +26,8 @@ import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
import java.util.*;
|
||||
|
||||
import static java.lang.System.Logger.Level.ERROR;
|
||||
|
||||
/**
|
||||
* Property mapped to a List Set or Map.
|
||||
*/
|
||||
@@ -326,7 +328,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
|
||||
*/
|
||||
@Override
|
||||
public void lazyLoadMany(EntityBean current) {
|
||||
EntityBean parentBean = childMasterProperty.getValueAsEntityBean(current);
|
||||
EntityBean parentBean = childMasterProperty.valueAsEntityBean(current);
|
||||
if (parentBean != null) {
|
||||
addBeanToCollectionWithCreate(parentBean, current, true);
|
||||
}
|
||||
@@ -667,7 +669,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
|
||||
}
|
||||
} catch (PersistenceException e) {
|
||||
// not found as individual scalar properties
|
||||
CoreLog.log.error("Could not find a exported property?", e);
|
||||
CoreLog.log.log(ERROR, "Could not find a exported property?", e);
|
||||
}
|
||||
} else {
|
||||
if (idProp != null) {
|
||||
@@ -962,7 +964,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
|
||||
setValue(bean, collection);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
CoreLog.log.error("Error setting value from L2 cache", e);
|
||||
CoreLog.log.log(ERROR, "Error setting value from L2 cache", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -975,7 +977,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
|
||||
}
|
||||
return jsonWriteCollection(collection);
|
||||
} catch (Exception e) {
|
||||
CoreLog.log.error("Error building value element collection json for L2 cache", e);
|
||||
CoreLog.log.log(ERROR, "Error building value element collection json for L2 cache", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
|
||||
* Return the property value as an entity bean.
|
||||
*/
|
||||
@Override
|
||||
public EntityBean getValueAsEntityBean(EntityBean owner) {
|
||||
public EntityBean valueAsEntityBean(EntityBean owner) {
|
||||
return (EntityBean) getValue(owner);
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -7,6 +7,8 @@ import io.ebeaninternal.server.deploy.meta.DeployBeanDescriptor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static java.lang.System.Logger.Level.DEBUG;
|
||||
|
||||
/**
|
||||
* Default implementation for creating BeanControllers.
|
||||
*/
|
||||
@@ -28,7 +30,7 @@ final class BeanQueryAdapterManager {
|
||||
void addQueryAdapter(DeployBeanDescriptor<?> deployDesc) {
|
||||
for (BeanQueryAdapter c : list) {
|
||||
if (c.isRegisterFor(deployDesc.getBeanType())) {
|
||||
CoreLog.internal.debug("BeanQueryAdapter on[{}] {}", deployDesc.getFullName(), c.getClass().getName());
|
||||
CoreLog.internal.log(DEBUG, "BeanQueryAdapter on[{0}] {1}", deployDesc.getFullName(), c.getClass().getName());
|
||||
deployDesc.addQueryAdapter(c);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ import io.ebeaninternal.server.deploy.meta.DeployBeanTable;
|
||||
import io.ebeaninternal.server.deploy.meta.DeployTableJoin;
|
||||
import io.ebeaninternal.server.deploy.meta.DeployTableJoinColumn;
|
||||
|
||||
import static java.lang.System.Logger.Level.DEBUG;
|
||||
|
||||
|
||||
/**
|
||||
* Used for associated beans in place of a BeanDescriptor. This is done to avoid
|
||||
@@ -105,7 +107,7 @@ public final class BeanTable {
|
||||
if (complexKey) {
|
||||
// just to copy the column name rather than prefix with the foreignKeyPrefix.
|
||||
// I think that with complex keys this is the more common approach.
|
||||
CoreLog.internal.debug("On table[{}] foreign key column [{}]", baseTable, lc);
|
||||
CoreLog.internal.log(DEBUG, "On table[{0}] foreign key column [{1}]", baseTable, lc);
|
||||
fk = lc;
|
||||
}
|
||||
if (sqlFormulaSelect != null) {
|
||||
|
||||
@@ -27,7 +27,7 @@ public interface DbReadContext {
|
||||
/**
|
||||
* Return the DataReader.
|
||||
*/
|
||||
DataReader getDataReader();
|
||||
DataReader dataReader();
|
||||
|
||||
/**
|
||||
* Return true if the query is using supplied SQL rather than generated SQL.
|
||||
@@ -52,7 +52,7 @@ public interface DbReadContext {
|
||||
/**
|
||||
* Return the persistence context.
|
||||
*/
|
||||
PersistenceContext getPersistenceContext();
|
||||
PersistenceContext persistenceContext();
|
||||
|
||||
/**
|
||||
* Register a reference for lazy loading.
|
||||
@@ -69,7 +69,6 @@ public interface DbReadContext {
|
||||
*/
|
||||
void register(BeanPropertyAssocMany<?> many, BeanCollection<?> bc);
|
||||
|
||||
|
||||
/**
|
||||
* Set back the bean that has just been loaded with its id.
|
||||
*/
|
||||
@@ -78,7 +77,7 @@ public interface DbReadContext {
|
||||
/**
|
||||
* Return the query mode.
|
||||
*/
|
||||
SpiQuery.Mode getQueryMode();
|
||||
SpiQuery.Mode queryMode();
|
||||
|
||||
/**
|
||||
* Return true if the underlying query is a 'asDraft' query.
|
||||
|
||||
@@ -31,7 +31,7 @@ public interface DbSqlContext {
|
||||
/**
|
||||
* Return a list of encrypted properties which require additional binding.
|
||||
*/
|
||||
BeanProperty[] getEncryptedProps();
|
||||
BeanProperty[] encryptedProps();
|
||||
|
||||
/**
|
||||
* Append a string directly to the SQL buffer.
|
||||
@@ -83,7 +83,7 @@ public interface DbSqlContext {
|
||||
/**
|
||||
* Return the current context of the sql context.
|
||||
*/
|
||||
String getContent();
|
||||
String content();
|
||||
|
||||
/**
|
||||
* Push a join node onto the stack.
|
||||
@@ -99,14 +99,14 @@ public interface DbSqlContext {
|
||||
* Return a table alias without many where clause joins. Typically this is for
|
||||
* the select clause (fetch joins).
|
||||
*/
|
||||
String getTableAlias(String prefix);
|
||||
String tableAlias(String prefix);
|
||||
|
||||
/**
|
||||
* Return a table alias that takes into account many where joins.
|
||||
*/
|
||||
String getTableAliasManyWhere(String prefix);
|
||||
String tableAliasManyWhere(String prefix);
|
||||
|
||||
String getRelativePrefix(String propName);
|
||||
String relativePrefix(String propName);
|
||||
|
||||
/**
|
||||
* Append the lower and upper bound columns into the select clause
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ class DynamicPropertyAggregationFormula extends DynamicPropertyBase {
|
||||
public void load(SqlBeanLoad sqlBeanLoad) {
|
||||
Object value;
|
||||
try {
|
||||
value = scalarType.read(sqlBeanLoad.ctx().getDataReader());
|
||||
value = scalarType.read(sqlBeanLoad.ctx().dataReader());
|
||||
} catch (Exception e) {
|
||||
sqlBeanLoad.ctx().handleLoadError(fullName, e);
|
||||
return;
|
||||
|
||||
@@ -65,7 +65,7 @@ abstract class DynamicPropertyBase implements STreeProperty {
|
||||
|
||||
@Override
|
||||
public void loadIgnore(DbReadContext ctx) {
|
||||
scalarType.loadIgnore(ctx.getDataReader());
|
||||
scalarType.loadIgnore(ctx.dataReader());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -197,7 +197,7 @@ public final class InheritInfo {
|
||||
* Return the associated InheritInfo for this DB row read.
|
||||
*/
|
||||
public InheritInfo readType(DbReadContext ctx) throws SQLException {
|
||||
return readType(ctx.getDataReader().getString());
|
||||
return readType(ctx.dataReader().getString());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+3
-1
@@ -7,6 +7,8 @@ import io.ebeaninternal.server.deploy.meta.DeployBeanDescriptor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static java.lang.System.Logger.Level.DEBUG;
|
||||
|
||||
/**
|
||||
* Default implementation for creating BeanControllers.
|
||||
*/
|
||||
@@ -28,7 +30,7 @@ final class PersistControllerManager {
|
||||
void addPersistControllers(DeployBeanDescriptor<?> deployDesc) {
|
||||
for (BeanPersistController c : list) {
|
||||
if (c.isRegisterFor(deployDesc.getBeanType())) {
|
||||
CoreLog.log.debug("BeanPersistController on[{}] {}", deployDesc.getFullName(), c.getClass().getName());
|
||||
CoreLog.log.log(DEBUG, "BeanPersistController on[{0}] {1}", deployDesc.getFullName(), c.getClass().getName());
|
||||
deployDesc.addPersistController(c);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ import io.ebeaninternal.server.deploy.meta.DeployBeanDescriptor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static java.lang.System.Logger.Level.DEBUG;
|
||||
|
||||
/**
|
||||
* Manages the assignment/registration of BeanPersistListener with their
|
||||
* respective DeployBeanDescriptor's.
|
||||
@@ -29,7 +31,7 @@ final class PersistListenerManager {
|
||||
<T> void addPersistListeners(DeployBeanDescriptor<T> deployDesc) {
|
||||
for (BeanPersistListener listener : list) {
|
||||
if (listener.isRegisterFor(deployDesc.getBeanType())) {
|
||||
CoreLog.log.debug("BeanPersistListener on[{}] {}", deployDesc.getFullName(), listener.getClass().getName());
|
||||
CoreLog.log.log(DEBUG, "BeanPersistListener on[{0}] {1}", deployDesc.getFullName(), listener.getClass().getName());
|
||||
deployDesc.addPersistListener(listener);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ import io.ebeaninternal.server.deploy.meta.DeployBeanDescriptor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static java.lang.System.Logger.Level.DEBUG;
|
||||
|
||||
/**
|
||||
* Default implementation for creating BeanControllers.
|
||||
*/
|
||||
@@ -28,7 +30,7 @@ final class PostConstructManager {
|
||||
void addPostConstructListeners(DeployBeanDescriptor<?> deployDesc) {
|
||||
for (BeanPostConstructListener c : list) {
|
||||
if (c.isRegisterFor(deployDesc.getBeanType())) {
|
||||
CoreLog.log.debug("BeanPostLoad on[{}] {}", deployDesc.getFullName(), c.getClass().getName());
|
||||
CoreLog.log.log(DEBUG, "BeanPostLoad on[{0}] {1}", deployDesc.getFullName(), c.getClass().getName());
|
||||
deployDesc.addPostConstructListener(c);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ import io.ebeaninternal.server.deploy.meta.DeployBeanDescriptor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static java.lang.System.Logger.Level.DEBUG;
|
||||
|
||||
/**
|
||||
* Default implementation for creating BeanControllers.
|
||||
*/
|
||||
@@ -28,7 +30,7 @@ final class PostLoadManager {
|
||||
void addPostLoad(DeployBeanDescriptor<?> deployDesc) {
|
||||
for (BeanPostLoad c : list) {
|
||||
if (c.isRegisterFor(deployDesc.getBeanType())) {
|
||||
CoreLog.log.debug("BeanPostLoad on[{}] {}", deployDesc.getFullName(), c.getClass().getName());
|
||||
CoreLog.log.log(DEBUG, "BeanPostLoad on[{0}] {1}", deployDesc.getFullName(), c.getClass().getName());
|
||||
deployDesc.addPostLoad(c);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public final class TableJoin {
|
||||
private final int queryHash;
|
||||
|
||||
private final PropertyForeignKey foreignKey;
|
||||
|
||||
|
||||
private final String extraWhere;
|
||||
|
||||
public TableJoin(DeployTableJoin deploy) {
|
||||
@@ -135,21 +135,21 @@ public final class TableJoin {
|
||||
|
||||
public void addJoin(SqlJoinType joinType, String prefix, DbSqlContext ctx, String predicate) {
|
||||
String[] names = SplitName.split(prefix);
|
||||
String a1 = ctx.getTableAlias(names[0]);
|
||||
String a2 = ctx.getTableAlias(prefix);
|
||||
String a1 = ctx.tableAlias(names[0]);
|
||||
String a2 = ctx.tableAlias(prefix);
|
||||
addJoin(joinType, a1, a2, ctx);
|
||||
ctx.append(" and ").append(a2).append(predicate);
|
||||
}
|
||||
|
||||
public SqlJoinType addJoin(SqlJoinType joinType, String prefix, DbSqlContext ctx) {
|
||||
String[] names = SplitName.split(prefix);
|
||||
String a1 = ctx.getTableAlias(names[0]);
|
||||
String a2 = ctx.getTableAlias(prefix);
|
||||
String a1 = ctx.tableAlias(names[0]);
|
||||
String a2 = ctx.tableAlias(prefix);
|
||||
return addJoin(joinType, a1, a2, ctx);
|
||||
}
|
||||
|
||||
public SqlJoinType addJoin(SqlJoinType joinType, String a1, String a2, DbSqlContext ctx) {
|
||||
String joinLiteral = joinType.getLiteral(type);
|
||||
String joinLiteral = joinType.literal(type);
|
||||
ctx.addJoin(joinLiteral, table, columns(), a1, a2, extraWhere);
|
||||
return joinType.autoToOuter(type);
|
||||
}
|
||||
|
||||
+3
-1
@@ -11,6 +11,8 @@ import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
|
||||
import static java.lang.System.Logger.Level.WARNING;
|
||||
|
||||
/**
|
||||
* Helper object to classify BeanProperties into appropriate lists.
|
||||
*/
|
||||
@@ -222,7 +224,7 @@ public final class DeployBeanPropertyLists {
|
||||
if (versionProperty == null) {
|
||||
versionProperty = prop;
|
||||
} else {
|
||||
CoreLog.internal.warn("Multiple @Version properties - property " + prop.fullName() + " not treated as a version property");
|
||||
CoreLog.internal.log(WARNING, "Multiple @Version properties - property " + prop.fullName() + " not treated as a version property");
|
||||
}
|
||||
} else if (prop.isDraftDirty()) {
|
||||
draftDirty = prop;
|
||||
|
||||
+4
-2
@@ -16,6 +16,8 @@ import io.ebeaninternal.server.query.SqlJoinType;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
import static java.lang.System.Logger.Level.INFO;
|
||||
|
||||
/**
|
||||
* Read the deployment annotations for Associated One beans.
|
||||
*/
|
||||
@@ -213,10 +215,10 @@ final class AnnotationAssocOnes extends AnnotationAssoc {
|
||||
prop.setPrimaryKeyJoin(true);
|
||||
|
||||
if (!primaryKeyJoin.name().isEmpty()) {
|
||||
CoreLog.internal.info("Automatically determining join columns for @PrimaryKeyJoinColumn - ignoring PrimaryKeyJoinColumn.name attribute [{}] on {}", primaryKeyJoin.name(), prop.getFullBeanName());
|
||||
CoreLog.internal.log(INFO, "Automatically determining join columns for @PrimaryKeyJoinColumn - ignoring PrimaryKeyJoinColumn.name attribute [{0}] on {1}", primaryKeyJoin.name(), prop.getFullBeanName());
|
||||
}
|
||||
if (!primaryKeyJoin.referencedColumnName().isEmpty()) {
|
||||
CoreLog.internal.info("Automatically determining join columns for @PrimaryKeyJoinColumn - Ignoring PrimaryKeyJoinColumn.referencedColumnName attribute [{}] on {}", primaryKeyJoin.referencedColumnName(), prop.getFullBeanName());
|
||||
CoreLog.internal.log(INFO, "Automatically determining join columns for @PrimaryKeyJoinColumn - Ignoring PrimaryKeyJoinColumn.referencedColumnName attribute [{0}] on {1}", primaryKeyJoin.referencedColumnName(), prop.getFullBeanName());
|
||||
}
|
||||
BeanTable baseBeanTable = factory.beanTable(info.getDescriptor().getBeanType());
|
||||
String localPrimaryKey = baseBeanTable.getIdColumn();
|
||||
|
||||
@@ -1,19 +1,7 @@
|
||||
package io.ebeaninternal.server.deploy.parse;
|
||||
|
||||
import io.ebean.annotation.Cache;
|
||||
import io.ebean.annotation.DbComment;
|
||||
import io.ebean.annotation.DbPartition;
|
||||
import io.ebean.annotation.DocStore;
|
||||
import io.ebean.annotation.Draftable;
|
||||
import io.ebean.annotation.DraftableElement;
|
||||
import io.ebean.annotation.History;
|
||||
import io.ebean.annotation.Identity;
|
||||
import io.ebean.annotation.Index;
|
||||
import io.ebean.annotation.InvalidateQueryCache;
|
||||
import io.ebean.annotation.ReadAudit;
|
||||
import io.ebean.annotation.StorageEngine;
|
||||
import io.ebean.annotation.Tablespace;
|
||||
import io.ebean.annotation.View;
|
||||
import io.ebean.annotation.*;
|
||||
import io.ebean.config.TableName;
|
||||
import io.ebeaninternal.api.CoreLog;
|
||||
import io.ebeaninternal.server.deploy.BeanDescriptor.EntityType;
|
||||
@@ -23,16 +11,10 @@ import io.ebeaninternal.server.deploy.PartitionMeta;
|
||||
import io.ebeaninternal.server.deploy.TablespaceMeta;
|
||||
import io.ebeaninternal.server.deploy.meta.DeployBeanProperty;
|
||||
|
||||
import javax.persistence.AttributeOverride;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Embeddable;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.IdClass;
|
||||
import javax.persistence.NamedQuery;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.UniqueConstraint;
|
||||
import javax.persistence.*;
|
||||
|
||||
import static io.ebean.util.AnnotationUtil.typeGet;
|
||||
import static java.lang.System.Logger.Level.ERROR;
|
||||
|
||||
/**
|
||||
* Read the class level deployment annotations.
|
||||
@@ -65,7 +47,7 @@ final class AnnotationClass extends AnnotationParser {
|
||||
Column column = override.column();
|
||||
DeployBeanProperty beanProperty = descriptor.getBeanProperty(propertyName);
|
||||
if (beanProperty == null) {
|
||||
CoreLog.log.error("AttributeOverride property [" + propertyName + "] not found on " + descriptor.getFullName());
|
||||
CoreLog.log.log(ERROR, "AttributeOverride property [" + propertyName + "] not found on " + descriptor.getFullName());
|
||||
} else {
|
||||
readColumn(column, beanProperty);
|
||||
}
|
||||
|
||||
+6
-4
@@ -13,6 +13,8 @@ import javax.persistence.PersistenceException;
|
||||
import javax.persistence.Transient;
|
||||
import java.lang.reflect.*;
|
||||
|
||||
import static java.lang.System.Logger.Level.*;
|
||||
|
||||
/**
|
||||
* Create the properties for a bean.
|
||||
* <p>
|
||||
@@ -84,7 +86,7 @@ public final class DeployCreateProperties {
|
||||
if (replaced != null && !replaced.isTransient()) {
|
||||
String msg = "Huh??? property " + prop.getFullBeanName() + " being defined twice";
|
||||
msg += " but replaced property was not transient? This is not expected?";
|
||||
CoreLog.log.warn(msg);
|
||||
CoreLog.log.log(WARNING, msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -111,7 +113,7 @@ public final class DeployCreateProperties {
|
||||
return new DeployBeanPropertySimpleCollection(desc, targetType, manyType);
|
||||
}
|
||||
} catch (NullPointerException e) {
|
||||
CoreLog.internal.debug("expected non-scalar type {}", e.getMessage());
|
||||
CoreLog.internal.log(DEBUG, "expected non-scalar type {0}", e.getMessage());
|
||||
}
|
||||
return new DeployBeanPropertyAssocMany(desc, targetType, manyType);
|
||||
}
|
||||
@@ -132,7 +134,7 @@ public final class DeployCreateProperties {
|
||||
// not supporting this field (generic type used)
|
||||
return null;
|
||||
}
|
||||
CoreLog.internal.warn("Could not find parameter type (via reflection) on " + desc.getFullName() + " " + field.getName());
|
||||
CoreLog.internal.log(WARNING, "Could not find parameter type (via reflection) on " + desc.getFullName() + " " + field.getName());
|
||||
}
|
||||
return createManyType(desc, targetType, manyType);
|
||||
}
|
||||
@@ -151,7 +153,7 @@ public final class DeployCreateProperties {
|
||||
return new DeployBeanPropertyAssocOne(desc, propertyType);
|
||||
|
||||
} catch (Exception e) {
|
||||
CoreLog.log.error("Error with " + desc + " field:" + field.getName(), e);
|
||||
CoreLog.log.log(ERROR, "Error with " + desc + " field:" + field.getName(), e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ import java.lang.reflect.Modifier;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static java.lang.System.Logger.Level.DEBUG;
|
||||
|
||||
/**
|
||||
* Build the DtoMeta for a bean.
|
||||
* <p>
|
||||
@@ -39,7 +41,7 @@ final class DtoMetaBuilder {
|
||||
final String name = propertyName(method.getName());
|
||||
properties.add(new DtoMetaProperty(typeManager, dtoType, method, name));
|
||||
} catch (Exception e) {
|
||||
CoreLog.log.debug("exclude on " + dtoType + " method " + method, e);
|
||||
CoreLog.log.log(DEBUG, "exclude on " + dtoType + " method " + method, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -77,7 +79,7 @@ final class DtoMetaBuilder {
|
||||
constructorList.add(new DtoMetaConstructor(typeManager, constructor, dtoType));
|
||||
} catch (Exception e) {
|
||||
// we don't want that constructor
|
||||
CoreLog.log.debug("exclude on " + dtoType + " constructor " + constructor, e);
|
||||
CoreLog.log.log(DEBUG, "exclude on " + dtoType + " constructor " + constructor, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+8
-8
@@ -1,12 +1,12 @@
|
||||
package io.ebeaninternal.server.executor;
|
||||
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import io.avaje.applog.AppLog;
|
||||
|
||||
import java.util.concurrent.*;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import static java.lang.System.Logger.Level.*;
|
||||
|
||||
/**
|
||||
* A "CachedThreadPool" based on Daemon threads.
|
||||
* <p>
|
||||
@@ -14,7 +14,7 @@ import java.util.concurrent.locks.ReentrantLock;
|
||||
*/
|
||||
final class DaemonExecutorService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(DaemonExecutorService.class);
|
||||
private static final System.Logger logger = AppLog.getLogger(DaemonExecutorService.class);
|
||||
|
||||
private final ReentrantLock lock = new ReentrantLock(false);
|
||||
private final String namePrefix;
|
||||
@@ -44,19 +44,19 @@ final class DaemonExecutorService {
|
||||
lock.lock();
|
||||
try {
|
||||
if (service.isShutdown()) {
|
||||
logger.debug("DaemonExecutorService[{}] already shut down", namePrefix);
|
||||
logger.log(DEBUG, "DaemonExecutorService[{0}] already shut down", namePrefix);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
logger.debug("DaemonExecutorService[{}] shutting down...", namePrefix);
|
||||
logger.log(DEBUG, "DaemonExecutorService[{0}] shutting down...", namePrefix);
|
||||
service.shutdown();
|
||||
if (!service.awaitTermination(shutdownWaitSeconds, TimeUnit.SECONDS)) {
|
||||
logger.info("DaemonExecutorService[{}] shut down timeout exceeded. Terminating running threads.", namePrefix);
|
||||
logger.log(INFO, "DaemonExecutorService[{0}] shut down timeout exceeded. Terminating running threads.", namePrefix);
|
||||
service.shutdownNow();
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("Error during shutdown of DaemonThreadPool[" + namePrefix + "]", e);
|
||||
logger.log(ERROR, "Error during shutdown of DaemonThreadPool[" + namePrefix + "]", e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
} finally {
|
||||
|
||||
+8
-7
@@ -1,18 +1,19 @@
|
||||
package io.ebeaninternal.server.executor;
|
||||
|
||||
import io.ebeaninternal.api.CoreLog;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import static java.lang.System.Logger.Level.*;
|
||||
|
||||
/**
|
||||
* Daemon based ScheduleThreadPool.
|
||||
*/
|
||||
public final class DaemonScheduleThreadPool extends ScheduledThreadPoolExecutor {
|
||||
|
||||
private static final Logger log = CoreLog.log;
|
||||
private static final System.Logger log = CoreLog.log;
|
||||
|
||||
private final ReentrantLock lock = new ReentrantLock();
|
||||
private final String namePrefix;
|
||||
@@ -38,19 +39,19 @@ public final class DaemonScheduleThreadPool extends ScheduledThreadPoolExecutor
|
||||
lock.lock();
|
||||
try {
|
||||
if (super.isShutdown()) {
|
||||
log.debug("Already shutdown threadPool {}", namePrefix);
|
||||
log.log(DEBUG, "Already shutdown threadPool {0}", namePrefix);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
log.trace("shutting down threadPool {}", namePrefix);
|
||||
log.log(TRACE, "shutting down threadPool {0}", namePrefix);
|
||||
super.shutdown();
|
||||
if (!super.awaitTermination(shutdownWaitSeconds, TimeUnit.SECONDS)) {
|
||||
log.info("Shutdown wait timeout exceeded. Terminating running threads for {}", namePrefix);
|
||||
log.log(INFO, "Shutdown wait timeout exceeded. Terminating running threads for {0}", namePrefix);
|
||||
super.shutdownNow();
|
||||
}
|
||||
log.trace("shutdown complete for threadPool {}", namePrefix);
|
||||
log.log(TRACE, "shutdown complete for threadPool {0}", namePrefix);
|
||||
} catch (Exception e) {
|
||||
log.error("Error during shutdown of threadPool " + namePrefix, e);
|
||||
log.log(ERROR, "Error during shutdown of threadPool " + namePrefix, e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
} finally {
|
||||
|
||||
+12
-12
@@ -1,13 +1,13 @@
|
||||
package io.ebeaninternal.server.executor;
|
||||
|
||||
import io.avaje.applog.AppLog;
|
||||
import io.avaje.lang.NonNullApi;
|
||||
import io.ebean.config.BackgroundExecutorWrapper;
|
||||
import io.ebeaninternal.api.SpiBackgroundExecutor;
|
||||
|
||||
import java.util.concurrent.*;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import static java.lang.System.Logger.Level.*;
|
||||
|
||||
/**
|
||||
* The default implementation of the BackgroundExecutor.
|
||||
@@ -15,7 +15,7 @@ import org.slf4j.LoggerFactory;
|
||||
@NonNullApi
|
||||
public final class DefaultBackgroundExecutor implements SpiBackgroundExecutor {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger("io.ebean.BackgroundExecutor");
|
||||
private static final System.Logger log = AppLog.getLogger("io.ebean.BackgroundExecutor");
|
||||
|
||||
private final ScheduledExecutorService schedulePool;
|
||||
private final DaemonExecutorService pool;
|
||||
@@ -28,7 +28,7 @@ public final class DefaultBackgroundExecutor implements SpiBackgroundExecutor {
|
||||
this.schedulePool = new DaemonScheduleThreadPool(schedulePoolSize, shutdownWaitSeconds, namePrefix + "-periodic-");
|
||||
this.pool = new DaemonExecutorService(shutdownWaitSeconds, namePrefix);
|
||||
this.wrapper = wrapper;
|
||||
log.debug("Created backgroundExecutor {} (schedulePoolSize={}, shutdownWaitSeconds={})", namePrefix, schedulePoolSize, shutdownWaitSeconds);
|
||||
log.log(DEBUG, "Created backgroundExecutor {0} (schedulePoolSize={1}, shutdownWaitSeconds={2})", namePrefix, schedulePoolSize, shutdownWaitSeconds);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -59,20 +59,20 @@ public final class DefaultBackgroundExecutor implements SpiBackgroundExecutor {
|
||||
* This is used in methods that accepts a <code>Runnable</code> and return
|
||||
* either <code>void</code> or <code>ScheduledFuture</code>, as there is
|
||||
* normally no Future.get() call.
|
||||
*
|
||||
* <p>
|
||||
* Note: When submitting a <code>Callable</code>, you must check
|
||||
* <code>Future.get()</code> for exceptions.
|
||||
*/
|
||||
private Runnable logExceptions(Runnable task) {
|
||||
long queued = System.nanoTime();
|
||||
log.trace("Queued {}", task);
|
||||
log.log(TRACE, "Queued {0}", task);
|
||||
return () -> {
|
||||
try {
|
||||
if (log.isTraceEnabled()) {
|
||||
if (log.isLoggable(TRACE)) {
|
||||
long start = System.nanoTime();
|
||||
log.trace("Start {} (delay time {} us)", task, (start - queued) / 1000L);
|
||||
log.log(TRACE, "Start {0} (delay time {1} us)", task, (start - queued) / 1000L);
|
||||
task.run();
|
||||
log.trace("Stop {} (exec time {} us)", task, (System.nanoTime() - start) / 1000L);
|
||||
log.log(TRACE, "Stop {0} (exec time {1} us)", task, (System.nanoTime() - start) / 1000L);
|
||||
} else {
|
||||
task.run();
|
||||
}
|
||||
@@ -80,7 +80,7 @@ public final class DefaultBackgroundExecutor implements SpiBackgroundExecutor {
|
||||
// log any exception here. Note they will not bubble up to the calling user
|
||||
// unless Future.get() is checked. (Which is almost never done on scheduled
|
||||
// background executions)
|
||||
log.error("Error while executing the task {}", task, t);
|
||||
log.log(ERROR, "Error while executing the task " + task, t);
|
||||
throw t;
|
||||
}
|
||||
};
|
||||
@@ -128,10 +128,10 @@ public final class DefaultBackgroundExecutor implements SpiBackgroundExecutor {
|
||||
|
||||
@Override
|
||||
public void shutdown() {
|
||||
log.trace("BackgroundExecutor shutting down");
|
||||
log.log(TRACE, "BackgroundExecutor shutting down");
|
||||
schedulePool.shutdown();
|
||||
pool.shutdown();
|
||||
log.debug("BackgroundExecutor stopped");
|
||||
log.log(DEBUG, "BackgroundExecutor stopped");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user