Compare commits

..
45 Commits
Author SHA1 Message Date
Rob Bygrave 4610dbb26e Version 14.8.0 2024-10-25 14:28:58 +13:00
Rob BygraveandGitHub b26382f99c Merge pull request #3507 from ebean-orm/feature/agent-1480
Bump ebean-agent to 14.8.0
2024-10-25 14:18:20 +13:00
Rob Bygrave 2fba89f846 Bump ebean-agent to 14.8.0
This ebean agent is required to support the fluid QueryBuilder API change.
2024-10-25 14:17:46 +13:00
Rob Bygrave e4f13da868 Merge branch 'dynamic-property-group-by' 2024-10-24 16:13:01 +13:00
Rob Bygrave 32cd081fce #3504 Tidy test only and final method 2024-10-24 16:12:45 +13:00
Rob Bygrave f6da332998 Add test for TestReflectiveModificationUpdate 2024-10-24 08:37:02 +13:00
Alexander Wagner d8f321d87b Fix: dynamic property group by with alias 2024-10-22 13:24:12 +02:00
Rob Bygrave c868d8a23b Fix test for Postgres TestDistinctOnQuery 2024-10-22 19:00:52 +13:00
Rob Bygrave d77c14d866 Fix test for Postgres TestDistinctOnQuery 2024-10-22 08:14:01 +13:00
Rob BygraveandGitHub 423d906848 Merge pull request #3499 from ebean-orm/feature/3489
Potentially breaking change: Throw PersistenceException for unknown property in select clause
2024-10-18 19:25:46 +13:00
Rob Bygrave 100d33cc94 Potentially breaking change: Throw PersistenceException for unknown property in select clause 2024-10-18 19:12:53 +13:00
Rob BygraveandGitHub 20cf6a9c00 Merge pull request #3498 from ebean-orm/feature/migrate-avaje-lang-to-jspecify
Migrate to JSpecify NullMarked/Nullable from avaje.lang NonNullApi/Nullable
2024-10-18 16:56:19 +13:00
Rob BygraveandGitHub e2c12268f7 Merge branch 'master' into feature/migrate-avaje-lang-to-jspecify 2024-10-18 16:52:53 +13:00
Rob BygraveandGitHub 937f6296e1 Merge pull request #3497 from ebean-orm/feature/fluid-self-querybuilder
Fix SELF of QueryBuilder, QueryBean, IQueryBean for fluid use
2024-10-18 16:48:26 +13:00
Rob Bygrave 24749567d2 Migrate to JSpecify NullMarked/Nullable from avaje.lang NonNullApi/Nullable 2024-10-18 16:46:41 +13:00
Rob Bygrave 7045240778 Merge branch 'transaction-readonly' 2024-10-18 16:27:18 +13:00
Rob Bygrave 6ceea85b94 Move markNotQueryOnly() into init transaction methods of PersistRequest 2024-10-18 16:26:49 +13:00
Rob Bygrave e04ac50800 Fix SELF of QueryBuilder, QueryBean, IQueryBean for fluid use
Currently, the SELF response type of QueryBuilder returns as Object when really we want it to return the SELF generic type of QueryBuilder, QueryBean, IQueryBean etc

Note that this change requires an updated ebean-agent
2024-10-18 16:18:39 +13:00
Noemi Praml a452fc0e21 call request.markNotQueryOnly 2024-10-17 16:30:42 +02:00
Noemi Praml 4438d5db7d Fixes in DefaultPersister 2024-10-17 16:19:19 +02:00
Noemi Praml 9ca6fa31e5 more tests 2024-10-17 16:19:03 +02:00
Rob BygraveandGitHub e0a00bea34 Merge pull request #3496 from mumbler6/fix-flaky
fixed flaky test in ToStringBuilderTest.java
2024-10-17 21:36:15 +13:00
mumbler6 b24b549298 fixed flaky test in ToStringBuilderTest.java 2024-10-15 22:41:51 -05:00
Rob Bygrave 51d0f4efcc Fix test TestOrderedList for Postgres ANY 2024-10-15 22:14:45 +13:00
Noemi Praml e08985d7c5 suggested solution 2024-10-14 16:53:48 +02:00
Noemi Praml 4f984ff2d4 add: failing test 2024-10-14 16:53:00 +02:00
Rob Bygrave b6843c6db0 Version 14.7.0 2024-10-10 23:48:29 +13:00
Rob Bygrave 57782c05b5 Update ebean-agent to 14.7.0 (Updates to ASM 9.7.1) 2024-10-10 23:46:37 +13:00
Rob BygraveandGitHub a2ee8b61f8 Merge pull request #3487 from FOCONIS/batch-ordering-bug
Bug: Batch ordering - Regression introduced in version 13.26.1, insertAll() leaves batchMode=true enabled ... when it should not
2024-10-10 22:31:15 +13:00
Rob BygraveandGitHub 1225a2776f Merge pull request #3485 from FOCONIS/ordercolumn-cache-queries
Fix orderBy for cached many requests
2024-10-10 22:30:23 +13:00
Rob BygraveandGitHub a499c8c26a Merge pull request #3493 from ebean-orm/feature/3490
#3490 filterMany generates invalid sql when the many side uses @EmbeddedId to model composite primary key
2024-10-10 22:27:58 +13:00
Rob Bygrave 8e627c756f #3490 filterMany generates invalid sql when the many side uses @EmbeddedId to model composite primary key 2024-10-10 22:24:24 +13:00
Rob Bygrave 45cc78bb0a #3490 filterMany generates invalid sql when the many side uses @EmbeddedId to model composite primary key 2024-10-10 22:11:20 +13:00
Rob Bygrave 38a8e95b36 #3491 Update javadocs and SqlQuery Postgres ANY tests 2024-10-10 20:08:03 +13:00
Rob BygraveandGitHub bca381104b Merge pull request #3491 from ajcamilo/master
Add setArrayParameter to SqlQuery
2024-10-10 20:07:08 +13:00
André Camilo 7e0c6795ff add setArrayParameter to SqlQuery 2024-10-09 13:24:52 +01:00
Roland Praml 8b4804be22 Fix: after DB.inserAll, transaction may stay in batchmode 2024-10-08 13:16:37 +02:00
Roland Praml a8418a3d75 Created test for batch escalation 2024-10-08 13:16:32 +02:00
Rob BygraveandGitHub bb0f63e38a Merge pull request #3488 from ebean-orm/dependabot/maven/ebean-test/commons-io-commons-io-2.14.0
Bump commons-io:commons-io from 2.7 to 2.14.0 in /ebean-test
2024-10-08 18:28:32 +13:00
Rob Bygrave 978ed26b78 Update ebean-agent 14.6.1 for #3484 2024-10-08 18:23:46 +13:00
Rob Bygrave 5cfa7295f8 Update tests for test-kotlin with latest agent 2024-10-08 18:17:08 +13:00
Noemi Praml 88d8b4fb5e Fix orderBy for cached many requests 2024-10-07 15:04:46 +02:00
dependabot[bot]andGitHub 93155d3c8f Bump commons-io:commons-io from 2.7 to 2.14.0 in /ebean-test
Bumps commons-io:commons-io from 2.7 to 2.14.0.

---
updated-dependencies:
- dependency-name: commons-io:commons-io
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-03 18:46:07 +00:00
Rob Bygrave 6d5f740337 TestQueryPaging example to H2 and Postgres due to use of nulls first
nulls first isn't supports by mysql
2024-09-20 21:21:57 +12:00
Rob Bygrave bd06b57144 Add valhalla EA build 2024-09-18 20:49:40 +12:00
137 changed files with 1068 additions and 371 deletions
+41
View File
@@ -0,0 +1,41 @@
name: Valhalla EA
on:
workflow_dispatch:
schedule:
- cron: '39 2 * * 3'
jobs:
build:
runs-on: ${{ matrix.os }}
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
java_version: [valhalla]
os: [ubuntu-latest]
steps:
- 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@v4
env:
cache-name: maven-cache
with:
path:
~/.m2
key: build-${{ env.cache-name }}
- name: Maven version
run: mvn --version
# - name: Prepare
# run: ./jakarta-to-valhalla.sh
- name: Build with Maven
run: mvn package
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.6.0</version>
<version>14.8.0</version>
<relativePath>../..</relativePath>
</parent>
@@ -17,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-clickhouse</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.6.0</version>
<version>14.8.0</version>
<relativePath>../..</relativePath>
</parent>
@@ -17,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.6.0</version>
<version>14.8.0</version>
<relativePath>../..</relativePath>
</parent>
@@ -17,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-db2</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.6.0</version>
<version>14.8.0</version>
<relativePath>../..</relativePath>
</parent>
@@ -17,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-h2</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.6.0</version>
<version>14.8.0</version>
<relativePath>../..</relativePath>
</parent>
@@ -17,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-hana</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.6.0</version>
<version>14.8.0</version>
<relativePath>../..</relativePath>
</parent>
@@ -17,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-mariadb</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.6.0</version>
<version>14.8.0</version>
<relativePath>../..</relativePath>
</parent>
@@ -17,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-mysql</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
</dependencies>
+6 -6
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.6.0</version>
<version>14.8.0</version>
<relativePath>../..</relativePath>
</parent>
@@ -22,13 +22,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
@@ -47,19 +47,19 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-net-postgis-types</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.6.0</version>
<version>14.8.0</version>
<relativePath>../..</relativePath>
</parent>
@@ -17,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-nuodb</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.6.0</version>
<version>14.8.0</version>
<relativePath>../..</relativePath>
</parent>
@@ -17,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-oracle</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
</dependencies>
+6 -6
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.6.0</version>
<version>14.8.0</version>
<relativePath>../..</relativePath>
</parent>
@@ -22,13 +22,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
@@ -47,19 +47,19 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-postgis-types</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.6.0</version>
<version>14.8.0</version>
<relativePath>../..</relativePath>
</parent>
@@ -17,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.6.0</version>
<version>14.8.0</version>
<relativePath>../..</relativePath>
</parent>
@@ -17,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-sqlite</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.6.0</version>
<version>14.8.0</version>
<relativePath>../..</relativePath>
</parent>
@@ -17,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-sqlserver</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.6.0</version>
<version>14.8.0</version>
<relativePath>../..</relativePath>
</parent>
@@ -17,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
</dependencies>
+6 -6
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.6.0</version>
<version>14.8.0</version>
<relativePath>../..</relativePath>
</parent>
@@ -17,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
@@ -41,7 +41,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-jackson-mapper</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
@@ -60,13 +60,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-all</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
</dependencies>
+1 -1
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.6.0</version>
<version>14.8.0</version>
</parent>
<artifactId>composites</artifactId>
+4 -8
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.6.0</version>
<version>14.8.0</version>
</parent>
<name>ebean api</name>
@@ -26,14 +26,10 @@
<version>1.0</version>
</dependency>
<!--
Class retention Nonnull and Nullable annotations
to assist with IDE auto-completion with Ebean API
-->
<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-lang</artifactId>
<version>1.1</version>
<groupId>org.jspecify</groupId>
<artifactId>jspecify</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
@@ -1,10 +1,9 @@
package io.ebean;
import io.avaje.lang.NonNullApi;
import org.jspecify.annotations.NullMarked;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
@@ -20,7 +19,7 @@ import java.util.concurrent.TimeUnit;
* This also propagates MDC context from the current thread to the
* background task if defined.
*/
@NonNullApi
@NullMarked
public interface BackgroundExecutor {
/**
@@ -1,7 +1,7 @@
package io.ebean;
import io.avaje.lang.NonNullApi;
import io.avaje.lang.Nullable;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import java.util.List;
import java.util.Optional;
@@ -30,7 +30,7 @@ import java.util.Optional;
*
* @see BeanRepository
*/
@NonNullApi
@NullMarked
public abstract class BeanFinder<I,T> {
protected final Database database;
@@ -1,6 +1,6 @@
package io.ebean;
import io.avaje.lang.NonNullApi;
import org.jspecify.annotations.NullMarked;
import io.ebean.bean.EntityBean;
import java.util.Collection;
@@ -36,7 +36,7 @@ import java.util.Collection;
* @param <I> The ID type
* @param <T> The Bean type
*/
@NonNullApi
@NullMarked
public abstract class BeanRepository<I, T> extends BeanFinder<I, T> {
/**
+3 -3
View File
@@ -1,7 +1,7 @@
package io.ebean;
import io.avaje.lang.NonNullApi;
import io.avaje.lang.Nullable;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import io.ebean.annotation.TxIsolation;
import io.ebean.cache.ServerCacheManager;
import io.ebean.plugin.Property;
@@ -57,7 +57,7 @@ import java.util.concurrent.Callable;
*
* }</pre>
*/
@NonNullApi
@NullMarked
public final class DB {
private static final DbContext context = DbContext.getInstance();
@@ -1,7 +1,7 @@
package io.ebean;
import io.avaje.lang.NonNullApi;
import io.avaje.lang.Nullable;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import io.ebean.annotation.Platform;
import io.ebean.annotation.TxIsolation;
import io.ebean.cache.ServerCacheManager;
@@ -83,7 +83,7 @@ import java.util.concurrent.Callable;
* @see DatabaseFactory
* @see DatabaseConfig
*/
@NonNullApi
@NullMarked
public interface Database {
/**
@@ -1,7 +1,7 @@
package io.ebean;
import io.avaje.lang.NonNullApi;
import io.avaje.lang.Nullable;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import io.ebean.docstore.DocQueryContext;
import io.ebean.docstore.RawDoc;
@@ -14,7 +14,7 @@ import java.util.function.Predicate;
/**
* Document storage operations.
*/
@NonNullApi
@NullMarked
public interface DocumentStore {
/**
+14 -3
View File
@@ -1,7 +1,7 @@
package io.ebean;
import io.avaje.lang.NonNullApi;
import io.avaje.lang.Nullable;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import javax.sql.DataSource;
import java.sql.Connection;
@@ -42,7 +42,7 @@ import java.util.stream.Stream;
*
* }</pre>
*/
@NonNullApi
@NullMarked
public interface DtoQuery<T> extends CancelableQuery {
/**
@@ -140,6 +140,17 @@ public interface DtoQuery<T> extends CancelableQuery {
* Bind the named multi-value array parameter which we would use with Postgres ANY.
* <p>
* For Postgres this binds an ARRAY rather than expands into multiple bind values.
* <pre>{@code
*
* String sql = "select id, name from o_customer where id = any(:idList)";
*
* var ids = List.of(1, 2, 3);
*
* List<CustomerDto> list2 = DB.findDto(CustomerDto.class, sql)
* .setArrayParameter("idList", ids)
* .findList();
*
* }</pre>
*/
DtoQuery<T> setArrayParameter(String name, Collection<?> values);
@@ -1,7 +1,7 @@
package io.ebean;
import io.avaje.lang.NonNullApi;
import io.avaje.lang.Nullable;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import io.ebean.search.*;
import jakarta.persistence.NonUniqueResultException;
@@ -31,7 +31,7 @@ import java.util.function.Predicate;
*
* @see Query#where()
*/
@NonNullApi
@NullMarked
public interface ExpressionList<T> {
/**
@@ -1,6 +1,6 @@
package io.ebean;
import io.avaje.lang.NonNullApi;
import org.jspecify.annotations.NullMarked;
import io.ebean.service.SpiFetchGroupQuery;
/**
@@ -61,7 +61,7 @@ import io.ebean.service.SpiFetchGroupQuery;
*
* @param <T> The bean type the Fetch group can be applied to
*/
@NonNullApi
@NullMarked
public interface FetchGroup<T> {
/**
@@ -1,6 +1,6 @@
package io.ebean;
import io.avaje.lang.NonNullApi;
import org.jspecify.annotations.NullMarked;
/**
* Builds a FetchGroup by adding fetch clauses.
@@ -23,7 +23,7 @@ import io.avaje.lang.NonNullApi;
*
* }</pre>
*/
@NonNullApi
@NullMarked
public interface FetchGroupBuilder<T> {
/**
+2 -2
View File
@@ -1,6 +1,6 @@
package io.ebean;
import io.avaje.lang.NonNullApi;
import org.jspecify.annotations.NullMarked;
import java.util.List;
import java.util.Set;
@@ -79,7 +79,7 @@ import java.util.Set;
*
* @param <T> the entity bean type
*/
@NonNullApi
@NullMarked
public interface Filter<T> {
/**
+3 -3
View File
@@ -1,7 +1,7 @@
package io.ebean;
import io.avaje.lang.NonNullApi;
import io.avaje.lang.Nullable;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import java.util.List;
/**
@@ -60,7 +60,7 @@ import java.util.List;
* @see BeanRepository
* @see BeanFinder
*/
@NonNullApi
@NullMarked
public class Finder<I, T> {
/**
@@ -1,6 +1,6 @@
package io.ebean;
import io.avaje.lang.Nullable;
import org.jspecify.annotations.Nullable;
/**
* Options to be used with insert such as ON CONFLICT DO UPDATE | NOTHING.
+1 -1
View File
@@ -1,6 +1,6 @@
package io.ebean;
import io.avaje.lang.Nullable;
import org.jspecify.annotations.Nullable;
/**
* Used to specify Paging on a Query as an alternative to setting each of the
+2 -2
View File
@@ -1,6 +1,6 @@
package io.ebean;
import io.avaje.lang.NonNullApi;
import org.jspecify.annotations.NullMarked;
/**
* Object relational query for finding a List, Set, Map or single entity bean.
@@ -149,7 +149,7 @@ import io.avaje.lang.NonNullApi;
*
* @param <T> the type of Entity bean this query will fetch.
*/
@NonNullApi
@NullMarked
public interface Query<T> extends CancelableQuery, QueryBuilder<Query<T>, T> {
/**
@@ -1,6 +1,6 @@
package io.ebean;
import io.avaje.lang.Nullable;
import org.jspecify.annotations.Nullable;
import javax.sql.DataSource;
import java.sql.Connection;
@@ -20,7 +20,7 @@ import java.util.stream.Stream;
* @param <SELF> The type of the builder
* @param <T> The entity bean type
*/
public interface QueryBuilder<SELF, T> extends QueryBuilderProjection<SELF, T> {
public interface QueryBuilder<SELF extends QueryBuilder<SELF, T>, T> extends QueryBuilderProjection<SELF, T> {
/**
* Set root table alias.
@@ -6,7 +6,7 @@ package io.ebean;
* @param <SELF> The builder type
* @param <T> The entity bean type
*/
public interface QueryBuilderProjection<SELF, T> {
public interface QueryBuilderProjection<SELF extends QueryBuilderProjection<SELF, T>, T> {
/**
* Apply the path properties replacing the select and fetch clauses.
+39 -4
View File
@@ -1,11 +1,12 @@
package io.ebean;
import io.avaje.lang.NonNullApi;
import io.avaje.lang.Nullable;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import javax.sql.DataSource;
import java.io.Serializable;
import java.sql.Connection;
import java.util.Collection;
import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;
@@ -39,7 +40,7 @@ import java.util.function.Predicate;
*
* }</pre>
*/
@NonNullApi
@NullMarked
public interface SqlQuery extends Serializable, CancelableQuery {
/**
@@ -171,7 +172,7 @@ public interface SqlQuery extends Serializable, CancelableQuery {
* List<SqlRow> list =
* DB.sqlQuery(sql)
* .setParameter("Rob")
* .setParameter("Status.NEW)
* .setParameter(Status.NEW)
* .findList();
*
* // the same as ...
@@ -241,11 +242,45 @@ public interface SqlQuery extends Serializable, CancelableQuery {
*/
SqlQuery setParameter(int position, Object value);
/**
* Bind the array parameter by its index position for use with Postgres ANY.
* <p>
* For Postgres this binds an ARRAY rather than expands into multiple bind values.
* <pre>{@code
*
* String sql = "select name from customer where id = any(?)";
*
* List<SqlRow> list =
* DB.sqlQuery(sql)
* .setArrayParameter(1, List.of(1, 2, 3))
* .findList();
*
* }</pre>
*/
SqlQuery setArrayParameter(int position, Collection<?> value);
/**
* Bind the named parameter value.
*/
SqlQuery setParameter(String name, Object value);
/**
* Bind the named array parameter which we would use with Postgres ANY.
* <p>
* For Postgres this binds an ARRAY rather than expands into multiple bind values.
* <pre>{@code
*
* String sql = "select name from customer where id = any(:idList)";
*
* List<SqlRow> list =
* DB.sqlQuery(sql)
* .setArrayParameter("idList", List.of(1, 2, 3))
* .findList();
*
* }</pre>
*/
SqlQuery setArrayParameter(String name, Collection<?> value);
/**
* Set the index of the first row of the results to return.
*/
+1 -1
View File
@@ -1,6 +1,6 @@
package io.ebean.cache;
import io.avaje.lang.Nullable;
import org.jspecify.annotations.Nullable;
import io.ebean.meta.MetricVisitor;
import java.util.LinkedHashMap;
+1 -1
View File
@@ -7,7 +7,7 @@ module io.ebean.api {
requires transitive java.sql;
requires transitive io.avaje.config;
requires transitive io.avaje.lang;
requires transitive org.jspecify;
requires transitive jakarta.persistence.api;
requires transitive io.ebean.annotation;
requires transitive io.ebean.datasource.api;
@@ -1 +1 @@
ebean-version: 145
ebean-version: 148
@@ -213,7 +213,7 @@ class ToStringBuilderTest {
final int id;
final Map<String, ParamValue> map = new HashMap<>();
final Map<String, ParamValue> map = new LinkedHashMap<>();
ParamStore(final int id) {
+26 -26
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.6.0</version>
<version>14.8.0</version>
</parent>
<name>ebean bom</name>
@@ -89,25 +89,25 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core-type</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
@@ -125,13 +125,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-jackson-mapper</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-ddl-generator</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
@@ -155,37 +155,37 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>querybean-generator</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>kotlin-querybean-generator</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-redis</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-spring-txn</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<!-- platforms -->
@@ -193,79 +193,79 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-clickhouse</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-db2</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-h2</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-hana</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-mariadb</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-mysql</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-nuodb</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-oracle</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-postgres</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-postgis</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-postgis-types</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-sqlite</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-sqlserver</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
</dependencies>
+2 -2
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.6.0</version>
<version>14.8.0</version>
</parent>
<artifactId>ebean-core-type</artifactId>
@@ -16,7 +16,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
@@ -1,6 +1,6 @@
package io.ebean.core.type;
import io.avaje.lang.Nullable;
import org.jspecify.annotations.Nullable;
import java.lang.annotation.Annotation;
@@ -1,6 +1,6 @@
package io.ebean.core.type;
import io.avaje.lang.Nullable;
import org.jspecify.annotations.Nullable;
/**
* A ScalarType that has variations based on the mapped JDBC type (like VARCHAR, CLOB, JSON etc).
@@ -1,6 +1,6 @@
package io.ebean.core.type;
import io.avaje.lang.Nullable;
import org.jspecify.annotations.Nullable;
import io.ebean.DatabaseBuilder;
/**
+6 -6
View File
@@ -3,7 +3,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.6.0</version>
<version>14.8.0</version>
</parent>
<artifactId>ebean-core</artifactId>
@@ -22,7 +22,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
@@ -46,7 +46,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core-type</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
@@ -159,21 +159,21 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-h2</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-sqlserver</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
<scope>test</scope>
</dependency>
@@ -231,6 +231,14 @@ public final class BindParams implements Serializable {
return p;
}
/**
* Set a named In parameter that is multi-valued.
*/
public void setArrayParameter(int position, Collection<?> value) {
Param p = parameter(position);
p.setInValue(new MultiValueWrapper(value));
}
/**
* Set a named In parameter that is multi-valued.
*/
@@ -1,6 +1,6 @@
package io.ebeaninternal.api;
import io.avaje.lang.Nullable;
import org.jspecify.annotations.Nullable;
import io.ebean.*;
import io.ebean.bean.BeanCollectionLoader;
import io.ebean.bean.CallOrigin;
@@ -1,6 +1,6 @@
package io.ebeaninternal.api;
import io.avaje.lang.Nullable;
import org.jspecify.annotations.Nullable;
import io.ebean.CacheMode;
import io.ebean.CountDistinctOrder;
import io.ebean.ExpressionList;
@@ -1,6 +1,6 @@
package io.ebeaninternal.api;
import io.avaje.lang.Nullable;
import org.jspecify.annotations.Nullable;
/**
* SQL query binding (for SqlQuery and DtoQuery).
@@ -105,6 +105,9 @@ final class DefaultBeanLoader {
if (ebi.isReadOnly()) {
query.setReadOnly(true);
}
if (many.hasOrderColumn()) {
query.orderBy(many.path() + "." + many.fetchOrderBy());
}
server.findOne(query);
if (beanCollection != null) {
@@ -1,7 +1,7 @@
package io.ebeaninternal.server.core;
import io.avaje.lang.NonNullApi;
import io.avaje.lang.Nullable;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import io.ebean.*;
import io.ebean.annotation.Platform;
import io.ebean.annotation.TxIsolation;
@@ -70,7 +70,7 @@ import static java.util.stream.StreamSupport.stream;
/**
* The default server side implementation of EbeanServer.
*/
@NonNullApi
@NullMarked
public final class DefaultServer implements SpiServer, SpiEbeanServer {
private static final System.Logger log = CoreLog.internal;
@@ -1689,6 +1689,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
for (Object bean : beans) {
persister.insert(checkEntityBean(bean), options, txn);
}
txn.flushBatchOnCollection();
return 0;
}, transaction);
}
@@ -146,6 +146,7 @@ public abstract class PersistRequest extends BeanRequest implements BatchPostExe
public void initTransIfRequired() {
createImplicitTransIfRequired();
persistCascade = transaction.isPersistCascade();
transaction.markNotQueryOnly();
}
/**
@@ -228,6 +228,7 @@ public final class PersistRequestBean<T> extends PersistRequest implements BeanP
docStoreMode = calcDocStoreMode(transaction, type);
}
checkBatchEscalationOnCascade();
transaction.markNotQueryOnly();
}
/**
@@ -1,6 +1,6 @@
package io.ebeaninternal.server.core;
import io.avaje.lang.Nullable;
import org.jspecify.annotations.Nullable;
import io.ebean.*;
import io.ebean.bean.EntityBean;
import io.ebean.meta.MetricVisitor;
@@ -62,6 +62,11 @@ class DynamicPropertyAggregationFormula extends DynamicPropertyBase {
ctx.appendParseSelect(parsedFormula, alias);
}
@Override
public final void appendGroupBy(DbSqlContext ctx, boolean subQuery) {
ctx.appendParseSelect(parsedFormula, null);
}
@Override
public boolean isLobForPlatform() {
return false;
@@ -54,7 +54,7 @@ public final class IdBinderEmbedded implements IdBinder {
if (i > 0) {
sb.append(" and ");
}
sb.append("${").append(prefix).append('.').append(embIdProperty.name()).append('}').append(props[i].name()).append(" is null");
sb.append("${").append(prefix).append('}').append(props[i].dbColumn()).append(" is null");
}
sb.append(") or (").append(filterManyExpression).append("))");
return sb.toString();
@@ -1,6 +1,6 @@
package io.ebeaninternal.server.deploy.meta;
import io.avaje.lang.Nullable;
import org.jspecify.annotations.Nullable;
import io.ebean.annotation.*;
import io.ebean.config.ScalarTypeConverter;
import io.ebean.config.dbplatform.DbDefaultValue;
@@ -1,6 +1,6 @@
package io.ebeaninternal.server.el;
import io.avaje.lang.NonNullApi;
import org.jspecify.annotations.NullMarked;
import io.ebean.Filter;
import io.ebeaninternal.server.deploy.BeanDescriptor;
@@ -12,7 +12,7 @@ import java.util.regex.Pattern;
/**
* Default implementation of the Filter interface.
*/
@NonNullApi
@NullMarked
public final class ElFilter<T> implements Filter<T> {
private final BeanDescriptor<T> beanDescriptor;
@@ -1,7 +1,7 @@
package io.ebeaninternal.server.executor;
import io.avaje.applog.AppLog;
import io.avaje.lang.NonNullApi;
import org.jspecify.annotations.NullMarked;
import io.ebean.config.BackgroundExecutorWrapper;
import io.ebeaninternal.api.SpiBackgroundExecutor;
@@ -12,7 +12,7 @@ import static java.lang.System.Logger.Level.*;
/**
* The default implementation of the BackgroundExecutor.
*/
@NonNullApi
@NullMarked
public final class DefaultBackgroundExecutor implements SpiBackgroundExecutor {
private static final System.Logger log = AppLog.getLogger("io.ebean.BackgroundExecutor");
@@ -1,7 +1,7 @@
package io.ebeaninternal.server.expression;
import io.avaje.lang.NonNullApi;
import io.avaje.lang.Nullable;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import io.ebean.*;
import io.ebean.event.BeanQueryRequest;
import io.ebean.search.*;
@@ -18,7 +18,7 @@ import java.util.function.Predicate;
/**
* Default implementation of ExpressionList.
*/
@NonNullApi
@NullMarked
public class DefaultExpressionList<T> implements SpiExpressionList<T> {
private static final String AND = " and ";
@@ -1,7 +1,7 @@
package io.ebeaninternal.server.expression;
import io.avaje.lang.NonNullApi;
import io.avaje.lang.Nullable;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import io.ebean.*;
import io.ebeaninternal.api.SpiExpressionList;
import io.ebeaninternal.api.SpiQuery;
@@ -9,7 +9,7 @@ import io.ebeaninternal.api.SpiQuery;
import jakarta.persistence.PersistenceException;
import java.util.*;
@NonNullApi
@NullMarked
public final class FilterExpressionList<T> extends DefaultExpressionList<T> {
private static final String notAllowedMessage = "This method is not allowed on a filter";
@@ -1,7 +1,7 @@
package io.ebeaninternal.server.expression;
import io.avaje.lang.NonNullApi;
import io.avaje.lang.Nullable;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import io.ebean.*;
import io.ebean.event.BeanQueryRequest;
import io.ebean.search.*;
@@ -18,7 +18,7 @@ import java.util.function.Predicate;
/**
* Junction implementation.
*/
@NonNullApi
@NullMarked
final class JunctionExpression<T> implements SpiJunction<T>, SpiExpression, ExpressionList<T> {
DefaultExpressionList<T> exprList;
@@ -1,6 +1,6 @@
package io.ebeaninternal.server.query;
import io.avaje.lang.NonNullApi;
import org.jspecify.annotations.NullMarked;
import io.ebean.FetchConfig;
import io.ebean.FetchGroup;
import io.ebean.FetchGroupBuilder;
@@ -10,7 +10,7 @@ import io.ebeaninternal.server.querydefn.SpiFetchGroup;
/**
* Default implementation of the FetchGroupBuilder.
*/
@NonNullApi
@NullMarked
final class DFetchGroupBuilder<T> implements FetchGroupBuilder<T> {
private static final FetchConfig DEFAULT_FETCH = FetchConfig.ofDefault();
@@ -1,7 +1,7 @@
package io.ebeaninternal.server.query;
import io.avaje.lang.NonNullApi;
import io.avaje.lang.Nullable;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import io.ebean.*;
import io.ebean.service.SpiFetchGroupQuery;
import io.ebeaninternal.api.SpiQueryFetch;
@@ -23,7 +23,7 @@ import java.util.stream.Stream;
/**
* Implementation of FetchGroup query for use to create FetchGroup via query beans.
*/
@NonNullApi
@NullMarked
final class DefaultFetchGroupQuery<T> implements SpiFetchGroupQuery<T>, SpiQueryFetch {
private static final FetchConfig FETCH_CACHE = FetchConfig.ofCache();
@@ -92,6 +92,13 @@ public interface STreeProperty extends ScalarDataReader<Object> {
*/
void appendSelect(DbSqlContext ctx, boolean subQuery);
/**
* Append to group by.
*/
default void appendGroupBy(DbSqlContext ctx, boolean subQuery) {
appendSelect(ctx, subQuery);
}
/**
* Append to the from clause.
*/
@@ -11,6 +11,7 @@ import io.ebeaninternal.server.deploy.InheritInfo;
import io.ebeaninternal.server.deploy.TableJoin;
import io.ebeaninternal.server.querydefn.OrmQueryDetail;
import io.ebeaninternal.server.querydefn.OrmQueryProperties;
import jakarta.persistence.PersistenceException;
import java.util.*;
@@ -440,12 +441,9 @@ public final class SqlTreeBuilder {
} else {
// find the property including searching the
// sub class hierarchy if required
STreeProperty p = desc.findPropertyWithDynamic(propName, queryProps.getPath());
if (p == null) {
log.log(ERROR, "property [{0}] not found on {1} for query - excluding it.", propName, desc);
p = desc.findProperty("id");
selectProps.add(p);
throw new PersistenceException("Property not found - " + SplitName.add(queryProps.getPath(), propName));
} else if (p.isId() && excludeIdProperty()) {
// do not bother to include id for normal queries as the
@@ -163,7 +163,7 @@ class SqlTreeNodeBean implements SqlTreeNode {
}
for (STreeProperty property : properties) {
if (!property.isAggregation()) {
property.appendSelect(ctx, subQuery);
property.appendGroupBy(ctx, subQuery);
}
}
for (SqlTreeNode child : children) {
@@ -1,6 +1,6 @@
package io.ebeaninternal.server.querydefn;
import io.avaje.lang.NonNullApi;
import org.jspecify.annotations.NullMarked;
import io.ebean.DtoQuery;
import io.ebean.ProfileLocation;
import io.ebean.QueryIterator;
@@ -23,7 +23,7 @@ import java.util.stream.Stream;
/**
* Default implementation of DtoQuery.
*/
@NonNullApi
@NullMarked
public final class DefaultDtoQuery<T> extends AbstractQuery implements SpiDtoQuery<T> {
private final SpiEbeanServer server;
@@ -1,7 +1,7 @@
package io.ebeaninternal.server.querydefn;
import io.avaje.lang.NonNullApi;
import io.avaje.lang.Nullable;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import io.ebean.*;
import io.ebean.bean.CallOrigin;
import io.ebean.bean.ObjectGraphNode;
@@ -35,7 +35,7 @@ import java.util.stream.Stream;
/**
* Default implementation of an Object Relational query.
*/
@NonNullApi
@NullMarked
public class DefaultOrmQuery<T> extends AbstractQuery implements SpiQuery<T> {
private static final String DEFAULT_QUERY_NAME = "default";
@@ -1,7 +1,7 @@
package io.ebeaninternal.server.querydefn;
import io.avaje.lang.NonNullApi;
import io.avaje.lang.Nullable;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import io.ebean.*;
import io.ebeaninternal.api.BindParams;
import io.ebeaninternal.api.SpiEbeanServer;
@@ -10,6 +10,7 @@ import io.ebeaninternal.api.SpiTransaction;
import io.ebeaninternal.server.transaction.ExternalJdbcTransaction;
import java.sql.Connection;
import java.util.Collection;
import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;
@@ -18,7 +19,7 @@ import java.util.function.Predicate;
/**
* Default implementation of SQuery - SQL Query.
*/
@NonNullApi
@NullMarked
public final class DefaultRelationalQuery extends AbstractQuery implements SpiSqlQuery {
private static final long serialVersionUID = -1098305779779591068L;
@@ -133,12 +134,24 @@ public final class DefaultRelationalQuery extends AbstractQuery implements SpiSq
return this;
}
@Override
public DefaultRelationalQuery setArrayParameter(int position, Collection<?> value) {
bindParams.setArrayParameter(position, value);
return this;
}
@Override
public DefaultRelationalQuery setParameter(String paramName, Object value) {
bindParams.setParameter(paramName, value);
return this;
}
@Override
public DefaultRelationalQuery setArrayParameter(String paramName, Collection<?> value) {
bindParams.setArrayParameter(paramName, value);
return this;
}
@Override
public String toString() {
return "SqlQuery " + query;
@@ -417,6 +417,10 @@ class JdbcTransaction implements SpiTransaction, TxnProfileEventCodes {
@Override
public final void markNotQueryOnly() {
this.queryOnly = false;
// if the transaction is readonly, it should not allow updates/deletes
if (localReadOnly){
throw new IllegalStateException("This transaction is read-only");
}
}
@Override
@@ -1,6 +1,6 @@
package io.ebeanservice.docstore.none;
import io.avaje.lang.NonNullApi;
import org.jspecify.annotations.NullMarked;
import io.ebean.DocStoreQueueEntry;
import io.ebean.DocumentStore;
import io.ebean.PagedList;
@@ -17,7 +17,7 @@ import java.util.function.Predicate;
/**
* DocumentStore that barfs it is used.
*/
@NonNullApi
@NullMarked
public final class NoneDocStore implements DocumentStore {
public static IllegalStateException implementationNotInClassPath() {
+4 -4
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.6.0</version>
<version>14.8.0</version>
</parent>
<name>ebean ddl generation</name>
@@ -28,14 +28,14 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core-type</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
<scope>provided</scope>
</dependency>
@@ -65,7 +65,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-all</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
<scope>test</scope>
</dependency>
+2 -2
View File
@@ -3,7 +3,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.6.0</version>
<version>14.8.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -14,7 +14,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core-type</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
<scope>provided</scope>
</dependency>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.6.0</version>
<version>14.8.0</version>
</parent>
<name>ebean net postgis types</name>
@@ -19,14 +19,14 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<!-- provided scope -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
<scope>provided</scope>
</dependency>
@@ -54,7 +54,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
<scope>test</scope>
</dependency>
@@ -78,7 +78,7 @@
<extensions>true</extensions>
<configuration>
<tiles>
<tile>io.ebean.tile:enhancement:14.6.0</tile>
<tile>io.ebean.tile:enhancement:14.8.0</tile>
</tiles>
</configuration>
</plugin>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.6.0</version>
<version>14.8.0</version>
</parent>
<name>ebean postgis types</name>
@@ -19,14 +19,14 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<!-- provided scope -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
<scope>provided</scope>
</dependency>
@@ -62,7 +62,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
<scope>test</scope>
</dependency>
@@ -86,7 +86,7 @@
<extensions>true</extensions>
<configuration>
<tiles>
<tile>io.ebean.tile:enhancement:14.6.0</tile>
<tile>io.ebean.tile:enhancement:14.8.0</tile>
</tiles>
</configuration>
</plugin>
+9 -13
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.6.0</version>
<version>14.8.0</version>
</parent>
<name>ebean querybean</name>
@@ -17,7 +17,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
<scope>provided</scope>
</dependency>
@@ -28,14 +28,10 @@
<scope>provided</scope>
</dependency>
<!--
Class retention Nonnull and Nullable annotations
to assist with IDE auto-completion with Ebean API
-->
<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-lang</artifactId>
<version>1.1</version>
<groupId>org.jspecify</groupId>
<artifactId>jspecify</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
@@ -63,14 +59,14 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-ddl-generator</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
<scope>test</scope>
</dependency>
@@ -84,7 +80,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>querybean-generator</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
<scope>provided</scope>
</dependency>
@@ -100,7 +96,7 @@
<extensions>true</extensions>
<configuration>
<tiles>
<tile>io.ebean.tile:enhancement:14.6.0</tile>
<tile>io.ebean.tile:enhancement:14.8.0</tile>
</tiles>
</configuration>
</plugin>
@@ -44,7 +44,7 @@ import java.util.Collection;
* @param <T> the entity bean type (normal entity bean type e.g. Customer)
* @param <R> the specific query bean type (e.g. QCustomer)
*/
public interface IQueryBean<T, R> extends QueryBuilder<R, T> {
public interface IQueryBean<T, R extends IQueryBean<T, R>> extends QueryBuilder<R, T> {
/**
* Return the underlying query.
@@ -64,6 +64,7 @@ public interface IQueryBean<T, R> extends QueryBuilder<R, T> {
*
* @param properties The properties to include in the DISTINCT ON clause.
*/
@SuppressWarnings("unchecked")
R distinctOn(TQProperty<R, ?>... properties);
/**
@@ -1,7 +1,7 @@
package io.ebean.typequery;
import io.avaje.lang.Nullable;
import org.jspecify.annotations.Nullable;
import io.ebean.Query;
/**
@@ -1,6 +1,6 @@
package io.ebean.typequery;
import io.avaje.lang.Nullable;
import org.jspecify.annotations.Nullable;
import io.ebean.Query;
import java.util.Collection;
@@ -1,7 +1,7 @@
package io.ebean.typequery;
import io.avaje.lang.NonNullApi;
import io.avaje.lang.Nullable;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import io.ebean.*;
import io.ebean.search.MultiMatch;
import io.ebean.search.TextCommonTerms;
@@ -56,8 +56,8 @@ import java.util.stream.Stream;
* @param <T> the entity bean type (normal entity bean type e.g. Customer)
* @param <R> the specific root query bean type (e.g. QCustomer)
*/
@NonNullApi
public abstract class QueryBean<T, R> implements IQueryBean<T, R> {
@NullMarked
public abstract class QueryBean<T, R extends QueryBean<T, R>> implements IQueryBean<T, R> {
/**
* The underlying query.
@@ -1,6 +1,6 @@
package io.ebean.typequery;
import io.avaje.lang.Nullable;
import org.jspecify.annotations.Nullable;
import java.util.Collection;
@@ -0,0 +1,40 @@
package org.example.domain;
import jakarta.persistence.*;
@Entity
public class DataWithFormula {
@EmbeddedId
private DataWithFormulaKey id;
@Column(insertable = false, updatable = false)
private String metaKey;
@Column(insertable = false, updatable = false)
private Integer valueIndex;
@ManyToOne
private DataWithFormulaMain main;
public DataWithFormulaKey getId() {
return id;
}
public void setId(DataWithFormulaKey id) {
this.id = id;
}
public String getMetaKey() {
return metaKey;
}
public void setMetaKey(String metaKey) {
this.metaKey = metaKey;
}
public Integer getValueIndex() {
return valueIndex;
}
public void setValueIndex(Integer valueIndex) {
this.valueIndex = valueIndex;
}
}
@@ -0,0 +1,49 @@
package org.example.domain;
import io.ebean.annotation.NotNull;
import jakarta.persistence.Embeddable;
import java.util.Objects;
import java.util.UUID;
@Embeddable
public class DataWithFormulaKey {
@NotNull
private final UUID mainId;
@NotNull
private final String metaKey;
@NotNull
private final Integer valueIndex;
public DataWithFormulaKey(UUID mainId, String metaKey, Integer valueIndex) {
this.mainId = mainId;
this.metaKey = metaKey;
this.valueIndex = valueIndex;
}
public UUID getMainId() {
return mainId;
}
public String getMetaKey() {
return metaKey;
}
public Integer getValueIndex() {
return valueIndex;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
DataWithFormulaKey that = (DataWithFormulaKey) o;
return Objects.equals(mainId, that.mainId) && Objects.equals(metaKey, that.metaKey) && Objects.equals(valueIndex, that.valueIndex);
}
@Override
public int hashCode() {
return Objects.hash(mainId, metaKey, valueIndex);
}
}
@@ -0,0 +1,43 @@
package org.example.domain;
import jakarta.persistence.CascadeType;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.OneToMany;
import java.util.List;
import java.util.UUID;
@Entity
public class DataWithFormulaMain {
@Id
private UUID id;
private String title;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "main")
private List<DataWithFormula> metaData;
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public List<DataWithFormula> getMetaData() {
return metaData;
}
public void setMetaData(List<DataWithFormula> metaData) {
this.metaData = metaData;
}
}
@@ -0,0 +1,41 @@
package org.querytest;
import io.ebean.DB;
import io.ebean.test.LoggedSql;
import org.example.domain.DataWithFormulaMain;
import org.example.domain.query.QDataWithFormulaMain;
import org.junit.jupiter.api.Test;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
class QDataWithFormulaMainTest {
@Test
void testFilterMany() {
LoggedSql.start();
new QDataWithFormulaMain()
.metaData.filterMany(metadata -> metadata.id.metaKey.eq(""))
.findList();
List<String> sql = LoggedSql.stop();
assertThat(sql).hasSize(1);
assertThat(sql.get(0)).contains(" where ((t1.main_id is null and t1.meta_key is null and t1.value_index is null) or (t1.meta_key = ?)) order by t0.id");
}
@Test
void testFilterManyComposite() {
LoggedSql.start();
DB.find(DataWithFormulaMain.class)
.where()
.filterMany("metaData").eq("metaKey", "")
.findList();
List<String> sql = LoggedSql.stop();
assertThat(sql).hasSize(1);
assertThat(sql.get(0)).contains(" where ((t1.main_id is null and t1.meta_key is null and t1.value_index is null) or (t1.meta_key = ?)) order by t0.id");
}
}
@@ -1,5 +1,9 @@
package org.querytest;
import io.ebean.QueryBuilder;
import io.ebean.QueryBuilderProjection;
import io.ebean.typequery.IQueryBean;
import io.ebean.typequery.QueryBean;
import org.example.domain.Customer;
import org.example.domain.query.QCustomer;
import org.junit.jupiter.api.Test;
@@ -46,4 +50,29 @@ class QueryAlsoIfTest {
q.findList();
assertThat(q.getGeneratedSql()).isEqualTo("select /* QueryAlsoIfTest.notApply */ t0.id, t0.name from be_customer t0 where t0.name is not null");
}
@Test
void queryBuilders_expect_fluidUseOfSELF() {
var q = new QCustomer();
checkQueryBean(q);
checkIQueryBean(q);
checkQueryBuilder(q);
checkQueryBuilderProjection(q);
}
private void checkQueryBean(QueryBean<?, ?> queryBean) {
queryBean.setFirstRow(10).setMaxRows(10);
}
private void checkIQueryBean(IQueryBean<?, ?> iQueryBean) {
iQueryBean.setFirstRow(10).setMaxRows(20);
}
private void checkQueryBuilderProjection(QueryBuilderProjection<?, ?> queryBuilder) {
queryBuilder.fetch("a").fetch("b");
}
private void checkQueryBuilder(QueryBuilder<?,?> queryBuilder) {
queryBuilder.setFirstRow(10).setMaxRows(10);
}
}
+7 -7
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.6.0</version>
<version>14.8.0</version>
</parent>
<artifactId>ebean-redis</artifactId>
@@ -29,35 +29,35 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>querybean-generator</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
<scope>provided</scope>
</dependency>
@@ -72,7 +72,7 @@
<extensions>true</extensions>
<configuration>
<tiles>
<tile>io.ebean.tile:enhancement:14.6.0</tile>
<tile>io.ebean.tile:enhancement:14.8.0</tile>
</tiles>
</configuration>
</plugin>
+4 -4
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.6.0</version>
<version>14.8.0</version>
</parent>
<artifactId>ebean-spring-txn</artifactId>
@@ -28,7 +28,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
<scope>provided</scope>
</dependency>
@@ -77,7 +77,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
<scope>test</scope>
</dependency>
@@ -99,7 +99,7 @@
<extensions>true</extensions>
<configuration>
<tiles>
<tile>io.ebean.tile:enhancement:14.6.0</tile>
<tile>io.ebean.tile:enhancement:14.8.0</tile>
</tiles>
</configuration>
</plugin>
+8 -8
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.6.0</version>
<version>14.8.0</version>
</parent>
<name>ebean test</name>
@@ -33,20 +33,20 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-h2</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-ddl-generator</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
</dependency>
<dependency>
@@ -149,14 +149,14 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-jackson-mapper</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-all</artifactId>
<version>14.6.0</version>
<version>14.8.0</version>
<scope>test</scope>
</dependency>
@@ -206,7 +206,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.7</version>
<version>2.14.0</version>
<scope>test</scope>
</dependency>
@@ -309,7 +309,7 @@
<extensions>true</extensions>
<configuration>
<tiles>
<tile>io.ebean.tile:enhancement:14.6.0</tile>
<tile>io.ebean.tile:enhancement:14.8.0</tile>
</tiles>
</configuration>
</plugin>
@@ -1,5 +1,7 @@
package io.ebean.xtest.base;
import io.ebean.DB;
import io.ebean.Query;
import io.ebean.xtest.BaseTestCase;
import io.ebean.DtoQuery;
import io.ebean.QueryIterator;
@@ -9,6 +11,7 @@ import io.ebean.test.LoggedSql;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tests.model.basic.Contact;
import org.tests.model.basic.Customer;
import org.tests.model.basic.ResetBasicData;
@@ -406,6 +409,24 @@ public class DtoQuery2Test extends BaseTestCase {
assertThat(robs).isNotEmpty();
}
@Test
void dto_test_formula_with_group_by() {
ResetBasicData.reset();
Query<Contact> query = server().find(Contact.class)
.select("concat(first_name, last_name) as custname, count(*) as cnt")
.orderBy("custname desc");
List<DCustFormula> ret = query.asDto(DCustFormula.class).findList();
String sql = query.getGeneratedSql();
assertThat(sql)
.describedAs("group by formula only")
.contains("from contact t0 group by concat(first_name, last_name) order by custname desc");
assertThat(ret.get(0).getCustname()).isEqualTo("TracyRed");
assertThat(ret.get(0).getCnt()).isEqualTo(1L);
}
public static class DCust {
final Integer id;
@@ -614,4 +635,33 @@ public class DtoQuery2Test extends BaseTestCase {
return this;
}
}
public static class DCustFormula {
String custname;
Long cnt;
public DCustFormula() {}
public void setCustname(String custname) {
this.custname = custname;
}
public String getCustname() {
return custname;
}
public void setCnt(Long cnt) {
this.cnt = cnt;
}
public Long getCnt() {
return cnt;
}
@Override
public String toString() {
return getCustname() + ": " + getCnt();
}
}
}
@@ -230,11 +230,30 @@ class DtoQueryTest extends BaseTestCase {
assertThat(list2).isNotEmpty();
List<SqlRow> list3 = DB.sqlQuery("select id, name from o_customer where id in (:idList)")
.setParameter("idList", ids)
.findList();
assertThat(list3).isNotEmpty();
List<SqlRow> list4 = DB.sqlQuery("select id, name from o_customer where id = any(:idList)")
.setArrayParameter("idList", ids)
.findList();
assertThat(list4).isNotEmpty();
List<SqlRow> list5 = DB.sqlQuery("select id, name from o_customer where id = any(?) and name like ?")
.setArrayParameter(1, ids)
.setParameter(2, "foo%")
.findList();
assertThat(list5).isEmpty();
List<String> sql = LoggedSql.stop();
assertThat(sql).hasSize(3);
assertThat(sql).hasSize(6);
assertThat(sql.get(0)).contains(" id = any(?)");
assertThat(sql.get(1)).contains(" id in (?,?)");
assertThat(sql.get(2)).contains(" id = any(?)");
assertThat(sql.get(3)).contains(" id in (?,?)");
assertThat(sql.get(4)).contains(" id = any(?)");
assertThat(sql.get(5)).contains(" id = any(?) and name like ?");
}
@ForPlatform(Platform.POSTGRES)
@@ -0,0 +1,90 @@
package io.ebean.xtest.base;
import io.ebean.BeanState;
import io.ebean.DB;
import io.ebean.bean.EntityBean;
import io.ebean.bean.EntityBeanIntercept;
import io.ebean.test.LoggedSql;
import io.ebean.xtest.BaseTestCase;
import org.junit.jupiter.api.Test;
import org.tests.model.converstation.User;
import java.lang.reflect.Field;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
class TestReflectiveModificationUpdate extends BaseTestCase {
@Test
void statelessUpdate_via_reflection() throws NoSuchFieldException, IllegalAccessException {
// populate db with a user
User seed = new User();
seed.setName("someName");
seed.setEmail("some@junk.com");
seed.save();
Field field = User.class.getDeclaredField("email");
field.setAccessible(true);
// our bean to perform stateless update
User user = new User();
user.setId(seed.getId());
user.setName("mod");
field.set(user, "change@junk.com");
// need to set property loaded state to include in the stateless update
BeanState beanState = DB.beanState(user);
beanState.setPropertyLoaded("email", true);
LoggedSql.start();
user.update();
List<String> sql = LoggedSql.stop();
assertThat(sql).hasSize(1);
assertThat(sql.get(0)).contains("update c_user set name=?, email=?, when_modified=? where id=?");
}
@Test
void normalUpdate_via_reflection() throws NoSuchFieldException, IllegalAccessException {
// populate db with a user
User seed = new User();
seed.setName("someName");
seed.setEmail("some@junk.com");
seed.save();
Field field = User.class.getDeclaredField("email");
field.setAccessible(true);
// fetching the bean from database, so a "normal update"
User user = DB.find(User.class, seed.getId());
user.setName("mod");
// ideally we get the old value first (if there are change listeners etc)
Object oldValue = field.get(user);
// reflectively modify
field.set(user, "change@junk.com");
// BeanState beanState = DB.beanState(user);
// need to use EntityBeanIntercept rather than BeanState
// so this isn't great !!
EntityBean eb = (EntityBean) user;
EntityBeanIntercept ebi = eb._ebean_getIntercept();
int pos = ebi.findProperty("email");
// EITHER ideally mark as dirty with the original value
//ebi.setChangedPropertyValue(pos, true, oldValue);
// OR just mark as changed
ebi.markPropertyAsChanged(pos);
LoggedSql.start();
user.update();
List<String> sql = LoggedSql.stop();
assertThat(sql).hasSize(1);
assertThat(sql.get(0)).contains("update c_user set name=?, email=?, version=?, when_modified=? where id=? and version=?");
}
}
@@ -1,6 +1,6 @@
package io.ebean.xtest.internal.api;
import io.avaje.lang.NonNullApi;
import org.jspecify.annotations.NullMarked;
import io.ebean.*;
import io.ebean.annotation.Platform;
import io.ebean.annotation.TxIsolation;
@@ -38,7 +38,7 @@ import java.util.stream.Stream;
/**
* Test double for SpiEbeanServer.
*/
@NonNullApi
@NullMarked
public class TDSpiEbeanServer extends TDSpiServer implements SpiEbeanServer {
String name;
@@ -1,6 +1,6 @@
package io.ebean.xtest.internal.api;
import io.avaje.lang.NonNullApi;
import org.jspecify.annotations.NullMarked;
import io.ebean.*;
import io.ebean.annotation.Platform;
import io.ebean.annotation.TxIsolation;
@@ -25,7 +25,7 @@ import java.util.Map;
import java.util.Set;
import java.util.concurrent.Callable;
@NonNullApi
@NullMarked
public class TDSpiServer implements SpiServer {
@Override
public void shutdown() {
@@ -12,14 +12,14 @@ import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
public class WriteJsonTest {
class WriteJsonTest {
@Test
public void test_push() {
void test_push() {
ResetBasicData.reset();
FetchPath fetchPath = PathProperties.parse("id,status,name,customer(id,name,billingAddress(street,city)),details(qty,product(sku,prodName))");
FetchPath fetchPath = PathProperties.parse("id,status,customer(id,name,billingAddress(line1,city)),details(orderQty,product(sku,name))");
Query<Order> query = DB.find(Order.class);
@@ -20,7 +20,7 @@ public class TestMappedSuper extends BaseTestCase {
// select includes a transient property
TMapSuperEntity e2 = DB.find(TMapSuperEntity.class)
.where().idEq(e.getId())
.select("id, name, myint, someObject, bananan")
.select("id, name, myint, someObject")
.findOne();
assertNotNull(e2);
@@ -15,6 +15,7 @@ import io.ebean.xtest.base.DtoQuery2Test;
import io.ebeaninternal.api.SpiTransaction;
import org.junit.jupiter.api.Test;
import org.tests.model.basic.*;
import org.tests.query.cache.Acl;
import java.sql.Timestamp;
import java.util.ArrayList;
@@ -359,4 +360,22 @@ public class TestBatchInsertFlush extends BaseTestCase {
txn.end();
}
}
@Test
public void testBatchEscalationInsert() {
try (Transaction txn = DB.beginTransaction()) {
assertThat(txn.isBatchMode()).isFalse();
DB.insertAll(List.of(new Acl("test")));
assertThat(txn.isBatchMode()).isFalse();
}
}
@Test
public void testBatchEscalationSave() {
try (Transaction txn = DB.beginTransaction()) {
assertThat(txn.isBatchMode()).isFalse();
DB.saveAll(List.of(new Acl("test")));
assertThat(txn.isBatchMode()).isFalse();
}
}
}

Some files were not shown because too many files have changed in this diff Show More