Merge branch 'master' into wip/EntityBeanIntercept-interface

This commit is contained in:
Rob Bygrave authored and GitHub committed 2022-04-12 21:09:58 +12:00
commit 45003b3d5f
140 files changed
+1072 -1581

No files matched your search

+1
View File
@@ -18,6 +18,7 @@
[![datasource EA](https://github.com/ebean-orm/ebean-datasource/actions/workflows/jdk-ea.yml/badge.svg)](https://github.com/ebean-orm/ebean-datasource/actions/workflows/jdk-ea.yml) [![datasource EA](https://github.com/ebean-orm/ebean-datasource/actions/workflows/jdk-ea.yml/badge.svg)](https://github.com/ebean-orm/ebean-datasource/actions/workflows/jdk-ea.yml)
[![migration EA](https://github.com/ebean-orm/ebean-migration/actions/workflows/jdk-ea.yml/badge.svg)](https://github.com/ebean-orm/ebean-migration/actions/workflows/jdk-ea.yml) [![migration EA](https://github.com/ebean-orm/ebean-migration/actions/workflows/jdk-ea.yml/badge.svg)](https://github.com/ebean-orm/ebean-migration/actions/workflows/jdk-ea.yml)
[![test-docker EA](https://github.com/ebean-orm/ebean-test-docker/actions/workflows/jdk-ea.yml/badge.svg)](https://github.com/ebean-orm/ebean-test-docker/actions/workflows/jdk-ea.yml) [![test-docker EA](https://github.com/ebean-orm/ebean-test-docker/actions/workflows/jdk-ea.yml/badge.svg)](https://github.com/ebean-orm/ebean-test-docker/actions/workflows/jdk-ea.yml)
[![ebean-agent EA](https://github.com/ebean-orm/ebean-agent/actions/workflows/jdk-ea.yml/badge.svg)](https://github.com/ebean-orm/ebean-agent/actions/workflows/jdk-ea.yml)
# Sponsors # Sponsors
+5 -5
View File
@@ -4,7 +4,7 @@
<parent> <parent>
<artifactId>composites</artifactId> <artifactId>composites</artifactId>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</parent> </parent>
<name>ebean-clickhouse</name> <name>ebean-clickhouse</name>
@@ -16,13 +16,13 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId> <artifactId>ebean-api</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId> <artifactId>ebean-core</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
@@ -35,13 +35,13 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId> <artifactId>ebean-querybean</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-platform-clickhouse</artifactId> <artifactId>ebean-platform-clickhouse</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent> <parent>
<artifactId>composites</artifactId> <artifactId>composites</artifactId>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</parent> </parent>
<name>ebean-cockroach</name> <name>ebean-cockroach</name>
@@ -16,13 +16,13 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId> <artifactId>ebean-api</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId> <artifactId>ebean-core</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
@@ -35,13 +35,13 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId> <artifactId>ebean-querybean</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId> <artifactId>ebean-platform-postgres</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent> <parent>
<artifactId>composites</artifactId> <artifactId>composites</artifactId>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</parent> </parent>
<name>ebean-db2</name> <name>ebean-db2</name>
@@ -16,13 +16,13 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId> <artifactId>ebean-api</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId> <artifactId>ebean-core</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
@@ -35,13 +35,13 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId> <artifactId>ebean-querybean</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-platform-db2</artifactId> <artifactId>ebean-platform-db2</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent> <parent>
<artifactId>composites</artifactId> <artifactId>composites</artifactId>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</parent> </parent>
<name>ebean-h2</name> <name>ebean-h2</name>
@@ -16,13 +16,13 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId> <artifactId>ebean-api</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId> <artifactId>ebean-core</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
@@ -35,13 +35,13 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId> <artifactId>ebean-querybean</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-platform-h2</artifactId> <artifactId>ebean-platform-h2</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent> <parent>
<artifactId>composites</artifactId> <artifactId>composites</artifactId>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</parent> </parent>
<name>ebean-hana</name> <name>ebean-hana</name>
@@ -16,13 +16,13 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId> <artifactId>ebean-api</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId> <artifactId>ebean-core</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
@@ -35,13 +35,13 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId> <artifactId>ebean-querybean</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-platform-hana</artifactId> <artifactId>ebean-platform-hana</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent> <parent>
<artifactId>composites</artifactId> <artifactId>composites</artifactId>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</parent> </parent>
<name>ebean-mariadb</name> <name>ebean-mariadb</name>
@@ -16,13 +16,13 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId> <artifactId>ebean-api</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId> <artifactId>ebean-core</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
@@ -35,13 +35,13 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId> <artifactId>ebean-querybean</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-platform-mariadb</artifactId> <artifactId>ebean-platform-mariadb</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent> <parent>
<artifactId>composites</artifactId> <artifactId>composites</artifactId>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</parent> </parent>
<name>ebean-mysql</name> <name>ebean-mysql</name>
@@ -16,13 +16,13 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId> <artifactId>ebean-api</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId> <artifactId>ebean-core</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
@@ -35,13 +35,13 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId> <artifactId>ebean-querybean</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-platform-mysql</artifactId> <artifactId>ebean-platform-mysql</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent> <parent>
<artifactId>composites</artifactId> <artifactId>composites</artifactId>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</parent> </parent>
<name>ebean-nuodb</name> <name>ebean-nuodb</name>
@@ -16,13 +16,13 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId> <artifactId>ebean-api</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId> <artifactId>ebean-core</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
@@ -35,13 +35,13 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId> <artifactId>ebean-querybean</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-platform-nuodb</artifactId> <artifactId>ebean-platform-nuodb</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent> <parent>
<artifactId>composites</artifactId> <artifactId>composites</artifactId>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</parent> </parent>
<name>ebean-oracle</name> <name>ebean-oracle</name>
@@ -16,13 +16,13 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId> <artifactId>ebean-api</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId> <artifactId>ebean-core</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
@@ -35,13 +35,13 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId> <artifactId>ebean-querybean</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-platform-oracle</artifactId> <artifactId>ebean-platform-oracle</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent> <parent>
<artifactId>composites</artifactId> <artifactId>composites</artifactId>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</parent> </parent>
<name>ebean-postgres</name> <name>ebean-postgres</name>
@@ -16,13 +16,13 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId> <artifactId>ebean-api</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId> <artifactId>ebean-core</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
@@ -35,13 +35,13 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId> <artifactId>ebean-querybean</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId> <artifactId>ebean-platform-postgres</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent> <parent>
<artifactId>composites</artifactId> <artifactId>composites</artifactId>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</parent> </parent>
<name>ebean-sqlite</name> <name>ebean-sqlite</name>
@@ -16,13 +16,13 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId> <artifactId>ebean-api</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId> <artifactId>ebean-core</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
@@ -35,13 +35,13 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId> <artifactId>ebean-querybean</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-platform-sqlite</artifactId> <artifactId>ebean-platform-sqlite</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent> <parent>
<artifactId>composites</artifactId> <artifactId>composites</artifactId>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</parent> </parent>
<name>ebean-sqlserver</name> <name>ebean-sqlserver</name>
@@ -16,13 +16,13 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId> <artifactId>ebean-api</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId> <artifactId>ebean-core</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
@@ -35,13 +35,13 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId> <artifactId>ebean-querybean</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-platform-sqlserver</artifactId> <artifactId>ebean-platform-sqlserver</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent> <parent>
<artifactId>composites</artifactId> <artifactId>composites</artifactId>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</parent> </parent>
<name>ebean-yugabyte</name> <name>ebean-yugabyte</name>
@@ -16,13 +16,13 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId> <artifactId>ebean-api</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId> <artifactId>ebean-core</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
@@ -35,13 +35,13 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId> <artifactId>ebean-querybean</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId> <artifactId>ebean-platform-postgres</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent> <parent>
<artifactId>composites</artifactId> <artifactId>composites</artifactId>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</parent> </parent>
<name>ebean (all platforms)</name> <name>ebean (all platforms)</name>
@@ -16,13 +16,13 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId> <artifactId>ebean-api</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId> <artifactId>ebean-core</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
@@ -35,13 +35,13 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId> <artifactId>ebean-querybean</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-platform-all</artifactId> <artifactId>ebean-platform-all</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
+1 -1
View File
@@ -4,7 +4,7 @@
<parent> <parent>
<artifactId>ebean-parent</artifactId> <artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</parent> </parent>
<artifactId>composites</artifactId> <artifactId>composites</artifactId>
+2 -2
View File
@@ -4,7 +4,7 @@
<parent> <parent>
<artifactId>ebean-parent</artifactId> <artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</parent> </parent>
<name>ebean api</name> <name>ebean api</name>
@@ -49,7 +49,7 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-annotation</artifactId> <artifactId>ebean-annotation</artifactId>
<version>7.8</version> <version>8.0</version>
</dependency> </dependency>
<dependency> <dependency>
@@ -74,40 +74,16 @@ public interface BeanState {
*/ */
Set<String> loadedProps(); Set<String> loadedProps();
/**
* Deprecated migrate to loadedProps().
*/
@Deprecated
default Set<String> getLoadedProps() {
return loadedProps();
}
/** /**
* Return the set of changed properties. * Return the set of changed properties.
*/ */
Set<String> changedProps(); Set<String> changedProps();
/**
* Deprecated migrate to changedProps().
*/
@Deprecated
default Set<String> getChangedProps() {
return changedProps();
}
/** /**
* Return a map of the updated properties and their new and old values. * Return a map of the updated properties and their new and old values.
*/ */
Map<String, ValuePair> dirtyValues(); Map<String, ValuePair> dirtyValues();
/**
* Deprecated migrate to dirtyValues().
*/
@Deprecated
default Map<String, ValuePair> getDirtyValues() {
return dirtyValues();
}
/** /**
* Return true if the bean is readOnly. * Return true if the bean is readOnly.
* <p> * <p>
@@ -139,24 +115,9 @@ public interface BeanState {
*/ */
Map<String, Exception> loadErrors(); Map<String, Exception> loadErrors();
/**
* Deprecated migrate to loadErrors().
*/
@Deprecated
default Map<String, Exception> getLoadErrors() {
return loadErrors();
}
/** /**
* Return the sort order value for an order column. * Return the sort order value for an order column.
*/ */
int sortOrder(); int sortOrder();
/**
* Deprecated migrate to sortOrder().
*/
@Deprecated
default int getSortOrder() {
return sortOrder();
}
} }
+19 -133
View File
@@ -22,10 +22,9 @@ import java.util.concurrent.Callable;
* DB additionally provides a convenient way to use the 'default' Database. * DB additionally provides a convenient way to use the 'default' Database.
* <p> * <p>
* <h3>Default database</h3> * <h3>Default database</h3>
* <p>
* One of the Database instances can be registered as the "default database" * One of the Database instances can be registered as the "default database"
* and can be obtained using <code>DB.getDefault()</code> * and can be obtained using <code>DB.getDefault()</code>
* </p> *
* <pre>{@code * <pre>{@code
* *
* Database database = DB.getDefault(); * Database database = DB.getDefault();
@@ -36,7 +35,7 @@ import java.util.concurrent.Callable;
* <p> * <p>
* Multiple database instances can be registered with DB and we can obtain them * Multiple database instances can be registered with DB and we can obtain them
* using <code>DB.byName()</code> * using <code>DB.byName()</code>
* </p> *
* <pre>{@code * <pre>{@code
* *
* Database hrDatabase = DB.byName("hr"); * Database hrDatabase = DB.byName("hr");
@@ -47,7 +46,6 @@ import java.util.concurrent.Callable;
* <p> * <p>
* DB has methods like {@link #find(Class)} and {@link #save(Object)} which are * DB has methods like {@link #find(Class)} and {@link #save(Object)} which are
* just convenience for using the default database. * just convenience for using the default database.
* </p>
* *
* <pre>{@code * <pre>{@code
* *
@@ -117,39 +115,26 @@ public final class DB {
* build the WHERE and HAVING clauses. Alternatively you can use the * build the WHERE and HAVING clauses. Alternatively you can use the
* ExpressionFactory directly to create expressions to add to the query where * ExpressionFactory directly to create expressions to add to the query where
* clause. * clause.
* </p>
* <p> * <p>
* Alternatively you can use the {@link Expr} as a shortcut to the * Alternatively you can use the {@link Expr} as a shortcut to the
* ExpressionFactory of the 'Default' database. * ExpressionFactory of the 'Default' database.
* </p>
* <p> * <p>
* You generally need to the an ExpressionFactory (or {@link Expr}) to build * You generally need to the an ExpressionFactory (or {@link Expr}) to build
* an expression that uses OR like Expression e = Expr.or(..., ...); * an expression that uses OR like Expression e = Expr.or(..., ...);
* </p>
*/ */
public static ExpressionFactory expressionFactory() { public static ExpressionFactory expressionFactory() {
return getDefault().expressionFactory(); return getDefault().expressionFactory();
} }
/**
* Deprecated migrate to expressionFactory().
*/
@Deprecated
public static ExpressionFactory getExpressionFactory() {
return expressionFactory();
}
/** /**
* Return the next identity value for a given bean type. * Return the next identity value for a given bean type.
* <p> * <p>
* This will only work when a IdGenerator is on this bean type such as a DB * This will only work when a IdGenerator is on this bean type such as a DB
* sequence or UUID. * sequence or UUID.
* </p>
* <p> * <p>
* For DB's supporting getGeneratedKeys and sequences such as Oracle10 you do * For DB's supporting getGeneratedKeys and sequences such as Oracle10 you do
* not need to use this method generally. It is made available for more * not need to use this method generally. It is made available for more
* complex cases where it is useful to get an ID prior to some processing. * complex cases where it is useful to get an ID prior to some processing.
* </p>
*/ */
public static Object nextId(Class<?> beanType) { public static Object nextId(Class<?> beanType) {
return getDefault().nextId(beanType); return getDefault().nextId(beanType);
@@ -159,17 +144,14 @@ public final class DB {
* Start a transaction with 'REQUIRED' semantics. * Start a transaction with 'REQUIRED' semantics.
* <p> * <p>
* With REQUIRED semantics if an active transaction already exists that transaction will be used. * With REQUIRED semantics if an active transaction already exists that transaction will be used.
* </p>
* <p> * <p>
* The transaction is stored in a ThreadLocal variable and typically you only * The transaction is stored in a ThreadLocal variable and typically you only
* need to use the returned Transaction <em>IF</em> you wish to do things like * need to use the returned Transaction <em>IF</em> you wish to do things like
* use batch mode, change the transaction isolation level, use savepoints or * use batch mode, change the transaction isolation level, use savepoints or
* log comments to the transaction log. * log comments to the transaction log.
* </p>
* <p> * <p>
* Example of using a transaction to span multiple calls to find(), save() * Example of using a transaction to span multiple calls to find(), save() etc.
* etc. *
* </p>
* <pre>{@code * <pre>{@code
* *
* try (Transaction transaction = DB.beginTransaction()) { * try (Transaction transaction = DB.beginTransaction()) {
@@ -187,7 +169,6 @@ public final class DB {
* With Database we can pass the transaction to the various find(), save() and execute() * With Database we can pass the transaction to the various find(), save() and execute()
* methods. This gives us the ability to create the transactions externally from Ebean * methods. This gives us the ability to create the transactions externally from Ebean
* and use the transaction explicitly via the various methods available on Database. * and use the transaction explicitly via the various methods available on Database.
* </p>
*/ */
public static Transaction beginTransaction() { public static Transaction beginTransaction() {
return getDefault().beginTransaction(); return getDefault().beginTransaction();
@@ -199,7 +180,6 @@ public final class DB {
* You will want to do this if you want multiple Transactions in a single * You will want to do this if you want multiple Transactions in a single
* thread or generally use transactions outside of the TransactionThreadLocal * thread or generally use transactions outside of the TransactionThreadLocal
* management. * management.
* </p>
*/ */
public static Transaction createTransaction() { public static Transaction createTransaction() {
return getDefault().createTransaction(); return getDefault().createTransaction();
@@ -219,7 +199,6 @@ public final class DB {
* <p> * <p>
* Note that this provides an try finally alternative to using {@link #executeCall(TxScope, Callable)} or * Note that this provides an try finally alternative to using {@link #executeCall(TxScope, Callable)} or
* {@link #execute(TxScope, Runnable)}. * {@link #execute(TxScope, Runnable)}.
* </p>
* <p> * <p>
* <h3>REQUIRES_NEW example:</h3> * <h3>REQUIRES_NEW example:</h3>
* <pre>{@code * <pre>{@code
@@ -278,7 +257,7 @@ public final class DB {
/** /**
* Register a TransactionCallback on the currently active transaction. * Register a TransactionCallback on the currently active transaction.
* <p/> * <p>
* If there is no currently active transaction then a PersistenceException is thrown. * If there is no currently active transaction then a PersistenceException is thrown.
* *
* @param transactionCallback the transaction callback to be registered with the current transaction * @param transactionCallback the transaction callback to be registered with the current transaction
@@ -307,14 +286,12 @@ public final class DB {
* rollback the transaction. * rollback the transaction.
* <p> * <p>
* It is preferable to use <em>try with resources</em> rather than this. * It is preferable to use <em>try with resources</em> rather than this.
* </p>
* <p> * <p>
* Useful to put in a finally block to ensure the transaction is ended, rather * Useful to put in a finally block to ensure the transaction is ended, rather
* than a rollbackTransaction() in each catch block. * than a rollbackTransaction() in each catch block.
* </p>
* <p> * <p>
* Code example: * Code example:
* </p> *
* <pre>{@code * <pre>{@code
* DB.beginTransaction(); * DB.beginTransaction();
* try { * try {
@@ -345,7 +322,6 @@ public final class DB {
* <p> * <p>
* When null is passed in for b, then the 'OldValues' of a is used for the * When null is passed in for b, then the 'OldValues' of a is used for the
* difference comparison. * difference comparison.
* </p>
*/ */
public static Map<String, ValuePair> diff(Object a, Object b) { public static Map<String, ValuePair> diff(Object a, Object b) {
return getDefault().diff(a, b); return getDefault().diff(a, b);
@@ -356,18 +332,15 @@ public final class DB {
* <p> * <p>
* If there is no current transaction one will be created and committed for * If there is no current transaction one will be created and committed for
* you automatically. * you automatically.
* </p>
* <p> * <p>
* Save can cascade along relationships. For this to happen you need to * Save can cascade along relationships. For this to happen you need to
* specify a cascade of CascadeType.ALL or CascadeType.PERSIST on the * specify a cascade of CascadeType.ALL or CascadeType.PERSIST on the
* OneToMany, OneToOne or ManyToMany annotation. * OneToMany, OneToOne or ManyToMany annotation.
* </p>
* <p> * <p>
* When a save cascades via a OneToMany or ManyToMany Ebean will automatically * When a save cascades via a OneToMany or ManyToMany Ebean will automatically
* set the 'parent' object to the 'detail' object. In the example below in * set the 'parent' object to the 'detail' object. In the example below in
* saving the order and cascade saving the order details the 'parent' order * saving the order and cascade saving the order details the 'parent' order
* will be set against each order detail when it is saved. * will be set against each order detail when it is saved.
* </p>
*/ */
public static void save(Object bean) throws OptimisticLockException { public static void save(Object bean) throws OptimisticLockException {
getDefault().save(bean); getDefault().save(bean);
@@ -418,11 +391,9 @@ public final class DB {
* <b>Stateless updates:</b> Note that the bean does not have to be previously fetched to call * <b>Stateless updates:</b> Note that the bean does not have to be previously fetched to call
* update().You can create a new instance and set some of its properties programmatically for via * update().You can create a new instance and set some of its properties programmatically for via
* JSON/XML marshalling etc. This is described as a 'stateless update'. * JSON/XML marshalling etc. This is described as a 'stateless update'.
* </p>
* <p> * <p>
* <b>Optimistic Locking: </b> Note that if the version property is not set when update() is * <b>Optimistic Locking: </b> Note that if the version property is not set when update() is
* called then no optimistic locking is performed (internally ConcurrencyMode.NONE is used). * called then no optimistic locking is performed (internally ConcurrencyMode.NONE is used).
* </p>
* <p> * <p>
* <pre>{@code * <pre>{@code
* *
@@ -539,20 +510,16 @@ public final class DB {
* Delete the bean. * Delete the bean.
* <p> * <p>
* This will return true if the bean was deleted successfully or JDBC batch is being used. * This will return true if the bean was deleted successfully or JDBC batch is being used.
* </p>
* <p> * <p>
* If there is no current transaction one will be created and committed for * If there is no current transaction one will be created and committed for
* you automatically. * you automatically.
* </p>
* <p> * <p>
* If the bean is configured with <code>@SoftDelete</code> then this will perform a soft * If the bean is configured with <code>@SoftDelete</code> then this will perform a soft
* delete rather than a hard/permanent delete. * delete rather than a hard/permanent delete.
* </p>
* <p> * <p>
* If the Bean does not have a version property (or loaded version property) and * If the Bean does not have a version property (or loaded version property) and
* the bean does not exist then this returns false indicating that nothing was * the bean does not exist then this returns false indicating that nothing was
* deleted. Note that, if JDBC batch mode is used then this always returns true. * deleted. Note that, if JDBC batch mode is used then this always returns true.
* </p>
*/ */
public static boolean delete(Object bean) throws OptimisticLockException { public static boolean delete(Object bean) throws OptimisticLockException {
return getDefault().delete(bean); return getDefault().delete(bean);
@@ -612,7 +579,6 @@ public final class DB {
* <p> * <p>
* Note that this resets OneToMany and ManyToMany properties so that if they * Note that this resets OneToMany and ManyToMany properties so that if they
* are accessed a lazy load will refresh the many property. * are accessed a lazy load will refresh the many property.
* </p>
*/ */
public static void refresh(Object bean) { public static void refresh(Object bean) {
getDefault().refresh(bean); getDefault().refresh(bean);
@@ -620,6 +586,7 @@ public final class DB {
/** /**
* Refresh a 'many' property of a bean. * Refresh a 'many' property of a bean.
*
* <pre>{@code * <pre>{@code
* *
* Order order = ...; * Order order = ...;
@@ -640,7 +607,7 @@ public final class DB {
* Get a reference object. * Get a reference object.
* <p> * <p>
* This is sometimes described as a proxy (with lazy loading). * This is sometimes described as a proxy (with lazy loading).
* </p> *
* <pre>{@code * <pre>{@code
* *
* Product product = DB.getReference(Product.class, 1); * Product product = DB.getReference(Product.class, 1);
@@ -661,14 +628,6 @@ public final class DB {
return getDefault().reference(beanType, id); return getDefault().reference(beanType, id);
} }
/**
* Deprecated migrate to beanId().
*/
@Deprecated
public static <T> T getReference(Class<T> beanType, Object id) {
return reference(beanType, id);
}
/** /**
* Sort the list using the sortByClause which can contain a comma delimited * Sort the list using the sortByClause which can contain a comma delimited
* list of property names and keywords asc, desc, nullsHigh and nullsLow. * list of property names and keywords asc, desc, nullsHigh and nullsLow.
@@ -684,7 +643,7 @@ public final class DB {
* <p> * <p>
* Note that the sorting uses a Comparator and Collections.sort(); and does * Note that the sorting uses a Comparator and Collections.sort(); and does
* not invoke a DB query. * not invoke a DB query.
* </p> *
* <pre>{@code * <pre>{@code
* *
* // find orders and their customers * // find orders and their customers
@@ -719,9 +678,8 @@ public final class DB {
* *
* }</pre> * }</pre>
* <p> * <p>
* If you want more control over the query then you can use createQuery() and * If you want more control over the query then you can use createQuery() and Query.findOne();
* Query.findOne(); *
* </p>
* <pre>{@code * <pre>{@code
* *
* // ... additionally fetching customer, customer shipping address, * // ... additionally fetching customer, customer shipping address,
@@ -761,40 +719,25 @@ public final class DB {
} }
/** /**
* Look to execute a native sql query that does not returns beans but instead * Look to execute a native sql query that does not return beans but instead
* returns SqlRow or direct access to ResultSet (see {@link SqlQuery#findList(RowMapper)}. * returns SqlRow or uses {@link RowMapper}.
*
* <p> * <p>
* Refer to {@link DtoQuery} for native sql queries returning DTO beans. * Refer to {@link DtoQuery} for native sql queries returning DTO beans.
* </p>
* <p> * <p>
* Refer to {@link #findNative(Class, String)} for native sql queries returning entity beans. * Refer to {@link #findNative(Class, String)} for native sql queries returning entity beans.
* </p>
*/ */
public static SqlQuery sqlQuery(String sql) { public static SqlQuery sqlQuery(String sql) {
return getDefault().sqlQuery(sql); return getDefault().sqlQuery(sql);
} }
/**
* Deprecated - migrate to sqlQuery().
* <p>
* This is an alias for {@link #sqlQuery(String)}.
*/
@Deprecated
public static SqlQuery createSqlQuery(String sql) {
return sqlQuery(sql);
}
/** /**
* Look to execute a native sql insert update or delete statement. * Look to execute a native sql insert update or delete statement.
* <p> * <p>
* Use this to execute a Insert Update or Delete statement. The statement will * Use this to execute a Insert Update or Delete statement. The statement will
* be native to the database and contain database table and column names. * be native to the database and contain database table and column names.
* </p>
* *
* <p> * <p>
* See {@link SqlUpdate} for example usage. * See {@link SqlUpdate} for example usage.
* </p>
* *
* @return The SqlUpdate instance to set parameters and execute * @return The SqlUpdate instance to set parameters and execute
*/ */
@@ -802,16 +745,6 @@ public final class DB {
return getDefault().sqlUpdate(sql); return getDefault().sqlUpdate(sql);
} }
/**
* Deprecated - migrate to sqlUpdate().
* <p>
* This is an alias for {@link #sqlUpdate(String)}.
*/
@Deprecated
public static SqlUpdate createSqlUpdate(String sql) {
return sqlUpdate(sql);
}
/** /**
* Create a CallableSql to execute a given stored procedure. * Create a CallableSql to execute a given stored procedure.
* *
@@ -828,10 +761,9 @@ public final class DB {
* <p> * <p>
* The orm update differs from the sql update in that it you can use the bean * The orm update differs from the sql update in that it you can use the bean
* name and bean property names rather than table and column names. * name and bean property names rather than table and column names.
* </p>
* <p> * <p>
* An example: * An example:
* </p> *
* <pre>{@code * <pre>{@code
* *
* // The bean name and properties - "topic","postCount" and "id" * // The bean name and properties - "topic","postCount" and "id"
@@ -864,7 +796,6 @@ public final class DB {
* Create a named query. * Create a named query.
* <p> * <p>
* For RawSql the named query is expected to be in ebean.xml. * For RawSql the named query is expected to be in ebean.xml.
* </p>
* *
* @param beanType The type of entity bean * @param beanType The type of entity bean
* @param namedQuery The name of the query * @param namedQuery The name of the query
@@ -880,15 +811,12 @@ public final class DB {
* <p> * <p>
* You can use the methods on the Query object to specify fetch paths, * You can use the methods on the Query object to specify fetch paths,
* predicates, order by, limits etc. * predicates, order by, limits etc.
* </p>
* <p> * <p>
* You then use findList(), findSet(), findMap() and findOne() to execute * You then use findList(), findSet(), findMap() and findOne() to execute
* the query and return the collection or bean. * the query and return the collection or bean.
* </p>
* <p> * <p>
* Note that a query executed by {@link Query#findList()} etc will execute against * Note that a query executed by {@link Query#findList()} etc will execute against
* the same database from which is was created. * the same database from which is was created.
* </p>
* *
* @param beanType the class of entity to be fetched * @param beanType the class of entity to be fetched
* @return A ORM Query for this beanType * @return A ORM Query for this beanType
@@ -940,7 +868,6 @@ public final class DB {
* This is actually the same as {@link #createQuery(Class)}. The reason it * This is actually the same as {@link #createQuery(Class)}. The reason it
* exists is that people used to JPA will probably be looking for a * exists is that people used to JPA will probably be looking for a
* createQuery method (the same as entityManager). * createQuery method (the same as entityManager).
* </p>
* *
* @param beanType the type of entity bean to find * @param beanType the type of entity bean to find
* @return A ORM Query object for this beanType * @return A ORM Query object for this beanType
@@ -953,7 +880,7 @@ public final class DB {
* Create a query using native SQL. * Create a query using native SQL.
* <p> * <p>
* The native SQL can contain named parameters or positioned parameters. * The native SQL can contain named parameters or positioned parameters.
* </p> *
* <pre>{@code * <pre>{@code
* *
* String sql = "select c.id, c.name from customer c where c.name like ? order by c.name"; * String sql = "select c.id, c.name from customer c where c.name like ? order by c.name";
@@ -978,7 +905,6 @@ public final class DB {
* <p> * <p>
* DTO beans are just normal bean like classes with public constructor(s) and setters. * DTO beans are just normal bean like classes with public constructor(s) and setters.
* They do not need to be registered with Ebean before use. * They do not need to be registered with Ebean before use.
* </p>
* *
* @param dtoType The type of the DTO bean the rows will be mapped into. * @param dtoType The type of the DTO bean the rows will be mapped into.
* @param sql The SQL query to execute. * @param sql The SQL query to execute.
@@ -1015,10 +941,8 @@ public final class DB {
* going back to the database. * going back to the database.
* <p> * <p>
* This produces and returns a new list with the sort and filters applied. * This produces and returns a new list with the sort and filters applied.
* </p>
* <p> * <p>
* Refer to {@link Filter} for an example of its use. * Refer to {@link Filter} for an example of its use.
* </p>
*/ */
public static <T> Filter<T> filter(Class<T> beanType) { public static <T> Filter<T> filter(Class<T> beanType) {
return getDefault().filter(beanType); return getDefault().filter(beanType);
@@ -1029,7 +953,7 @@ public final class DB {
* <p> * <p>
* The scope can control the transaction type, isolation and rollback * The scope can control the transaction type, isolation and rollback
* semantics. * semantics.
* </p> *
* <pre>{@code * <pre>{@code
* *
* // set specific transactional scope settings * // set specific transactional scope settings
@@ -1053,7 +977,7 @@ public final class DB {
* <p> * <p>
* The default scope runs with REQUIRED and by default will rollback on any * The default scope runs with REQUIRED and by default will rollback on any
* exception (checked or runtime). * exception (checked or runtime).
* </p> *
* <pre>{@code * <pre>{@code
* *
* DB.execute(() -> { * DB.execute(() -> {
@@ -1078,7 +1002,7 @@ public final class DB {
* <p> * <p>
* The scope can control the transaction type, isolation and rollback * The scope can control the transaction type, isolation and rollback
* semantics. * semantics.
* </p> *
* <pre>{@code * <pre>{@code
* *
* // set specific transactional scope settings * // set specific transactional scope settings
@@ -1102,11 +1026,10 @@ public final class DB {
* <p> * <p>
* The default scope runs with REQUIRED and by default will rollback on any * The default scope runs with REQUIRED and by default will rollback on any
* exception (checked or runtime). * exception (checked or runtime).
* </p>
* <p> * <p>
* This is basically the same as TxRunnable except that it returns an Object * This is basically the same as TxRunnable except that it returns an Object
* (and you specify the return type via generics). * (and you specify the return type via generics).
* </p> *
* <pre>{@code * <pre>{@code
* *
* DB.executeCall(() -> { * DB.executeCall(() -> {
@@ -1135,23 +1058,19 @@ public final class DB {
* <p> * <p>
* If you use DB.execute(UpdateSql) then the table modification information * If you use DB.execute(UpdateSql) then the table modification information
* is automatically deduced and you do not need to call this method yourself. * is automatically deduced and you do not need to call this method yourself.
* </p>
* <p> * <p>
* This information is used to invalidate objects out of the cache and * This information is used to invalidate objects out of the cache and
* potentially text indexes. This information is also automatically broadcast * potentially text indexes. This information is also automatically broadcast
* across the cluster. * across the cluster.
* </p>
* <p> * <p>
* If there is a transaction then this information is placed into the current * If there is a transaction then this information is placed into the current
* transactions event information. When the transaction is committed this * transactions event information. When the transaction is committed this
* information is registered (with the transaction manager). If this * information is registered (with the transaction manager). If this
* transaction is rolled back then none of the transaction event information * transaction is rolled back then none of the transaction event information
* registers including the information you put in via this method. * registers including the information you put in via this method.
* </p>
* <p> * <p>
* If there is NO current transaction when you call this method then this * If there is NO current transaction when you call this method then this
* information is registered immediately (with the transaction manager). * information is registered immediately (with the transaction manager).
* </p>
* *
* @param tableName the name of the table that was modified * @param tableName the name of the table that was modified
* @param inserts true if rows where inserted into the table * @param inserts true if rows where inserted into the table
@@ -1166,20 +1085,11 @@ public final class DB {
* Return the BeanState for a given entity bean. * Return the BeanState for a given entity bean.
* <p> * <p>
* This will return null if the bean is not an enhanced entity bean. * This will return null if the bean is not an enhanced entity bean.
* </p>
*/ */
public static BeanState beanState(Object bean) { public static BeanState beanState(Object bean) {
return getDefault().beanState(bean); return getDefault().beanState(bean);
} }
/**
* Deprecated migrate to beanState().
*/
@Deprecated
public static BeanState getBeanState(Object bean) {
return beanState(bean);
}
/** /**
* Return the value of the Id property for a given bean. * Return the value of the Id property for a given bean.
*/ */
@@ -1187,14 +1097,6 @@ public final class DB {
return getDefault().beanId(bean); return getDefault().beanId(bean);
} }
/**
* Deprecated migrate to beanId().
*/
@Deprecated
public static Object getBeanId(Object bean) {
return beanId(bean);
}
/** /**
* Load and lock the bean using {@code select for update}. * Load and lock the bean using {@code select for update}.
* <p> * <p>
@@ -1210,14 +1112,6 @@ public final class DB {
getDefault().lock(bean); getDefault().lock(bean);
} }
/**
* Deprecated migrate to cacheManager().
*/
@Deprecated
public static ServerCacheManager getServerCacheManager() {
return getDefault().cacheManager();
}
/** /**
* Return the manager of the level 2 cache ("L2" cache). * Return the manager of the level 2 cache ("L2" cache).
*/ */
@@ -1233,14 +1127,6 @@ public final class DB {
return getDefault().backgroundExecutor(); return getDefault().backgroundExecutor();
} }
/**
* Deprecated migrate to backgroundExecutor().
*/
@Deprecated
public static BackgroundExecutor getBackgroundExecutor() {
return backgroundExecutor();
}
/** /**
* Return the JsonContext for reading/writing JSON. * Return the JsonContext for reading/writing JSON.
*/ */
@@ -123,81 +123,33 @@ public interface Database {
*/ */
AutoTune autoTune(); AutoTune autoTune();
/**
* Deprecated migrate to autoTune().
*/
@Deprecated
default AutoTune getAutoTune() {
return autoTune();
}
/** /**
* Return the associated DataSource for this Database instance. * Return the associated DataSource for this Database instance.
*/ */
DataSource dataSource(); DataSource dataSource();
/**
* Deprecated migrate to dataSource().
*/
@Deprecated
default DataSource getDataSource() {
return dataSource();
}
/** /**
* Return the associated read only DataSource for this Database instance (can be null). * Return the associated read only DataSource for this Database instance (can be null).
*/ */
DataSource readOnlyDataSource(); DataSource readOnlyDataSource();
/**
* Deprecated migrate to readOnlyDataSource().
*/
@Deprecated
default DataSource getReadOnlyDataSource() {
return readOnlyDataSource();
}
/** /**
* Return the name. This is used with {@link DB#byName(String)} to get a * Return the name. This is used with {@link DB#byName(String)} to get a
* Database that was registered with the DB singleton. * Database that was registered with the DB singleton.
*/ */
String name(); String name();
/**
* Deprecated migrate to name().
*/
@Deprecated
default String getName() {
return name();
}
/** /**
* Return the ExpressionFactory for this database. * Return the ExpressionFactory for this database.
*/ */
ExpressionFactory expressionFactory(); ExpressionFactory expressionFactory();
/**
* Deprecated migrate to expressionFactory().
*/
@Deprecated
default ExpressionFactory getExpressionFactory() {
return expressionFactory();
}
/** /**
* Return the MetaInfoManager which is used to get meta data from the Database * Return the MetaInfoManager which is used to get meta data from the Database
* such as query execution statistics. * such as query execution statistics.
*/ */
MetaInfoManager metaInfo(); MetaInfoManager metaInfo();
/**
* Deprecated migrate to metaInfo().
*/
@Deprecated
default MetaInfoManager getMetaInfoManager() {
return metaInfo();
}
/** /**
* Return the platform used for this database instance. * Return the platform used for this database instance.
* <p> * <p>
@@ -217,27 +169,11 @@ public interface Database {
*/ */
Platform platform(); Platform platform();
/**
* Deprecated migrate to platform().
*/
@Deprecated
default Platform getPlatform() {
return platform();
}
/** /**
* Return the extended API intended for use by plugins. * Return the extended API intended for use by plugins.
*/ */
SpiServer pluginApi(); SpiServer pluginApi();
/**
* Deprecated migrate to pluginApi().
*/
@Deprecated
default SpiServer getPluginApi() {
return pluginApi();
}
/** /**
* Return the BeanState for a given entity bean. * Return the BeanState for a given entity bean.
* <p> * <p>
@@ -246,27 +182,11 @@ public interface Database {
*/ */
BeanState beanState(Object bean); BeanState beanState(Object bean);
/**
* Deprecated migrate to beanState().
*/
@Deprecated
default BeanState getBeanState(Object bean) {
return beanState(bean);
}
/** /**
* Return the value of the Id property for a given bean. * Return the value of the Id property for a given bean.
*/ */
Object beanId(Object bean); Object beanId(Object bean);
/**
* Deprecated migrate to beanId().
*/
@Deprecated
default Object getBeanId(Object bean) {
return beanId(bean);
}
/** /**
* Set the Id value onto the bean converting the type of the id value if necessary. * Set the Id value onto the bean converting the type of the id value if necessary.
* <p> * <p>
@@ -279,14 +199,6 @@ public interface Database {
*/ */
Object beanId(Object bean, Object id); Object beanId(Object bean, Object id);
/**
* Deprecated migrate to beanId().
*/
@Deprecated
default Object setBeanId(Object bean, Object id) {
return beanId(bean, id);
}
/** /**
* Return a map of the differences between two objects of the same type. * Return a map of the differences between two objects of the same type.
* <p> * <p>
@@ -588,14 +500,6 @@ public interface Database {
*/ */
SqlQuery sqlQuery(String sql); SqlQuery sqlQuery(String sql);
/**
* Deprecated - migrate to sqlQuery().
* <p>
* This is an alias for {@link #sqlQuery(String)}.
*/
@Deprecated
SqlQuery createSqlQuery(String sql);
/** /**
* Look to execute a native sql insert update or delete statement. * Look to execute a native sql insert update or delete statement.
* <p> * <p>
@@ -611,14 +515,6 @@ public interface Database {
*/ */
SqlUpdate sqlUpdate(String sql); SqlUpdate sqlUpdate(String sql);
/**
* Deprecated - migrate to sqlUpdate().
* <p>
* This is an alias for {@link #sqlUpdate(String)}.
*/
@Deprecated
SqlUpdate createSqlUpdate(String sql);
/** /**
* Create a CallableSql to execute a given stored procedure. * Create a CallableSql to execute a given stored procedure.
*/ */
@@ -952,14 +848,6 @@ public interface Database {
*/ */
<T> T reference(Class<T> beanType, Object id); <T> T reference(Class<T> beanType, Object id);
/**
* Deprecated migrate to reference().
*/
@Deprecated
default <T> T getReference(Class<T> beanType, Object id) {
return reference(beanType, id);
}
/** /**
* Return the extended API for Database. * Return the extended API for Database.
* <p> * <p>
@@ -1528,28 +1416,12 @@ public interface Database {
*/ */
ServerCacheManager cacheManager(); ServerCacheManager cacheManager();
/**
* Deprecated migrate to cacheManager().
*/
@Deprecated
default ServerCacheManager getServerCacheManager() {
return cacheManager();
}
/** /**
* Return the BackgroundExecutor service for asynchronous processing of * Return the BackgroundExecutor service for asynchronous processing of
* queries. * queries.
*/ */
BackgroundExecutor backgroundExecutor(); BackgroundExecutor backgroundExecutor();
/**
* Deprecated migrate to backgroundExecutor().
*/
@Deprecated
default BackgroundExecutor getBackgroundExecutor() {
return backgroundExecutor();
}
/** /**
* Return the JsonContext for reading/writing JSON. * Return the JsonContext for reading/writing JSON.
* <p> * <p>
@@ -26,7 +26,7 @@ import java.util.concurrent.locks.ReentrantLock;
* methods on the DB singleton such as {@link DB#find(Class)} are just a * methods on the DB singleton such as {@link DB#find(Class)} are just a
* convenient way of using the 'default/primary' Database. * convenient way of using the 'default/primary' Database.
*/ */
public class DatabaseFactory { public final class DatabaseFactory {
private static final ReentrantLock lock = new ReentrantLock(); private static final ReentrantLock lock = new ReentrantLock();
private static SpiContainer container; private static SpiContainer container;
@@ -10,7 +10,7 @@ import java.util.concurrent.locks.ReentrantLock;
* <p/> * <p/>
* Intended for internal use as part of bootup, construction, registration of the default database. * Intended for internal use as part of bootup, construction, registration of the default database.
*/ */
class DbPrimary { final class DbPrimary {
private static final ReentrantLock lock = new ReentrantLock(); private static final ReentrantLock lock = new ReentrantLock();
private static String defaultServerName; private static String defaultServerName;
@@ -12,7 +12,7 @@ import java.util.Properties;
* *
* @author Roland Praml, FOCONIS AG * @author Roland Praml, FOCONIS AG
*/ */
public class EbeanVersion { public final class EbeanVersion {
private static final Logger log = LoggerFactory.getLogger("io.ebean"); private static final Logger log = LoggerFactory.getLogger("io.ebean");
+1 -1
View File
@@ -25,7 +25,7 @@ import java.util.Map;
* *
* @see Query#where() * @see Query#where()
*/ */
public class Expr { public final class Expr {
private Expr() { private Expr() {
} }
@@ -112,19 +112,6 @@ public interface ExtendedServer {
*/ */
<T> Stream<T> findStream(Query<T> query, Transaction transaction); <T> Stream<T> findStream(Query<T> query, Transaction transaction);
/**
* Deprecated - migrate to findStream().
* <p>
* 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.
*/
@Deprecated
<T> Stream<T> findLargeStream(Query<T> query, Transaction transaction);
/** /**
* Execute the query visiting the each bean one at a time. * Execute the query visiting the each bean one at a time.
* <p> * <p>
@@ -31,7 +31,7 @@ import java.io.Serializable;
* @author mario * @author mario
* @author rbygrave * @author rbygrave
*/ */
public class FetchConfig implements Serializable { public final class FetchConfig implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@@ -750,29 +750,6 @@ public interface Query<T> extends CancelableQuery {
*/ */
Stream<T> findStream(); Stream<T> findStream();
/**
* Deprecated - migrate to findStream.
* <p>
* Execute the query returning the result as a Stream.
* <p>
* Note that this uses multiple persistence contexts such that we can use
* it with a large number of results.
* </p>
* <pre>{@code
*
* // use try with resources to ensure Stream is closed
*
* try (Stream<Customer> stream = query.findLargeStream()) {
* stream
* .map(...)
* .collect(...);
* }
*
* }</pre>
*/
@Deprecated
Stream<T> findLargeStream();
/** /**
* Execute the query processing the beans one at a time. * Execute the query processing the beans one at a time.
* <p> * <p>
@@ -74,18 +74,6 @@ public interface SqlQuery extends Serializable, CancelableQuery {
@Nullable @Nullable
SqlRow findOne(); SqlRow findOne();
/**
* Deprecated migrate to use {@link #mapTo(RowMapper)}
*/
@Deprecated
<T> T findOne(RowMapper<T> mapper);
/**
* Deprecated migrate to use {@link #mapTo(RowMapper)}
*/
@Deprecated
<T> List<T> findList(RowMapper<T> mapper);
/** /**
* Execute the query reading each row from ResultSet using the RowConsumer. * Execute the query reading each row from ResultSet using the RowConsumer.
* <p> * <p>
@@ -121,50 +109,6 @@ public interface SqlQuery extends Serializable, CancelableQuery {
*/ */
Optional<SqlRow> findOneOrEmpty(); Optional<SqlRow> findOneOrEmpty();
/**
* Deprecated - migrate to <code>.mapToScalar(attributeType).findOne()</code>.
* <pre>{@code
*
* .mapToScalar(BigDecimal.class)
* .findOne();
* }
*/
@Deprecated
<T> T findSingleAttribute(Class<T> attributeType);
/**
* Deprecated - migrate to <code>.mapToScalar(BigDecimal.class).findOne()</code>.
* <pre>{@code
*
* .mapToScalar(BigDecimal.class)
* .findOne();
* }
*/
@Deprecated
BigDecimal findSingleDecimal();
/**
* Deprecated - migrate to <code>.mapToScalar(Long.class).findOne()</code>.
* <pre>{@code
*
* .mapToScalar(Long.class)
* .findOne();
* }
*/
@Deprecated
Long findSingleLong();
/**
* Deprecated - migrate to <code>.mapToScalar(Long.class).findList()</code>.
* <pre>{@code
*
* .mapToScalar(Long.class)
* .findList();
* }
*/
@Deprecated
<T> List<T> findSingleAttributeList(Class<T> attributeType);
/** /**
* Set one of more positioned parameters. * Set one of more positioned parameters.
* <p> * <p>
@@ -194,12 +138,6 @@ public interface SqlQuery extends Serializable, CancelableQuery {
*/ */
SqlQuery setParameters(Object... values); SqlQuery setParameters(Object... values);
/**
* Deprecated migrate to setParameters(Object... values)
*/
@Deprecated
SqlQuery setParams(Object... values);
/** /**
* Set the next bind parameter by position. * Set the next bind parameter by position.
* <pre>{@code * <pre>{@code
@@ -287,12 +287,6 @@ public interface SqlUpdate {
*/ */
SqlUpdate setParameters(Object... values); SqlUpdate setParameters(Object... values);
/**
* Deprecated migrate to setParameters(Object... values).
*/
@Deprecated
SqlUpdate setParams(Object... values);
/** /**
* Set the next bind parameter by position. * Set the next bind parameter by position.
* *
@@ -300,12 +294,6 @@ public interface SqlUpdate {
*/ */
SqlUpdate setParameter(Object value); SqlUpdate setParameter(Object value);
/**
* Deprecated migrate to setParameter(value).
*/
@Deprecated
SqlUpdate setNextParameter(Object value);
/** /**
* Set a parameter via its index position. * Set a parameter via its index position.
*/ */
@@ -11,7 +11,7 @@ import java.util.ServiceLoader;
/** /**
* Lookup internal services. * Lookup internal services.
*/ */
class XServiceProvider { final class XServiceProvider {
private static SpiRawSqlService rawSqlService = initRawSql(); private static SpiRawSqlService rawSqlService = initRawSql();
@@ -18,7 +18,7 @@ import java.util.Set;
* <em>java.util.Collection</em>. The reason being that java.util.Map is not a * <em>java.util.Collection</em>. The reason being that java.util.Map is not a
* Collection. I realise this makes this name confusing so I apologise for that. * Collection. I realise this makes this name confusing so I apologise for that.
*/ */
public interface BeanCollection<E> extends Serializable { public interface BeanCollection<E> extends Serializable, ToStringAware {
enum ModifyListenMode { enum ModifyListenMode {
/** /**
@@ -11,7 +11,7 @@ import java.io.Serializable;
* general application consumption. * general application consumption.
* </p> * </p>
*/ */
public interface EntityBean extends Serializable { public interface EntityBean extends Serializable, ToStringAware {
/** /**
* Return all the property names in defined order. * Return all the property names in defined order.
@@ -116,4 +116,8 @@ public interface EntityBean extends Serializable {
throw new NotEnhancedException(); throw new NotEnhancedException();
} }
@Override
default void toString(ToStringBuilder builder) {
throw new NotEnhancedException();
}
} }
@@ -0,0 +1,12 @@
package io.ebean.bean;
/**
* A type that can participate in building toString content with ToStringBuilder.
*/
public interface ToStringAware {
/**
* Append to the ToStringBuilder.
*/
void toString(ToStringBuilder builder);
}
@@ -0,0 +1,163 @@
package io.ebean.bean;
import java.util.Collection;
import java.util.IdentityHashMap;
/**
* Helps build toString content taking into account recursion.
* <p>
* That is, it detects and handles the case where there are relationships that recurse
* and would otherwise become an infinite loop (e.g. bidirectional parent child).
*/
public final class ToStringBuilder {
/**
* The max number of objects that we allow before stopping content being appended.
*/
private static final int MAX = 100;
/**
* Max length of content in string form added for any given value.
*/
private static final int TRIM_LENGTH = 500;
/**
* The max total content after which we stop content being appended.
*/
private static final int MAX_TOTAL_CONTENT = 2000;
private final IdentityHashMap<Object, Integer> id = new IdentityHashMap<>();
private final StringBuilder sb = new StringBuilder(50);
private boolean first = true;
private int counter;
@Override
public String toString() {
return sb.toString();
}
/**
* Set of an object being added.
*/
public void start(Object bean) {
if (counter == 0) {
id.putIfAbsent(bean, 0);
}
if (counter <= MAX) {
sb.append(bean.getClass().getSimpleName()).append("@").append(counter).append("(");
}
}
/**
* Add a property as name value pair.
*/
public void add(String name, Object value) {
if (value != null && counter <= MAX) {
if (value instanceof BeanCollection) {
if (((BeanCollection<?>)value).isReference()) {
// suppress unloaded bean collections
return;
}
}
key(name);
value(value);
}
}
/**
* Add raw content.
*/
public void addRaw(String content) {
sb.append(content);
}
/**
* End of an object.
*/
public void end() {
if (counter <= MAX) {
sb.append(")");
}
}
private void key(String name) {
if (counter > MAX) {
return;
}
if (first) {
first = false;
} else {
sb.append(", ");
}
sb.append(name).append(":");
}
private void value(Object value) {
if (counter > MAX) {
return;
}
if (value instanceof ToStringAware) {
if (value instanceof BeanCollection) {
((ToStringAware) value).toString(this);
} else if (push(value)) {
((ToStringAware) value).toString(this);
}
} else if (value instanceof Collection) {
addCollection((Collection<?>) value);
} else {
String content = String.valueOf(value);
if (content.length() > TRIM_LENGTH) {
content = content.substring(0, TRIM_LENGTH) + " <trimmed>";
}
sb.append(content);
if (sb.length() >= MAX_TOTAL_CONTENT) {
sb.append(" ...");
counter += MAX;
}
}
}
/**
* Add a collection of values.
*/
public void addCollection(Collection<?> c) {
if (c == null || c.isEmpty()) {
sb.append("[]");
return;
}
boolean firstElement = true;
sb.append("[");
for (Object o : c) {
if (firstElement) {
firstElement = false;
} else {
sb.append(", ");
}
value(o);
if (counter > MAX) {
return;
}
}
sb.append("]");
}
private boolean push(Object bean) {
if (counter > MAX) {
return false;
}
if (counter == MAX) {
sb.append(" ...");
counter++;
return false;
}
Integer idx = id.putIfAbsent(bean, counter++);
if (idx != null) {
--counter;
sb.append(bean.getClass().getSimpleName()).append("@").append(idx);
return false;
}
first = true;
return true;
}
}
+15 -15
View File
@@ -1,5 +1,6 @@
package io.ebean.cache; package io.ebean.cache;
import io.avaje.lang.Nullable;
import io.ebean.meta.MetricVisitor; import io.ebean.meta.MetricVisitor;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
@@ -68,40 +69,39 @@ public interface ServerCache {
/** /**
* Return the number of entries in the cache. * Return the number of entries in the cache.
*/ */
int size(); default int size() {
return 0;
}
/** /**
* Return the hit ratio the cache is currently getting. * Return the hit ratio the cache is currently getting.
*/ */
default int hitRatio() { default int hitRatio() {
return getHitRatio(); return 0;
} }
/**
* Deprecated migrate to hitRatio().
*/
@Deprecated
int getHitRatio();
/** /**
* Return statistics for the cache. * Return statistics for the cache.
* *
* @param reset if true the statistics are reset. * @param reset if true the statistics are reset.
*/ */
@Nullable
default ServerCacheStatistics statistics(boolean reset) { default ServerCacheStatistics statistics(boolean reset) {
return getStatistics(reset); return null;
} }
/**
* Deprecated migrate to statistics().
*/
@Deprecated
ServerCacheStatistics getStatistics(boolean reset);
/** /**
* Visit the metrics for the cache. * Visit the metrics for the cache.
*/ */
default void visit(MetricVisitor visitor) { default void visit(MetricVisitor visitor) {
// do nothing by default // do nothing by default
} }
/**
* Unwrap the underlying ServerCache.
*/
@SuppressWarnings("unchecked")
default <T> T unwrap(Class<T> cls) {
return (T) this;
}
} }
@@ -13,6 +13,7 @@ public class ServerCacheConfig {
private final ServerCacheOptions cacheOptions; private final ServerCacheOptions cacheOptions;
private final CurrentTenantProvider tenantProvider; private final CurrentTenantProvider tenantProvider;
private final QueryCacheEntryValidate queryCacheEntryValidate; private final QueryCacheEntryValidate queryCacheEntryValidate;
private final TenantAwareKey tenantAwareKey;
public ServerCacheConfig(ServerCacheType type, String cacheKey, String shortName, ServerCacheOptions cacheOptions, CurrentTenantProvider tenantProvider, QueryCacheEntryValidate queryCacheEntryValidate) { public ServerCacheConfig(ServerCacheType type, String cacheKey, String shortName, ServerCacheOptions cacheOptions, CurrentTenantProvider tenantProvider, QueryCacheEntryValidate queryCacheEntryValidate) {
this.type = type; this.type = type;
@@ -21,6 +22,14 @@ public class ServerCacheConfig {
this.cacheOptions = cacheOptions; this.cacheOptions = cacheOptions;
this.tenantProvider = tenantProvider; this.tenantProvider = tenantProvider;
this.queryCacheEntryValidate = queryCacheEntryValidate; this.queryCacheEntryValidate = queryCacheEntryValidate;
this.tenantAwareKey = (tenantProvider == null) ? null : new TenantAwareKey(tenantProvider);
}
/**
* Return the ServerCache taking into account if multi-tenant is used.
*/
public ServerCache tenantAware(ServerCache cache) {
return tenantAwareKey == null ? cache : new TenantAwareCache(cache, tenantAwareKey);
} }
/** /**
@@ -23,14 +23,6 @@ public interface ServerCacheManager {
*/ */
boolean localL2Caching(); boolean localL2Caching();
/**
* Deprecated migrate to localL2Caching().
*/
@Deprecated
default boolean isLocalL2Caching() {
return localL2Caching();
}
/** /**
* Return all the cache regions. * Return all the cache regions.
*/ */
@@ -46,77 +38,36 @@ public interface ServerCacheManager {
*/ */
void enabledRegions(String regions); void enabledRegions(String regions);
/**
* Deprecated migrate to enabledRegions().
*/
@Deprecated
default void setEnabledRegions(String regions) {
enabledRegions(regions);
}
/** /**
* Enable or disable all the cache regions. * Enable or disable all the cache regions.
*/ */
void allRegionsEnabled(boolean enabled); void allRegionsEnabled(boolean enabled);
/**
* Deprecated migrate to allRegionsEnabled().
*/
@Deprecated
default void setAllRegionsEnabled(boolean enabled) {
allRegionsEnabled(enabled);
}
/** /**
* Return the cache region by name. Typically, to enable or disable the region. * Return the cache region by name. Typically, to enable or disable the region.
*/ */
ServerCacheRegion region(String name); ServerCacheRegion region(String name);
@Deprecated
default ServerCacheRegion getRegion(String name) {
return region(name);
}
/** /**
* Return the cache for mapping natural keys to id values. * Return the cache for mapping natural keys to id values.
*/ */
ServerCache naturalKeyCache(Class<?> beanType); ServerCache naturalKeyCache(Class<?> beanType);
@Deprecated
default ServerCache getNaturalKeyCache(Class<?> beanType) {
return naturalKeyCache(beanType);
}
/** /**
* Return the cache for beans of a particular type. * Return the cache for beans of a particular type.
*/ */
ServerCache beanCache(Class<?> beanType); ServerCache beanCache(Class<?> beanType);
@Deprecated
default ServerCache getBeanCache(Class<?> beanType) {
return beanCache(beanType);
}
/** /**
* Return the cache for associated many properties of a bean type. * Return the cache for associated many properties of a bean type.
*/ */
ServerCache collectionIdsCache(Class<?> beanType, String propertyName); ServerCache collectionIdsCache(Class<?> beanType, String propertyName);
@Deprecated
default ServerCache getCollectionIdsCache(Class<?> beanType, String propertyName) {
return collectionIdsCache(beanType, propertyName);
}
/** /**
* Return the cache for query results of a particular type of bean. * Return the cache for query results of a particular type of bean.
*/ */
ServerCache queryCache(Class<?> beanType); ServerCache queryCache(Class<?> beanType);
@Deprecated
default ServerCache getQueryCache(Class<?> beanType) {
return queryCache(beanType);
}
/** /**
* This clears both the bean and query cache for a given type. * This clears both the bean and query cache for a given type.
*/ */
@@ -10,14 +10,6 @@ public interface ServerCacheRegion {
*/ */
String name(); String name();
/**
* Deprecated migrate to name().
*/
@Deprecated
default String getName() {
return name();
}
/** /**
* Return true if the cache region is enabled. * Return true if the cache region is enabled.
*/ */
@@ -0,0 +1,104 @@
package io.ebean.cache;
import io.ebean.meta.MetricVisitor;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
/**
* A ServerCache proxy that is tenant aware.
*/
public final class TenantAwareCache implements ServerCache {
private final ServerCache delegate;
private final TenantAwareKey tenantAwareKey;
/**
* Create given the TenantAwareKey and delegate cache to proxy to.
*
* @param delegate The cache to proxy to
* @param tenantAwareKey Provides tenant aware keys to use in the cache
*/
public TenantAwareCache(ServerCache delegate, TenantAwareKey tenantAwareKey) {
this.delegate = delegate;
this.tenantAwareKey = tenantAwareKey;
}
/**
* Return the underlying ServerCache that is being delegated to.
*/
@Override
public <T> T unwrap(Class<T> cls) {
return (T)delegate;
}
@Override
public void visit(MetricVisitor visitor) {
delegate.visit(visitor);
}
private Object key(Object key) {
return tenantAwareKey.key(key);
}
@Override
public Object get(Object id) {
return delegate.get(key(id));
}
@Override
public void put(Object id, Object value) {
delegate.put(key(id), value);
}
@Override
public void remove(Object id) {
delegate.remove(key(id));
}
@Override
public void clear() {
delegate.clear();
}
@Override
public int size() {
return delegate.size();
}
@Override
public int hitRatio() {
return delegate.hitRatio();
}
@Override
public ServerCacheStatistics statistics(boolean reset) {
return delegate.statistics(reset);
}
@Override
public Map<Object, Object> getAll(Set<Object> keys) {
Map<Object, Object> keyMapping = new HashMap<>(keys.size());
keys.forEach(k -> keyMapping.put(key(k), k));
Map<Object, Object> tmp = delegate.getAll(keyMapping.keySet());
Map<Object, Object> ret = new HashMap<>(keys.size());
// unwrap tenant info here
tmp.forEach((k,v)-> ret.put(((TenantAwareKey.CacheKey) k).key, v));
return ret;
}
@Override
public void putAll(Map<Object, Object> keyValues) {
Map<Object, Object> tmp = new HashMap<>();
keyValues.forEach((k, v) -> tmp.put(key(k), v));
delegate.putAll(tmp);
}
@Override
public void removeAll(Set<Object> keys) {
delegate.removeAll(keys.stream().map(this::key).collect(Collectors.toSet()));
}
}
@@ -1,9 +1,6 @@
package io.ebean.common; package io.ebean.common;
import io.ebean.bean.BeanCollection; import io.ebean.bean.*;
import io.ebean.bean.BeanCollectionAdd;
import io.ebean.bean.BeanCollectionLoader;
import io.ebean.bean.EntityBean;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
@@ -47,6 +44,11 @@ public final class BeanList<E> extends AbstractBeanCollection<E> implements List
super(loader, ownerBean, propertyName); super(loader, ownerBean, propertyName);
} }
@Override
public void toString(ToStringBuilder builder) {
builder.addCollection(list);
}
@Override @Override
public void reset(EntityBean ownerBean, String propertyName) { public void reset(EntityBean ownerBean, String propertyName) {
this.ownerBean = ownerBean; this.ownerBean = ownerBean;
@@ -191,18 +193,11 @@ public final class BeanList<E> extends AbstractBeanCollection<E> implements List
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(50);
sb.append("BeanList ");
if (isReadOnly()) {
sb.append("readOnly ");
}
if (list == null) { if (list == null) {
sb.append("deferred "); return "BeanList<deferred>";
} else { } else {
sb.append("size[").append(list.size()).append("] "); return list.toString();
sb.append("list").append(list);
} }
return sb.toString();
} }
/** /**
@@ -3,6 +3,7 @@ package io.ebean.common;
import io.ebean.bean.BeanCollection; import io.ebean.bean.BeanCollection;
import io.ebean.bean.BeanCollectionLoader; import io.ebean.bean.BeanCollectionLoader;
import io.ebean.bean.EntityBean; import io.ebean.bean.EntityBean;
import io.ebean.bean.ToStringBuilder;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
@@ -40,6 +41,19 @@ public final class BeanMap<K, E> extends AbstractBeanCollection<E> implements Ma
super(ebeanServer, ownerBean, propertyName); super(ebeanServer, ownerBean, propertyName);
} }
@Override
public void toString(ToStringBuilder builder) {
if (map == null || map.isEmpty()) {
builder.addRaw("{}");
} else {
builder.addRaw("{");
for (Entry<K, E> entry : map.entrySet()) {
builder.add(String.valueOf(entry.getKey()), entry.getValue());
}
builder.addRaw("}");
}
}
@Override @Override
public void reset(EntityBean ownerBean, String propertyName) { public void reset(EntityBean ownerBean, String propertyName) {
this.ownerBean = ownerBean; this.ownerBean = ownerBean;
@@ -183,27 +197,20 @@ public final class BeanMap<K, E> extends AbstractBeanCollection<E> implements Ma
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(50);
sb.append("BeanMap ");
if (isReadOnly()) {
sb.append("readOnly ");
}
if (map == null) { if (map == null) {
sb.append("deferred "); return "BeanMap<deferred>";
} else { } else {
sb.append("size[").append(map.size()).append("]"); return map.toString();
sb.append(" map").append(map);
} }
return sb.toString();
} }
/** /**
* Equal if obj is a Map and equal in a Map sense. * Equal if object is a Map and equal in a Map sense.
*/ */
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object object) {
init(); init();
return map.equals(obj); return map.equals(object);
} }
@Override @Override
@@ -1,9 +1,6 @@
package io.ebean.common; package io.ebean.common;
import io.ebean.bean.BeanCollection; import io.ebean.bean.*;
import io.ebean.bean.BeanCollectionAdd;
import io.ebean.bean.BeanCollectionLoader;
import io.ebean.bean.EntityBean;
import java.io.Serializable; import java.io.Serializable;
import java.util.Collection; import java.util.Collection;
@@ -41,6 +38,11 @@ public final class BeanSet<E> extends AbstractBeanCollection<E> implements Set<E
super(loader, ownerBean, propertyName); super(loader, ownerBean, propertyName);
} }
@Override
public void toString(ToStringBuilder builder) {
builder.addCollection(set);
}
@Override @Override
public void reset(EntityBean ownerBean, String propertyName) { public void reset(EntityBean ownerBean, String propertyName) {
this.ownerBean = ownerBean; this.ownerBean = ownerBean;
@@ -169,18 +171,11 @@ public final class BeanSet<E> extends AbstractBeanCollection<E> implements Set<E
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(50);
sb.append("BeanSet ");
if (isReadOnly()) {
sb.append("readOnly ");
}
if (set == null) { if (set == null) {
sb.append("deferred "); return "BeanSet<deferred>";
} else { } else {
sb.append("size[").append(set.size()).append("]"); return set.toString();
sb.append(" set").append(set);
} }
return sb.toString();
} }
/** /**
@@ -25,14 +25,6 @@ public class QueryPlanCapture {
return database; return database;
} }
/**
* Deprecated migrate to database().
*/
@Deprecated
public Database getDatabase() {
return database;
}
/** /**
* Return the captured query plans. * Return the captured query plans.
*/ */
@@ -40,11 +32,4 @@ public class QueryPlanCapture {
return plans; return plans;
} }
/**
* Deprecated migrate to plans().
*/
@Deprecated
public List<MetaQueryPlan> getPlans() {
return plans;
}
} }
@@ -10,11 +10,4 @@ public interface MetaCountMetric extends MetaMetric {
*/ */
long count(); long count();
/**
* Migrate to count()
*/
@Deprecated
default long getCount() {
return count();
}
} }
@@ -10,11 +10,4 @@ public interface MetaMetric {
*/ */
String name(); String name();
/**
* Migrate to name().
*/
@Deprecated
default String getName() {
return name();
}
} }
@@ -10,40 +10,16 @@ public interface MetaQueryMetric extends MetaTimedMetric {
*/ */
Class<?> type(); Class<?> type();
/**
* Migrate to type().
*/
@Deprecated
default Class<?> getType() {
return type();
}
/** /**
* The label for the query (can be null). * The label for the query (can be null).
*/ */
String label(); String label();
/**
* Migrate to label().
*/
@Deprecated
default String getLabel() {
return label();
}
/** /**
* The actual SQL of the query. * The actual SQL of the query.
*/ */
String sql(); String sql();
/**
* Migrate to sql().
*/
@Deprecated
default String getSql() {
return sql();
}
/** /**
* Return the hash of the plan. * Return the hash of the plan.
*/ */
@@ -11,67 +11,26 @@ public interface MetaTimedMetric extends MetaMetric {
*/ */
String location(); String location();
/**
* Migrate to location()
*/
@Deprecated
default String getLocation() {
return location();
}
/** /**
* Return the total count. * Return the total count.
*/ */
long count(); long count();
/**
* Migrate to count()
*/
@Deprecated
default long getCount() {
return count();
}
/** /**
* Return the total execution time in micros. * Return the total execution time in micros.
*/ */
long total(); long total();
/**
* Migrate to total()
*/
@Deprecated
default long getTotal() {
return total();
}
/** /**
* Return the max execution time in micros. * Return the max execution time in micros.
*/ */
long max(); long max();
/**
* Migrate to max()
*/
@Deprecated
default long getMax() {
return max();
}
/** /**
* Return the mean execution time in micros. * Return the mean execution time in micros.
*/ */
long mean(); long mean();
/**
* Migrate to mean()
*/
@Deprecated
default long getMean() {
return mean();
}
/** /**
* Return true if this is the first metrics collection for this query. * Return true if this is the first metrics collection for this query.
* <p> * <p>
@@ -12,37 +12,14 @@ public interface ServerMetrics {
*/ */
List<MetaTimedMetric> timedMetrics(); List<MetaTimedMetric> timedMetrics();
/**
* Migrate to timedMetrics().
*/
@Deprecated
default List<MetaTimedMetric> getTimedMetrics() {
return timedMetrics();
}
/** /**
* Return the query metrics. * Return the query metrics.
*/ */
List<MetaQueryMetric> queryMetrics(); List<MetaQueryMetric> queryMetrics();
/**
* Migrate to queryMetrics().
*/
@Deprecated
default List<MetaQueryMetric> getQueryMetrics() {
return queryMetrics();
}
/** /**
* Return the Counter metrics. * Return the Counter metrics.
*/ */
List<MetaCountMetric> countMetrics(); List<MetaCountMetric> countMetrics();
/**
* Migrate to countMetrics().
*/
@Deprecated
default List<MetaCountMetric> getCountMetrics() {
return countMetrics();
}
} }
@@ -19,6 +19,7 @@ public interface ServerMetricsAsJson {
/** /**
* Set the sort property - see SortMetric * Set the sort property - see SortMetric
*
* @see SortMetric * @see SortMetric
*/ */
ServerMetricsAsJson withSort(Comparator<MetaTimedMetric> sortBy); ServerMetricsAsJson withSort(Comparator<MetaTimedMetric> sortBy);
@@ -35,9 +36,9 @@ public interface ServerMetricsAsJson {
*/ */
ServerMetricsAsJson withHeader(boolean withHeader); ServerMetricsAsJson withHeader(boolean withHeader);
/** /**
* Collect and write metrics as JSON to the given buffer. * Collect and write metrics as JSON to the given buffer.
*/ */
void write(Appendable buffer); void write(Appendable buffer);
/** /**
@@ -5,7 +5,7 @@ import java.util.Comparator;
/** /**
* Comparator for timed metrics sorted by name and then count. * Comparator for timed metrics sorted by name and then count.
*/ */
public class SortMetric { public final class SortMetric {
public static final Comparator<MetaCountMetric> COUNT_NAME = new CountName(); public static final Comparator<MetaCountMetric> COUNT_NAME = new CountName();
@@ -6,7 +6,7 @@ import java.util.ServiceLoader;
/** /**
* Lookup MetricFactory service. * Lookup MetricFactory service.
*/ */
class MetricServiceProvider { final class MetricServiceProvider {
private static final MetricFactory metricFactory = init(); private static final MetricFactory metricFactory = init();
@@ -12,14 +12,6 @@ public interface QueryPlanMetric {
*/ */
TimedMetric metric(); TimedMetric metric();
/**
* Deprecated migrate to metric().
*/
@Deprecated
default TimedMetric getMetric() {
return metric();
}
/** /**
* Visit the underlying metric. * Visit the underlying metric.
*/ */
@@ -16,28 +16,12 @@ public interface BeanDocType<T> {
/** /**
* Return the doc store index type for this bean type. * Return the doc store index type for this bean type.
*/ */
default String indexType() { String indexType();
return getIndexType();
}
/**
* Deprecated migrate to indexType().
*/
@Deprecated
String getIndexType();
/** /**
* Return the doc store index name for this bean type. * Return the doc store index name for this bean type.
*/ */
default String indexName() { String indexName();
return getIndexName();
}
/**
* Deprecated migrate to indexName().
*/
@Deprecated
String getIndexName();
/** /**
* Apply the appropriate fetch path to the query such that the query returns beans matching * Apply the appropriate fetch path to the query such that the query returns beans matching
@@ -48,29 +32,13 @@ public interface BeanDocType<T> {
/** /**
* Return the FetchPath for the embedded document. * Return the FetchPath for the embedded document.
*/ */
default FetchPath embedded(String path) { FetchPath embedded(String path);
return getEmbedded(path);
}
/**
* Deprecated migrate to embedded().
*/
@Deprecated
FetchPath getEmbedded(String path);
/** /**
* For embedded 'many' properties we need a FetchPath relative to the root which is used to * For embedded 'many' properties we need a FetchPath relative to the root which is used to
* build and replace the embedded list. * build and replace the embedded list.
*/ */
default FetchPath embeddedManyRoot(String path) { FetchPath embeddedManyRoot(String path);
return getEmbeddedManyRoot(path);
}
/**
* Deprecated migrate to embeddedManyRoot().
*/
@Deprecated
FetchPath getEmbeddedManyRoot(String path);
/** /**
* Return a 'raw' property mapped for the given property. * Return a 'raw' property mapped for the given property.
@@ -22,53 +22,21 @@ public interface BeanType<T> {
*/ */
String name(); String name();
/**
* Deprecated migrate to name().
*/
@Deprecated
default String getName() {
return name();
}
/** /**
* Return the full name of the bean type. * Return the full name of the bean type.
*/ */
String fullName(); String fullName();
/**
* Deprecated migrate to fullName().
*/
@Deprecated
default String getFullName() {
return fullName();
}
/** /**
* Return the class type this BeanDescriptor describes. * Return the class type this BeanDescriptor describes.
*/ */
Class<T> type(); Class<T> type();
/**
* Deprecated migrate to type().
*/
@Deprecated
default Class<T> getBeanType() {
return type();
}
/** /**
* Return the type bean for an OneToMany or ManyToOne or ManyToMany property. * Return the type bean for an OneToMany or ManyToOne or ManyToMany property.
*/ */
BeanType<?> beanTypeAtPath(String propertyName); BeanType<?> beanTypeAtPath(String propertyName);
/**
* Deprecated migrate to beanTypeAtPath().
*/
@Deprecated
default BeanType<?> getBeanTypeAtPath(String propertyName) {
return beanTypeAtPath(propertyName);
}
/** /**
* Return all the properties for this bean type. * Return all the properties for this bean type.
*/ */
@@ -79,53 +47,21 @@ public interface BeanType<T> {
*/ */
Property idProperty(); Property idProperty();
/**
* Deprecated migrate to idProperty().
*/
@Deprecated
default Property getIdProperty() {
return idProperty();
}
/** /**
* Return the when modified property if there is one defined. * Return the when modified property if there is one defined.
*/ */
Property whenModifiedProperty(); Property whenModifiedProperty();
/**
* Deprecated migrate to idProperty().
*/
@Deprecated
default Property getWhenModifiedProperty() {
return whenModifiedProperty();
}
/** /**
* Return the when created property if there is one defined. * Return the when created property if there is one defined.
*/ */
Property whenCreatedProperty(); Property whenCreatedProperty();
/**
* Deprecated migrate to idProperty().
*/
@Deprecated
default Property getWhenCreatedProperty() {
return whenCreatedProperty();
}
/** /**
* Return the Property to read values from a bean. * Return the Property to read values from a bean.
*/ */
Property property(String propertyName); Property property(String propertyName);
/**
* Deprecated migrate to property().
*/
@Deprecated
default Property getProperty(String propertyName) {
return property(propertyName);
}
/** /**
* Return the ExpressionPath for a given property path. * Return the ExpressionPath for a given property path.
* <p> * <p>
@@ -134,14 +70,6 @@ public interface BeanType<T> {
*/ */
ExpressionPath expressionPath(String path); ExpressionPath expressionPath(String path);
/**
* Deprecated migrate to expressionPath().
*/
@Deprecated
default ExpressionPath getExpressionPath(String path) {
return expressionPath(path);
}
/** /**
* Return true if the property is a valid known property or path for the given bean type. * Return true if the property is a valid known property or path for the given bean type.
*/ */
@@ -177,14 +105,6 @@ public interface BeanType<T> {
*/ */
String baseTable(); String baseTable();
/**
* Deprecated migrate to baseTable().
*/
@Deprecated
default String getBaseTable() {
return baseTable();
}
/** /**
* Create a new instance of the bean. * Create a new instance of the bean.
*/ */
@@ -195,98 +115,36 @@ public interface BeanType<T> {
*/ */
Object id(Object bean); Object id(Object bean);
/**
* Deprecated migrate to id()
*/
@Deprecated
default Object beanId(Object bean) {
return id(bean);
}
/**
* Deprecated migrate to id()
*/
@Deprecated
Object getBeanId(T bean);
/** /**
* Set the id value to the bean. * Set the id value to the bean.
*/ */
void setId(T bean, Object idValue); void setId(T bean, Object idValue);
/**
* Deprecated migrate to setId()
*/
@Deprecated
default void setBeanId(T bean, Object idValue) {
setId(bean, idValue);
}
/** /**
* Return the bean persist controller. * Return the bean persist controller.
*/ */
BeanPersistController persistController(); BeanPersistController persistController();
/**
* Deprecated migrate to persistController()
*/
@Deprecated
default BeanPersistController getPersistController() {
return persistController();
}
/** /**
* Return the bean persist listener. * Return the bean persist listener.
*/ */
BeanPersistListener persistListener(); BeanPersistListener persistListener();
/**
* Deprecated migrate to persistListener()
*/
@Deprecated
default BeanPersistListener getPersistListener() {
return persistListener();
}
/** /**
* Return the beanFinder. Usually null unless overriding the finder. * Return the beanFinder. Usually null unless overriding the finder.
*/ */
BeanFindController findController(); BeanFindController findController();
/**
* Deprecated migrate to findController()
*/
@Deprecated
default BeanFindController getFindController() {
return findController();
}
/** /**
* Return the BeanQueryAdapter or null if none is defined. * Return the BeanQueryAdapter or null if none is defined.
*/ */
BeanQueryAdapter queryAdapter(); BeanQueryAdapter queryAdapter();
/**
* Deprecated migrate to queryAdapter()
*/
@Deprecated
default BeanQueryAdapter getQueryAdapter() {
return queryAdapter();
}
/** /**
* Return the identity generation type. * Return the identity generation type.
*/ */
IdType idType(); IdType idType();
/**
* Deprecated migrate to idType()
*/
@Deprecated
default IdType getIdType() {
return idType();
}
/** /**
* Return true if this bean type has doc store backing. * Return true if this bean type has doc store backing.
*/ */
@@ -301,27 +159,11 @@ public interface BeanType<T> {
*/ */
DocMapping docMapping(); DocMapping docMapping();
/**
* Deprecated migrate to docMapping()
*/
@Deprecated
default DocMapping getDocMapping() {
return docMapping();
}
/** /**
* Return the doc store queueId for this bean type. * Return the doc store queueId for this bean type.
*/ */
String docStoreQueueId(); String docStoreQueueId();
/**
* Deprecated migrate to docStoreQueueId()
*/
@Deprecated
default String getDocStoreQueueId() {
return docStoreQueueId();
}
/** /**
* Return the doc store support for this bean type.\ * Return the doc store support for this bean type.\
*/ */
@@ -353,27 +195,11 @@ public interface BeanType<T> {
*/ */
List<BeanType<?>> inheritanceChildren(); List<BeanType<?>> inheritanceChildren();
/**
* Deprecated migrate to inheritanceChildren()
*/
@Deprecated
default List<BeanType<?>> getInheritanceChildren() {
return inheritanceChildren();
}
/** /**
* Returns the parent in inheritance hierarchy * Returns the parent in inheritance hierarchy
*/ */
BeanType<?> inheritanceParent(); BeanType<?> inheritanceParent();
/**
* Deprecated migrate to inheritanceParent()
*/
@Deprecated
default BeanType<?> getInheritanceParent() {
return inheritanceParent();
}
/** /**
* Visit all children recursively * Visit all children recursively
*/ */
@@ -384,14 +210,6 @@ public interface BeanType<T> {
*/ */
String discColumn(); String discColumn();
/**
* Deprecated migrate to discColumn()
*/
@Deprecated
default String getDiscColumn() {
return discColumn();
}
/** /**
* Create a bean given the discriminator value. * Create a bean given the discriminator value.
*/ */
@@ -39,14 +39,6 @@ public interface ExpressionPath {
*/ */
StringParser stringParser(); StringParser stringParser();
/**
* Deprecated migrate to stringParser().
*/
@Deprecated
default StringParser getStringParser() {
return stringParser();
}
/** /**
* For DateTime capable scalar types convert the long systemTimeMillis into * For DateTime capable scalar types convert the long systemTimeMillis into
* an appropriate java time (Date,Timestamp,Time,Calendar, JODA type etc). * an appropriate java time (Date,Timestamp,Time,Calendar, JODA type etc).
@@ -64,14 +56,6 @@ public interface ExpressionPath {
*/ */
int jdbcType(); int jdbcType();
/**
* Deprecated migrate to jdbcType().
*/
@Deprecated
default int getJdbcType() {
return jdbcType();
}
/** /**
* Return true if this is an ManyToOne or OneToOne associated bean property. * Return true if this is an ManyToOne or OneToOne associated bean property.
*/ */
@@ -85,50 +69,19 @@ public interface ExpressionPath {
*/ */
String assocIdExpression(String propName, String bindOperator); String assocIdExpression(String propName, String bindOperator);
/**
* Deprecated migrate to assocIdExpression().
*/
@Deprecated
default String getAssocIdExpression(String propName, String bindOperator) {
return assocIdExpression(propName, bindOperator);
}
/** /**
* Return the Id values for the given bean value. * Return the Id values for the given bean value.
*/ */
Object[] assocIdValues(EntityBean bean); Object[] assocIdValues(EntityBean bean);
/**
* Deprecated migrate to assocIdValues().
*/
@Deprecated
default Object[] getAssocIdValues(EntityBean bean) {
return assocIdValues(bean);
}
/** /**
* Return the underlying bean property. * Return the underlying bean property.
*/ */
Property property(); Property property();
/**
* Deprecated migrate to property().
*/
@Deprecated
default Property getProperty() {
return property();
}
/** /**
* The ElPrefix plus name. * The ElPrefix plus name.
*/ */
String elName(); String elName();
/**
* Deprecated migrate to elName().
*/
@Deprecated
default String getElName() {
return elName();
}
} }
@@ -10,40 +10,16 @@ public interface Property {
*/ */
String name(); String name();
/**
* Deprecated migrate to name().
*/
@Deprecated
default String getName() {
return name();
}
/** /**
* Return the type of the property. * Return the type of the property.
*/ */
Class<?> type(); Class<?> type();
/**
* Deprecated migrate to type().
*/
@Deprecated
default Class<?> getPropertyType() {
return type();
}
/** /**
* Return the value of the property on the given bean. * Return the value of the property on the given bean.
*/ */
Object value(Object bean); Object value(Object bean);
/**
* Deprecated migrate to value().
*/
@Deprecated
default Object getVal(Object bean) {
return value(bean);
}
/** /**
* Return true if this is a OneToMany or ManyToMany property. * Return true if this is a OneToMany or ManyToMany property.
*/ */
@@ -10,7 +10,7 @@ import java.util.Set;
/** /**
* Annotation utility methods to find annotations. * Annotation utility methods to find annotations.
*/ */
public class AnnotationUtil { public final class AnnotationUtil {
/** /**
* Determine if the supplied {@link Annotation} is defined in the core JDK {@code java.lang.annotation} package. * Determine if the supplied {@link Annotation} is defined in the core JDK {@code java.lang.annotation} package.
@@ -1,6 +1,6 @@
package io.ebean.util; package io.ebean.util;
public class CamelCaseHelper { public final class CamelCaseHelper {
/** /**
* To underscore from camel case using digits compressed true and force upper case false. * To underscore from camel case using digits compressed true and force upper case false.
@@ -16,7 +16,7 @@ import java.nio.charset.StandardCharsets;
* Utilities for IO. It uses UTF-8 as encoding when reading/writing and uses * Utilities for IO. It uses UTF-8 as encoding when reading/writing and uses
* buffered IO for better performance. * buffered IO for better performance.
*/ */
public class IOUtils { public final class IOUtils {
/** /**
* Read from stream as UTF-8. * Read from stream as UTF-8.
@@ -11,7 +11,7 @@ import java.sql.Statement;
/** /**
* Utility for closing raw Jdbc resources. * Utility for closing raw Jdbc resources.
*/ */
public class JdbcClose { public final class JdbcClose {
private static final Logger log = LoggerFactory.getLogger("io.ebean"); private static final Logger log = LoggerFactory.getLogger("io.ebean");
@@ -3,7 +3,7 @@ package io.ebean.util;
/** /**
* Helper for dot notation property paths. * Helper for dot notation property paths.
*/ */
public class SplitName { public final class SplitName {
private static final char PERIOD = '.'; private static final char PERIOD = '.';
@@ -7,7 +7,7 @@ import java.util.regex.Pattern;
/** /**
* Utility String class that supports String manipulation functions. * Utility String class that supports String manipulation functions.
*/ */
public class StringHelper { public final class StringHelper {
private static final Pattern SPLIT_NAMES = Pattern.compile("[\\s,;]+"); private static final Pattern SPLIT_NAMES = Pattern.compile("[\\s,;]+");
@@ -0,0 +1,223 @@
package io.ebean.bean;
import io.ebean.common.BeanList;
import io.ebean.common.BeanMap;
import io.ebean.common.BeanSet;
import org.junit.jupiter.api.Test;
import java.util.*;
import static org.assertj.core.api.Assertions.assertThat;
class ToStringBuilderTest {
@Test
void basic() {
ToStringBuilder builder = new ToStringBuilder();
builder.start(new Object());
builder.end();
assertThat(builder.toString()).isEqualTo("Object@0()");
}
@Test
void fields() {
ToStringBuilder builder = new ToStringBuilder();
builder.start(new Object());
builder.add("a", 1);
builder.add("b", "B");
builder.end();
assertThat(builder.toString()).isEqualTo("Object@0(a:1, b:B)");
}
@Test
void max100Beans_expect_noMoreContentAfterMax100() {
String loop100 = addLoopForMaxBeans(100);
String loop101 = addLoopForMaxBeans(101);
String loop900 = addLoopForMaxBeans(900);
assertThat(loop100).isEqualTo(loop101);
assertThat(loop101).isEqualTo(loop900);
}
private String addLoopForMaxBeans(int loopMax) {
ToStringBuilder builder = new ToStringBuilder();
builder.start(new Object());
for (int i = 0; i <= loopMax; i++) {
addForMax(builder, i);
}
builder.end();
return builder.toString();
}
private void addForMax(ToStringBuilder builder, int i) {
builder.add("c", new B(i));
}
@Test
void maxContent_expect_noMoreContentAfterMax2000() {
String loop23 = addContentLoop(23);
String loop24 = addContentLoop(24);
String loop25 = addContentLoop(25);
assertThat(loop23).isEqualTo(loop24);
assertThat(loop23).isEqualTo(loop25);
}
private String addContentLoop(int loopMax) {
ToStringBuilder builder = new ToStringBuilder();
builder.start(new Object());
for (int i = 0; i <= loopMax; i++) {
addForMaxContent(builder, i);
}
builder.end();
return builder.toString();
}
private void addForMaxContent(ToStringBuilder builder, int i) {
builder.add("someContentThatAddsUp", new Recurse(i, "SomeContentThatAddsUp_SomeContentThatAddsUp!!"));
}
@Test
void add_referenceBeanCollection_expect_nothingAdded() {
ToStringBuilder builder = new ToStringBuilder();
builder.add("ref", new BeanList<>(null));
assertThat(builder.toString()).isEqualTo("");
}
@Test
void addCollection_some() {
ToStringBuilder builder = new ToStringBuilder();
builder.addCollection( new BeanList<>(List.of("A","B")));
assertThat(builder.toString()).isEqualTo("[A, B]");
}
@Test
void addCollection_null() {
ToStringBuilder builder = new ToStringBuilder();
builder.addCollection(null);
assertThat(builder.toString()).isEqualTo("[]");
}
@Test
void addCollection_empty() {
ToStringBuilder builder = new ToStringBuilder();
builder.addCollection(Collections.emptyList());
assertThat(builder.toString()).isEqualTo("[]");
}
@Test
void flatBean() {
Recurse instance0 = new Recurse(42, "java");
assertThat(instance0.toString()).isEqualTo("Recurse@0(id:42, nm:java)");
}
@Test
void recursive_expect_reference() {
Recurse instance0 = new Recurse(42, "java");
instance0.other = instance0;
assertThat(instance0.toString()).isEqualTo("Recurse@0(id:42, nm:java, other:Recurse@0)");
}
@Test
void notRecursive() {
Recurse instance0 = new Recurse(42, "java");
instance0.other = new Recurse(43, "jvm");
assertThat(instance0.toString()).isEqualTo("Recurse@0(id:42, nm:java, other:Recurse@1(id:43, nm:jvm))");
}
@Test
void beanList_null_empty() {
assertThat(toStringFor(new BeanList<String>(null))).isEqualTo("[]");
assertThat(toStringFor(new BeanList<String>(Collections.emptyList()))).isEqualTo("[]");
}
@Test
void beanSet_null_empty() {
assertThat(toStringFor(new BeanSet<String>(null))).isEqualTo("[]");
assertThat(toStringFor(new BeanSet<String>(Collections.emptySet()))).isEqualTo("[]");
}
@Test
void beanMap_null_empty() {
assertThat(toStringFor(new BeanMap<String, String>(null))).isEqualTo("{}");
assertThat(toStringFor(new BeanMap<String, String>(Collections.emptyMap()))).isEqualTo("{}");
}
@Test
void beanList_some() {
BeanList<Recurse> list = new BeanList<>(List.of(new Recurse(1, "a"), new Recurse(2, "b")));
assertThat(toStringFor(list)).isEqualTo("[Recurse@1(id:1, nm:a), Recurse@2(id:2, nm:b)]");
}
@Test
void beanSet_some() {
BeanSet<Recurse> list = new BeanSet<>(new LinkedHashSet<>(List.of(new Recurse(1, "a"), new Recurse(2, "b"))));
assertThat(toStringFor(list)).isEqualTo("[Recurse@1(id:1, nm:a), Recurse@2(id:2, nm:b)]");
}
@Test
void beanMap_some() {
Map<String, Recurse> under = new LinkedHashMap<>();
under.put("a", new Recurse(1, "a"));
under.put("b", new Recurse(2, "b"));
BeanMap<String, Recurse> list = new BeanMap<>(under);
assertThat(toStringFor(list)).isEqualTo("{a:Recurse@1(id:1, nm:a), b:Recurse@2(id:2, nm:b)}");
}
private String toStringFor(ToStringAware aware) {
ToStringBuilder builder = new ToStringBuilder();
aware.toString(builder);
return builder.toString();
}
static final class Recurse implements ToStringAware {
final int id;
final String nm;
Recurse other;
Recurse(int id, String nm) {
this.id = id;
this.nm = nm;
}
public String toString() {
ToStringBuilder builder = new ToStringBuilder();
toString(builder);
return builder.toString();
}
@Override
public void toString(ToStringBuilder builder) {
builder.start(this);
builder.add("id", id);
builder.add("nm", nm);
builder.add("other", other);
builder.end();
}
}
static final class B implements ToStringAware {
final int id;
B(int id) {
this.id = id;
}
public String toString() {
ToStringBuilder builder = new ToStringBuilder();
toString(builder);
return builder.toString();
}
@Override
public void toString(ToStringBuilder builder) {
builder.start(this);
builder.add("b", id);
builder.end();
}
}
}
@@ -0,0 +1,113 @@
package io.ebean.cache;
import io.ebean.cache.TenantAwareKey.CacheKey;
import io.ebean.config.CurrentTenantProvider;
import org.junit.jupiter.api.Test;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import static org.assertj.core.api.Assertions.assertThat;
class TenantAwareCacheTest {
ServerCache serverCache;
TenantAwareCache cache;
TenantAwareCacheTest() {
TenantAwareKey key = new TenantAwareKey(new TenantProv());
this.serverCache = new Cache();
this.cache = new TenantAwareCache(serverCache, key);
}
@Test
void put_get_remove() {
cache.put("A", "a");
Object val = cache.get("A");
assertThat(val).isEqualTo("a");
CacheKey cacheKey = new CacheKey("A", 42);
Object val2 = serverCache.get(cacheKey);
assertThat(val2).isEqualTo("a");
cache.put("B", "bb");
assertThat(cache.size()).isEqualTo(2);
cache.remove("A");
assertThat(cache.get("A")).isNull();
assertThat(cache.size()).isEqualTo(1);
cache.clear();
assertThat(cache.size()).isEqualTo(0);
assertThat(cache.get("B")).isNull();
}
@Test
void putAll_getAll_removeAll() {
Map<Object, Object> map = new HashMap<>();
map.put("A", "a");
map.put("B", "b");
map.put("C", "c");
cache.putAll(map);
assertThat(cache.size()).isEqualTo(3);
assertThat(cache.get("A")).isEqualTo("a");
assertThat(serverCache.get(new CacheKey("A", 42))).isEqualTo("a");
Map<Object, Object> result = cache.getAll(Set.of("A", "B", "C", "D"));
assertThat(result).hasSize(3);
assertThat(result).containsOnlyKeys("A", "B", "C");
assertThat(result.values()).containsOnly("a", "b", "c");
cache.removeAll(Set.of("A", "C", "D"));
assertThat(cache.size()).isEqualTo(1);
assertThat(cache.get("B")).isEqualTo("b");
assertThat(serverCache.get(new CacheKey("B", 42))).isEqualTo("b");
cache.remove("B");
assertThat(cache.size()).isEqualTo(0);
}
static class TenantProv implements CurrentTenantProvider {
@Override
public Object currentId() {
return 42;
}
}
static class Cache implements ServerCache {
Map<Object, Object> map = new ConcurrentHashMap<>();
@Override
public Object get(Object id) {
return map.get(id);
}
@Override
public void put(Object id, Object value) {
map.put(id, value);
}
@Override
public void remove(Object id) {
map.remove(id);
}
@Override
public void clear() {
map.clear();
}
@Override
public int size() {
return map.size();
}
}
}
@@ -1,4 +1,4 @@
package io.ebean.xtest.config; package io.ebean.config;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import io.ebean.annotation.MutationDetection; import io.ebean.annotation.MutationDetection;
@@ -17,11 +17,10 @@ import java.util.Properties;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*;
public class DatabaseConfigTest { class DatabaseConfigTest {
@Test @Test
public void testLoadFromEbeanProperties() { void testLoadFromEbeanProperties() {
DatabaseConfig config = new DatabaseConfig(); DatabaseConfig config = new DatabaseConfig();
config.loadFromProperties(); config.loadFromProperties();
@@ -30,8 +29,7 @@ public class DatabaseConfigTest {
} }
@Test @Test
public void evalPropertiesInput() { void evalPropertiesInput() {
String home = System.getProperty("user.home"); String home = System.getProperty("user.home");
String fileSeparator = System.getProperty("file.separator"); String fileSeparator = System.getProperty("file.separator");
@@ -46,8 +44,7 @@ public class DatabaseConfigTest {
} }
@Test @Test
public void testLoadWithProperties() { void testLoadWithProperties() {
DatabaseConfig config = new DatabaseConfig(); DatabaseConfig config = new DatabaseConfig();
config.setPersistBatch(PersistBatch.NONE); config.setPersistBatch(PersistBatch.NONE);
config.setPersistBatchOnCascade(PersistBatch.NONE); config.setPersistBatchOnCascade(PersistBatch.NONE);
@@ -154,8 +151,7 @@ public class DatabaseConfigTest {
} }
@Test @Test
public void test_defaults() { void test_defaults() {
DatabaseConfig config = new DatabaseConfig(); DatabaseConfig config = new DatabaseConfig();
assertTrue(config.isIdGeneratorAutomatic()); assertTrue(config.isIdGeneratorAutomatic());
assertTrue(config.isDefaultServer()); assertTrue(config.isDefaultServer());
@@ -186,8 +182,7 @@ public class DatabaseConfigTest {
} }
@Test @Test
public void test_putServiceObject() { void test_putServiceObject() {
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
DatabaseConfig config = new DatabaseConfig(); DatabaseConfig config = new DatabaseConfig();
+4 -4
View File
@@ -4,7 +4,7 @@
<parent> <parent>
<artifactId>ebean-parent</artifactId> <artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</parent> </parent>
<!-- <parent>--> <!-- <parent>-->
<!-- <groupId>org.avaje</groupId>--> <!-- <groupId>org.avaje</groupId>-->
@@ -26,7 +26,7 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId> <artifactId>ebean-core</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
@@ -55,7 +55,7 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-platform-h2</artifactId> <artifactId>ebean-platform-h2</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
@@ -70,7 +70,7 @@
<extensions>true</extensions> <extensions>true</extensions>
<configuration> <configuration>
<tiles> <tiles>
<tile>io.ebean.tile:enhancement:13.0.1-RC1</tile> <tile>io.ebean.tile:enhancement:13.3.0</tile>
</tiles> </tiles>
</configuration> </configuration>
</plugin> </plugin>
+15 -15
View File
@@ -4,7 +4,7 @@
<parent> <parent>
<artifactId>ebean-parent</artifactId> <artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</parent> </parent>
<name>ebean bom</name> <name>ebean bom</name>
@@ -71,88 +71,88 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean</artifactId> <artifactId>ebean</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId> <artifactId>ebean-api</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId> <artifactId>ebean-core</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-core-type</artifactId> <artifactId>ebean-core-type</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-ddl-generator</artifactId> <artifactId>ebean-ddl-generator</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-externalmapping-api</artifactId> <artifactId>ebean-externalmapping-api</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-externalmapping-xml</artifactId> <artifactId>ebean-externalmapping-xml</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-autotune</artifactId> <artifactId>ebean-autotune</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId> <artifactId>ebean-querybean</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>querybean-generator</artifactId> <artifactId>querybean-generator</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>kotlin-querybean-generator</artifactId> <artifactId>kotlin-querybean-generator</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId> <artifactId>ebean-test</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-postgis</artifactId> <artifactId>ebean-postgis</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-redis</artifactId> <artifactId>ebean-redis</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
+2 -2
View File
@@ -4,7 +4,7 @@
<parent> <parent>
<artifactId>ebean-parent</artifactId> <artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</parent> </parent>
<artifactId>ebean-core-type</artifactId> <artifactId>ebean-core-type</artifactId>
@@ -16,7 +16,7 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId> <artifactId>ebean-api</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
+7 -7
View File
@@ -3,7 +3,7 @@
<parent> <parent>
<artifactId>ebean-parent</artifactId> <artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</parent> </parent>
<artifactId>ebean-core</artifactId> <artifactId>ebean-core</artifactId>
@@ -41,19 +41,19 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId> <artifactId>ebean-api</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-core-type</artifactId> <artifactId>ebean-core-type</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-externalmapping-api</artifactId> <artifactId>ebean-externalmapping-api</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
@@ -144,21 +144,21 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-platform-h2</artifactId> <artifactId>ebean-platform-h2</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId> <artifactId>ebean-platform-postgres</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-platform-sqlserver</artifactId> <artifactId>ebean-platform-sqlserver</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
@@ -2,14 +2,7 @@ package io.ebeaninternal.server.cache;
import io.ebeaninternal.server.deploy.BeanDescriptor; import io.ebeaninternal.server.deploy.BeanDescriptor;
import java.util.ArrayList; import java.util.*;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
/** /**
* List of changes to be applied to L2 cache. * List of changes to be applied to L2 cache.
@@ -3,12 +3,7 @@ package io.ebeaninternal.server.cache;
import io.ebean.annotation.Cache; import io.ebean.annotation.Cache;
import io.ebean.annotation.CacheBeanTuning; import io.ebean.annotation.CacheBeanTuning;
import io.ebean.annotation.CacheQueryTuning; import io.ebean.annotation.CacheQueryTuning;
import io.ebean.cache.QueryCacheEntryValidate; import io.ebean.cache.*;
import io.ebean.cache.ServerCache;
import io.ebean.cache.ServerCacheConfig;
import io.ebean.cache.ServerCacheFactory;
import io.ebean.cache.ServerCacheOptions;
import io.ebean.cache.ServerCacheType;
import io.ebean.config.CurrentTenantProvider; import io.ebean.config.CurrentTenantProvider;
import io.ebean.meta.MetricVisitor; import io.ebean.meta.MetricVisitor;
import io.ebean.util.AnnotationUtil; import io.ebean.util.AnnotationUtil;
@@ -3,7 +3,6 @@ package io.ebeaninternal.server.cache;
import io.ebean.BackgroundExecutor; import io.ebean.BackgroundExecutor;
import io.ebean.cache.ServerCache; import io.ebean.cache.ServerCache;
import io.ebean.cache.ServerCacheStatistics; import io.ebean.cache.ServerCacheStatistics;
import io.ebean.cache.TenantAwareKey;
import io.ebean.meta.MetricVisitor; import io.ebean.meta.MetricVisitor;
import io.ebean.metric.CountMetric; import io.ebean.metric.CountMetric;
import io.ebean.metric.MetricFactory; import io.ebean.metric.MetricFactory;
@@ -12,11 +11,7 @@ import org.slf4j.LoggerFactory;
import java.io.Serializable; import java.io.Serializable;
import java.lang.ref.SoftReference; import java.lang.ref.SoftReference;
import java.util.ArrayList; import java.util.*;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
/** /**
@@ -52,14 +47,12 @@ public class DefaultServerCache implements ServerCache {
private final int trimFrequency; private final int trimFrequency;
private final int maxIdleSecs; private final int maxIdleSecs;
private final int maxSecsToLive; private final int maxSecsToLive;
private final TenantAwareKey tenantAwareKey;
public DefaultServerCache(DefaultServerCacheConfig config) { public DefaultServerCache(DefaultServerCacheConfig config) {
this.name = config.getName(); this.name = config.getName();
this.shortName = config.getShortName(); this.shortName = config.getShortName();
this.map = config.getMap(); this.map = config.getMap();
this.maxSize = config.getMaxSize(); this.maxSize = config.getMaxSize();
this.tenantAwareKey = new TenantAwareKey(config.getTenantProvider());
this.maxIdleSecs = config.getMaxIdleSecs(); this.maxIdleSecs = config.getMaxIdleSecs();
this.maxSecsToLive = config.getMaxSecsToLive(); this.maxSecsToLive = config.getMaxSecsToLive();
this.trimFrequency = config.determineTrimFrequency(); this.trimFrequency = config.determineTrimFrequency();
@@ -92,7 +85,7 @@ public class DefaultServerCache implements ServerCache {
} }
@Override @Override
public ServerCacheStatistics getStatistics(boolean reset) { public ServerCacheStatistics statistics(boolean reset) {
ServerCacheStatistics cacheStats = new ServerCacheStatistics(); ServerCacheStatistics cacheStats = new ServerCacheStatistics();
cacheStats.setCacheName(name); cacheStats.setCacheName(name);
cacheStats.setMaxSize(maxSize); cacheStats.setMaxSize(maxSize);
@@ -121,7 +114,7 @@ public class DefaultServerCache implements ServerCache {
} }
@Override @Override
public int getHitRatio() { public int hitRatio() {
long mc = missCount.get(false); long mc = missCount.get(false);
long hc = hitCount.get(false); long hc = hitCount.get(false);
long totalCount = hc + mc; long totalCount = hc + mc;
@@ -152,19 +145,12 @@ public class DefaultServerCache implements ServerCache {
map.clear(); map.clear();
} }
/**
* Return the tenant aware key.
*/
protected Object key(Object id) {
return tenantAwareKey.key(id);
}
/** /**
* Return a value from the cache. * Return a value from the cache.
*/ */
@Override @Override
public Object get(Object id) { public Object get(Object key) {
CacheEntry entry = getCacheEntry(id); CacheEntry entry = getCacheEntry(key);
if (entry == null) { if (entry == null) {
missCount.increment(); missCount.increment();
return null; return null;
@@ -184,8 +170,8 @@ public class DefaultServerCache implements ServerCache {
/** /**
* Get the cache entry - override for query cache to validate dependent tables. * Get the cache entry - override for query cache to validate dependent tables.
*/ */
protected CacheEntry getCacheEntry(Object id) { protected CacheEntry getCacheEntry(Object key) {
final SoftReference<CacheEntry> ref = map.get(key(id)); final SoftReference<CacheEntry> ref = map.get(key);
return ref != null ? ref.get() : null; return ref != null ? ref.get() : null;
} }
@@ -198,8 +184,7 @@ public class DefaultServerCache implements ServerCache {
* Put a value into the cache. * Put a value into the cache.
*/ */
@Override @Override
public void put(Object id, Object value) { public void put(Object key, Object value) {
Object key = key(id);
map.put(key, new SoftReference<>(new CacheEntry(key, value))); map.put(key, new SoftReference<>(new CacheEntry(key, value)));
putCount.increment(); putCount.increment();
} }
@@ -208,8 +193,8 @@ public class DefaultServerCache implements ServerCache {
* Remove an entry from the cache. * Remove an entry from the cache.
*/ */
@Override @Override
public void remove(Object id) { public void remove(Object key) {
SoftReference<CacheEntry> entry = map.remove(key(id)); SoftReference<CacheEntry> entry = map.remove(key);
if (entry != null && entry.get() != null) { if (entry != null && entry.get() != null) {
removeCount.increment(); removeCount.increment();
} }
@@ -3,7 +3,6 @@ package io.ebeaninternal.server.cache;
import io.ebean.cache.QueryCacheEntryValidate; import io.ebean.cache.QueryCacheEntryValidate;
import io.ebean.cache.ServerCacheConfig; import io.ebean.cache.ServerCacheConfig;
import io.ebean.cache.ServerCacheOptions; import io.ebean.cache.ServerCacheOptions;
import io.ebean.config.CurrentTenantProvider;
import io.ebeaninternal.server.cache.DefaultServerCache.CacheEntry; import io.ebeaninternal.server.cache.DefaultServerCache.CacheEntry;
import java.lang.ref.SoftReference; import java.lang.ref.SoftReference;
@@ -34,10 +33,6 @@ public final class DefaultServerCacheConfig {
this.maxSize = options.getMaxSize(); this.maxSize = options.getMaxSize();
} }
public CurrentTenantProvider getTenantProvider() {
return config.getTenantProvider();
}
public QueryCacheEntryValidate getQueryCacheEntryValidate() { public QueryCacheEntryValidate getQueryCacheEntryValidate() {
return config.getQueryCacheEntryValidate(); return config.getQueryCacheEntryValidate();
} }
@@ -1,11 +1,7 @@
package io.ebeaninternal.server.cache; package io.ebeaninternal.server.cache;
import io.ebean.BackgroundExecutor; import io.ebean.BackgroundExecutor;
import io.ebean.cache.ServerCache; import io.ebean.cache.*;
import io.ebean.cache.ServerCacheConfig;
import io.ebean.cache.ServerCacheFactory;
import io.ebean.cache.ServerCacheNotification;
import io.ebean.cache.ServerCacheNotify;
/** /**
@@ -41,7 +37,7 @@ final class DefaultServerCacheFactory implements ServerCacheFactory {
if (executor != null) { if (executor != null) {
cache.periodicTrim(executor); cache.periodicTrim(executor);
} }
return cache; return config.tenantAware(cache);
} }
@Override @Override
@@ -10,11 +10,7 @@ import io.ebeaninternal.server.deploy.DCacheRegion;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* Manages the bean and query caches. * Manages the bean and query caches.
@@ -27,8 +27,7 @@ public class DefaultServerQueryCache extends DefaultServerCache {
} }
@Override @Override
protected CacheEntry getCacheEntry(Object id) { protected CacheEntry getCacheEntry(Object key) {
Object key = key(id);
final SoftReference<CacheEntry> ref = map.get(key); final SoftReference<CacheEntry> ref = map.get(key);
CacheEntry entry = ref != null ? ref.get() : null; CacheEntry entry = ref != null ? ref.get() : null;
if (entry == null) { if (entry == null) {
@@ -978,21 +978,11 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
return new DefaultRelationalQuery(this, sql.trim()); return new DefaultRelationalQuery(this, sql.trim());
} }
@Override
public SqlQuery createSqlQuery(String sql) {
return sqlQuery(sql);
}
@Override @Override
public SqlUpdate sqlUpdate(String sql) { public SqlUpdate sqlUpdate(String sql) {
return new DefaultSqlUpdate(this, sql.trim()); return new DefaultSqlUpdate(this, sql.trim());
} }
@Override
public SqlUpdate createSqlUpdate(String sql) {
return sqlUpdate(sql);
}
@Override @Override
public CallableSql createCallableSql(String sql) { public CallableSql createCallableSql(String sql) {
return new DefaultCallableSql(this, sql.trim()); return new DefaultCallableSql(this, sql.trim());
@@ -1376,11 +1366,6 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
} }
} }
@Override
public <T> Stream<T> findLargeStream(Query<T> query, Transaction transaction) {
return findStream(query, transaction);
}
@Override @Override
public <T> Stream<T> findStream(Query<T> query, Transaction transaction) { public <T> Stream<T> findStream(Query<T> query, Transaction transaction) {
return toStream(findIterate(query, transaction)); return toStream(findIterate(query, transaction));
@@ -261,16 +261,6 @@ public final class DefaultSqlUpdate implements Serializable, SpiSqlUpdate {
return this; return this;
} }
@Override
public SqlUpdate setParams(Object... values) {
return setParameters(values);
}
@Override
public SqlUpdate setNextParameter(Object value) {
return setParameter(value);
}
@Override @Override
public SqlUpdate setParameters(Object... values) { public SqlUpdate setParameters(Object... values) {
for (Object value : values) { for (Object value : values) {
@@ -2114,10 +2114,10 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
return getId((EntityBean) bean); return getId((EntityBean) bean);
} }
@Override // @Override
public Object getBeanId(T bean) { // public Object beanId(T bean) {
return getId((EntityBean) bean); // return getId((EntityBean) bean);
} // }
/** /**
* Return the Id value for the bean with embeddedId beans converted into maps. * Return the Id value for the bean with embeddedId beans converted into maps.
@@ -219,9 +219,7 @@ public class DeployBeanProperty {
return (AnnotationUtil.has(field, WhenCreated.class) return (AnnotationUtil.has(field, WhenCreated.class)
|| AnnotationUtil.has(field, WhenModified.class) || AnnotationUtil.has(field, WhenModified.class)
|| AnnotationUtil.has(field, WhoModified.class) || AnnotationUtil.has(field, WhoModified.class)
|| AnnotationUtil.has(field, WhoCreated.class) || AnnotationUtil.has(field, WhoCreated.class));
|| AnnotationUtil.has(field, UpdatedTimestamp.class)
|| AnnotationUtil.has(field, CreatedTimestamp.class));
} }
public String getFullBeanName() { public String getFullBeanName() {
@@ -1,38 +1,7 @@
package io.ebeaninternal.server.deploy.parse; package io.ebeaninternal.server.deploy.parse;
import io.ebean.annotation.Aggregation;
import io.ebean.annotation.CreatedTimestamp;
import io.ebean.annotation.DbArray;
import io.ebean.annotation.DbComment;
import io.ebean.annotation.DbDefault;
import io.ebean.annotation.DbJson;
import io.ebean.annotation.DbJsonB;
import io.ebean.annotation.DbMap;
import io.ebean.annotation.DbMigration;
import io.ebean.annotation.DocCode;
import io.ebean.annotation.DocEmbedded;
import io.ebean.annotation.DocProperty;
import io.ebean.annotation.DocSortable;
import io.ebean.annotation.Draft;
import io.ebean.annotation.DraftDirty;
import io.ebean.annotation.DraftOnly;
import io.ebean.annotation.DraftReset;
import io.ebean.annotation.Encrypted;
import io.ebean.annotation.Expose;
import io.ebean.annotation.Formula;
import io.ebean.annotation.HistoryExclude;
import io.ebean.annotation.Identity;
import io.ebean.annotation.Index; import io.ebean.annotation.Index;
import io.ebean.annotation.JsonIgnore; import io.ebean.annotation.*;
import io.ebean.annotation.Length;
import io.ebean.annotation.SoftDelete;
import io.ebean.annotation.TenantId;
import io.ebean.annotation.UnmappedJson;
import io.ebean.annotation.UpdatedTimestamp;
import io.ebean.annotation.WhenCreated;
import io.ebean.annotation.WhenModified;
import io.ebean.annotation.WhoCreated;
import io.ebean.annotation.WhoModified;
import io.ebean.config.EncryptDeploy; import io.ebean.config.EncryptDeploy;
import io.ebean.config.EncryptDeploy.Mode; import io.ebean.config.EncryptDeploy.Mode;
import io.ebean.config.dbplatform.DbEncrypt; import io.ebean.config.dbplatform.DbEncrypt;
@@ -51,24 +20,7 @@ import io.ebeaninternal.server.type.ScalarTypeBytesBase;
import io.ebeaninternal.server.type.ScalarTypeBytesEncrypted; import io.ebeaninternal.server.type.ScalarTypeBytesEncrypted;
import io.ebeaninternal.server.type.ScalarTypeEncryptedWrapper; import io.ebeaninternal.server.type.ScalarTypeEncryptedWrapper;
import javax.persistence.Basic; import javax.persistence.*;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.PersistenceException;
import javax.persistence.SequenceGenerator;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import javax.persistence.Version;
import java.sql.Types; import java.sql.Types;
import java.util.Set; import java.util.Set;
import java.util.UUID; import java.util.UUID;
@@ -339,10 +291,10 @@ final class AnnotationFields extends AnnotationParser {
} }
private void initWhen(DeployBeanProperty prop) { private void initWhen(DeployBeanProperty prop) {
if (has(prop, WhenCreated.class) || has(prop, CreatedTimestamp.class)) { if (has(prop, WhenCreated.class)) {
generatedPropFactory.setInsertTimestamp(prop); generatedPropFactory.setInsertTimestamp(prop);
} }
if (has(prop, WhenModified.class) || has(prop, UpdatedTimestamp.class)) { if (has(prop, WhenModified.class)) {
generatedPropFactory.setUpdateTimestamp(prop); generatedPropFactory.setUpdateTimestamp(prop);
} }
} }
@@ -48,7 +48,6 @@ final class DCountMetric implements CountMetric {
@Override @Override
public void visit(MetricVisitor visitor) { public void visit(MetricVisitor visitor) {
long val = visitor.reset() ? count.sumThenReset() : count.sum(); long val = visitor.reset() ? count.sumThenReset() : count.sum();
if (val > 0) { if (val > 0) {
visitor.visitCount(new DCountMetricStats(name, val)); visitor.visitCount(new DCountMetricStats(name, val));
@@ -251,11 +251,6 @@ final class DefaultFetchGroupQuery<T> implements SpiFetchGroupQuery<T>, SpiQuery
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup"); throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
} }
@Override
public Stream<T> findLargeStream() {
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override @Override
public void findEach(Consumer<T> consumer) { public void findEach(Consumer<T> consumer) {
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup"); throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
@@ -1456,11 +1456,6 @@ public final class DefaultOrmQuery<T> extends AbstractQuery implements SpiQuery<
return server.findStream(this, transaction); return server.findStream(this, transaction);
} }
@Override
public Stream<T> findLargeStream() {
return server.findLargeStream(this, transaction);
}
@Override @Override
public List<Version<T>> findVersions() { public List<Version<T>> findVersions() {
this.temporalMode = TemporalMode.VERSIONS; this.temporalMode = TemporalMode.VERSIONS;
@@ -10,7 +10,6 @@ import io.ebeaninternal.api.BindParams;
import io.ebeaninternal.api.SpiEbeanServer; import io.ebeaninternal.api.SpiEbeanServer;
import io.ebeaninternal.api.SpiSqlQuery; import io.ebeaninternal.api.SpiSqlQuery;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.function.Consumer; import java.util.function.Consumer;
@@ -56,36 +55,6 @@ public final class DefaultRelationalQuery extends AbstractQuery implements SpiSq
return server.findList(this, null); return server.findList(this, null);
} }
@Override
public BigDecimal findSingleDecimal() {
return server.findSingleAttribute(this, BigDecimal.class);
}
@Override
public Long findSingleLong() {
return server.findSingleAttribute(this, Long.class);
}
@Override
public <T> T findSingleAttribute(Class<T> cls) {
return server.findSingleAttribute(this, cls);
}
@Override
public <T> List<T> findSingleAttributeList(Class<T> cls) {
return server.findSingleAttributeList(this, cls);
}
@Override
public <T> T findOne(RowMapper<T> mapper) {
return server.findOneMapper(this, mapper);
}
@Override
public <T> List<T> findList(RowMapper<T> mapper) {
return server.findListMapper(this, mapper);
}
@Override @Override
public void findEachRow(RowConsumer consumer) { public void findEachRow(RowConsumer consumer) {
server.findEachRow(this, consumer); server.findEachRow(this, consumer);
@@ -101,12 +70,6 @@ public final class DefaultRelationalQuery extends AbstractQuery implements SpiSq
return Optional.ofNullable(findOne()); return Optional.ofNullable(findOne());
} }
@Override
@Deprecated
public DefaultRelationalQuery setParams(Object... values) {
return setParameters(values);
}
@Override @Override
public DefaultRelationalQuery setParameters(Object... values) { public DefaultRelationalQuery setParameters(Object... values) {
bindParams.setNextParameters(values); bindParams.setNextParameters(values);
@@ -237,6 +200,14 @@ public final class DefaultRelationalQuery extends AbstractQuery implements SpiSq
return new Mapper(mapper); return new Mapper(mapper);
} }
private <T> T findSingleAttribute(Class<T> cls) {
return server.findSingleAttribute(this, cls);
}
private <T> List<T> findSingleAttributeList(Class<T> cls) {
return server.findSingleAttributeList(this, cls);
}
private class Scalar<T> implements SqlQuery.TypeQuery<T> { private class Scalar<T> implements SqlQuery.TypeQuery<T> {
private final Class<T> type; private final Class<T> type;
@@ -54,14 +54,13 @@ public interface DocStoreBeanAdapter<T> extends BeanDocType<T> {
/** /**
* Return the index type for this bean type. * Return the index type for this bean type.
*/ */
@Override String indexType();
String getIndexType();
/** /**
* Return the index name for this bean type. * Return the index name for this bean type.
*/ */
@Override @Override
String getIndexName(); String indexName();
/** /**
* Process a delete by id of a given document. * Process a delete by id of a given document.
@@ -102,7 +102,6 @@ public abstract class DocStoreBeanBaseAdapter<T> implements DocStoreBeanAdapter<
private boolean registerPaths; private boolean registerPaths;
public DocStoreBeanBaseAdapter(BeanDescriptor<T> desc, DeployBeanDescriptor<T> deploy) { public DocStoreBeanBaseAdapter(BeanDescriptor<T> desc, DeployBeanDescriptor<T> deploy) {
this.desc = desc; this.desc = desc;
this.server = desc.ebeanServer(); this.server = desc.ebeanServer();
this.mapped = deploy.isDocStoreMapped(); this.mapped = deploy.isDocStoreMapped();
@@ -123,7 +122,6 @@ public abstract class DocStoreBeanBaseAdapter<T> implements DocStoreBeanAdapter<
@Override @Override
public DocumentMapping createDocMapping() { public DocumentMapping createDocMapping() {
if (documentMapping != null) { if (documentMapping != null) {
return documentMapping; return documentMapping;
} }
@@ -143,12 +141,12 @@ public abstract class DocStoreBeanBaseAdapter<T> implements DocStoreBeanAdapter<
} }
@Override @Override
public String getIndexType() { public String indexType() {
return indexType; return indexType;
} }
@Override @Override
public String getIndexName() { public String indexName() {
return indexName; return indexName;
} }
@@ -159,7 +157,6 @@ public abstract class DocStoreBeanBaseAdapter<T> implements DocStoreBeanAdapter<
@Override @Override
public String rawProperty(String property) { public String rawProperty(String property) {
String rawProperty = sortableMap.get(property); String rawProperty = sortableMap.get(property);
return rawProperty == null ? property : rawProperty; return rawProperty == null ? property : rawProperty;
} }
@@ -192,7 +189,6 @@ public abstract class DocStoreBeanBaseAdapter<T> implements DocStoreBeanAdapter<
*/ */
@Override @Override
public void registerInvalidationPath(String queueId, String path, Set<String> properties) { public void registerInvalidationPath(String queueId, String path, Set<String> properties) {
if (!mapped) { if (!mapped) {
if (update == DocStoreMode.IGNORE) { if (update == DocStoreMode.IGNORE) {
// bean type not mapped but is included as nested document // bean type not mapped but is included as nested document
@@ -207,7 +203,6 @@ public abstract class DocStoreBeanBaseAdapter<T> implements DocStoreBeanAdapter<
* Return the DsInvalidationListener based on the properties, path. * Return the DsInvalidationListener based on the properties, path.
*/ */
protected DocStoreEmbeddedInvalidation getEmbeddedInvalidation(String queueId, String path, Set<String> properties) { protected DocStoreEmbeddedInvalidation getEmbeddedInvalidation(String queueId, String path, Set<String> properties) {
if (properties.contains("*")) { if (properties.contains("*")) {
return new DocStoreEmbeddedInvalidation(queueId, path); return new DocStoreEmbeddedInvalidation(queueId, path);
} else { } else {
@@ -245,19 +240,15 @@ public abstract class DocStoreBeanBaseAdapter<T> implements DocStoreBeanAdapter<
* This can add derived/embedded/nested parts to the document. * This can add derived/embedded/nested parts to the document.
*/ */
protected DocStructure derivePathProperties(PathProperties pathProps) { protected DocStructure derivePathProperties(PathProperties pathProps) {
boolean includeByDefault = (pathProps == null); boolean includeByDefault = (pathProps == null);
if (pathProps == null) { if (pathProps == null) {
pathProps = new PathProperties(); pathProps = new PathProperties();
} }
return getDocStructure(pathProps, includeByDefault); return getDocStructure(pathProps, includeByDefault);
} }
protected DocStructure getDocStructure(PathProperties pathProps, final boolean includeByDefault) { protected DocStructure getDocStructure(PathProperties pathProps, final boolean includeByDefault) {
final DocStructure docStructure = new DocStructure(pathProps); final DocStructure docStructure = new DocStructure(pathProps);
BeanProperty[] properties = desc.propertiesNonTransient(); BeanProperty[] properties = desc.propertiesNonTransient();
for (BeanProperty property : properties) { for (BeanProperty property : properties) {
property.docStoreInclude(includeByDefault, docStructure); property.docStoreInclude(includeByDefault, docStructure);
@@ -271,17 +262,16 @@ public abstract class DocStoreBeanBaseAdapter<T> implements DocStoreBeanAdapter<
} }
}); });
} }
return docStructure; return docStructure;
} }
@Override @Override
public FetchPath getEmbedded(String path) { public FetchPath embedded(String path) {
return docStructure.getEmbedded(path); return docStructure.getEmbedded(path);
} }
@Override @Override
public FetchPath getEmbeddedManyRoot(String path) { public FetchPath embeddedManyRoot(String path) {
return docStructure.getEmbeddedManyRoot(path); return docStructure.getEmbeddedManyRoot(path);
} }
@@ -297,7 +287,6 @@ public abstract class DocStoreBeanBaseAdapter<T> implements DocStoreBeanAdapter<
@Override @Override
public DocStoreMode getMode(PersistRequest.Type persistType, DocStoreMode txnMode) { public DocStoreMode getMode(PersistRequest.Type persistType, DocStoreMode txnMode) {
if (txnMode == null) { if (txnMode == null) {
return getMode(persistType); return getMode(persistType);
} else if (txnMode == DocStoreMode.IGNORE) { } else if (txnMode == DocStoreMode.IGNORE) {
@@ -1,5 +1,6 @@
package io.ebeaninternal.server.cache; package io.ebeaninternal.server.cache;
import io.ebean.cache.ServerCache;
import io.ebean.cache.ServerCacheFactory; import io.ebean.cache.ServerCacheFactory;
import io.ebean.cache.ServerCacheOptions; import io.ebean.cache.ServerCacheOptions;
import io.ebean.cache.ServerCacheType; import io.ebean.cache.ServerCacheType;
@@ -12,7 +13,7 @@ import org.tests.model.basic.Customer;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
public class DefaultCacheHolderTest { class DefaultCacheHolderTest {
private final ThreadLocal<String> tenantId = new ThreadLocal<>(); private final ThreadLocal<String> tenantId = new ThreadLocal<>();
@@ -25,42 +26,30 @@ public class DefaultCacheHolderTest {
.with(cacheFactory, new TableModState()); .with(cacheFactory, new TableModState());
} }
@Test @Test
public void getCache_normal() { void getCache_normal() {
DefaultCacheHolder holder = new DefaultCacheHolder(options()); DefaultCacheHolder holder = new DefaultCacheHolder(options());
DefaultServerCache cache = cache(holder, Customer.class); ServerCache cache = cache(holder, Customer.class);
assertThat(cache.getName()).isEqualTo("org.tests.model.basic.Customer_B"); ServerCache cache1 = cache(holder, Customer.class);
assertThat(cache.getShortName()).isEqualTo("Customer_B");
DefaultServerCache cache1 = cache(holder, Customer.class);
assertThat(cache1).isSameAs(cache); assertThat(cache1).isSameAs(cache);
DefaultServerCache cache2 = cache(holder, Contact.class); ServerCache cache2 = cache(holder, Contact.class);
assertThat(cache1).isNotSameAs(cache2); assertThat(cache1).isNotSameAs(cache2);
assertThat(cache2.getName()).isEqualTo("org.tests.model.basic.Contact_B");
assertThat(cache2.getShortName()).isEqualTo("Contact_B");
} }
private DefaultServerCache cache(DefaultCacheHolder holder, Class<?> type) { private ServerCache cache(DefaultCacheHolder holder, Class<?> type) {
return (DefaultServerCache) holder.getCache(type, ServerCacheType.BEAN); return holder.getCache(type, ServerCacheType.BEAN);
} }
@Test @Test
public void getCache_multiTenant() throws Exception { void getCache_multiTenant() throws Exception {
CacheManagerOptions builder = options().with(tenantId::get); CacheManagerOptions builder = options().with(tenantId::get);
DefaultCacheHolder holder = new DefaultCacheHolder(builder); DefaultCacheHolder holder = new DefaultCacheHolder(builder);
tenantId.set("ten_1"); tenantId.set("ten_1");
DefaultServerCache cache = cache(holder, Customer.class); ServerCache cache = cache(holder, Customer.class);
assertThat(cache.getName()).isEqualTo("org.tests.model.basic.Customer_B");
assertThat(cache.getShortName()).isEqualTo("Customer_B");
cache.put("1", "value-for-tenant1"); cache.put("1", "value-for-tenant1");
cache.put("2", "an other value-for-tenant1"); cache.put("2", "an other value-for-tenant1");
@@ -109,10 +98,9 @@ public class DefaultCacheHolderTest {
} }
@Test @Test
public void clearAll() { void clearAll() {
DefaultCacheHolder holder = new DefaultCacheHolder(options()); DefaultCacheHolder holder = new DefaultCacheHolder(options());
DefaultServerCache cache = cache(holder, Customer.class); ServerCache cache = cache(holder, Customer.class);
cache.put("foo", "foo"); cache.put("foo", "foo");
assertThat(cache.size()).isEqualTo(1); assertThat(cache.size()).isEqualTo(1);
holder.clearAll(); holder.clearAll();
@@ -121,12 +109,11 @@ public class DefaultCacheHolderTest {
} }
@Test @Test
public void clearAll_multiTenant() { void clearAll_multiTenant() {
CacheManagerOptions options = options().with(tenantId::get); CacheManagerOptions options = options().with(tenantId::get);
DefaultCacheHolder holder = new DefaultCacheHolder(options); DefaultCacheHolder holder = new DefaultCacheHolder(options);
DefaultServerCache cache = cache(holder, Customer.class); ServerCache cache = cache(holder, Customer.class);
cache.put("foo", "foo"); cache.put("foo", "foo");
assertThat(cache.size()).isEqualTo(1); assertThat(cache.size()).isEqualTo(1);
@@ -1,5 +1,6 @@
package io.ebeaninternal.server.cache; package io.ebeaninternal.server.cache;
import io.ebean.cache.ServerCache;
import io.ebean.config.ContainerConfig; import io.ebean.config.ContainerConfig;
import io.ebean.config.CurrentTenantProvider; import io.ebean.config.CurrentTenantProvider;
import io.ebean.config.DatabaseConfig; import io.ebean.config.DatabaseConfig;
@@ -11,7 +12,7 @@ import org.tests.model.basic.Customer;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
public class DefaultServerCacheManagerTest { class DefaultServerCacheManagerTest {
private final ThreadLocal<String> tenantId = new ThreadLocal<>(); private final ThreadLocal<String> tenantId = new ThreadLocal<>();
@@ -29,7 +30,7 @@ public class DefaultServerCacheManagerTest {
private final DefaultServerCacheManager multiTenantManager; private final DefaultServerCacheManager multiTenantManager;
public DefaultServerCacheManagerTest(){ DefaultServerCacheManagerTest(){
CacheManagerOptions builder = new CacheManagerOptions(clusterManager, new DatabaseConfig(), true); CacheManagerOptions builder = new CacheManagerOptions(clusterManager, new DatabaseConfig(), true);
builder.with(new TdTenPro()); builder.with(new TdTenPro());
this.multiTenantManager = new DefaultServerCacheManager(builder); this.multiTenantManager = new DefaultServerCacheManager(builder);
@@ -37,86 +38,79 @@ public class DefaultServerCacheManagerTest {
@Test @Test
public void getCache_normal() { void getCache_normal() {
ServerCache cache = cache(manager, Customer.class);
DefaultServerCache dsc = cache.unwrap(DefaultServerCache.class);
assertThat(dsc.getName()).isEqualTo("org.tests.model.basic.Customer_B");
assertThat(dsc.getShortName()).isEqualTo("Customer_B");
DefaultServerCache cache = cache(manager, Customer.class); ServerCache cache1 = cache(manager, Customer.class);
assertThat(cache.getName()).isEqualTo("org.tests.model.basic.Customer_B");
assertThat(cache.getShortName()).isEqualTo("Customer_B");
DefaultServerCache cache1 = cache(manager, Customer.class);
assertThat(cache1).isSameAs(cache); assertThat(cache1).isSameAs(cache);
DefaultServerCache cache2 = cache(manager, Contact.class); ServerCache cache2 = cache(manager, Contact.class);
assertThat(cache1).isNotSameAs(cache2); assertThat(cache1).isNotSameAs(cache2);
assertThat(cache2.getName()).isEqualTo("org.tests.model.basic.Contact_B"); DefaultServerCache dsc2 = cache2.unwrap(DefaultServerCache.class);
assertThat(cache2.getShortName()).isEqualTo("Contact_B"); assertThat(dsc2.getName()).isEqualTo("org.tests.model.basic.Contact_B");
assertThat(dsc2.getShortName()).isEqualTo("Contact_B");
DefaultServerCache natKeyCache = (DefaultServerCache) manager.getNaturalKeyCache(Customer.class); ServerCache natKeyCache = manager.getNaturalKeyCache(Customer.class);
assertThat(natKeyCache.getName()).isEqualTo("org.tests.model.basic.Customer_N"); DefaultServerCache dscNatKey = natKeyCache.unwrap(DefaultServerCache.class);
assertThat(natKeyCache.getShortName()).isEqualTo("Customer_N"); assertThat(dscNatKey.getName()).isEqualTo("org.tests.model.basic.Customer_N");
assertThat(dscNatKey.getShortName()).isEqualTo("Customer_N");
DefaultServerCache queryCache = (DefaultServerCache) manager.getQueryCache(Customer.class); ServerCache queryCache = manager.getQueryCache(Customer.class);
assertThat(queryCache.getName()).isEqualTo("org.tests.model.basic.Customer_Q"); DefaultServerCache dscQueryCache = queryCache.unwrap(DefaultServerCache.class);
assertThat(queryCache.getShortName()).isEqualTo("Customer_Q"); assertThat(dscQueryCache.getName()).isEqualTo("org.tests.model.basic.Customer_Q");
assertThat(dscQueryCache.getShortName()).isEqualTo("Customer_Q");
DefaultServerCache collCache = (DefaultServerCache) manager.getCollectionIdsCache(Customer.class, "contacts"); ServerCache collCache = manager.getCollectionIdsCache(Customer.class, "contacts");
assertThat(collCache.getName()).isEqualTo("org.tests.model.basic.Customer.contacts_C"); DefaultServerCache dscCollCache = collCache.unwrap(DefaultServerCache.class);
assertThat(collCache.getShortName()).isEqualTo("Customer.contacts_C"); assertThat(dscCollCache.getName()).isEqualTo("org.tests.model.basic.Customer.contacts_C");
assertThat(dscCollCache.getShortName()).isEqualTo("Customer.contacts_C");
cache.clearCount.reset(); cache.statistics(true);
collCache.clearCount.reset(); collCache.statistics(true);
queryCache.clearCount.reset(); queryCache.statistics(true);
natKeyCache.clearCount.reset(); natKeyCache.statistics(true);
manager.clear(Customer.class); manager.clear(Customer.class);
assertThat(cache.clearCount.get(true)).isEqualTo(1); assertThat(cache.statistics(true).getClearCount()).isEqualTo(1);
assertThat(natKeyCache.clearCount.get(true)).isEqualTo(1); assertThat(natKeyCache.statistics(true).getClearCount()).isEqualTo(1);
assertThat(queryCache.clearCount.get(true)).isEqualTo(1); assertThat(queryCache.statistics(true).getClearCount()).isEqualTo(1);
assertThat(collCache.clearCount.get(true)).isEqualTo(1); assertThat(collCache.statistics(true).getClearCount()).isEqualTo(1);
} }
private DefaultServerCache cache(DefaultServerCacheManager manager, Class<?> beanType) { private ServerCache cache(DefaultServerCacheManager manager, Class<?> beanType) {
return (DefaultServerCache) manager.getBeanCache(beanType); return manager.getBeanCache(beanType);
} }
@Test @Test
public void getCache_multiTenant() { void getCache_multiTenant() {
tenantId.set("ten1"); tenantId.set("ten1");
DefaultServerCache cache = cache(multiTenantManager, Customer.class); ServerCache cache = cache(multiTenantManager, Customer.class);
assertThat(cache.getName()).isEqualTo("org.tests.model.basic.Customer_B");
cache.put("1", "tenant1"); cache.put("1", "tenant1");
tenantId.set("ten2"); tenantId.set("ten2");
assertThat(cache.get("1")).isNull(); assertThat(cache.get("1")).isNull();
tenantId.set("ten1"); tenantId.set("ten1");
assertThat(cache.get("1")).isEqualTo("tenant1");
assertThat(cache.get("1")).isNotNull();
} }
@Test @Test
public void getCache_singleTenant() { void getCache_singleTenant() {
ServerCache cache = cache(manager, Customer.class);
tenantId.set("ten1"); tenantId.set("ten1");
DefaultServerCache cache = cache(manager, Customer.class);
assertThat(cache.getName()).isEqualTo("org.tests.model.basic.Customer_B");
cache.put("1", "tenant1"); cache.put("1", "tenant1");
tenantId.set("ten2"); tenantId.set("ten2");
assertThat(cache.get("1")).isEqualTo("tenant1"); assertThat(cache.get("1")).isEqualTo("tenant1");
} }
@Test @Test
public void isLocalL2Caching() { void isLocalL2Caching() {
assertTrue(manager.isLocalL2Caching()); assertTrue(manager.isLocalL2Caching());
assertTrue(multiTenantManager.isLocalL2Caching()); assertTrue(multiTenantManager.isLocalL2Caching());
} }
@@ -40,7 +40,7 @@ public class Contact {
@OneToMany(cascade = CascadeType.ALL) @OneToMany(cascade = CascadeType.ALL)
List<ContactNote> notes; List<ContactNote> notes;
@CreatedTimestamp @WhenCreated
Timestamp cretime; Timestamp cretime;
@Version @Version
@@ -33,7 +33,7 @@ public class Product implements Serializable {
String name; String name;
@CreatedTimestamp @WhenCreated
Timestamp cretime; Timestamp cretime;
@Version @Version
+4 -4
View File
@@ -4,7 +4,7 @@
<parent> <parent>
<artifactId>ebean-parent</artifactId> <artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</parent> </parent>
<name>ebean ddl generation</name> <name>ebean ddl generation</name>
@@ -28,14 +28,14 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-core-type</artifactId> <artifactId>ebean-core-type</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId> <artifactId>ebean-core</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
@@ -58,7 +58,7 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-platform-all</artifactId> <artifactId>ebean-platform-all</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
+1 -1
View File
@@ -4,7 +4,7 @@
<parent> <parent>
<artifactId>ebean-parent</artifactId> <artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</parent> </parent>
<name>ebean external mapping api</name> <name>ebean external mapping api</name>
+6 -6
View File
@@ -4,7 +4,7 @@
<parent> <parent>
<artifactId>ebean-parent</artifactId> <artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</parent> </parent>
<scm> <scm>
@@ -28,7 +28,7 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-externalmapping-api</artifactId> <artifactId>ebean-externalmapping-api</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
@@ -61,21 +61,21 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-platform-h2</artifactId> <artifactId>ebean-platform-h2</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId> <artifactId>ebean-core</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-ddl-generator</artifactId> <artifactId>ebean-ddl-generator</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
@@ -98,7 +98,7 @@
<configuration> <configuration>
<tiles> <tiles>
<!-- other tiles ... --> <!-- other tiles ... -->
<tile>io.ebean.tile:enhancement:13.0.1-RC1</tile> <tile>io.ebean.tile:enhancement:13.3.0</tile>
</tiles> </tiles>
</configuration> </configuration>
</plugin> </plugin>
+4 -4
View File
@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>ebean-parent</artifactId> <artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
@@ -29,7 +29,7 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId> <artifactId>ebean-core</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
@@ -51,7 +51,7 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId> <artifactId>ebean-test</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
@@ -93,7 +93,7 @@
<extensions>true</extensions> <extensions>true</extensions>
<configuration> <configuration>
<tiles> <tiles>
<tile>io.ebean.tile:enhancement:13.0.1-RC1</tile> <tile>io.ebean.tile:enhancement:13.3.0</tile>
</tiles> </tiles>
</configuration> </configuration>
</plugin> </plugin>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent> <parent>
<artifactId>ebean-parent</artifactId> <artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</parent> </parent>
<name>ebean postgis</name> <name>ebean postgis</name>
@@ -22,14 +22,14 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId> <artifactId>ebean-platform-postgres</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</dependency> </dependency>
<!-- provided scope --> <!-- provided scope -->
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId> <artifactId>ebean-core</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
@@ -73,7 +73,7 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId> <artifactId>ebean-test</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
@@ -104,7 +104,7 @@
<extensions>true</extensions> <extensions>true</extensions>
<configuration> <configuration>
<tiles> <tiles>
<tile>io.ebean.tile:enhancement:13.0.1-RC1</tile> <tile>io.ebean.tile:enhancement:13.3.0</tile>
</tiles> </tiles>
</configuration> </configuration>
</plugin> </plugin>
+6 -6
View File
@@ -4,7 +4,7 @@
<parent> <parent>
<artifactId>ebean-parent</artifactId> <artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</parent> </parent>
<name>ebean querybean</name> <name>ebean querybean</name>
@@ -17,7 +17,7 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId> <artifactId>ebean-core</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
@@ -63,21 +63,21 @@
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-ddl-generator</artifactId> <artifactId>ebean-ddl-generator</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>querybean-generator</artifactId> <artifactId>querybean-generator</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId> <artifactId>ebean-test</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
@@ -107,7 +107,7 @@
<extensions>true</extensions> <extensions>true</extensions>
<configuration> <configuration>
<tiles> <tiles>
<tile>io.ebean.tile:enhancement:13.0.1-RC1</tile> <tile>io.ebean.tile:enhancement:13.3.0</tile>
</tiles> </tiles>
</configuration> </configuration>
</plugin> </plugin>
@@ -1646,14 +1646,6 @@ public abstract class TQRootBean<T, R> {
return query.findStream(); return query.findStream();
} }
/**
* Deprecated - migrate to findStream().
*/
@Deprecated
public Stream<T> findLargeStream() {
return query.findLargeStream();
}
/** /**
* Execute the query returning the set of objects. * Execute the query returning the set of objects.
* <p> * <p>
@@ -270,6 +270,12 @@ public class QCustomerTest {
assertThat(foo).hasSize(1); assertThat(foo).hasSize(1);
} }
Customer customer = DB.find(Customer.class, cust.getId());
assert customer != null;
String customerToString = customer.toString();
assertThat(customerToString).contains("Customer@0(id:");
assertThat(customerToString).contains(", status:GOOD, inactive:false, name:usingConnection, version:1, whenCreated:");
} }
@Test @Test
@@ -387,24 +393,6 @@ public class QCustomerTest {
assertThat(sb.toString()).isEqualTo("stream1|stream2"); assertThat(sb.toString()).isEqualTo("stream1|stream2");
} }
@Test
public void testFindLargeStream() {
insertCustomer("largeStream1");
insertCustomer("largeStream2");
insertCustomer("largeStream3");
StringJoiner sb = new StringJoiner("|");
try (Stream<Customer> stream = new QCustomer()
.name.startsWith("largeStream")
.id.asc()
.findLargeStream()) {
stream.forEach(it -> sb.add(it.getName()));
}
assertThat(sb.toString()).isEqualTo("largeStream1|largeStream2|largeStream3");
}
@Test @Test
public void testFilterMany() { public void testFilterMany() {
+8 -8
View File
@@ -4,7 +4,7 @@
<parent> <parent>
<artifactId>ebean-parent</artifactId> <artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
</parent> </parent>
<artifactId>ebean-redis</artifactId> <artifactId>ebean-redis</artifactId>
@@ -16,41 +16,41 @@
<dependency> <dependency>
<groupId>redis.clients</groupId> <groupId>redis.clients</groupId>
<artifactId>jedis</artifactId> <artifactId>jedis</artifactId>
<version>4.2.0</version> <version>4.2.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId> <artifactId>ebean-api</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId> <artifactId>ebean-core</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId> <artifactId>ebean-querybean</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>querybean-generator</artifactId> <artifactId>querybean-generator</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId> <artifactId>ebean-test</artifactId>
<version>13.0.1-SNAPSHOT</version> <version>13.3.0-SNAPSHOT</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
@@ -80,7 +80,7 @@
<extensions>true</extensions> <extensions>true</extensions>
<configuration> <configuration>
<tiles> <tiles>
<tile>io.ebean.tile:enhancement:13.0.1-RC1</tile> <tile>io.ebean.tile:enhancement:13.3.0</tile>
</tiles> </tiles>
</configuration> </configuration>
</plugin> </plugin>
Loaded 100 of 140 files, more files were not shown because too many files have changed in this diff. Show more