Compare commits

..
123 changed files with 340 additions and 1672 deletions
+1 -1
View File
@@ -56,7 +56,7 @@ Work at the highest level of abstraction and drop down levels as needed.
<tr>
<td align="center" valign="middle">
<a href="https://www.foconis.de/" target="_blank">
<img width="222px" src="https://group.foconis.com/download/ci/logo/png-72dpi/logo-quer/foconis-analytics-quer.png">
<img width="222px" src="https://www.foconis.de/templates/yootheme/cache/foconis_logo_322-709da1de.png">
</a>
</td>
<td align="center" valign="middle">
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.5.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.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-clickhouse</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.5.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.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.5.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.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-db2</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.5.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.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-h2</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.5.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.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-hana</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.5.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.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-mariadb</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.5.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.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-mysql</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
</dependencies>
-85
View File
@@ -1,85 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.5.0</version>
<relativePath>../..</relativePath>
</parent>
<name>ebean-net-postgis</name>
<description>ebean-net-postgis composite</description>
<artifactId>ebean-net-postgis</artifactId>
<properties>
<postgis.jdbc.version>2023.1.0</postgis.jdbc.version>
<postgres.jdbc.version>42.7.2</postgres.jdbc.version>
</properties>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>14.5.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.5.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-datasource</artifactId>
<version>${ebean-datasource.version}</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-migration</artifactId>
<version>${ebean-migration.version}</version>
</dependency>
<!-- Technically optional but most expected to use query beans -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.5.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>14.5.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-net-postgis-types</artifactId>
<version>14.5.0</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgres.jdbc.version}</version>
<exclusions>
<!-- exclude unnecessary checker framework -->
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.postgis</groupId>
<artifactId>postgis-jdbc</artifactId>
<version>${postgis.jdbc.version}</version>
</dependency>
</dependencies>
</project>
@@ -1,7 +0,0 @@
package io.ebean.postgis.assembly;
/**
* Nothing interesting here - required placeholder for javadoc.
*/
public class Assembly {
}
@@ -1,10 +0,0 @@
module io.ebean.postgis {
requires transitive io.ebean.api;
requires transitive io.ebean.core;
requires transitive io.ebean.datasource;
requires transitive io.ebean.querybean;
requires transitive io.ebean.platform.postgres;
// requires transitive io.ebean.postgis.types;
}
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.5.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.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-nuodb</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.5.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.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-oracle</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
</dependencies>
+6 -6
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.5.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.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
@@ -47,19 +47,19 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-postgis-types</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.5.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.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.5.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.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-sqlite</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.5.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.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-sqlserver</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.5.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.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
@@ -42,13 +42,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
</dependencies>
+6 -6
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.5.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.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.5.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.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
@@ -60,13 +60,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-all</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
</dependencies>
+1 -2
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.5.0</version>
<version>14.4.0</version>
</parent>
<artifactId>composites</artifactId>
@@ -24,7 +24,6 @@
<module>ebean-oracle</module>
<module>ebean-postgres</module>
<module>ebean-postgis</module>
<module>ebean-net-postgis</module>
<!-- <module>sqlanywhere</module>-->
<module>ebean-sqlite</module>
<module>ebean-sqlserver</module>
+1 -1
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.5.0</version>
<version>14.4.0</version>
</parent>
<name>ebean api</name>
@@ -20,7 +20,6 @@ import java.util.stream.Stream;
* @param <SELF> The type of the builder
* @param <T> The entity bean type
*/
//public interface QueryBuilder<SELF extends QueryBuilder<SELF, T>, T> extends QueryBuilderProjection<SELF, T> {
public interface QueryBuilder<SELF, T> extends QueryBuilderProjection<SELF, T> {
/**
@@ -28,15 +27,6 @@ public interface QueryBuilder<SELF, T> extends QueryBuilderProjection<SELF, T> {
*/
SELF alias(String alias);
/**
* Apply changes to the query using a function.
* <p>
* This can be used to apply generic features to queries.
*
* @param apply The changes to apply to the query
*/
SELF also(Consumer<QueryBuilder<?, ?>> apply);
/**
* Apply changes to the query conditional on the supplied predicate.
* <p>
@@ -6,7 +6,6 @@ package io.ebean;
* @param <SELF> The builder type
* @param <T> The entity bean type
*/
//public interface QueryBuilderProjection<SELF extends QueryBuilderProjection<SELF, T>, T> {
public interface QueryBuilderProjection<SELF, T> {
/**
-1
View File
@@ -8,7 +8,6 @@ module io.ebean.api {
uses io.ebean.service.SpiRawSqlService;
uses io.ebean.service.SpiProfileLocationFactory;
uses io.ebean.service.SpiFetchGroupService;
uses io.ebean.service.SpiJsonService;
requires transitive java.sql;
requires transitive io.avaje.config;
+26 -26
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.5.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.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core-type</artifactId>
<version>14.5.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.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-ddl-generator</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
@@ -155,37 +155,37 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>querybean-generator</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>kotlin-querybean-generator</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-redis</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-spring-txn</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<!-- platforms -->
@@ -193,79 +193,79 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-clickhouse</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-db2</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-h2</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-hana</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-mariadb</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-mysql</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-nuodb</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-oracle</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-postgres</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-postgis</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-postgis-types</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-sqlite</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-sqlserver</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
</dependencies>
+2 -2
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.5.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.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
+6 -6
View File
@@ -3,7 +3,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.5.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.5.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.5.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.5.0</version>
<version>14.4.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-sqlserver</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
<scope>test</scope>
</dependency>
@@ -2,7 +2,30 @@ package io.ebeaninternal.server.query;
import io.avaje.lang.NonNullApi;
import io.avaje.lang.Nullable;
import io.ebean.*;
import io.ebean.CacheMode;
import io.ebean.CountDistinctOrder;
import io.ebean.Database;
import io.ebean.DtoQuery;
import io.ebean.Expression;
import io.ebean.ExpressionFactory;
import io.ebean.ExpressionList;
import io.ebean.FetchConfig;
import io.ebean.FetchGroup;
import io.ebean.FetchPath;
import io.ebean.FutureIds;
import io.ebean.FutureList;
import io.ebean.FutureRowCount;
import io.ebean.OrderBy;
import io.ebean.PagedList;
import io.ebean.PersistenceContextScope;
import io.ebean.ProfileLocation;
import io.ebean.Query;
import io.ebean.QueryIterator;
import io.ebean.QueryType;
import io.ebean.RawSql;
import io.ebean.Transaction;
import io.ebean.UpdateQuery;
import io.ebean.Version;
import io.ebean.service.SpiFetchGroupQuery;
import io.ebeaninternal.api.SpiQueryFetch;
import io.ebeaninternal.server.querydefn.OrmQueryDetail;
@@ -207,11 +230,6 @@ final class DefaultFetchGroupQuery<T> implements SpiFetchGroupQuery<T>, SpiQuery
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> also(Consumer<QueryBuilder<?, ?>> apply) {
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
}
@Override
public Query<T> alsoIf(BooleanSupplier predicate, Consumer<Query<T>> apply) {
throw new RuntimeException("EB102: Only select() and fetch() clause is allowed on FetchGroup");
@@ -293,12 +293,6 @@ public class DefaultOrmQuery<T> extends AbstractQuery implements SpiQuery<T> {
return this;
}
@Override
public Query<T> also(Consumer<QueryBuilder<?, ?>> apply) {
apply.accept(this);
return this;
}
@Override
public Query<T> alsoIf(BooleanSupplier predicate, Consumer<Query<T>> consumer) {
if (predicate.getAsBoolean()) {
@@ -1373,9 +1367,7 @@ public class DefaultOrmQuery<T> extends AbstractQuery implements SpiQuery<T> {
@Override
public final Query<T> select(FetchGroup<T> fetchGroup) {
if (fetchGroup != null) {
this.detail = ((SpiFetchGroup<T>) fetchGroup).detail();
}
this.detail = ((SpiFetchGroup<T>) fetchGroup).detail();
return this;
}
+2 -2
View File
@@ -47,7 +47,7 @@ module io.ebean.core {
exports io.ebeanservice.docstore.api.support to io.ebean.elastic, io.ebean.test;
exports io.ebeanservice.docstore.api.mapping to io.ebean.elastic;
exports io.ebeaninternal.api to io.ebean.ddl.generator, io.ebean.querybean, io.ebean.autotune, io.ebean.postgis, io.ebean.test, io.ebean.elastic, io.ebean.spring.txn, io.ebean.postgis.types;
exports io.ebeaninternal.api to io.ebean.ddl.generator, io.ebean.querybean, io.ebean.autotune, io.ebean.postgis, io.ebean.test, io.ebean.elastic, io.ebean.spring.txn;
exports io.ebeaninternal.api.json to io.ebean.test;
exports io.ebeaninternal.json to io.ebean.test;
exports io.ebeaninternal.server.autotune to io.ebean.autotune;
@@ -69,7 +69,7 @@ module io.ebean.core {
exports io.ebeaninternal.server.querydefn to io.ebean.autotune, io.ebean.querybean, io.ebean.test, io.ebean.elastic;
exports io.ebeaninternal.server.rawsql to io.ebean.test;
exports io.ebeaninternal.server.json to io.ebean.test, io.ebean.elastic;
exports io.ebeaninternal.server.type to io.ebean.postgis, io.ebean.test, io.ebean.postgis.types;
exports io.ebeaninternal.server.type to io.ebean.postgis, io.ebean.test;
exports io.ebeaninternal.server.transaction to io.ebean.test, io.ebean.elastic, io.ebean.spring.txn, io.ebean.k8scache;
exports io.ebeaninternal.server.util to io.ebean.querybean;
+4 -4
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.5.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.5.0</version>
<version>14.4.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.5.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.5.0</version>
<version>14.4.0</version>
<scope>test</scope>
</dependency>
@@ -15,6 +15,4 @@ module io.ebean.ddl.generator {
// support existing tests
exports io.ebeaninternal.extraddl.model to io.ebean.test;
opens io.ebeaninternal.extraddl.model to jakarta.xml.bind;
}
+2 -2
View File
@@ -3,7 +3,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.5.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.5.0</version>
<version>14.4.0</version>
<scope>provided</scope>
</dependency>
-17
View File
@@ -1,17 +0,0 @@
# editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
spaces_around_operators = true
max_line_length = 130
[pom.xml]
# Because of <project... line
max_line_length = 999
-201
View File
@@ -1,201 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-3
View File
@@ -1,3 +0,0 @@
# ebean.postgis.types
Ebean support for Postgres Geometry types
-90
View File
@@ -1,90 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.5.0</version>
</parent>
<name>ebean net postgis types</name>
<artifactId>ebean-net-postgis-types</artifactId>
<properties>
<postgis.jdbc.version>2023.1.0</postgis.jdbc.version>
</properties>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>14.5.0</version>
</dependency>
<!-- provided scope -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.5.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>net.postgis</groupId>
<artifactId>postgis-jdbc</artifactId>
<version>${postgis.jdbc.version}</version>
</dependency>
<!-- expected to be provided -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.7.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>14.5.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.avaje.composite</groupId>
<artifactId>logback</artifactId>
<version>1.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- for testing -->
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.40</version>
<extensions>true</extensions>
<configuration>
<tiles>
<tile>io.ebean.tile:enhancement:14.3.0</tile>
</tiles>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -1,23 +0,0 @@
package io.ebean.postgis;
import io.ebean.DatabaseBuilder;
import io.ebean.core.type.ExtraTypeFactory;
import io.ebean.core.type.ScalarType;
import java.util.Arrays;
import java.util.List;
public class PostgisExtraTypeFactory implements ExtraTypeFactory {
@Override
public List<ScalarType<?>> createTypes(DatabaseBuilder.Settings config, Object objectMapper) {
return Arrays.asList(
new ScalarTypePgisPoint(),
new ScalarTypePgisPolygon(),
new ScalarTypePgisLineString(),
new ScalarTypePgisMultiPolygon(),
new ScalarTypePgisMultiPoint(),
new ScalarTypePgisMultiLineString()
);
}
}
@@ -1,13 +0,0 @@
package io.ebean.postgis;
import io.ebean.DatabaseBuilder;
import io.ebeaninternal.api.GeoTypeProvider;
import io.ebeaninternal.server.type.GeoTypeBinder;
public class PostgisGeoTypeBindProvider implements GeoTypeProvider {
@Override
public GeoTypeBinder createBinder(DatabaseBuilder.Settings config) {
return new PostgisGeoTypeBinder();
}
}
@@ -1,21 +0,0 @@
package io.ebean.postgis;
import io.ebean.core.type.DataBinder;
import io.ebeaninternal.server.type.GeoTypeBinder;
import net.postgis.jdbc.PGgeometryLW;
import net.postgis.jdbc.geometry.Geometry;
import java.sql.SQLException;
class PostgisGeoTypeBinder implements GeoTypeBinder {
PostgisGeoTypeBinder() {
}
@Override
public void bind(DataBinder binder, int dataType, Object data) throws SQLException {
if (data instanceof Geometry) {
binder.setObject(new PGgeometryLW((Geometry) data));
}
}
}
@@ -1,118 +0,0 @@
package io.ebean.postgis;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import io.ebean.core.type.DataBinder;
import io.ebean.core.type.DataReader;
import io.ebean.core.type.DocPropertyType;
import io.ebean.core.type.ScalarType;
import net.postgis.jdbc.PGgeometry;
import net.postgis.jdbc.PGgeometryLW;
import net.postgis.jdbc.geometry.Geometry;
import net.postgis.jdbc.geometry.GeometryBuilder;
import net.postgis.jdbc.geometry.binary.BinaryParser;
import org.postgresql.util.PGobject;
import java.io.DataInput;
import java.io.DataOutput;
import java.sql.SQLException;
import java.sql.Types;
abstract class ScalarTypePgisBase<T extends Geometry> implements ScalarType<T> {
private final int jdbcType;
private final Class<T> cls;
ScalarTypePgisBase(int jdbcType, Class<T> cls) {
this.jdbcType = jdbcType;
this.cls = cls;
}
@Override
public void bind(DataBinder binder, T value) throws SQLException {
if (value == null) {
binder.setNull(Types.NULL);
} else {
binder.setObject(new PGgeometryLW(value));
}
}
@Override
@SuppressWarnings("unchecked")
public T read(DataReader reader) throws SQLException {
Object object = reader.getObject();
if (object == null) {
return null;
}
if (object instanceof PGgeometryLW) {
return (T) ((PGgeometryLW) object).getGeometry();
} else if (object instanceof PGgeometry) {
return (T) ((PGgeometry) object).getGeometry();
} else if (object instanceof PGobject) {
return (T) GeometryBuilder.geomFromString(((PGobject) object).getValue(), new BinaryParser(), false);
} else {
throw new IllegalStateException("Could not convert from " + object.getClass() + " to " + cls);
}
}
@Override
public boolean jdbcNative() {
return true;
}
@Override
public int jdbcType() {
return jdbcType;
}
@Override
public Class<T> type() {
return cls;
}
@Override
public T readData(DataInput dataInput) {
return null;
}
@Override
public void writeData(DataOutput dataOutput, T v) {
}
@Override
public Object toJdbcType(Object value) {
return null;
}
@Override
public T toBeanType(Object value) {
return null;
}
@Override
public String formatValue(T value) {
return value.toString();
}
@Override
public DocPropertyType docType() {
return null;
}
@Override
public T jsonRead(JsonParser parser) {
return null;
}
@Override
public void jsonWrite(JsonGenerator writer, T value) {
}
}
@@ -1,22 +0,0 @@
package io.ebean.postgis;
import io.ebean.config.dbplatform.ExtraDbTypes;
import net.postgis.jdbc.geometry.LineString;
import java.sql.SQLException;
public class ScalarTypePgisLineString extends ScalarTypePgisBase<LineString> {
public ScalarTypePgisLineString() {
super(ExtraDbTypes.LINESTRING, LineString.class);
}
@Override
public LineString parse(String value) {
try {
return new LineString(value);
} catch (SQLException e) {
throw new IllegalStateException(e);
}
}
}
@@ -1,22 +0,0 @@
package io.ebean.postgis;
import io.ebean.config.dbplatform.ExtraDbTypes;
import net.postgis.jdbc.geometry.MultiLineString;
import java.sql.SQLException;
public class ScalarTypePgisMultiLineString extends ScalarTypePgisBase<MultiLineString> {
public ScalarTypePgisMultiLineString() {
super(ExtraDbTypes.MULTILINESTRING, MultiLineString.class);
}
@Override
public MultiLineString parse(String value) {
try {
return new MultiLineString(value);
} catch (SQLException e) {
throw new IllegalStateException(e);
}
}
}
@@ -1,22 +0,0 @@
package io.ebean.postgis;
import io.ebean.config.dbplatform.ExtraDbTypes;
import net.postgis.jdbc.geometry.MultiPoint;
import java.sql.SQLException;
public class ScalarTypePgisMultiPoint extends ScalarTypePgisBase<MultiPoint> {
public ScalarTypePgisMultiPoint() {
super(ExtraDbTypes.MULTIPOINT, MultiPoint.class);
}
@Override
public MultiPoint parse(String value) {
try {
return new MultiPoint(value);
} catch (SQLException e) {
throw new IllegalStateException(e);
}
}
}
@@ -1,22 +0,0 @@
package io.ebean.postgis;
import io.ebean.config.dbplatform.ExtraDbTypes;
import net.postgis.jdbc.geometry.MultiPolygon;
import java.sql.SQLException;
public class ScalarTypePgisMultiPolygon extends ScalarTypePgisBase<MultiPolygon> {
public ScalarTypePgisMultiPolygon() {
super(ExtraDbTypes.MULTIPOLYGON, MultiPolygon.class);
}
@Override
public MultiPolygon parse(String value) {
try {
return new MultiPolygon(value);
} catch (SQLException e) {
throw new IllegalStateException(e);
}
}
}
@@ -1,22 +0,0 @@
package io.ebean.postgis;
import io.ebean.config.dbplatform.ExtraDbTypes;
import net.postgis.jdbc.geometry.Point;
import java.sql.SQLException;
public class ScalarTypePgisPoint extends ScalarTypePgisBase<Point> {
public ScalarTypePgisPoint() {
super(ExtraDbTypes.POINT, Point.class);
}
@Override
public Point parse(String value) {
try {
return new Point(value);
} catch (SQLException e) {
throw new IllegalStateException(e);
}
}
}
@@ -1,22 +0,0 @@
package io.ebean.postgis;
import io.ebean.config.dbplatform.ExtraDbTypes;
import net.postgis.jdbc.geometry.Polygon;
import java.sql.SQLException;
public class ScalarTypePgisPolygon extends ScalarTypePgisBase<Polygon> {
public ScalarTypePgisPolygon() {
super(ExtraDbTypes.POLYGON, Polygon.class);
}
@Override
public Polygon parse(String value) {
try {
return new Polygon(value);
} catch (SQLException e) {
throw new IllegalStateException(e);
}
}
}
@@ -1,17 +0,0 @@
import io.ebean.core.type.ExtraTypeFactory;
import io.ebeaninternal.api.GeoTypeProvider;
/**
* Provides GeoTypeProvider and ExtraTypeFactory.
*/
module io.ebean.postgis.types {
provides ExtraTypeFactory with io.ebean.postgis.PostgisExtraTypeFactory;
provides GeoTypeProvider with io.ebean.postgis.PostgisGeoTypeBindProvider;
requires io.ebean.core;
requires org.postgresql.jdbc;
requires net.postgis.jdbc;
requires net.postgis.jdbc.geometry;
requires com.fasterxml.jackson.core;
}
@@ -1 +0,0 @@
io.ebean.postgis.PostgisExtraTypeFactory
@@ -1 +0,0 @@
io.ebean.postgis.PostgisGeoTypeBindProvider
@@ -1,20 +0,0 @@
package org.example.domain;
import jakarta.persistence.Id;
import jakarta.persistence.MappedSuperclass;
@MappedSuperclass
abstract class BaseEntity {
@Id
Long id;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
}
@@ -1,43 +0,0 @@
package org.example.domain;
import io.ebean.annotation.Cache;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import net.postgis.jdbc.geometry.Point;
import net.postgis.jdbc.geometry.Polygon;
@Entity
@Table(name="mybean_cached")
@Cache
public class CachedBean extends BaseEntity {
String name;
Point point;
Polygon polygon;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Point getPoint() {
return point;
}
public void setPoint(Point point) {
this.point = point;
}
public Polygon getPolygon() {
return polygon;
}
public void setPolygon(Polygon polygon) {
this.polygon = polygon;
}
}
@@ -1,92 +0,0 @@
package org.example.domain;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import net.postgis.jdbc.geometry.*;
@Entity
@Table(name="mybean")
public class MyBean extends BaseEntity {
String name;
Point point;
Polygon poly;
LineString lineString;
MultiLineString multiLineString;
MultiPoint multiPoint;
MultiPolygon mpoly;
@Column(columnDefinition = "geometry(Point, 4326)", unique = true)
Point wgs84Point;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Point getPoint() {
return point;
}
public void setPoint(Point point) {
this.point = point;
}
public Polygon getPoly() {
return poly;
}
public void setPoly(Polygon poly) {
this.poly = poly;
}
public LineString getLineString() {
return lineString;
}
public void setLineString(LineString lineString) {
this.lineString = lineString;
}
public MultiLineString getMultiLineString() {
return multiLineString;
}
public void setMultiLineString(MultiLineString multiLineString) {
this.multiLineString = multiLineString;
}
public MultiPoint getMultiPoint() {
return multiPoint;
}
public void setMultiPoint(MultiPoint multiPoint) {
this.multiPoint = multiPoint;
}
public MultiPolygon getMpoly() {
return mpoly;
}
public void setMpoly(MultiPolygon mpoly) {
this.mpoly = mpoly;
}
public Point getWgs84Point() {
return wgs84Point;
}
public void setWgs84Point(final Point wgs84Point) {
this.wgs84Point = wgs84Point;
}
}
@@ -1,84 +0,0 @@
package org.example.domain;
import io.ebean.DB;
import net.postgis.jdbc.geometry.Point;
import net.postgis.jdbc.geometry.Polygon;
import org.junit.jupiter.api.Test;
import java.sql.SQLException;
import static org.junit.jupiter.api.Assertions.*;
public class TestCacheSerialization {
@Test
public void testCache() throws SQLException {
Point p1=new Point(1.0, 2.0);
p1.setSrid(4674);
Polygon pol=new Polygon("SRID=4674;POLYGON((0 0, 10 0, 10 10, 0 10, 0 0),(1 1, 1 2, 2 2, 2 1, 1 1))");
CachedBean tb=new CachedBean();
tb.setId(2080L);
tb.setName("Serialize Test");
tb.setPoint(p1);
tb.setPolygon(pol);
DB.insert(tb);
CachedBean r1=DB.find(CachedBean.class, tb.getId());
assertNotNull(r1);
assertEquals(p1, r1.getPoint());
assertEquals(pol, r1.getPolygon());
CachedBean r2=DB.find(CachedBean.class, tb.getId()); // this is returned from cache
assertNotNull(r2);
assertEquals(p1, r2.getPoint()); // and did fail https://github.com/ebean-orm/ebean/issues/3026
assertEquals(pol, r2.getPolygon());
DB.delete(tb);
}
@Test
public void testNullCache() throws SQLException {
Point p1=new Point(1.0, 2.0);
p1.setSrid(4674);
Polygon pol=new Polygon("SRID=4674;POLYGON((0 0, 10 0, 10 10, 0 10, 0 0),(1 1, 1 2, 2 2, 2 1, 1 1))");
CachedBean tb=new CachedBean();
tb.setId(2081L);
tb.setName("Serialize Test");
tb.setPoint(p1);
tb.setPolygon(null);
DB.insert(tb);
CachedBean r1=DB.find(CachedBean.class, tb.getId());
assertNotNull(r1);
assertEquals(p1, r1.getPoint());
assertNull(r1.getPolygon());
CachedBean r2=DB.find(CachedBean.class, tb.getId()); // this is returned from cache
assertNotNull(r2);
assertEquals(p1, r2.getPoint()); // and did fail https://github.com/ebean-orm/ebean/issues/3026
assertNull(r1.getPolygon());
tb.setPoint(null);
tb.setPolygon(pol);
DB.save(tb);
r1=DB.find(CachedBean.class, tb.getId());
assertNotNull(r1);
assertEquals(pol, r1.getPolygon());
assertNull(r1.getPoint());
r2=DB.find(CachedBean.class, tb.getId()); // this is returned from cache
assertNotNull(r2);
assertEquals(pol, r2.getPolygon()); // and did fail https://github.com/ebean-orm/ebean/issues/3026
assertNull(r1.getPoint());
DB.delete(tb);
}
}
@@ -1,57 +0,0 @@
package org.example.domain;
import io.ebean.DB;
import net.postgis.jdbc.geometry.*;
import org.junit.jupiter.api.Test;
import java.sql.SQLException;
import java.util.List;
public class TestInsertQuery {
/**
* Not automated this test yet.
*/
@Test
public void insert() throws SQLException {
List<MyBean> list = DB.find(MyBean.class).findList();
for (MyBean MyBean : list) {
System.out.println(MyBean.getPoint());
}
List<MyBean> list1 = DB.find(MyBean.class)
.where()
.raw("st_within(st_pointfromwkb(st_point(?, ?), 4674), poly)", 1.9, 1.9)
.findList();
System.out.println(list1);
Point point = new Point("SRID=4674;POINT(2.8 1.7)");
Polygon poly = new Polygon("SRID=4674;POLYGON((2 2, 2 -2, -2 -2, -2 2, 2 2))");
LineString lineString = new LineString("SRID=4674;LINESTRING(0 0, 1 2)");
MultiLineString multiLineString = new MultiLineString("SRID=4674;MULTILINESTRING((0 0, 1 2), (1 2, 3 -1))");
MultiPoint multiPoint = new MultiPoint("SRID=4674;MULTIPOINT((2 3), (7 8))");
MultiPolygon mpoly = new MultiPolygon("SRID=4674;MULTIPOLYGON(((1 1, 1 -1, -1 -1, -1 1, 1 1)),((1 1, 3 1, 3 3, 1 3, 1 1)))");
MyBean p = new MyBean();
p.setName("me at "+System.currentTimeMillis());
p.setPoint(point);
p.setPoly(poly);
p.setLineString(lineString);
p.setMultiLineString(multiLineString);
p.setMultiPoint(multiPoint);
p.setMpoly(mpoly);
DB.save(p);
List<String> content =
DB.find(MyBean.class)
.select("ST_AsText(lineString)::String")
.findSingleAttributeList();
System.out.println(content);
}
}
@@ -1,18 +0,0 @@
ebean:
dbSchema: mynetgisapp
geometrySRID: 4674
test:
# useDocker: false
# shutdown: stop # stop | remove
platform: postgis
ddlMode: dropCreate # none | dropCreate | create | migration | createOnly | migrationDropCreate
dbName: mynetgisapp
postgis:
containerName: ebeanbuild_postgis2
port: 9433
image: ghcr.io/baosystems/postgis:15
# extensions: postgis
# url: jdbc:postgresql_lwgis://localhost:6432/mygisapp
# driver: org.postgis.DriverWrapperLW
@@ -1,23 +0,0 @@
<configuration scan="true" scanPeriod="3 seconds">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
</Pattern>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="STDOUT"/>
</root>
<!-- Logging for SQL etc -->
<logger name="io.ebean.docker" level="TRACE"/>
<logger name="io.ebean.SQL" level="TRACE"/>
<logger name="io.ebean.TXN" level="TRACE"/>
<logger name="io.ebean.SUM" level="TRACE"/>
<logger name="io.ebean.DDL" level="TRACE"/>
</configuration>
@@ -1,18 +0,0 @@
## when running tests
ebean.ddl.generate=true
#ebean.ddl.run=true
#ebean.ddl.createOnly=true
ebean.geometrySRID=4674
datasource.default=db
datasource.db.username=pgis
datasource.db.password=pgis
datasource.db.databaseUrl=jdbc:postgresql_lwgis://127.0.0.1:5432/pgis
datasource.db.databaseDriver=net.postgis.jdbc.DriverWrapperLW
+4 -4
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.5.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.5.0</version>
<version>14.4.0</version>
</dependency>
<!-- provided scope -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.5.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.5.0</version>
<version>14.4.0</version>
<scope>test</scope>
</dependency>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.5.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.5.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.5.0</version>
<version>14.4.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>14.5.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.5.0</version>
<version>14.4.0</version>
<scope>provided</scope>
</dependency>
@@ -44,7 +44,6 @@ 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 IQueryBean<T, R>> extends QueryBuilder<R, T> {
public interface IQueryBean<T, R> extends QueryBuilder<R, T> {
/**
@@ -57,7 +57,6 @@ import java.util.stream.Stream;
* @param <R> the specific root query bean type (e.g. QCustomer)
*/
@NonNullApi
//public abstract class QueryBean<T, R extends QueryBean<T, R>> implements IQueryBean<T, R> {
public abstract class QueryBean<T, R> implements IQueryBean<T, R> {
/**
@@ -276,13 +275,6 @@ public abstract class QueryBean<T, R> implements IQueryBean<T, R> {
return root;
}
@Override
public R also(Consumer<QueryBuilder<?, ?>> apply) {
apply.accept(this);
return root;
}
@Override
public final R alsoIf(BooleanSupplier predicate, Consumer<R> apply) {
if (predicate.getAsBoolean()) {
@@ -142,22 +142,6 @@ class QOrderTest {
.findList();
}
@Test
void viaNullFetchGraph() {
DB.getDefault();
LoggedSql.start();
FetchGroup<Order> fg = null;
new QOrder()
.select(fg)
.status.eq(Order.Status.NEW)
.findList();
final List<String> sql = LoggedSql.stop();
assertThat(sql).hasSize(1);
assertThat(sql.get(0)).contains("select /* QOrderTest.viaNullFetchGraph */ t0.id, ");
}
@Test
void viaFetchGraph() {
@@ -1,12 +1,9 @@
package org.querytest;
import io.ebean.QueryBuilder;
import org.example.domain.Customer;
import org.example.domain.query.QCustomer;
import org.junit.jupiter.api.Test;
import java.util.function.Consumer;
import static org.assertj.core.api.Assertions.assertThat;
import static org.example.domain.query.QCustomer.Alias.name;
@@ -14,32 +11,6 @@ class QueryAlsoIfTest {
int dummy = 1;
@Test
void also() {
var myPager = new MyPager(10);
var q = new QCustomer()
.select(name)
.also(myPager)
.query();
q.findList();
assertThat(q.getGeneratedSql()).contains("select /* QueryAlsoIfTest.also */ t0.id, t0.name from be_customer t0 limit 10");
}
static class MyPager implements Consumer<QueryBuilder<?,?>> {
final int maxRows;
MyPager(int maxRows) {
this.maxRows = maxRows;
}
@Override
public void accept(QueryBuilder<?, ?> queryBuilder) {
queryBuilder.setMaxRows(maxRows);
}
}
@Test
void apply() {
var q = new QCustomer()
+6 -6
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.5.0</version>
<version>14.4.0</version>
</parent>
<artifactId>ebean-redis</artifactId>
@@ -29,35 +29,35 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>querybean-generator</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
<scope>provided</scope>
</dependency>
+3 -3
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.5.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.5.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.5.0</version>
<version>14.4.0</version>
<scope>test</scope>
</dependency>
+6 -6
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.5.0</version>
<version>14.4.0</version>
</parent>
<name>ebean test</name>
@@ -33,20 +33,20 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-h2</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-ddl-generator</artifactId>
<version>14.5.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.5.0</version>
<version>14.4.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-all</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
<scope>test</scope>
</dependency>
@@ -9,9 +9,6 @@ import java.util.Properties;
*/
class PostgisSetup implements PlatformSetup {
private static final String NET_POSTGIS_DRIVER = "net.postgis.jdbc.DriverWrapperLW";
private static final String ORG_POSTGIS_DRIVER = "org.postgis.DriverWrapperLW";
@Override
public Properties setup(Config config) {
int defaultPort = config.isUseDocker() ? 7432 : 5432;
@@ -20,8 +17,9 @@ class PostgisSetup implements PlatformSetup {
config.setDefaultPort(defaultPort);
config.setUsernameDefault();
config.setPasswordDefault();
config.setDriver(driver(config));
config.setDriver("org.postgis.DriverWrapperLW");
config.setUrl("jdbc:postgresql_lwgis://${host}:${port}/${databaseName}");
String schema = config.getSchema();
if (schema != null && !schema.equals(config.getUsername())) {
config.urlAppend("?currentSchema=" + schema);
@@ -30,19 +28,6 @@ class PostgisSetup implements PlatformSetup {
return dockerProperties(config);
}
private String driver(Config config) {
String driver = config.getPlatformKey("driver", "");
if (!driver.isEmpty()) {
return driver;
}
try {
Class.forName(NET_POSTGIS_DRIVER);
return NET_POSTGIS_DRIVER;
} catch (ClassNotFoundException e){
return ORG_POSTGIS_DRIVER;
}
}
private Properties dockerProperties(Config config) {
if (!config.isUseDocker()) {
return new Properties();
@@ -1,6 +1,5 @@
package org.tests.basic;
import io.ebean.test.LoggedSql;
import io.ebean.xtest.BaseTestCase;
import io.ebean.DB;
import io.ebean.FutureIds;
@@ -29,13 +28,8 @@ public class TestFetchId extends BaseTestCase {
.gt("details.id", 0)
.query();
LoggedSql.start();
List<Object> ids = query.findIds();
assertThat(ids).isNotEmpty();
List<String> sql = LoggedSql.stop();
assertThat(sql).hasSize(1);
assertThat(sql.get(0)).doesNotContain("order by");
assertThat(sql.get(0)).doesNotContain("join o_order_detail t1");
FutureIds<Order> futureIds = query.findFutureIds();
@@ -34,63 +34,11 @@ public class TestQueryForUpdate extends BaseTestCase {
if (isSqlServer()) {
assertThat(sqlOf(query)).contains("with (updlock)");
} else if (isDb2()) {
assertThat(sqlOf(query)).contains("with rs use and keep update locks");
} else {
assertThat(sqlOf(query)).contains("for update");
}
}
@Test
public void testConcurrentForUpdate() throws InterruptedException {
ResetBasicData.reset();
Thread t1 = new Thread() {
@Override
public void run() {
try (final Transaction transaction = DB.beginTransaction()) {
System.out.println("Thread: before find");
DB.find(Customer.class)
.forUpdate()
// .orderBy().desc("1") // this would help by the locks in DB2
.findList();
System.out.println("Thread: after find");
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
System.out.println("Thread: done");
}
}
};
t1.start();
Thread.sleep(100);
long start = System.currentTimeMillis();
try (final Transaction transaction = DB.beginTransaction()) {
if (isH2()) {
DB.sqlUpdate("SET LOCK_TIMEOUT 5000").execute();
}
System.out.println("Main: before find");
DB.find(Customer.class)
.forUpdate()
//.orderBy().desc("1") // this would help by the locks in DB2
.findList();
System.out.println("Main: after find");
}
start = System.currentTimeMillis() - start;
assertThat(start).isGreaterThan(2800);
}
@Test
public void testForUpdate_withLimit() {
ResetBasicData.reset();
@@ -107,8 +55,6 @@ public class TestQueryForUpdate extends BaseTestCase {
if (isSqlServer()) {
assertThat(sqlOf(query)).contains("with (updlock)");
} else if (isDb2()) {
assertThat(sqlOf(query)).contains("with rs use and keep update locks");
} else if (!isOracle()) {
// Oracle does not support FOR UPDATE with FETCH
assertThat(sqlOf(query)).contains("for update");
@@ -142,8 +88,6 @@ public class TestQueryForUpdate extends BaseTestCase {
assertThat(sql.get(0)).contains("from o_order");
if (isSqlServer()) {
assertThat(sql.get(1)).contains("from o_customer t0 with (updlock) where t0.id = ?");
} else if (isDb2()) {
assertThat(sql.get(1)).contains("from o_customer t0 where t0.id = ? with rs use and keep update locks");
} else {
assertThat(sql.get(1)).contains("from o_customer t0 where t0.id = ? for update");
}
@@ -179,8 +123,6 @@ public class TestQueryForUpdate extends BaseTestCase {
assertThat(sql.get(0)).contains("from o_order");
if (isSqlServer()) {
assertThat(sql.get(1)).contains("from o_customer t0 with (updlock,nowait) where t0.id = ?");
} else if (isDb2()) {
assertThat(sql.get(1)).contains("from o_customer t0 where t0.id = ? with rs use and keep update locks");
} else {
assertThat(sql.get(1)).contains("from o_customer t0 where t0.id = ? for update");
}
@@ -5,7 +5,6 @@ import io.ebean.BeanState;
import io.ebean.DB;
import org.junit.jupiter.api.Test;
import org.tests.model.basic.Customer;
import org.tests.model.basic.ResetBasicData;
import java.sql.Types;
import java.util.Optional;
@@ -17,7 +16,7 @@ public class TestTransient extends BaseTestCase {
@Test
public void testTransient() {
ResetBasicData.reset();
Customer cnew = new Customer();
cnew.setName("testTrans");
@@ -2,7 +2,6 @@ package org.tests.batchload;
import io.ebean.xtest.BaseTestCase;
import io.ebean.DB;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.tests.model.basic.Contact;
import org.tests.model.basic.Customer;
@@ -14,13 +13,11 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
public class TestBasicNavOnEmpty extends BaseTestCase {
@BeforeAll
static void before() {
ResetBasicData.reset();
}
@Test
public void test() {
ResetBasicData.reset();
Customer c = new Customer();
c.setName("HelloRob");
@@ -5,7 +5,6 @@ import io.ebean.DB;
import io.ebean.bean.EntityBean;
import io.ebean.bean.EntityBeanIntercept;
import io.ebean.xtest.BaseTestCase;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.tests.model.basic.Customer;
import org.tests.model.basic.ResetBasicData;
@@ -19,11 +18,6 @@ import static org.junit.jupiter.api.Assertions.*;
class TestBeanState extends BaseTestCase {
@BeforeAll
static void before() {
ResetBasicData.reset();
}
@Test
void invalid() {
assertThrows(IllegalArgumentException.class, () -> DB.beanState(new Object()));
@@ -31,6 +25,7 @@ class TestBeanState extends BaseTestCase {
@Test
void loadErrors_when_empty() {
ResetBasicData.reset();
Customer one = DB.find(Customer.class).setMaxRows(1).findOne();
BeanState beanState = DB.beanState(one);
@@ -39,6 +34,8 @@ class TestBeanState extends BaseTestCase {
@Test
void test() {
ResetBasicData.reset();
List<Customer> custs = DB.find(Customer.class).findList();
Customer customer = DB.find(Customer.class).setId(custs.get(0).getId()).select("name")
@@ -72,6 +69,8 @@ class TestBeanState extends BaseTestCase {
@Test
void setDisableLazyLoad_expect_lazyLoadingDisabled() {
ResetBasicData.reset();
List<Customer> custs = DB.find(Customer.class).order("id").findList();
Customer customer = DB.find(Customer.class)
@@ -87,6 +86,7 @@ class TestBeanState extends BaseTestCase {
@Test
void changedProps_when_setManyProperty() {
ResetBasicData.reset();
Customer customer = DB.find(Customer.class).order("id").setMaxRows(1).findOne();
@@ -2,11 +2,9 @@ package org.tests.batchload;
import io.ebean.DB;
import io.ebean.xtest.base.TransactionalTestCase;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.tests.model.basic.Contact;
import org.tests.model.basic.Customer;
import org.tests.model.basic.ResetBasicData;
import java.util.List;
@@ -230,6 +230,5 @@ public class TestQueryJoinToAssocOne extends BaseTestCase {
String originQuery = trimSql(loggedSql.get(0), 5);
assertThat(originQuery).contains("select t0.id, t0.status, t0.ship_date, t1.id, t1.order_qty, t1.unit_price");
assertThat(originQuery).contains(" from o_order t0 left join o_order_detail t1 ");
assertThat(originQuery).contains(" order by t0.id, t1.id asc, t1.order_qty asc, t1.cretime desc;");
}
}
@@ -2,7 +2,6 @@ package org.tests.batchload;
import io.ebean.xtest.BaseTestCase;
import io.ebean.DB;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.tests.model.basic.Customer;
import org.tests.model.basic.ResetBasicData;
@@ -12,13 +11,11 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
public class TestSecondQueryNoRows extends BaseTestCase {
@BeforeAll
static void before() {
ResetBasicData.reset();
}
@Test
public void test() {
ResetBasicData.reset();
Customer cnew = new Customer();
cnew.setName("testSecQueryNoRows");
@@ -3,11 +3,9 @@ package org.tests.cache;
import io.ebean.xtest.BaseTestCase;
import io.ebean.DB;
import io.ebean.test.LoggedSql;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.tests.model.basic.Contact;
import org.tests.model.basic.Customer;
import org.tests.model.basic.ResetBasicData;
import java.sql.Date;
import java.time.LocalDate;
@@ -20,11 +18,6 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
public class TestBeanCacheContactLazyLoad extends BaseTestCase {
@BeforeAll
static void before() {
ResetBasicData.reset();
}
/**
* This test shows a wrong behaviour of the bean cache up to at least Ebean 12.4.*:
* <ul>
@@ -15,6 +15,7 @@ public class TestCacheInterceptSaveWhenLazyLoaded extends BaseTestCase {
@Test
public void test() {
ResetBasicData.reset();
Customer customer = new Customer();
@@ -4,7 +4,6 @@ import io.ebean.xtest.BaseTestCase;
import io.ebean.DB;
import io.ebean.Query;
import io.ebean.cache.ServerCache;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.tests.model.basic.Address;
import org.tests.model.basic.Contact;
@@ -19,14 +18,11 @@ import static org.assertj.core.api.Assertions.assertThat;
public class TestQueryCacheTableDependency extends BaseTestCase {
@BeforeAll
static void before() {
ResetBasicData.reset();
}
@Test
public void testFindCountOnDependent() {
ResetBasicData.reset();
ServerCache customerCache = DB.cacheManager().queryCache(Customer.class);
customerCache.clear();
@@ -99,6 +95,8 @@ public class TestQueryCacheTableDependency extends BaseTestCase {
@Test
public void testFindCountOnOtherL2Cached() {
ResetBasicData.reset();
Customer fi = DB.find(Customer.class).where().eq("name", "Fiona").findOne();
int custCount0 = DB.find(Customer.class).setUseQueryCache(true).setReadOnly(true)
@@ -185,7 +185,7 @@ public class TestOrderedList extends BaseTestCase {
DB.save(masterDb);
masterDb = DB.find(OmCacheOrderedMaster.class, master.getId());
assertThat(masterDb.getDetails()).containsExactlyInAnyOrder(detail3, detail1);
assertThat(masterDb.getDetails()).containsExactly(detail3, detail1);
}
}
@@ -3,7 +3,6 @@ package org.tests.docstore;
import io.ebean.xtest.BaseTestCase;
import io.ebean.text.json.JsonReadOptions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.tests.model.basic.Customer;
import org.tests.model.basic.Product;
@@ -17,19 +16,19 @@ import static org.assertj.core.api.Assertions.assertThat;
public class CustomerReportTest extends BaseTestCase {
@BeforeAll
static void before() {
ResetBasicData.reset();
}
@Test
public void testToJson() {
public void testToJson() throws Exception {
ResetBasicData.reset();
String json = server().json().toJson(getCustomerReport());
assertThat(json).isEqualTo("{\"dtype\":\"CR\",\"friends\":[{\"id\":2},{\"id\":3}],\"customer\":{\"id\":1}}");
}
@Test
public void testFromJson() {
public void testFromJson() throws Exception {
ResetBasicData.reset();
String json = "{\"dtype\":\"CR\",\"friends\":[{\"id\":2},{\"id\":3}],\"customer\":{\"id\":1}}";
JsonReadOptions opts = new JsonReadOptions();
@@ -44,7 +43,9 @@ public class CustomerReportTest extends BaseTestCase {
@Test
public void testEmbeddedDocs() {
public void testEmbeddedDocs() throws Exception {
ResetBasicData.reset();
CustomerReport report = getCustomerReport();
report.getEmbeddedReports().add(getProductReport());
@@ -14,9 +14,10 @@ public class ResetBasicData {
private static boolean runOnce;
private static final Database server = DB.getDefault();
private static Database server = DB.getDefault();
public static synchronized void reset() {
if (runOnce) {
int cnt1 = server.find(Customer.class).findCount();
int cnt2 = server.find(Order.class).findCount();
@@ -24,9 +25,18 @@ public class ResetBasicData {
int cnt4 = server.find(Product.class).findCount();
if (cnt1 == 4 && cnt2 == 5 && cnt3 == 2 && cnt4 == 4) {
// OK, test data not modified
outputCustomerIds();
} else {
outputState();
StringBuilder sb = new StringBuilder();
sb.append("Customers:");
server.find(Customer.class).findEach(c -> sb.append(' ').append(c.getId()));
sb.append(", Orders:");
server.find(Order.class).findEach(c -> sb.append(' ').append(c.getId()));
sb.append(", Countries:");
server.find(Country.class).findEach(c -> sb.append(' ').append(c.getCode()));
sb.append(", Products:");
server.find(Product.class).findEach(c -> sb.append(' ').append(c.getId()));
System.err.println("WARNING: basic test data was modified. Current content:");
System.err.println(sb.toString());
}
return;
}
@@ -45,28 +55,9 @@ public class ResetBasicData {
me.insertProducts();
me.insertTestCustAndOrders();
});
outputState();
runOnce = true;
}
private static void outputState() {
StringBuilder sb = new StringBuilder();
sb.append("CustomerIds:");
server.find(Customer.class).findEach(c -> sb.append(' ').append(c.getId()));
sb.append(", Orders:");
server.find(Order.class).findEach(c -> sb.append(' ').append(c.getId()));
sb.append(", Countries:");
server.find(Country.class).findEach(c -> sb.append(' ').append(c.getCode()));
sb.append(", Products:");
server.find(Product.class).findEach(c -> sb.append(' ').append(c.getId()));
System.err.println("WARNING: basic test data was modified. Current content:");
System.err.println(sb);
}
private static void outputCustomerIds() {
List<Object> ids = server.find(Customer.class).findIds();
System.err.println("CustomerIds:" + ids);
}
private void insertCountries() {
Country c = new Country();
@@ -181,6 +181,5 @@ public class TestManyWhereJoin extends BaseTestCase {
// additional join for fetching the many details
assertThat(sql).contains(" left join o_order_detail t1 on t1.order_id = t0.id");
assertThat(sql).contains("order by t0.cretime, t0.id, t1.id asc, t1.order_qty asc, t1.cretime desc");
}
}
@@ -2,49 +2,16 @@ package org.tests.query;
import io.ebean.DB;
import io.ebean.Query;
import io.ebean.QueryBuilder;
import io.ebean.xtest.BaseTestCase;
import org.junit.jupiter.api.Test;
import org.tests.model.basic.Customer;
import org.tests.model.basic.ResetBasicData;
import java.util.function.Consumer;
import static org.assertj.core.api.Assertions.assertThat;
class TestQueryAlsoIf extends BaseTestCase {
class TestQueryAlsoIf {
int dummy = 1;
@Test
void also() {
ResetBasicData.reset();
MyPager myPager = new MyPager(10);
Query<Customer> query = DB.find(Customer.class)
.select("name")
.also(myPager);
query.findList();
if (isLimitOffset()) {
assertThat(query.getGeneratedSql()).isEqualTo("select t0.id, t0.name from o_customer t0 limit 10");
}
}
static class MyPager implements Consumer<QueryBuilder<?, ?>> {
final int maxRows;
MyPager(int maxRows) {
this.maxRows = maxRows;
}
@Override
public void accept(QueryBuilder<?, ?> queryBuilder) {
queryBuilder.setMaxRows(maxRows);
}
}
@Test
void apply() {
ResetBasicData.reset();
@@ -213,7 +213,6 @@ public class TestQueryFilterMany extends BaseTestCase {
assertThat(sql).hasSize(1);
assertThat(sql.get(0)).contains("from o_customer t0 left join o_order t1");
assertThat(sql.get(0)).contains("where t1.order_date is not null");
assertThat(sql.get(0)).contains("order by t0.id");
}
@Test
@@ -270,7 +269,6 @@ public class TestQueryFilterMany extends BaseTestCase {
List<String> sqlList = LoggedSql.stop();
assertEquals(1, sqlList.size());
assertThat(sqlList.get(0)).contains("select count(*) from o_customer");
assertThat(sqlList.get(0)).doesNotContain("order by");
}
@Test
@@ -1,27 +1,17 @@
package org.tests.query;
import io.ebean.test.LoggedSql;
import io.ebean.xtest.BaseTestCase;
import io.ebean.DB;
import org.junit.jupiter.api.Test;
import org.tests.model.basic.MUser;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
public class TestQueryFilterManyOnM2M extends BaseTestCase {
@Test
public void test() {
LoggedSql.start();
DB.find(MUser.class).fetch("roles").filterMany("roles").ilike("roleName", "Jim%").findList();
List<String> sql = LoggedSql.stop();
assertThat(sql).hasSize(1);
assertThat(sql.get(0)).contains("select t0.userid, t0.user_name, t0.user_type_id, t1.roleid, t1.role_name from muser t0 left join mrole_muser t1z_ on t1z_.muser_userid = t0.userid left join mrole t1 on t1.roleid = t1z_.mrole_roleid where lower(t1.role_name) like");
assertThat(sql.get(0)).contains("order by t0.userid;");
}
}
@@ -1,6 +1,5 @@
package org.tests.query;
import io.ebean.test.LoggedSql;
import io.ebean.xtest.BaseTestCase;
import io.ebean.DB;
import org.junit.jupiter.api.Test;
@@ -11,8 +10,6 @@ import org.tests.model.basic.ResetBasicData;
import java.sql.Date;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
public class TestQueryFilterManySimple extends BaseTestCase {
@Test
@@ -23,7 +20,6 @@ public class TestQueryFilterManySimple extends BaseTestCase {
// not really last week :)
Date lastWeek = Date.valueOf("2010-01-01");
LoggedSql.start();
List<Customer> list = DB.find(Customer.class)
// .join("orders", new JoinConfig().lazy())
// .join("orders", new JoinConfig().query())
@@ -33,14 +29,5 @@ public class TestQueryFilterManySimple extends BaseTestCase {
// invoke lazy loading
list.get(0).getOrders().size();
List<String> sql = LoggedSql.stop();
assertThat(sql).hasSize(2);
assertThat(sql.get(0)).contains("from o_customer t0 left join o_order t1 on t1.kcustomer_id = t0.id and t1.order_date is not null left join o_customer t2 on t2.id = t1.kcustomer_id where");
assertThat(sql.get(0)).contains("order by t0.id");
if (isPostgresCompatible()) {
assertThat(sql.get(1)).contains("from contact t0 where (t0.customer_id) = any(?) and t0.first_name is not null;");
} else {
assertThat(sql.get(1)).contains("from contact t0 where (t0.customer_id) in (?) and t0.first_name is not null;");
}
}
}
@@ -1,6 +1,5 @@
package org.tests.query;
import io.ebean.test.LoggedSql;
import io.ebean.xtest.BaseTestCase;
import io.ebean.DB;
import io.ebean.Query;
@@ -20,7 +19,6 @@ public class TestRowCount extends BaseTestCase {
public void test() {
ResetBasicData.reset();
LoggedSql.start();
Query<Order> query = DB.find(Order.class)
.fetch("details")
@@ -34,13 +32,6 @@ public class TestRowCount extends BaseTestCase {
List<Object> ids = query.findIds();
List<Order> list = query.findList();
List<String> sql = LoggedSql.stop();
assertThat(sql).hasSize(3);
assertThat(sql.get(0)).doesNotContain("order by");
assertThat(sql.get(1)).contains("order by");
assertThat(sql.get(2)).contains("order by t0.id desc");
System.out.println(list);
for (Order order : list) {
order.getStatus();
@@ -7,7 +7,6 @@ import io.ebean.xtest.IgnorePlatform;
import io.ebean.annotation.Platform;
import io.ebean.meta.*;
import io.ebean.test.LoggedSql;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.tests.model.basic.Customer;
import org.tests.model.basic.EBasic;
@@ -20,13 +19,11 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
public class TestCustomerFinder extends BaseTestCase {
@BeforeAll
static void before() {
ResetBasicData.reset();
}
@Test
public void a_runFirst_metricsAsJson_sqlInInitialCollectionOnly() {
ResetBasicData.reset();
runQueries();
StringBuilder buffer0 = new StringBuilder();
@@ -58,12 +55,18 @@ public class TestCustomerFinder extends BaseTestCase {
@Test
public void test_ref() {
ResetBasicData.reset();
Customer customer = Customer.find.ref(1);
assertThat(customer.getId()).isEqualTo(1);
}
@Test
public void test_all_byId_byName() {
ResetBasicData.reset();
List<Customer> all = Customer.find.all();
List<Customer> list = DB.find(Customer.class).findList();
@@ -90,6 +93,7 @@ public class TestCustomerFinder extends BaseTestCase {
@Test
public void flush() {
Transaction transaction = DB.beginTransaction();
try {
Customer.find.currentTransaction().setBatchMode(true);
@@ -110,6 +114,7 @@ public class TestCustomerFinder extends BaseTestCase {
@Test
public void test_byName_deleteById() {
Customer customer = new Customer();
customer.setName("Newbie-879879897");
@@ -129,12 +134,16 @@ public class TestCustomerFinder extends BaseTestCase {
@Test
public void test_update() {
int rowsUpdated = Customer.find.updateToInactive("Frankie Who");
logger.debug("updated {}", rowsUpdated);
}
@Test
public void test_ormQuery() {
ResetBasicData.reset();
List<Customer> customers =
Customer.find.byNameStatus("R", Customer.Status.NEW);
@@ -143,6 +152,9 @@ public class TestCustomerFinder extends BaseTestCase {
@Test
public void test_nativeSingleAttribute() {
ResetBasicData.reset();
List<String> names = Customer.find.namesStartingWith("F");
assertThat(names).isNotEmpty();
}
@@ -150,6 +162,9 @@ public class TestCustomerFinder extends BaseTestCase {
@Test
@IgnorePlatform(Platform.DB2) // no query plans yet, for DB2
public void test_finders_queryPlans() {
ResetBasicData.reset();
// change default collect query plan threshold to 20 micros
QueryPlanInit init0 = new QueryPlanInit();
init0.setAll(true);
@@ -204,6 +219,9 @@ public class TestCustomerFinder extends BaseTestCase {
@Test
public void test_metricsAsJson_withAll() {
ResetBasicData.reset();
runQueries();
String metricsJson = server().metaInfo()
@@ -225,6 +243,9 @@ public class TestCustomerFinder extends BaseTestCase {
@Test
public void test_metricsAsJson_minimal() {
ResetBasicData.reset();
runQueries();
String metricsJson = server().metaInfo()
@@ -244,6 +265,9 @@ public class TestCustomerFinder extends BaseTestCase {
@Test
public void test_metricsAsJson_write() {
ResetBasicData.reset();
runQueries();
StringBuilder buffer = new StringBuilder();
@@ -259,6 +283,9 @@ public class TestCustomerFinder extends BaseTestCase {
@Test
public void test_metricsAsJson_writeWithHeader() {
ResetBasicData.reset();
runQueries();
StringBuilder buffer = new StringBuilder();
@@ -2,7 +2,6 @@ package org.tests.repository;
import io.ebean.xtest.BaseTestCase;
import io.ebean.DB;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.tests.model.basic.Customer;
import org.tests.model.basic.ResetBasicData;
@@ -15,15 +14,12 @@ import static org.assertj.core.api.Assertions.assertThat;
public class TestBeanRepository extends BaseTestCase {
@BeforeAll
static void before() {
ResetBasicData.reset();
}
@Test
public void test() {
DB.find(Customer.class).where().in("name", "c0", "c1").delete();
ResetBasicData.reset();
CustomerRepository repository = new CustomerRepository(server());
Customer customer = new Customer();
@@ -56,6 +52,9 @@ public class TestBeanRepository extends BaseTestCase {
@Test
public void findByName() {
ResetBasicData.reset();
CustomerRepository repository = new CustomerRepository(server());
Customer blah = new Customer();
@@ -81,5 +80,6 @@ public class TestBeanRepository extends BaseTestCase {
repository.deleteById(1099);
repository.findAll();
}
}
@@ -9,10 +9,12 @@ import io.ebeaninternal.api.json.SpiJsonReader;
import io.ebeaninternal.server.deploy.BeanDescriptor;
import io.ebeaninternal.server.json.ReadJson;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.tests.model.basic.*;
import org.tests.model.basic.Address;
import org.tests.model.basic.Contact;
import org.tests.model.basic.ContactNote;
import org.tests.model.basic.Customer;
import java.io.IOException;
import java.io.StringReader;
@@ -26,11 +28,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
public class TestJsonBeanDescriptorParse extends BaseTestCase {
@BeforeAll
static void before() {
ResetBasicData.reset();
}
@BeforeEach
void setup() {
Customer customer = new Customer();
@@ -79,7 +76,7 @@ public class TestJsonBeanDescriptorParse extends BaseTestCase {
}
@Test
public void testJsonManyUpdate() {
public void testJsonManyUpdate() throws IOException {
Customer customer = DB.find(Customer.class, 234);
String json =
@@ -111,7 +108,7 @@ public class TestJsonBeanDescriptorParse extends BaseTestCase {
}
@Test
public void testJsonUpdate() {
public void testJsonUpdate() throws IOException {
Customer customer = DB.find(Customer.class, 234);
DB.json().toBean(customer, "{}");
assertFalse(DB.beanState(customer).isDirty());
@@ -187,7 +184,8 @@ public class TestJsonBeanDescriptorParse extends BaseTestCase {
StringReader reader = new StringReader("{\"id\":123,\"name\":\"Hello Rob\"}");
JsonParser parser = server.json().createParser(reader);
return new ReadJson(descriptor, parser, null, null, false);
SpiJsonReader readJson = new ReadJson(descriptor, parser, null, null, false);
return readJson;
}
}
@@ -10,25 +10,20 @@ import io.ebean.annotation.Transactional;
import io.ebean.xtest.BaseTestCase;
import io.ebean.xtest.ForPlatform;
import io.ebeaninternal.api.SpiTransaction;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.tests.model.basic.Customer;
import org.tests.model.basic.Order;
import org.tests.model.basic.ResetBasicData;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.fail;
public class TestExecuteComplete extends BaseTestCase {
@BeforeAll
static void before() {
ResetBasicData.reset();
}
@ForPlatform(Platform.H2)
@Test
public void execute_when_errorOnCommit_threadLocalIsCleared() {
try {
DB.execute(TxScope.required().setBatch(PersistBatch.ALL), () -> {
@@ -48,6 +43,7 @@ public class TestExecuteComplete extends BaseTestCase {
@ForPlatform(Platform.H2)
@Test
public void nestedExecute_when_errorOnCommit_threadLocalIsCleared() {
try {
DB.execute(TxScope.required().setBatch(PersistBatch.ALL), () ->
DB.execute(() -> {
@@ -68,6 +64,7 @@ public class TestExecuteComplete extends BaseTestCase {
@ForPlatform(Platform.H2)
@Test
public void transactional_errorOnCommit_expect_threadScopeCleanup() {
try {
errorOnCommit();
fail();
@@ -88,6 +85,7 @@ public class TestExecuteComplete extends BaseTestCase {
@ForPlatform(Platform.H2)
@Test
public void normal_expect_threadScopeCleanup() {
Transaction txn1 = server().beginTransaction();
try {
txn1.commit();
@@ -101,6 +99,7 @@ public class TestExecuteComplete extends BaseTestCase {
@ForPlatform(Platform.H2)
@Test
public void missingEnd_expect_threadScopeCleanup() {
Transaction txn1 = server().beginTransaction();
try {
txn1.commit();
@@ -115,6 +114,7 @@ public class TestExecuteComplete extends BaseTestCase {
@ForPlatform(Platform.H2)
@Test
public void missingEnd_withRollbackOnly_expect_threadScopeCleanup() {
Transaction txn1 = server().beginTransaction();
try {
txn1.rollback();
@@ -129,6 +129,7 @@ public class TestExecuteComplete extends BaseTestCase {
@ForPlatform(Platform.H2)
@Test
public void implicit_query_expect_threadScopeCleanup() {
DB.find(Customer.class).findList();
assertThat(getInScopeTransaction()).isNull();
@@ -137,6 +138,7 @@ public class TestExecuteComplete extends BaseTestCase {
@ForPlatform(Platform.H2)
@Test
public void implicit_save_expect_threadScopeCleanup() {
Customer cust = new Customer();
cust.setName("Roland");
DB.save(cust);
@@ -147,6 +149,7 @@ public class TestExecuteComplete extends BaseTestCase {
@ForPlatform(Platform.H2)
@Test
public void no_transaction_expect_threadScopeCleanup() {
try (Transaction txn = DB.beginTransaction(TxScope.notSupported())) {
SpiTransaction txn2 = getInScopeTransaction();
// The NoTransaction placeholder can normally only occur inside
@@ -161,6 +164,7 @@ public class TestExecuteComplete extends BaseTestCase {
@ForPlatform(Platform.H2)
@Test
public void test_nested_userobjects() {
try (Transaction txn1 = DB.beginTransaction()) {
assertThat(getInScopeTransaction()).isNotNull();
getInScopeTransaction().putUserObject("foo", "bar");
@@ -7,10 +7,12 @@ import io.ebean.test.LoggedSql;
import io.ebean.xtest.BaseTestCase;
import io.ebeaninternal.api.SpiBeanTypeManager;
import io.ebeaninternal.api.SpiTransaction;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import org.tests.model.basic.*;
import org.tests.model.basic.Customer;
import org.tests.model.basic.EBasicVer;
import org.tests.model.basic.Order;
import org.tests.model.basic.OrderShipment;
import java.util.ArrayList;
import java.util.List;
@@ -19,11 +21,6 @@ import static org.assertj.core.api.Assertions.assertThat;
public class TestTransparentPersist extends BaseTestCase {
@BeforeAll
static void before() {
ResetBasicData.reset();
}
@Test
public void insertFlush_mutateFlush_expect_update() {
@@ -1,22 +1,15 @@
package org.tests.unitinternal;
import io.ebean.xtest.BaseTestCase;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.tests.model.basic.Customer;
import org.tests.model.basic.Order;
import org.tests.model.basic.ResetBasicData;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
public class TestEqualsOnEnhanced extends BaseTestCase {
@BeforeAll
static void before() {
ResetBasicData.reset();
}
@Test
public void test() {
Customer c = new Customer();
+1 -1
View File
@@ -15,7 +15,7 @@ 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.5.0'
git commit -am 'Version 14.4.0'
git tag 14.4.0
git push --tags
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.5.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.5.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.5.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.5.0</version>
<version>14.4.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-ddl-generator</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
<scope>test</scope>
</dependency>
@@ -157,7 +157,7 @@ class SimpleModuleInfoWriter {
private void writeMethodEntityClasses(Set<String> dbEntities, String dbName) {
String method = "defaultEntityClasses";
if (dbName != null) {
method = "entitiesFor_" + Util.stripForMethod(dbName);
method = "entitiesFor_" + dbName;
writeMethodComment("Entities for @DbName(name=\"%s\"))", dbName);
} else {
writeMethodComment("Entities with no @DbName", dbName);
@@ -187,7 +187,7 @@ class SimpleModuleInfoWriter {
private void writeMethodEntityClassesFor(Set<String> otherDbNames) {
writer.append(" private List<Class<?>> classesFor(String dbName) {").eol();
for (String dbName : otherDbNames) {
writer.append(" if (\"%s\".equals(dbName)) return entitiesFor_%s();", dbName, Util.stripForMethod(dbName)).eol();
writer.append(" if (\"%s\".equals(dbName)) return entitiesFor_%s();", dbName, dbName).eol();
}
writer.append(" return new ArrayList<>();").eol();
writer.append(" }").eol().eol();
@@ -2,10 +2,6 @@ package io.ebean.querybean.generator;
class Util {
static String stripForMethod(String dbName) {
return dbName.replace('-', '_');
}
static String packageOf(boolean nested, String originName) {
return nested ? nestedPackageOf(originName) : packageOf(originName);
}
@@ -5,14 +5,6 @@ import org.junit.jupiter.api.Test
internal class UtilTest {
@Test
fun stripForMethod() {
Assertions.assertEquals(io.ebean.querybean.generator.Util.stripForMethod("-a"), "_a")
Assertions.assertEquals(io.ebean.querybean.generator.Util.stripForMethod("-a-b-"), "_a_b_")
Assertions.assertEquals(io.ebean.querybean.generator.Util.stripForMethod("c-"), "c_")
Assertions.assertEquals(io.ebean.querybean.generator.Util.stripForMethod("my-foo"), "my_foo")
}
@Test
fun packageOf() {
Assertions.assertEquals(Util.packageOf(true, "com.example.Foo.Bar"), "com.example")
+14 -14
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.5.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.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-clickhouse</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-db2</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-hana</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-hsqldb</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-mysql</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-mariadb</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-nuodb</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-oracle</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-sqlanywhere</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-sqlite</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-sqlserver</artifactId>
<version>14.5.0</version>
<version>14.4.0</version>
</dependency>
</dependencies>

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