mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-09-20 19:17:55 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a9e3e2ea43 | ||
|
|
834ce971b3 | ||
|
|
5c27f89677 | ||
|
|
bfbbb7e7a7 | ||
|
|
a8947c7d2f | ||
|
|
d5401efb08 | ||
|
|
925ceaf441 | ||
|
|
c5fea13ca5 | ||
|
|
6fa3759786 | ||
|
|
1c5288b6ec | ||
|
|
b485fb7440 | ||
|
|
b07f909dd3 | ||
|
|
fa92e7a4b7 | ||
|
|
1823ef288a | ||
|
|
7b2128b02f | ||
|
|
3c84a902e8 | ||
|
|
3ce95c34cb | ||
|
|
d817dcb549 | ||
|
|
5f218e1fdb | ||
|
|
59daf5689a | ||
|
|
44efed5cd9 | ||
|
|
be28314e31 | ||
|
|
053d82b54a | ||
|
|
0141e2effa | ||
|
|
a33bb4d4c8 | ||
|
|
d0348210be | ||
|
|
753cf66cf0 | ||
|
|
4a8b4dd5fb | ||
|
|
2faf7008db | ||
|
|
76c25cbe83 | ||
|
|
5c36a725f4 | ||
|
|
b99d4f5a51 | ||
|
|
7d18942357 | ||
|
|
e51d9ba2ab | ||
|
|
1b1dce90ed | ||
|
|
405834fa45 | ||
|
|
7720229af9 | ||
|
|
89a294414e | ||
|
|
7bbfc00b86 | ||
|
|
d6c76de0a2 | ||
|
|
36f3986689 | ||
|
|
f0f4f13ec6 | ||
|
|
08466d42e9 | ||
|
|
1f841982a5 | ||
|
|
b34704a1fa |
@@ -20,14 +20,14 @@ jobs:
|
||||
os: [ubuntu-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Java
|
||||
uses: actions/setup-java@v3
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: ${{ matrix.java_version }}
|
||||
distribution: 'zulu'
|
||||
- name: Maven cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: maven-cache
|
||||
with:
|
||||
|
||||
@@ -20,14 +20,14 @@ jobs:
|
||||
os: [ubuntu-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Java
|
||||
uses: actions/setup-java@v3
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: ${{ matrix.java_version }}
|
||||
distribution: 'adopt'
|
||||
- name: Maven cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: maven-cache
|
||||
with:
|
||||
|
||||
@@ -20,14 +20,14 @@ jobs:
|
||||
os: [ubuntu-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Java
|
||||
uses: actions/setup-java@v3
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: ${{ matrix.java_version }}
|
||||
distribution: 'zulu'
|
||||
- name: Maven cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: maven-cache
|
||||
with:
|
||||
|
||||
@@ -16,18 +16,18 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
java_version: [GA,EA]
|
||||
java_version: [GA,EA,23]
|
||||
os: [ubuntu-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Java
|
||||
uses: oracle-actions/setup-java@v1
|
||||
with:
|
||||
website: jdk.java.net
|
||||
release: ${{ matrix.java_version }}
|
||||
- name: Maven cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: maven-cache
|
||||
with:
|
||||
|
||||
@@ -20,14 +20,14 @@ jobs:
|
||||
os: [ubuntu-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Java
|
||||
uses: actions/setup-java@v3
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: ${{ matrix.java_version }}
|
||||
distribution: 'adopt'
|
||||
- name: Maven cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: maven-cache
|
||||
with:
|
||||
|
||||
@@ -17,14 +17,14 @@ jobs:
|
||||
os: [ubuntu-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Java
|
||||
uses: actions/setup-java@v3
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: ${{ matrix.java_version }}
|
||||
distribution: 'adopt'
|
||||
- name: Maven cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: maven-cache
|
||||
with:
|
||||
|
||||
@@ -20,14 +20,14 @@ jobs:
|
||||
os: [ubuntu-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Java
|
||||
uses: actions/setup-java@v3
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: ${{ matrix.java_version }}
|
||||
distribution: 'zulu'
|
||||
- name: Maven cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: maven-cache
|
||||
with:
|
||||
|
||||
@@ -20,14 +20,14 @@ jobs:
|
||||
os: [ubuntu-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Java
|
||||
uses: actions/setup-java@v3
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: ${{ matrix.java_version }}
|
||||
distribution: 'adopt'
|
||||
- name: Maven cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: maven-cache
|
||||
with:
|
||||
|
||||
@@ -20,14 +20,14 @@ jobs:
|
||||
os: [ubuntu-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Java
|
||||
uses: actions/setup-java@v3
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: ${{ matrix.java_version }}
|
||||
distribution: 'zulu'
|
||||
- name: Maven cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: maven-cache
|
||||
with:
|
||||
|
||||
@@ -20,14 +20,14 @@ jobs:
|
||||
os: [ubuntu-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Java
|
||||
uses: actions/setup-java@v3
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: ${{ matrix.java_version }}
|
||||
distribution: 'adopt'
|
||||
- name: Maven cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: maven-cache
|
||||
with:
|
||||
|
||||
@@ -17,14 +17,14 @@ jobs:
|
||||
os: [ubuntu-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Java
|
||||
uses: actions/setup-java@v3
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: ${{ matrix.java_version }}
|
||||
distribution: 'adopt'
|
||||
- name: Maven cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: maven-cache
|
||||
with:
|
||||
|
||||
@@ -20,14 +20,14 @@ jobs:
|
||||
os: [ubuntu-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Java
|
||||
uses: actions/setup-java@v3
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: ${{ matrix.java_version }}
|
||||
distribution: 'adopt'
|
||||
- name: Maven cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: maven-cache
|
||||
with:
|
||||
|
||||
@@ -20,14 +20,14 @@ jobs:
|
||||
os: [ubuntu-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Java
|
||||
uses: actions/setup-java@v3
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: ${{ matrix.java_version }}
|
||||
distribution: 'adopt'
|
||||
- name: Maven cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: maven-cache
|
||||
with:
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -42,13 +42,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-clickhouse</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -42,13 +42,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -42,13 +42,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-db2</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -42,13 +42,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -42,13 +42,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-hana</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -42,13 +42,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-mariadb</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -42,13 +42,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-mysql</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -42,13 +42,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-nuodb</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -42,13 +42,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-oracle</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -22,13 +22,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -47,19 +47,19 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-postgis-types</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -42,13 +42,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -42,13 +42,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlite</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -42,13 +42,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlserver</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -42,13 +42,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -41,7 +41,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-jackson-mapper</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -60,13 +60,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-all</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>composites</artifactId>
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean api</name>
|
||||
|
||||
@@ -40,6 +40,13 @@ public interface QueryBuilderProjection<SELF, T> {
|
||||
*/
|
||||
SELF select(String fetchProperties);
|
||||
|
||||
/**
|
||||
* Set DISTINCT ON clause. This is a Postgres only SQL feature.
|
||||
*
|
||||
* @param distinctOn The properties to include in the DISTINCT ON clause.
|
||||
*/
|
||||
SELF distinctOn(String distinctOn);
|
||||
|
||||
/**
|
||||
* Apply the fetchGroup which defines what part of the object graph to load.
|
||||
*/
|
||||
|
||||
@@ -129,7 +129,7 @@ public class DatabaseConfig implements DatabaseBuilder.Settings {
|
||||
* When true then include a sql comment in generated SELECT queries with the query
|
||||
* label or profile location label.
|
||||
*/
|
||||
private boolean includeLabelInSql;
|
||||
private boolean includeLabelInSql = true;
|
||||
|
||||
/**
|
||||
* Interesting classes such as entities, embedded, ScalarTypes,
|
||||
|
||||
@@ -4,22 +4,8 @@ public final class AnsiSqlRowsLimiter implements SqlLimiter {
|
||||
|
||||
@Override
|
||||
public SqlLimitResponse limit(SqlLimitRequest request) {
|
||||
String dbSql = request.getDbSql();
|
||||
StringBuilder sb = new StringBuilder(50 + dbSql.length());
|
||||
sb.append("select ");
|
||||
if (request.isDistinct()) {
|
||||
sb.append("distinct ");
|
||||
}
|
||||
sb.append(dbSql);
|
||||
int firstRow = request.getFirstRow();
|
||||
if (firstRow > 0) {
|
||||
sb.append(" offset ").append(firstRow).append(" rows");
|
||||
}
|
||||
int maxRows = request.getMaxRows();
|
||||
if (maxRows > 0) {
|
||||
sb.append(" fetch next ").append(maxRows).append(" rows only");
|
||||
}
|
||||
String sql = request.getDbPlatform().completeSql(sb.toString(), request.getOrmQuery());
|
||||
final var ansiSql = request.ansiOffsetRows();
|
||||
final var sql = request.getDbPlatform().completeSql(ansiSql, request.getOrmQuery());
|
||||
return new SqlLimitResponse(sql);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,23 +7,16 @@ public final class LimitOffsetSqlLimiter implements SqlLimiter {
|
||||
|
||||
@Override
|
||||
public SqlLimitResponse limit(SqlLimitRequest request) {
|
||||
String dbSql = request.getDbSql();
|
||||
StringBuilder sb = new StringBuilder(50 + dbSql.length());
|
||||
sb.append("select ");
|
||||
if (request.isDistinct()) {
|
||||
sb.append("distinct ");
|
||||
}
|
||||
sb.append(dbSql);
|
||||
final var buffer = request.selectDistinctOnSql();
|
||||
int maxRows = request.getMaxRows();
|
||||
if (maxRows > 0) {
|
||||
sb.append(" limit ").append(maxRows);
|
||||
buffer.append(" limit ").append(maxRows);
|
||||
}
|
||||
int firstRow = request.getFirstRow();
|
||||
if (firstRow > 0) {
|
||||
sb.append(" offset ").append(firstRow);
|
||||
buffer.append(" offset ").append(firstRow);
|
||||
}
|
||||
String sql = request.getDbPlatform().completeSql(sb.toString(), request.getOrmQuery());
|
||||
return new SqlLimitResponse(sql);
|
||||
return new SqlLimitResponse(request.getDbPlatform().completeSql(buffer.toString(), request.getOrmQuery()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,21 @@ import io.ebean.Query;
|
||||
*/
|
||||
public interface SqlLimitRequest {
|
||||
|
||||
/**
|
||||
* Return ANSI SQL Offset and next rows.
|
||||
*/
|
||||
String ansiOffsetRows();
|
||||
|
||||
/**
|
||||
* Create and return buffer including the select distinct clause.
|
||||
*/
|
||||
StringBuilder selectDistinct();
|
||||
|
||||
/**
|
||||
* Create and return buffer including the select distinct on clause.
|
||||
*/
|
||||
StringBuilder selectDistinctOnSql();
|
||||
|
||||
/**
|
||||
* Return true if the query uses distinct.
|
||||
*/
|
||||
|
||||
@@ -76,7 +76,7 @@ class DatabaseConfigTest {
|
||||
props.setProperty("skipDataSourceCheck", "true");
|
||||
props.setProperty("readOnlyDatabase", "true");
|
||||
props.setProperty("lengthCheck", "ON");
|
||||
props.setProperty("includeLabelInSql", "true");
|
||||
props.setProperty("includeLabelInSql", "false");
|
||||
|
||||
props.setProperty("queryPlan.enable", "true");
|
||||
props.setProperty("queryPlan.thresholdMicros", "10000");
|
||||
@@ -97,7 +97,7 @@ class DatabaseConfigTest {
|
||||
assertTrue(settings.isLoadModuleInfo());
|
||||
assertTrue(settings.skipDataSourceCheck());
|
||||
assertTrue(settings.readOnlyDatabase());
|
||||
assertTrue(settings.isIncludeLabelInSql());
|
||||
assertFalse(settings.isIncludeLabelInSql());
|
||||
assertThat(settings.getLengthCheck()).isEqualTo(LengthCheck.ON);
|
||||
|
||||
assertTrue(settings.isIdGeneratorAutomatic());
|
||||
@@ -183,7 +183,7 @@ class DatabaseConfigTest {
|
||||
assertEquals(10000L, config.getQueryPlanCaptureMaxTimeMillis());
|
||||
assertEquals(10, config.getQueryPlanCaptureMaxCount());
|
||||
assertThat(config.getLengthCheck()).isEqualTo(LengthCheck.OFF);
|
||||
assertFalse(config.isIncludeLabelInSql());
|
||||
assertTrue(config.isIncludeLabelInSql());
|
||||
|
||||
config.setLoadModuleInfo(false);
|
||||
assertFalse(config.isAutoLoadModuleInfo());
|
||||
|
||||
+26
-26
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean bom</name>
|
||||
@@ -89,25 +89,25 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -125,13 +125,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-jackson-mapper</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-generator</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -155,37 +155,37 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>querybean-generator</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>kotlin-querybean-generator</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-redis</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-spring-txn</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- platforms -->
|
||||
@@ -193,79 +193,79 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-clickhouse</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-db2</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-h2</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-hana</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-mariadb</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-mysql</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-nuodb</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-oracle</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-postgres</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-postgis</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-postgis-types</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-sqlite</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-sqlserver</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
@@ -16,7 +16,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
+7
-6
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-core</artifactId>
|
||||
@@ -22,7 +22,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -46,7 +46,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -159,21 +159,21 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlserver</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -211,6 +211,7 @@
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<argLine>-Dnet.bytebuddy.experimental=true</argLine>
|
||||
<useSystemClassLoader>false</useSystemClassLoader>
|
||||
<trimStackTrace>false</trimStackTrace>
|
||||
<failIfNoTests>false</failIfNoTests>
|
||||
|
||||
@@ -84,10 +84,17 @@ public final class LoadBeanRequest extends LoadRequest {
|
||||
return idList;
|
||||
}
|
||||
|
||||
public SpiQuery<?> createQuery(SpiEbeanServer server) {
|
||||
final SpiQuery<?> query = server.createQuery(beanType());
|
||||
query.usingTransaction(transaction);
|
||||
configureQuery(query);
|
||||
return query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the query for lazy loading execution.
|
||||
*/
|
||||
public void configureQuery(SpiQuery<?> query) {
|
||||
private void configureQuery(SpiQuery<?> query) {
|
||||
query.setMode(Mode.LAZYLOAD_BEAN);
|
||||
query.setPersistenceContext(loadBuffer.persistenceContext());
|
||||
query.setLoadDescription(mode(), description());
|
||||
|
||||
@@ -94,6 +94,7 @@ public final class LoadManyRequest extends LoadRequest {
|
||||
public SpiQuery<?> createQuery(SpiEbeanServer server) {
|
||||
BeanPropertyAssocMany<?> many = many();
|
||||
SpiQuery<?> query = many.newQuery(server);
|
||||
query.usingTransaction(transaction);
|
||||
String orderBy = many.lazyFetchOrderBy();
|
||||
if (orderBy != null) {
|
||||
query.orderBy(orderBy);
|
||||
|
||||
@@ -439,6 +439,11 @@ public interface SpiQuery<T> extends Query<T>, SpiQueryFetch, TxnProfileEventCod
|
||||
@Override
|
||||
SpiQuery<T> copy();
|
||||
|
||||
/**
|
||||
* Return the distinct on clause.
|
||||
*/
|
||||
String distinctOn();
|
||||
|
||||
/**
|
||||
* Return a copy of the query attaching to a different EbeanServer.
|
||||
*/
|
||||
@@ -549,7 +554,6 @@ public interface SpiQuery<T> extends Query<T>, SpiQueryFetch, TxnProfileEventCod
|
||||
* Return true if the query should include the Id property.
|
||||
* <p>
|
||||
* distinct and single attribute queries exclude the Id property.
|
||||
* </p>
|
||||
*/
|
||||
boolean isWithId();
|
||||
|
||||
|
||||
@@ -357,4 +357,8 @@ public interface SpiTransaction extends Transaction {
|
||||
*/
|
||||
void postRollback(Throwable cause);
|
||||
|
||||
/**
|
||||
* Set the transaction to be inactive via external transaction manager.
|
||||
*/
|
||||
void deactivateExternal();
|
||||
}
|
||||
|
||||
@@ -447,4 +447,9 @@ public abstract class SpiTransactionProxy implements SpiTransaction {
|
||||
public void postRollback(Throwable cause) {
|
||||
transaction.postRollback(cause);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deactivateExternal() {
|
||||
transaction.deactivateExternal();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,9 +126,7 @@ final class DefaultBeanLoader {
|
||||
if (loadRequest.checkEmpty()) {
|
||||
throw new RuntimeException("Nothing in batch?");
|
||||
}
|
||||
final SpiQuery<?> query = server.createQuery(loadRequest.beanType());
|
||||
query.usingTransaction(loadRequest.transaction());
|
||||
loadRequest.configureQuery(query);
|
||||
final SpiQuery<?> query = loadRequest.createQuery(server);
|
||||
loadRequest.postLoad(executeQuery(loadRequest, query));
|
||||
}
|
||||
|
||||
|
||||
@@ -449,6 +449,9 @@ public final class InternalConfiguration {
|
||||
*/
|
||||
private DataTimeZone initDataTimeZone() {
|
||||
String tz = config.getDataTimeZone();
|
||||
if ("NoTimeZone".equals(tz)) {
|
||||
return new NoDataTimeZone();
|
||||
}
|
||||
if (tz == null) {
|
||||
if (isMySql(getPlatform())) {
|
||||
return new MySqlDataTimeZone();
|
||||
|
||||
+1
-1
@@ -514,7 +514,7 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
|
||||
if (natKeys != null && !natKeys.isEmpty()) {
|
||||
if (natLog.isLoggable(DEBUG)) {
|
||||
natLog.log(DEBUG, " MPUT {0}({1}, {2})", cacheName, naturalKey, natKeys.keySet());
|
||||
natLog.log(DEBUG, " MPUT {0}({1}, {2})", cacheName, Arrays.toString(naturalKey), natKeys.keySet());
|
||||
}
|
||||
naturalKeyCache.putAll(natKeys);
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ final class SubQueryExpression extends AbstractExpression implements Unsupported
|
||||
|
||||
@Override
|
||||
public void addSql(SpiExpressionRequest request) {
|
||||
request.property(propName).append(op.expression).append('(').parse(sql).append(')');
|
||||
request.property(propName).append(op.expression).append('(').append(sql).append(')');
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,7 +3,6 @@ package io.ebeaninternal.server.query;
|
||||
import io.ebean.*;
|
||||
import io.ebean.annotation.Platform;
|
||||
import io.ebean.config.dbplatform.DatabasePlatform;
|
||||
import io.ebean.config.dbplatform.SqlLimitRequest;
|
||||
import io.ebean.config.dbplatform.SqlLimitResponse;
|
||||
import io.ebean.config.dbplatform.SqlLimiter;
|
||||
import io.ebean.event.readaudit.ReadAuditQueryPlan;
|
||||
@@ -533,7 +532,7 @@ final class CQueryBuilder {
|
||||
private final boolean distinct;
|
||||
private final boolean countSingleAttribute;
|
||||
private final String dbOrderBy;
|
||||
private boolean useSqlLimiter;
|
||||
private final boolean useSqlLimiter;
|
||||
private boolean hasWhere;
|
||||
|
||||
private BuildReq(String selectClause, OrmQueryRequest<?> request, CQueryPredicates predicates, SqlTree select) {
|
||||
@@ -550,13 +549,15 @@ final class CQueryBuilder {
|
||||
this.distinct = query.isDistinct() || select.isSqlDistinct();
|
||||
this.dbOrderBy = predicates.dbOrderBy();
|
||||
this.countSingleAttribute = query.isCountDistinct() && query.isSingleAttribute();
|
||||
this.useSqlLimiter = selectClause == null
|
||||
&& query.hasMaxRowsOrFirstRow()
|
||||
&& (select.distinctOn() != null || select.manyProperty() == null || query.isSingleAttribute());
|
||||
}
|
||||
|
||||
private void appendSelect() {
|
||||
if (selectClause != null) {
|
||||
sb.append(selectClause);
|
||||
} else {
|
||||
useSqlLimiter = (query.hasMaxRowsOrFirstRow() && (select.manyProperty() == null || query.isSingleAttribute()));
|
||||
if (!useSqlLimiter) {
|
||||
appendSelectDistinct();
|
||||
}
|
||||
@@ -581,7 +582,7 @@ final class CQueryBuilder {
|
||||
if (request.isInlineCountDistinct()) {
|
||||
sb.append(')');
|
||||
}
|
||||
if (distinct && dbOrderBy != null) {
|
||||
if (distinct && dbOrderBy != null && query.distinctOn() == null) {
|
||||
// add the orderBy columns to the select clause (due to distinct)
|
||||
String[] tokens = DbOrderByTrim.trim(dbOrderBy).split(",");
|
||||
for (String token : tokens) {
|
||||
@@ -733,7 +734,7 @@ final class CQueryBuilder {
|
||||
}
|
||||
if (useSqlLimiter) {
|
||||
// use LIMIT/OFFSET, ROW_NUMBER() or rownum type SQL query limitation
|
||||
SqlLimitRequest r = new OrmQueryLimitRequest(sb.toString(), dbOrderBy, query, dbPlatform, distinct);
|
||||
var r = new OrmQueryLimitRequest(sb.toString(), dbOrderBy, query, dbPlatform, distinct, select.distinctOn(), hint(), inlineSqlComment());
|
||||
return sqlLimiter.limit(r);
|
||||
} else {
|
||||
if (updateStatement) {
|
||||
|
||||
@@ -62,6 +62,7 @@ public final class CQueryPredicates {
|
||||
*/
|
||||
private String dbFilterMany;
|
||||
private String dbOrderBy;
|
||||
private String dbDistinctOn;
|
||||
private String dbUpdateClause;
|
||||
/**
|
||||
* Includes from where and order by clauses.
|
||||
@@ -209,6 +210,10 @@ public final class CQueryPredicates {
|
||||
}
|
||||
}
|
||||
if (buildSql) {
|
||||
final String distinctOn = query.distinctOn();
|
||||
if (distinctOn != null) {
|
||||
dbDistinctOn = deployParser.parse(distinctOn);
|
||||
}
|
||||
predicateIncludes = deployParser.includes();
|
||||
}
|
||||
}
|
||||
@@ -231,6 +236,9 @@ public final class CQueryPredicates {
|
||||
if (dbOrderBy != null) {
|
||||
dbOrderBy = alias.parse(dbOrderBy);
|
||||
}
|
||||
if (dbDistinctOn != null) {
|
||||
dbDistinctOn = alias.parse(dbDistinctOn);
|
||||
}
|
||||
}
|
||||
|
||||
private String parseOrderBy() {
|
||||
@@ -351,6 +359,13 @@ public final class CQueryPredicates {
|
||||
return dbOrderBy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the db distinct on clause.
|
||||
*/
|
||||
String dbDistinctOn() {
|
||||
return dbDistinctOn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the includes required for the where and order by clause.
|
||||
*/
|
||||
|
||||
@@ -59,6 +59,11 @@ final class DefaultFetchGroupQuery<T> implements SpiFetchGroupQuery<T>, SpiQuery
|
||||
return new DFetchGroup<>(detail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Query<T> distinctOn(String distinctOn) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Query<T> select(String columns) {
|
||||
detail.select(columns);
|
||||
|
||||
@@ -156,6 +156,10 @@ public final class SqlTreeBuilder {
|
||||
}
|
||||
|
||||
private String buildDistinctOn() {
|
||||
String distinctOn = predicates.dbDistinctOn();
|
||||
if (distinctOn != null) {
|
||||
return distinctOn;
|
||||
}
|
||||
if (rawSql || !distinctOnPlatform || !sqlDistinct || Type.COUNT == query.type()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -72,6 +72,7 @@ public class DefaultOrmQuery<T> extends AbstractQuery implements SpiQuery<T> {
|
||||
* Lazy loading batch size (can override server wide default).
|
||||
*/
|
||||
private int lazyLoadBatchSize;
|
||||
private String distinctOn;
|
||||
private OrderBy<T> orderBy;
|
||||
private String loadMode;
|
||||
private String loadDescription;
|
||||
@@ -515,7 +516,10 @@ public class DefaultOrmQuery<T> extends AbstractQuery implements SpiQuery<T> {
|
||||
* Limit the number of fetch joins to Many properties, mark as query joins as needed.
|
||||
*/
|
||||
private void markQueryJoins() {
|
||||
detail.markQueryJoins(beanDescriptor, lazyLoadManyPath, isAllowOneManyFetch(), type.defaultSelect());
|
||||
if (distinctOn == null) {
|
||||
// no automatic join to query join conversion when distinctOn is used
|
||||
detail.markQueryJoins(beanDescriptor, lazyLoadManyPath, isAllowOneManyFetch(), type.defaultSelect());
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isAllowOneManyFetch() {
|
||||
@@ -639,12 +643,11 @@ public class DefaultOrmQuery<T> extends AbstractQuery implements SpiQuery<T> {
|
||||
return countDistinctOrder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the Id should be included in the query.
|
||||
*/
|
||||
@Override
|
||||
public final boolean isWithId() {
|
||||
return !manualId && !distinct && !singleAttribute;
|
||||
// distinctOn orm query will auto include the id property
|
||||
// distinctOn dto query does NOT (via setting manualId to true)
|
||||
return !manualId && !singleAttribute && (!distinct || distinctOn != null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -740,6 +743,7 @@ public class DefaultOrmQuery<T> extends AbstractQuery implements SpiQuery<T> {
|
||||
copy.baseTable = baseTable;
|
||||
copy.rootTableAlias = rootTableAlias;
|
||||
copy.distinct = distinct;
|
||||
copy.distinctOn = distinctOn;
|
||||
copy.allowLoadErrors = allowLoadErrors;
|
||||
copy.timeout = timeout;
|
||||
copy.mapKey = mapKey;
|
||||
@@ -799,6 +803,11 @@ public class DefaultOrmQuery<T> extends AbstractQuery implements SpiQuery<T> {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String distinctOn() {
|
||||
return distinctOn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final String loadDescription() {
|
||||
return loadDescription;
|
||||
@@ -1087,6 +1096,9 @@ public class DefaultOrmQuery<T> extends AbstractQuery implements SpiQuery<T> {
|
||||
}
|
||||
if (distinct) {
|
||||
sb.append("/dt");
|
||||
if (distinctOn != null) {
|
||||
sb.append("/o:").append(distinctOn);
|
||||
}
|
||||
}
|
||||
if (allowLoadErrors) {
|
||||
sb.append("/ae");
|
||||
@@ -1340,6 +1352,13 @@ public class DefaultOrmQuery<T> extends AbstractQuery implements SpiQuery<T> {
|
||||
detail.addNested(name, nestedDetail, config);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Query<T> distinctOn(String distinctOn) {
|
||||
this.distinctOn = distinctOn;
|
||||
this.distinct = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Query<T> select(String columns) {
|
||||
detail.select(columns);
|
||||
|
||||
@@ -11,13 +11,67 @@ public final class OrmQueryLimitRequest implements SqlLimitRequest {
|
||||
private final String sql;
|
||||
private final String sqlOrderBy;
|
||||
private final boolean distinct;
|
||||
private final String distinctOn;
|
||||
private final String hint;
|
||||
private final String label;
|
||||
|
||||
public OrmQueryLimitRequest(String sql, String sqlOrderBy, SpiQuery<?> ormQuery, DatabasePlatform dbPlatform, boolean distinct) {
|
||||
this(sql, sqlOrderBy, ormQuery, dbPlatform, distinct, null, "", "");
|
||||
}
|
||||
|
||||
public OrmQueryLimitRequest(String sql, String sqlOrderBy, SpiQuery<?> ormQuery, DatabasePlatform dbPlatform,
|
||||
boolean distinct, String distinctOn, String hint, String label) {
|
||||
this.sql = sql;
|
||||
this.sqlOrderBy = sqlOrderBy;
|
||||
this.ormQuery = ormQuery;
|
||||
this.dbPlatform = dbPlatform;
|
||||
this.distinct = distinct;
|
||||
this.distinctOn = distinctOn;
|
||||
this.hint = hint;
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
private StringBuilder newBuffer() {
|
||||
return new StringBuilder(50 + sql.length());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String ansiOffsetRows() {
|
||||
final var buffer = selectDistinct();
|
||||
buffer.append(sql);
|
||||
int firstRow = getFirstRow();
|
||||
if (firstRow > 0) {
|
||||
buffer.append(" offset ").append(firstRow).append(" rows");
|
||||
}
|
||||
int maxRows = getMaxRows();
|
||||
if (maxRows > 0) {
|
||||
buffer.append(" fetch next ").append(maxRows).append(" rows only");
|
||||
}
|
||||
return buffer.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public StringBuilder selectDistinct() {
|
||||
final var buffer = newBuffer();
|
||||
buffer.append("select ").append(hint).append(label);
|
||||
if (distinct) {
|
||||
buffer.append("distinct ");
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StringBuilder selectDistinctOnSql() {
|
||||
var buffer = newBuffer();
|
||||
buffer.append("select ").append(hint).append(label);
|
||||
if (distinct) {
|
||||
buffer.append("distinct ");
|
||||
if (distinctOn != null) {
|
||||
buffer.append("on (").append(distinctOn).append(") ");
|
||||
}
|
||||
}
|
||||
buffer.append(sql);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+5
@@ -609,6 +609,11 @@ final class ImplicitReadOnlyTransaction implements SpiTransaction, TxnProfileEve
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deactivateExternal() {
|
||||
this.active = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the transaction is active.
|
||||
*/
|
||||
|
||||
@@ -1082,6 +1082,11 @@ class JdbcTransaction implements SpiTransaction, TxnProfileEventCodes {
|
||||
return active;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deactivateExternal() {
|
||||
this.active = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean isPersistCascade() {
|
||||
return persistCascade;
|
||||
|
||||
+26
-21
@@ -94,9 +94,14 @@ public final class JtaTransactionManager implements ExternalTransactionManager {
|
||||
// check current Ebean transaction
|
||||
SpiTransaction currentEbeanTransaction = scope.inScope();
|
||||
if (currentEbeanTransaction != null) {
|
||||
// NOT expecting this so log WARNING
|
||||
log.log(WARNING, "JTA Transaction - no current txn BUT using current Ebean one {0}", currentEbeanTransaction.id());
|
||||
return currentEbeanTransaction;
|
||||
if (currentEbeanTransaction.isActive()) {
|
||||
// NOT expecting this so log WARNING
|
||||
log.log(WARNING, "JTA Transaction - no current txn BUT using current Ebean one {0}", currentEbeanTransaction.id());
|
||||
return currentEbeanTransaction;
|
||||
} else {
|
||||
log.log(DEBUG, "JTA Transaction - clearing inActive Ebean transaction {0}", currentEbeanTransaction.id());
|
||||
scope.clearExternal();
|
||||
}
|
||||
}
|
||||
|
||||
UserTransaction ut = userTransaction();
|
||||
@@ -186,27 +191,27 @@ public final class JtaTransactionManager implements ExternalTransactionManager {
|
||||
|
||||
@Override
|
||||
public void afterCompletion(int status) {
|
||||
switch (status) {
|
||||
case Status.STATUS_COMMITTED:
|
||||
log.log(DEBUG, "Jta Txn [{0}] committed", transaction.id());
|
||||
transaction.postCommit();
|
||||
// Remove this transaction object as it is completed
|
||||
transactionManager.scope().clearExternal();
|
||||
break;
|
||||
try {
|
||||
switch (status) {
|
||||
case Status.STATUS_COMMITTED:
|
||||
log.log(DEBUG, "Jta Txn [{0}] committed", transaction.id());
|
||||
transaction.postCommit();
|
||||
break;
|
||||
|
||||
case Status.STATUS_ROLLEDBACK:
|
||||
log.log(DEBUG, "Jta Txn [{0}] rollback", transaction.id());
|
||||
transaction.postRollback(null);
|
||||
// Remove this transaction object as it is completed
|
||||
transactionManager.scope().clearExternal();
|
||||
break;
|
||||
case Status.STATUS_ROLLEDBACK:
|
||||
log.log(DEBUG, "Jta Txn [{0}] rollback", transaction.id());
|
||||
transaction.postRollback(null);
|
||||
break;
|
||||
|
||||
default:
|
||||
log.log(DEBUG, "Jta Txn [{0}] status:{1}", transaction.id(), status);
|
||||
default:
|
||||
log.log(DEBUG, "Jta Txn [{0}] status:{1}", transaction.id(), status);
|
||||
}
|
||||
} finally {
|
||||
transaction.deactivateExternal();
|
||||
transactionManager.scope().clearExternal();
|
||||
// No matter the completion status of the transaction, we release the connection we got from the pool.
|
||||
JdbcClose.close(transaction.internalConnection());
|
||||
}
|
||||
|
||||
// No matter the completion status of the transaction, we release the connection we got from the pool.
|
||||
JdbcClose.close(transaction.internalConnection());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -117,6 +117,10 @@ final class NoTransaction implements SpiTransaction {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deactivateExternal() {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLogSql() {
|
||||
|
||||
@@ -196,10 +196,6 @@ public class InitDataSourceTest {
|
||||
public void dataSourceDown(DataSource dataSource, SQLException reason) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dataSourceWarning(DataSource dataSource, String msg) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -3,6 +3,7 @@ package io.ebeaninternal.server.querydefn;
|
||||
|
||||
import io.ebean.*;
|
||||
import io.ebeaninternal.api.BindValuesKey;
|
||||
import io.ebeaninternal.api.SpiQuery;
|
||||
import io.ebeaninternal.server.core.OrmQueryRequest;
|
||||
import io.ebeaninternal.server.core.OrmQueryRequestTestHelper;
|
||||
import io.ebeaninternal.server.expression.BaseExpressionTest;
|
||||
@@ -54,6 +55,32 @@ public class DefaultOrmQueryTest extends BaseExpressionTest {
|
||||
assertThat(q1.getId()).isEqualTo(42);
|
||||
}
|
||||
|
||||
@Test
|
||||
void when_distinctOn_then_planChanges() {
|
||||
DefaultOrmQuery<Order> q1 = (DefaultOrmQuery<Order>) DB.find(Order.class).distinctOn("name");
|
||||
DefaultOrmQuery<Order> q2 = (DefaultOrmQuery<Order>) DB.find(Order.class);
|
||||
|
||||
prepare(q1, q2);
|
||||
assertThat(q1.createQueryPlanKey()).isNotEqualTo(q2.createQueryPlanKey());
|
||||
}
|
||||
|
||||
@Test
|
||||
void when_distinctOn_match() {
|
||||
DefaultOrmQuery<Order> q1 = (DefaultOrmQuery<Order>) DB.find(Order.class).distinctOn("name");
|
||||
DefaultOrmQuery<Order> q2 = (DefaultOrmQuery<Order>) DB.find(Order.class).distinctOn("name");
|
||||
|
||||
prepare(q1, q2);
|
||||
assertThat(q1.createQueryPlanKey()).isEqualTo(q2.createQueryPlanKey());
|
||||
assertThat(bindKey(q1)).isEqualTo(bindKey(q2));
|
||||
}
|
||||
|
||||
@Test
|
||||
void when_distinctOn_copy() {
|
||||
DefaultOrmQuery<Order> q1 = (DefaultOrmQuery<Order>) DB.find(Order.class).distinctOn("name");
|
||||
SpiQuery<Order> copy = q1.copy();
|
||||
assertThat(copy.distinctOn()).isEqualTo("name");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void when_addWhere_then_planChanges() {
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean ddl generation</name>
|
||||
@@ -28,14 +28,14 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-all</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean postgis types</name>
|
||||
@@ -19,14 +19,14 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- provided scope -->
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<tiles>
|
||||
<tile>io.ebean.tile:enhancement:14.1.0</tile>
|
||||
<tile>io.ebean.tile:enhancement:14.3.0</tile>
|
||||
</tiles>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
@@ -35,6 +35,8 @@ public class TestCacheSerialization {
|
||||
assertEquals(p1, r2.getPoint()); // and did fail https://github.com/ebean-orm/ebean/issues/3026
|
||||
assertEquals(pol, r2.getPolygon());
|
||||
|
||||
DB.delete(tb);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -76,5 +78,7 @@ public class TestCacheSerialization {
|
||||
assertEquals(pol, r2.getPolygon()); // and did fail https://github.com/ebean-orm/ebean/issues/3026
|
||||
assertNull(r1.getPoint());
|
||||
|
||||
DB.delete(tb);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean querybean</name>
|
||||
@@ -17,7 +17,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -63,14 +63,14 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-generator</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>querybean-generator</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<tiles>
|
||||
<tile>io.ebean.tile:enhancement:14.1.0</tile>
|
||||
<tile>io.ebean.tile:enhancement:14.3.0</tile>
|
||||
</tiles>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
@@ -59,6 +59,13 @@ public interface IQueryBean<T, R> extends QueryBuilder<R, T> {
|
||||
*/
|
||||
FetchGroup<T> buildFetchGroup();
|
||||
|
||||
/**
|
||||
* Set DISTINCT ON properties. This is a Postgres only SQL feature.
|
||||
*
|
||||
* @param properties The properties to include in the DISTINCT ON clause.
|
||||
*/
|
||||
R distinctOn(TQProperty<R, ?>... properties);
|
||||
|
||||
/**
|
||||
* Specify the properties to be loaded on the 'main' root level entity bean.
|
||||
* <p>
|
||||
|
||||
+25
-8
@@ -57,7 +57,7 @@ import java.util.stream.Stream;
|
||||
* @param <R> the specific root query bean type (e.g. QCustomer)
|
||||
*/
|
||||
@NonNullApi
|
||||
public abstract class TQRootBean<T, R> implements IQueryBean<T, R> {
|
||||
public abstract class QueryBean<T, R> implements IQueryBean<T, R> {
|
||||
|
||||
/**
|
||||
* The underlying query.
|
||||
@@ -88,21 +88,21 @@ public abstract class TQRootBean<T, R> implements IQueryBean<T, R> {
|
||||
/**
|
||||
* Construct using the type of bean to query on and the default database.
|
||||
*/
|
||||
public TQRootBean(Class<T> beanType) {
|
||||
protected QueryBean(Class<T> beanType) {
|
||||
this(beanType, DB.getDefault());
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct using the type of bean to query on and a given database.
|
||||
*/
|
||||
public TQRootBean(Class<T> beanType, Database database) {
|
||||
protected QueryBean(Class<T> beanType, Database database) {
|
||||
this(database.find(beanType));
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct with a transaction.
|
||||
*/
|
||||
protected TQRootBean(Class<T> beanType, Transaction transaction) {
|
||||
protected QueryBean(Class<T> beanType, Transaction transaction) {
|
||||
this(beanType);
|
||||
query.usingTransaction(transaction);
|
||||
}
|
||||
@@ -110,7 +110,7 @@ public abstract class TQRootBean<T, R> implements IQueryBean<T, R> {
|
||||
/**
|
||||
* Construct with a database and transaction.
|
||||
*/
|
||||
protected TQRootBean(Class<T> beanType, Database database, Transaction transaction) {
|
||||
protected QueryBean(Class<T> beanType, Database database, Transaction transaction) {
|
||||
this(beanType, database);
|
||||
query.usingTransaction(transaction);
|
||||
}
|
||||
@@ -119,7 +119,7 @@ public abstract class TQRootBean<T, R> implements IQueryBean<T, R> {
|
||||
* Construct using a query.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public TQRootBean(Query<T> query) {
|
||||
protected QueryBean(Query<T> query) {
|
||||
this.query = query;
|
||||
this.root = (R) this;
|
||||
}
|
||||
@@ -129,13 +129,13 @@ public abstract class TQRootBean<T, R> implements IQueryBean<T, R> {
|
||||
* values for select() and fetch().
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public TQRootBean(boolean aliasDummy) {
|
||||
protected QueryBean(boolean aliasDummy) {
|
||||
this.query = null;
|
||||
this.root = (R) this;
|
||||
}
|
||||
|
||||
/** Construct for FilterMany */
|
||||
protected TQRootBean(ExpressionList<T> filter) {
|
||||
protected QueryBean(ExpressionList<T> filter) {
|
||||
this.query = null;
|
||||
this.root = null;
|
||||
this.whereStack = new ArrayStack<>();
|
||||
@@ -159,6 +159,12 @@ public abstract class TQRootBean<T, R> implements IQueryBean<T, R> {
|
||||
return query;
|
||||
}
|
||||
|
||||
@Override
|
||||
public R distinctOn(String distinctOn) {
|
||||
query.distinctOn(distinctOn);
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
public R select(String properties) {
|
||||
query.select(properties);
|
||||
@@ -171,6 +177,17 @@ public abstract class TQRootBean<T, R> implements IQueryBean<T, R> {
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SafeVarargs
|
||||
public final R distinctOn(TQProperty<R, ?>... properties) {
|
||||
final var joiner = new StringJoiner(", ");
|
||||
for (Query.Property<?> property : properties) {
|
||||
joiner.add(property.toString());
|
||||
}
|
||||
distinctOn(joiner.toString());
|
||||
return root;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SafeVarargs
|
||||
public final R select(TQProperty<R, ?>... properties) {
|
||||
@@ -46,7 +46,7 @@ public abstract class TQAssocBean<T, R, QB> extends TQAssoc<T, R> {
|
||||
* Eagerly fetch this association fetching all the properties.
|
||||
*/
|
||||
public final R fetch() {
|
||||
((TQRootBean) _root).query().fetch(_name);
|
||||
((QueryBean) _root).query().fetch(_name);
|
||||
return _root;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public abstract class TQAssocBean<T, R, QB> extends TQAssoc<T, R> {
|
||||
* Eagerly fetch this association using a "query join".
|
||||
*/
|
||||
public final R fetchQuery() {
|
||||
((TQRootBean) _root).query().fetchQuery(_name);
|
||||
((QueryBean) _root).query().fetchQuery(_name);
|
||||
return _root;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public abstract class TQAssocBean<T, R, QB> extends TQAssoc<T, R> {
|
||||
* Cache misses are populated via fetchQuery().
|
||||
*/
|
||||
public final R fetchCache() {
|
||||
((TQRootBean) _root).query().fetchCache(_name);
|
||||
((QueryBean) _root).query().fetchCache(_name);
|
||||
return _root;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ public abstract class TQAssocBean<T, R, QB> extends TQAssoc<T, R> {
|
||||
* Use lazy loading for fetching this association.
|
||||
*/
|
||||
public final R fetchLazy() {
|
||||
((TQRootBean) _root).query().fetchLazy(_name);
|
||||
((QueryBean) _root).query().fetchLazy(_name);
|
||||
return _root;
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ public abstract class TQAssocBean<T, R, QB> extends TQAssoc<T, R> {
|
||||
* Eagerly fetch this association with the properties specified.
|
||||
*/
|
||||
public final R fetch(String properties) {
|
||||
((TQRootBean) _root).query().fetch(_name, properties);
|
||||
((QueryBean) _root).query().fetch(_name, properties);
|
||||
return _root;
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public abstract class TQAssocBean<T, R, QB> extends TQAssoc<T, R> {
|
||||
* Eagerly fetch this association using a "query join" with the properties specified.
|
||||
*/
|
||||
public final R fetchQuery(String properties) {
|
||||
((TQRootBean) _root).query().fetchQuery(_name, properties);
|
||||
((QueryBean) _root).query().fetchQuery(_name, properties);
|
||||
return _root;
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ public abstract class TQAssocBean<T, R, QB> extends TQAssoc<T, R> {
|
||||
* Cache misses are populated via fetchQuery().
|
||||
*/
|
||||
public final R fetchCache(String properties) {
|
||||
((TQRootBean) _root).query().fetchCache(_name, properties);
|
||||
((QueryBean) _root).query().fetchCache(_name, properties);
|
||||
return _root;
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ public abstract class TQAssocBean<T, R, QB> extends TQAssoc<T, R> {
|
||||
}
|
||||
|
||||
private SpiQueryFetch spiQuery() {
|
||||
return (SpiQueryFetch) ((TQRootBean) _root).query();
|
||||
return (SpiQueryFetch) ((QueryBean) _root).query();
|
||||
}
|
||||
|
||||
private Set<String> properties(TQProperty<?, ?>... props) {
|
||||
|
||||
@@ -41,7 +41,7 @@ public class TQProperty<R, T> implements Query.Property<T> {
|
||||
* Internal method to return the underlying expression list.
|
||||
*/
|
||||
protected final ExpressionList<?> expr() {
|
||||
return ((TQRootBean<?, ?>) _root).peekExprList();
|
||||
return ((QueryBean<?, ?>) _root).peekExprList();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,6 +4,7 @@ import io.ebean.*;
|
||||
import io.ebean.annotation.Transactional;
|
||||
import io.ebean.test.LoggedSql;
|
||||
import io.ebean.types.Inet;
|
||||
import io.ebeaninternal.api.SpiQuery;
|
||||
import org.example.domain.Address;
|
||||
import org.example.domain.Country;
|
||||
import org.example.domain.Customer;
|
||||
@@ -226,6 +227,22 @@ public class QCustomerTest {
|
||||
.findList();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void distinctOn() {
|
||||
var c = QContact.alias();
|
||||
var q = new QContact()
|
||||
.distinctOn(c.customer)
|
||||
.select(c.lastName, c.whenCreated)
|
||||
.orderBy()
|
||||
.customer.id.asc()
|
||||
.whenCreated.desc()
|
||||
.query();
|
||||
|
||||
SpiQuery<?> spiQuery = (SpiQuery<?>) q;
|
||||
assertThat(spiQuery.distinctOn()).isEqualTo("customer");
|
||||
assertThat(spiQuery.isDistinct()).isTrue();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Test
|
||||
public void forUpdate() {
|
||||
@@ -314,7 +331,7 @@ public class QCustomerTest {
|
||||
.query();
|
||||
|
||||
q.findList();
|
||||
assertThat(q.getGeneratedSql()).isEqualTo("select t0.id, t0.name from be_customer t0 limit 10");
|
||||
assertThat(q.getGeneratedSql()).isEqualTo("select /* QCustomerTest.filterManySeparateQuery */ t0.id, t0.name from be_customer t0 limit 10");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+7
-7
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-redis</artifactId>
|
||||
@@ -22,28 +22,28 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>querybean-generator</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<tiles>
|
||||
<tile>io.ebean.tile:enhancement:14.1.0</tile>
|
||||
<tile>io.ebean.tile:enhancement:14.3.0</tile>
|
||||
</tiles>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-spring-txn</artifactId>
|
||||
@@ -28,7 +28,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<tiles>
|
||||
<tile>io.ebean.tile:enhancement:14.1.0</tile>
|
||||
<tile>io.ebean.tile:enhancement:14.3.0</tile>
|
||||
</tiles>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
+11
-11
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean test</name>
|
||||
@@ -12,8 +12,8 @@
|
||||
<artifactId>ebean-test</artifactId>
|
||||
|
||||
<properties>
|
||||
<bytebuddy.version>1.14.12</bytebuddy.version>
|
||||
<assertj.version>3.25.3</assertj.version>
|
||||
<bytebuddy.version>1.14.17</bytebuddy.version>
|
||||
<assertj.version>3.26.0</assertj.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -33,20 +33,20 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-generator</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -149,14 +149,14 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-jackson-mapper</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-all</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -293,7 +293,7 @@
|
||||
<dependency>
|
||||
<groupId>io.avaje</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>1.4</version>
|
||||
<version>1.5</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -305,11 +305,11 @@
|
||||
<plugin>
|
||||
<groupId>io.repaint.maven</groupId>
|
||||
<artifactId>tiles-maven-plugin</artifactId>
|
||||
<version>2.34</version>
|
||||
<version>2.40</version>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<tiles>
|
||||
<tile>io.ebean.tile:enhancement:14.1.0</tile>
|
||||
<tile>io.ebean.tile:enhancement:14.3.0</tile>
|
||||
</tiles>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
@@ -222,8 +222,12 @@ public class DtoQueryFromOrmTest extends BaseTestCase {
|
||||
LoggedSql.start();
|
||||
|
||||
DtoQuery<ContactDto> query = DB.find(Contact.class)
|
||||
.select("email, " + concat("lastName", ", ", "firstName") + " as fullName").where().isNotNull("email")
|
||||
.isNotNull("lastName").order().asc("lastName").asDto(ContactDto.class);
|
||||
.select("email, " + concat("lastName", ", ", "firstName") + " as fullName")
|
||||
.where()
|
||||
.isNotNull("email")
|
||||
.isNotNull("lastName")
|
||||
.order().asc("lastName")
|
||||
.asDto(ContactDto.class);
|
||||
|
||||
List<ContactDto> dtos = query.findList();
|
||||
|
||||
@@ -246,9 +250,15 @@ public class DtoQueryFromOrmTest extends BaseTestCase {
|
||||
|
||||
LoggedSql.start();
|
||||
|
||||
List<ContactDto> contactDtos = DB.find(Contact.class).setLabel("emailFullName")
|
||||
.select("email, " + concat("lastName", ", ", "firstName") + " as fullName").where().isNotNull("email")
|
||||
.isNotNull("lastName").order().asc("lastName").setMaxRows(10).asDto(ContactDto.class).findList();
|
||||
List<ContactDto> contactDtos = DB.find(Contact.class)
|
||||
.setLabel("emailFullName")
|
||||
.select("email, " + concat("lastName", ", ", "firstName") + " as fullName")
|
||||
.where().isNotNull("email")
|
||||
.isNotNull("lastName")
|
||||
.orderBy().asc("lastName")
|
||||
.setMaxRows(10)
|
||||
.asDto(ContactDto.class)
|
||||
.findList();
|
||||
|
||||
assertThat(contactDtos).isNotEmpty();
|
||||
|
||||
@@ -260,11 +270,11 @@ public class DtoQueryFromOrmTest extends BaseTestCase {
|
||||
List<String> sql = LoggedSql.stop();
|
||||
|
||||
if (isSqlServer()) {
|
||||
assertSql(sql.get(0)).contains("select top 10 t0.email, " + concat("t0.last_name", ", ", "t0.first_name")
|
||||
assertSql(sql.get(0)).contains("select /* emailFullName */ top 10 t0.email, " + concat("t0.last_name", ", ", "t0.first_name")
|
||||
+ " fullName from contact t0 where t0.email is not null and t0.last_name is not null order by t0.last_name");
|
||||
|
||||
} else {
|
||||
assertSql(sql.get(0)).contains("select t0.email, " + concat("t0.last_name", ", ", "t0.first_name")
|
||||
assertSql(sql.get(0)).contains("select /* emailFullName */ t0.email, " + concat("t0.last_name", ", ", "t0.first_name")
|
||||
+ " fullName from contact t0 where t0.email is not null and t0.last_name is not null order by t0.last_name");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ class TestLazyLoadMany extends BaseTestCase {
|
||||
}
|
||||
return m0;
|
||||
}
|
||||
|
||||
@Test
|
||||
void loadAfterPCCleared() {
|
||||
|
||||
@@ -31,6 +32,7 @@ class TestLazyLoadMany extends BaseTestCase {
|
||||
List<COOne> children = DB.find(COOne.class)
|
||||
.setLazyLoadBatchSize(2)
|
||||
.where().startsWith("name", "tll-m")
|
||||
.orderBy("name")
|
||||
.findList();
|
||||
|
||||
assertThat(children).hasSize(3);
|
||||
|
||||
@@ -0,0 +1,187 @@
|
||||
package org.tests.query;
|
||||
|
||||
import io.ebean.DB;
|
||||
import io.ebean.Query;
|
||||
import io.ebean.annotation.Platform;
|
||||
import io.ebean.test.LoggedSql;
|
||||
import io.ebean.xtest.BaseTestCase;
|
||||
import io.ebean.xtest.ForPlatform;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.tests.model.basic.Contact;
|
||||
import org.tests.model.basic.Customer;
|
||||
import org.tests.model.basic.OrderDetail;
|
||||
import org.tests.model.basic.ResetBasicData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
class TestDistinctOnQuery extends BaseTestCase {
|
||||
|
||||
@ForPlatform({Platform.POSTGRES, Platform.YUGABYTE})
|
||||
@Test
|
||||
void distinctOn() {
|
||||
ResetBasicData.reset();
|
||||
|
||||
LoggedSql.start();
|
||||
|
||||
List<Customer> customers = DB.find(Customer.class)
|
||||
.distinctOn("id")
|
||||
.select("name")
|
||||
.fetch("contacts", "firstName, lastName")
|
||||
.orderBy("id, contacts.lastName")
|
||||
.setMaxRows(10)
|
||||
.findList();
|
||||
|
||||
for (Customer customer : customers) {
|
||||
List<Contact> contacts = customer.getContacts();
|
||||
assertThat(contacts.size()).isEqualTo(1);
|
||||
}
|
||||
|
||||
List<String> sql = LoggedSql.stop();
|
||||
assertThat(sql).hasSize(1);
|
||||
assertThat(sql.get(0)).contains("select distinct on (t0.id) t0.id, t0.name, t1.id, t1.first_name, t1.last_name from o_customer t0 left join contact t1 on t1.customer_id = t0.id order by t0.id, t1.last_name limit 10;");
|
||||
}
|
||||
|
||||
@ForPlatform({Platform.POSTGRES, Platform.YUGABYTE})
|
||||
@Test
|
||||
void distinctOnSubQuery() {
|
||||
ResetBasicData.reset();
|
||||
|
||||
LoggedSql.start();
|
||||
|
||||
Query<OrderDetail> subQuery = DB.find(OrderDetail.class)
|
||||
.distinctOn("product")
|
||||
.select("id")
|
||||
.orderBy("product, updtime desc")
|
||||
.setMaxRows(10);
|
||||
|
||||
List<OrderDetail> lines = DB.find(OrderDetail.class)
|
||||
.select("product, orderQty, shipQty, created")
|
||||
.where().in("id", subQuery)
|
||||
.orderBy().asc("cretime")
|
||||
.findList();
|
||||
|
||||
assertThat(lines).isNotEmpty();
|
||||
List<String> sql = LoggedSql.stop();
|
||||
assertThat(sql).hasSize(1);
|
||||
assertThat(sql.get(0)).contains("select t0.id, t0.product_id, t0.order_qty, t0.ship_qty, t0.id from o_order_detail t0 where t0.id in (select distinct on (t0.product_id) t0.id from o_order_detail t0 order by t0.product_id, t0.updtime desc limit 10) order by t0.cretime");
|
||||
}
|
||||
|
||||
@ForPlatform({Platform.POSTGRES, Platform.YUGABYTE})
|
||||
@Test
|
||||
void distinctOnManyToOne() {
|
||||
ResetBasicData.reset();
|
||||
int totalCount = DB.find(Contact.class).findCount();
|
||||
|
||||
LoggedSql.start();
|
||||
List<Contact> contacts = DB.find(Contact.class)
|
||||
.distinctOn("customer")
|
||||
.select("*")
|
||||
.orderBy("customer, updtime desc")
|
||||
.setMaxRows(10)
|
||||
.findList();
|
||||
|
||||
assertThat(contacts.size()).isLessThan(totalCount);
|
||||
|
||||
List<String> sql = LoggedSql.stop();
|
||||
assertThat(sql).hasSize(1);
|
||||
assertThat(sql.get(0)).contains("select distinct on (t0.customer_id) t0.id, t0.first_name, t0.last_name");
|
||||
assertThat(sql.get(0)).contains("from contact t0 order by t0.customer_id, t0.updtime desc limit 10");
|
||||
}
|
||||
|
||||
@ForPlatform({Platform.POSTGRES, Platform.YUGABYTE})
|
||||
@Test
|
||||
void distinctOnToDto() {
|
||||
ResetBasicData.reset();
|
||||
int totalCount = DB.find(Contact.class).findCount();
|
||||
|
||||
LoggedSql.start();
|
||||
List<MyDto> contacts = DB.find(Contact.class)
|
||||
.distinctOn("lastName")
|
||||
.select("firstName, lastName")
|
||||
.orderBy("lastName desc")
|
||||
.setMaxRows(10)
|
||||
.asDto(MyDto.class)
|
||||
.findList();
|
||||
|
||||
assertThat(contacts.size()).isLessThan(totalCount);
|
||||
for (MyDto contact : contacts) {
|
||||
assertThat(contact.firstName()).isNotBlank();
|
||||
assertThat(contact.lastName()).isNotBlank();
|
||||
}
|
||||
|
||||
List<String> sql = LoggedSql.stop();
|
||||
assertThat(sql).hasSize(1);
|
||||
assertThat(sql.get(0)).contains("select distinct on (t0.last_name) t0.first_name, t0.last_name from contact t0 order by t0.last_name desc limit 10");
|
||||
}
|
||||
|
||||
@ForPlatform({Platform.POSTGRES, Platform.YUGABYTE})
|
||||
@Test
|
||||
void distinctOnToDtoWithId() {
|
||||
ResetBasicData.reset();
|
||||
int totalCount = DB.find(Contact.class).findCount();
|
||||
|
||||
LoggedSql.start();
|
||||
List<MyDtoWithId> contacts = DB.find(Contact.class)
|
||||
.distinctOn("lastName")
|
||||
.select("id, firstName, lastName")
|
||||
.orderBy("lastName desc")
|
||||
.setMaxRows(10)
|
||||
.asDto(MyDtoWithId.class)
|
||||
.findList();
|
||||
|
||||
assertThat(contacts.size()).isLessThan(totalCount);
|
||||
for (MyDtoWithId contact : contacts) {
|
||||
assertThat(contact.id()).isGreaterThan(0);
|
||||
assertThat(contact.firstName()).isNotBlank();
|
||||
assertThat(contact.lastName()).isNotBlank();
|
||||
}
|
||||
|
||||
List<String> sql = LoggedSql.stop();
|
||||
assertThat(sql).hasSize(1);
|
||||
assertThat(sql.get(0)).contains("select distinct on (t0.last_name) t0.id, t0.first_name, t0.last_name from contact t0 order by t0.last_name desc limit 10");
|
||||
}
|
||||
|
||||
public static class MyDto {
|
||||
private final String firstName;
|
||||
private final String lastName;
|
||||
|
||||
public MyDto(String firstName, String lastName) {
|
||||
this.firstName = firstName;
|
||||
this.lastName = lastName;
|
||||
}
|
||||
|
||||
public String firstName() {
|
||||
return firstName;
|
||||
}
|
||||
|
||||
public String lastName() {
|
||||
return lastName;
|
||||
}
|
||||
}
|
||||
|
||||
public static class MyDtoWithId {
|
||||
private final long id;
|
||||
private final String firstName;
|
||||
private final String lastName;
|
||||
|
||||
public MyDtoWithId(long id, String firstName, String lastName) {
|
||||
this.id = id;
|
||||
this.firstName = firstName;
|
||||
this.lastName = lastName;
|
||||
}
|
||||
|
||||
public long id() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String firstName() {
|
||||
return firstName;
|
||||
}
|
||||
|
||||
public String lastName() {
|
||||
return lastName;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -228,7 +228,7 @@ public class TestQueryFindIterate extends BaseTestCase {
|
||||
dsPool = (DataSourcePool) server().dataSource();
|
||||
}
|
||||
|
||||
int startConns = dsPool.getStatus(false).getBusy();
|
||||
int startConns = dsPool.status(false).busy();
|
||||
final Query<Customer> query = server().find(Customer.class)
|
||||
.where()
|
||||
.isNotNull("name")
|
||||
@@ -241,22 +241,22 @@ public class TestQueryFindIterate extends BaseTestCase {
|
||||
|
||||
QueryIterator<Customer> queryIterator = query.findIterate();
|
||||
|
||||
assertThat(dsPool.getStatus(false).getBusy()).isEqualTo(startConns + 1);
|
||||
assertThat(dsPool.status(false).busy()).isEqualTo(startConns + 1);
|
||||
|
||||
assertTrue(queryIterator.hasNext());
|
||||
assertThat(queryIterator.next()).isNotNull();
|
||||
assertThat(dsPool.getStatus(false).getBusy()).isEqualTo(startConns + 1);
|
||||
assertThat(dsPool.status(false).busy()).isEqualTo(startConns + 1);
|
||||
|
||||
assertTrue(queryIterator.hasNext());
|
||||
assertThat(queryIterator.next()).isNotNull();
|
||||
assertThat(dsPool.getStatus(false).getBusy()).isEqualTo(startConns + 1);
|
||||
assertThat(dsPool.status(false).busy()).isEqualTo(startConns + 1);
|
||||
|
||||
assertTrue(queryIterator.hasNext());
|
||||
assertThat(queryIterator.next()).isNotNull();
|
||||
assertThat(dsPool.getStatus(false).getBusy()).isEqualTo(startConns + 1);
|
||||
assertThat(dsPool.status(false).busy()).isEqualTo(startConns + 1);
|
||||
|
||||
assertFalse(queryIterator.hasNext());
|
||||
assertThat(dsPool.getStatus(false).getBusy()).isEqualTo(startConns);
|
||||
assertThat(dsPool.status(false).busy()).isEqualTo(startConns);
|
||||
try {
|
||||
queryIterator.next();
|
||||
fail("noSuchElementException expected");
|
||||
|
||||
@@ -15,8 +15,8 @@ mvn -T 4 clean package
|
||||
mvn -T 4 deploy -pl '!composites,!platforms' -Pcentral -DskipTests -DskipStagingRepositoryClose=true -DstagingProgressTimeoutMinutes=9
|
||||
|
||||
## git commit, git tag, git push --tags
|
||||
git commit -am 'Version 14.1.0'
|
||||
git tag 14.0.2
|
||||
git commit -am 'Version 14.4.0'
|
||||
git tag 14.4.0
|
||||
git push --tags
|
||||
|
||||
## convert to javax
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</parent>
|
||||
|
||||
<name>kotlin querybean generator</name>
|
||||
@@ -21,7 +21,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -56,14 +56,14 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-generator</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
+1
-1
@@ -337,7 +337,7 @@ class SimpleQueryBeanWriter {
|
||||
writer.append(" */").eol();
|
||||
writer.append(Constants.AT_GENERATED).eol();
|
||||
writer.append(Constants.AT_TYPEQUERYBEAN).eol();
|
||||
writer.append("class Q%s : io.ebean.typequery.TQRootBean<%s, Q%s> {", shortName, beanFullName, shortName).eol();
|
||||
writer.append("class Q%s : io.ebean.typequery.QueryBean<%s, Q%s> {", shortName, beanFullName, shortName).eol();
|
||||
}
|
||||
|
||||
writer.eol();
|
||||
|
||||
+14
-14
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -15,67 +15,67 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-clickhouse</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-db2</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-hana</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-hsqldb</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-mysql</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-mariadb</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-nuodb</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-oracle</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlanywhere</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlite</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlserver</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Provided scope so that the H2HistoryTrigger can live in Ebean core
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -15,13 +15,13 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-mysql</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
+1
-16
@@ -11,23 +11,8 @@ final class OracleAnsiSqlRowsLimiter implements SqlLimiter {
|
||||
|
||||
@Override
|
||||
public SqlLimitResponse limit(SqlLimitRequest request) {
|
||||
String dbSql = request.getDbSql();
|
||||
StringBuilder sb = new StringBuilder(50 + dbSql.length());
|
||||
sb.append("select ");
|
||||
if (request.isDistinct()) {
|
||||
sb.append("distinct ");
|
||||
}
|
||||
sb.append(dbSql);
|
||||
int firstRow = request.getFirstRow();
|
||||
if (firstRow > 0) {
|
||||
sb.append(" offset ").append(firstRow).append(" rows");
|
||||
}
|
||||
int maxRows = request.getMaxRows();
|
||||
if (maxRows > 0) {
|
||||
sb.append(" fetch next ").append(maxRows).append(" rows only");
|
||||
}
|
||||
// Oracle does not support FOR UPDATE clause with limit offset
|
||||
return new SqlLimitResponse(sb.toString());
|
||||
return new SqlLimitResponse(request.ansiOffsetRows());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>platforms</artifactId>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
+10
-18
@@ -11,31 +11,23 @@ final class SqlServerSqlLimiter implements SqlLimiter {
|
||||
|
||||
@Override
|
||||
public SqlLimitResponse limit(SqlLimitRequest request) {
|
||||
String dbSql = request.getDbSql();
|
||||
StringBuilder sb = new StringBuilder(50 + dbSql.length());
|
||||
int firstRow = request.getFirstRow();
|
||||
int maxRows = request.getMaxRows();
|
||||
if (firstRow < 1) {
|
||||
// just use top n
|
||||
sb.append("select ");
|
||||
if (request.isDistinct()) {
|
||||
sb.append("distinct ");
|
||||
}
|
||||
sb.append("top ").append(maxRows).append(' ');
|
||||
sb.append(dbSql);
|
||||
return new SqlLimitResponse(sb.toString());
|
||||
final var buffer = request.selectDistinct();
|
||||
buffer.append("top ").append(maxRows).append(' ');
|
||||
buffer.append(request.getDbSql());
|
||||
return new SqlLimitResponse(buffer.toString());
|
||||
}
|
||||
sb.append("select ");
|
||||
if (request.isDistinct()) {
|
||||
sb.append("distinct ");
|
||||
}
|
||||
sb.append(dbSql);
|
||||
sb.append(' ').append("offset");
|
||||
sb.append(' ').append(firstRow).append(" rows");
|
||||
final var buffer = request.selectDistinct();
|
||||
buffer.append(request.getDbSql());
|
||||
buffer.append(' ').append("offset");
|
||||
buffer.append(' ').append(firstRow).append(" rows");
|
||||
if (maxRows > 0) {
|
||||
sb.append(" fetch next ").append(maxRows).append(" rows only");
|
||||
buffer.append(" fetch next ").append(maxRows).append(" rows only");
|
||||
}
|
||||
return new SqlLimitResponse(sb.toString());
|
||||
return new SqlLimitResponse(buffer.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
<parent>
|
||||
<groupId>org.avaje</groupId>
|
||||
<artifactId>java11-oss</artifactId>
|
||||
<version>3.12</version>
|
||||
<version>4.3</version>
|
||||
</parent>
|
||||
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>ebean parent</name>
|
||||
@@ -50,11 +50,11 @@
|
||||
<ebean-annotation.version>8.4</ebean-annotation.version>
|
||||
<ebean-ddl-runner.version>2.3</ebean-ddl-runner.version>
|
||||
<ebean-migration-auto.version>1.2</ebean-migration-auto.version>
|
||||
<ebean-migration.version>14.0.0</ebean-migration.version>
|
||||
<ebean-test-containers.version>7.3</ebean-test-containers.version>
|
||||
<ebean-datasource.version>8.12</ebean-datasource.version>
|
||||
<ebean-agent.version>14.1.0</ebean-agent.version>
|
||||
<ebean-maven-plugin.version>14.1.0</ebean-maven-plugin.version>
|
||||
<ebean-migration.version>14.1.0</ebean-migration.version>
|
||||
<ebean-test-containers.version>7.4</ebean-test-containers.version>
|
||||
<ebean-datasource.version>9.0</ebean-datasource.version>
|
||||
<ebean-agent.version>14.4.0</ebean-agent.version>
|
||||
<ebean-maven-plugin.version>14.4.0</ebean-maven-plugin.version>
|
||||
<surefire.useModulePath>false</surefire.useModulePath>
|
||||
</properties>
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
<dependency>
|
||||
<groupId>io.avaje</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>1.4</version>
|
||||
<version>1.5</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>14.1.0</version>
|
||||
<version>14.4.0</version>
|
||||
</parent>
|
||||
|
||||
<name>querybean generator</name>
|
||||
|
||||
+4
-3
@@ -217,15 +217,16 @@ class SimpleQueryBeanWriter {
|
||||
private void writeClass() {
|
||||
writer.append("/**").eol();
|
||||
writer.append(" * Query bean for %s.", shortName).eol();
|
||||
writer.append(" * ").eol();
|
||||
writer.append(" * <p>").eol();
|
||||
writer.append(" * THIS IS A GENERATED OBJECT, DO NOT MODIFY THIS CLASS.").eol();
|
||||
writer.append(" */").eol();
|
||||
writer.append("@SuppressWarnings(\"unused\")").eol();
|
||||
writer.append(Constants.AT_GENERATED).eol();
|
||||
if (embeddable) {
|
||||
writer.append("public final class Q%s {", shortName).eol();
|
||||
} else {
|
||||
writer.append(Constants.AT_TYPEQUERYBEAN).eol();
|
||||
writer.append("public final class Q%s extends io.ebean.typequery.TQRootBean<%s,Q%s> {", shortName, beanFullName, shortName).eol();
|
||||
writer.append("public final class Q%s extends io.ebean.typequery.QueryBean<%s,Q%s> {", shortName, beanFullName, shortName).eol();
|
||||
}
|
||||
writer.eol();
|
||||
}
|
||||
@@ -285,7 +286,7 @@ class SimpleQueryBeanWriter {
|
||||
private void writeAssocFilterMany() {
|
||||
writer.eol();
|
||||
writer.append(" @SuppressWarnings({\"unchecked\", \"rawtypes\"})").eol();
|
||||
writer.append(" public final R filterMany(java.util.function.Consumer<Q%s> apply) {", shortName).eol();
|
||||
writer.append(" public R filterMany(java.util.function.Consumer<Q%s> apply) {", shortName).eol();
|
||||
writer.append(" final io.ebean.ExpressionList list = io.ebean.Expr.factory().expressionList();", shortName).eol();
|
||||
writer.append(" final var qb = new Q%s(list);", shortName).eol();
|
||||
writer.append(" apply.accept(qb);").eol();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user