mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Compare commits
71
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
451e2fa93c | ||
|
|
2ff3b0acb7 | ||
|
|
42594533da | ||
|
|
678494f331 | ||
|
|
361df6732a | ||
|
|
c3320f4a0b | ||
|
|
c411d9a665 | ||
|
|
8ea2c31076 | ||
|
|
254b0df16b | ||
|
|
c0f4451d20 | ||
|
|
6c544a2835 | ||
|
|
227d18bbf0 | ||
|
|
18cdd2ed7a | ||
|
|
91d1fb8cea | ||
|
|
058021f8d0 | ||
|
|
f4d270e8b5 | ||
|
|
7b8052c097 | ||
|
|
68b7deba9d | ||
|
|
65e924feaa | ||
|
|
6cc5e83b01 | ||
|
|
752d5d4782 | ||
|
|
20fdbfc972 | ||
|
|
bd01dfd29a | ||
|
|
6a9b5944a3 | ||
|
|
6e31de6f2e | ||
|
|
5fddc37037 | ||
|
|
ca6e3963db | ||
|
|
a966557b68 | ||
|
|
1a6a426683 | ||
|
|
dd43fe4db3 | ||
|
|
b4ebeb0070 | ||
|
|
0dbf982293 | ||
|
|
12d7184f02 | ||
|
|
c3295f1145 | ||
|
|
9bdcd6c55e | ||
|
|
b627794f8f | ||
|
|
b9f3ff24e9 | ||
|
|
9752eced1f | ||
|
|
e7aa1fdac5 | ||
|
|
9d26ab2103 | ||
|
|
103f965182 | ||
|
|
d28d9a6176 | ||
|
|
173b81a64b | ||
|
|
135b1e3b57 | ||
|
|
888109d706 | ||
|
|
8cd6d50def | ||
|
|
272b316ecc | ||
|
|
e95edad04b | ||
|
|
d934d44164 | ||
|
|
a2ad1aaf6e | ||
|
|
a0b6a13e6c | ||
|
|
a65340b939 | ||
|
|
0279f8b1ad | ||
|
|
bd2faed6a0 | ||
|
|
a0e2155ec2 | ||
|
|
5ff9171aaf | ||
|
|
4d7936c1a6 | ||
|
|
552145db37 | ||
|
|
0504cdc2d8 | ||
|
|
a380b609cd | ||
|
|
65ac083872 | ||
|
|
a82dca24da | ||
|
|
466a616f3e | ||
|
|
a0552387f8 | ||
|
|
25bc0e947d | ||
|
|
f8253a1252 | ||
|
|
2581d82cff | ||
|
|
331ea90e14 | ||
|
|
dfb1d6ab54 | ||
|
|
067f4bfdea | ||
|
|
0a71ad624e |
@@ -22,7 +22,7 @@ jobs:
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: ${{ matrix.java_version }}
|
||||
distribution: 'adopt'
|
||||
distribution: 'zulu'
|
||||
- name: Maven cache
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
|
||||
name: JDK 18-ea
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '30 6 * * 1,3,5'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
java_version: [18-ea]
|
||||
os: [ubuntu-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Java
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: ${{ matrix.java_version }}
|
||||
distribution: 'zulu'
|
||||
- name: Maven cache
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: maven-cache
|
||||
with:
|
||||
path:
|
||||
~/.m2
|
||||
key: build-${{ env.cache-name }}
|
||||
- name: Build with Maven
|
||||
run: mvn package
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
|
||||
name: MariaDB 10.6
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '10 7 * * 1,4'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
java_version: [11]
|
||||
os: [ubuntu-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Java
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: ${{ matrix.java_version }}
|
||||
distribution: 'adopt'
|
||||
- name: Maven cache
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: maven-cache
|
||||
with:
|
||||
path:
|
||||
~/.m2
|
||||
key: build-${{ env.cache-name }}
|
||||
- name: mariadb 10.6
|
||||
run: mvn clean test -Dprops.file=testconfig/ebean-mariadb.properties
|
||||
@@ -0,0 +1,39 @@
|
||||
|
||||
name: Multi-JDK Build
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '30 6 * * *'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
java_version: [8.0.192, 8, 11.0.3, 11, 17]
|
||||
os: [ubuntu-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Java
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: ${{ matrix.java_version }}
|
||||
distribution: 'zulu'
|
||||
- name: Maven cache
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: maven-cache
|
||||
with:
|
||||
path:
|
||||
~/.m2
|
||||
key: build-${{ env.cache-name }}
|
||||
- name: Build with Maven
|
||||
run: mvn package
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
|
||||
name: Multi-database platform test
|
||||
|
||||
on: [workflow_dispatch]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
java_version: [11]
|
||||
os: [ubuntu-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Java
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: ${{ matrix.java_version }}
|
||||
distribution: 'adopt'
|
||||
- name: Maven cache
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: maven-cache
|
||||
with:
|
||||
path:
|
||||
~/.m2
|
||||
key: build-${{ env.cache-name }}
|
||||
- name: h2
|
||||
run: mvn clean test
|
||||
- name: postgres
|
||||
run: mvn clean test -Dprops.file=testconfig/ebean-postgres.properties
|
||||
- name: mysql
|
||||
run: mvn clean test -Dprops.file=testconfig/ebean-mysql.properties
|
||||
- name: sqlserver 2019
|
||||
run: mvn clean test -Dprops.file=testconfig/ebean-sqlserver19.properties
|
||||
- name: sqlserver 2017
|
||||
run: mvn clean test -Dprops.file=testconfig/ebean-sqlserver17.properties
|
||||
- name: mariadb
|
||||
run: mvn clean test -Dprops.file=testconfig/ebean-mariadb.properties
|
||||
@@ -0,0 +1,38 @@
|
||||
|
||||
name: MySql
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '20 6 * * *'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
java_version: [11]
|
||||
os: [ubuntu-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Java
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: ${{ matrix.java_version }}
|
||||
distribution: 'adopt'
|
||||
- name: Maven cache
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: maven-cache
|
||||
with:
|
||||
path:
|
||||
~/.m2
|
||||
key: build-${{ env.cache-name }}
|
||||
- name: mysql
|
||||
run: mvn clean test -Dprops.file=testconfig/ebean-mysql.properties
|
||||
@@ -0,0 +1,38 @@
|
||||
|
||||
name: Postgres
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '10 6 * * *'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
java_version: [11]
|
||||
os: [ubuntu-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Java
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: ${{ matrix.java_version }}
|
||||
distribution: 'adopt'
|
||||
- name: Maven cache
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: maven-cache
|
||||
with:
|
||||
path:
|
||||
~/.m2
|
||||
key: build-${{ env.cache-name }}
|
||||
- name: postgres
|
||||
run: mvn clean test -Dprops.file=testconfig/ebean-postgres.properties
|
||||
@@ -0,0 +1,40 @@
|
||||
|
||||
name: SqlServer 2017 latest
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '10 7 * * 2,5'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
java_version: [11]
|
||||
os: [ubuntu-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Java
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: ${{ matrix.java_version }}
|
||||
distribution: 'adopt'
|
||||
- name: Maven cache
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: maven-cache
|
||||
with:
|
||||
path:
|
||||
~/.m2
|
||||
key: build-${{ env.cache-name }}
|
||||
# - name: sqlserver 2019 latest
|
||||
# run: mvn clean test -Dprops.file=testconfig/ebean-sqlserver.properties
|
||||
- name: sqlserver 2017 latest
|
||||
run: mvn clean test -Dprops.file=testconfig/ebean-sqlserver17.properties
|
||||
@@ -0,0 +1,35 @@
|
||||
|
||||
name: SqlServer 2019 latest
|
||||
|
||||
on: [workflow_dispatch]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
java_version: [11]
|
||||
os: [ubuntu-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Java
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: ${{ matrix.java_version }}
|
||||
distribution: 'adopt'
|
||||
- name: Maven cache
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: maven-cache
|
||||
with:
|
||||
path:
|
||||
~/.m2
|
||||
key: build-${{ env.cache-name }}
|
||||
- name: sqlserver 2019 latest
|
||||
run: mvn clean test -Dprops.file=testconfig/ebean-sqlserver19.properties
|
||||
@@ -1,5 +1,13 @@
|
||||
[](https://github.com/ebean-orm/ebean/actions/workflows/build.yml)
|
||||
[](https://maven-badges.herokuapp.com/maven-central/io.ebean/ebean)
|
||||
[](https://github.com/ebean-orm/ebean/blob/master/LICENSE)
|
||||
[](https://github.com/ebean-orm/ebean/actions/workflows/multi-jdk-build.yml)
|
||||
[](https://github.com/ebean-orm/ebean/actions/workflows/jdk-18-ea.yml)
|
||||
|
||||
[](https://github.com/ebean-orm/ebean/actions/workflows/postgres.yml)
|
||||
[](https://github.com/ebean-orm/ebean/actions/workflows/mysql.yml)
|
||||
[](https://github.com/ebean-orm/ebean/actions/workflows/mariadb-10.6.yml)
|
||||
[](https://github.com/ebean-orm/ebean/actions/workflows/sqlserver-2017-latest.yml)
|
||||
|
||||
# Sponsors
|
||||
<table>
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean api</name>
|
||||
@@ -27,7 +27,7 @@
|
||||
<dependency>
|
||||
<groupId>io.avaje</groupId>
|
||||
<artifactId>avaje-config</artifactId>
|
||||
<version>1.5</version>
|
||||
<version>1.7</version>
|
||||
</dependency>
|
||||
|
||||
<!--
|
||||
|
||||
@@ -378,7 +378,7 @@ public class PlatformConfig {
|
||||
BINARY(false, true, false),
|
||||
|
||||
/**
|
||||
* Store using DB BINARY(16).
|
||||
* Store using DB BINARY(16) with optimized packing.
|
||||
*/
|
||||
BINARY_OPTIMIZED(false, true, true);
|
||||
|
||||
|
||||
@@ -20,6 +20,8 @@ public class DB2Platform extends DatabasePlatform {
|
||||
public DB2Platform() {
|
||||
super();
|
||||
this.platform = Platform.DB2;
|
||||
// Note: DB2 (at least LUW supports length up to 128)
|
||||
// TOOD: Check if we need to introduce a new platform (DB2_LUW_11 ?)
|
||||
this.maxTableNameLength = 18;
|
||||
this.maxConstraintNameLength = 18;
|
||||
this.truncateTable = "truncate table %s reuse storage ignore delete triggers immediate";
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
package io.ebean.config.dbplatform.mariadb;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import io.ebean.BackgroundExecutor;
|
||||
import io.ebean.annotation.Platform;
|
||||
import io.ebean.config.dbplatform.PlatformIdGenerator;
|
||||
import io.ebean.config.dbplatform.mysql.BaseMySqlPlatform;
|
||||
|
||||
/**
|
||||
@@ -11,6 +15,14 @@ public class MariaDbPlatform extends BaseMySqlPlatform {
|
||||
public MariaDbPlatform() {
|
||||
super();
|
||||
this.platform = Platform.MARIADB;
|
||||
this.sequenceBatchMode = false;
|
||||
this.historySupport = new MariaDbHistorySupport();
|
||||
this.dbIdentity.setSupportsSequence(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlatformIdGenerator createSequenceIdGenerator(BackgroundExecutor be, DataSource ds, int stepSize, String seqName) {
|
||||
return new MariaDbSequence(be, ds, seqName, stepSize);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package io.ebean.config.dbplatform.mariadb;
|
||||
|
||||
import io.ebean.BackgroundExecutor;
|
||||
import io.ebean.config.dbplatform.SequenceStepIdGenerator;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
public class MariaDbSequence extends SequenceStepIdGenerator {
|
||||
|
||||
private final String nextSql;
|
||||
|
||||
/**
|
||||
* Construct where batchSize is the sequence step size.
|
||||
*/
|
||||
public MariaDbSequence(BackgroundExecutor be, DataSource ds, String seqName, int stepSize) {
|
||||
super(be, ds, seqName, stepSize);
|
||||
this.nextSql = "select next value for " + seqName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSql(int batchSize) {
|
||||
return nextSql;
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,7 @@ public class SQLitePlatform extends DatabasePlatform {
|
||||
this.dbDefaultValue.setFalse("0");
|
||||
this.dbDefaultValue.setTrue("1");
|
||||
this.dbDefaultValue.setNow("CURRENT_TIMESTAMP");
|
||||
this.supportsResultSetConcurrencyModeUpdatable = false;
|
||||
|
||||
dbTypeMap.put(DbType.BIT, new DbPlatformType("int"));
|
||||
dbTypeMap.put(DbType.BOOLEAN, new DbPlatformType("int"));
|
||||
|
||||
@@ -43,6 +43,12 @@ public interface BeanPersistRequest<T> {
|
||||
return transaction();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if this request is due to cascading persist.
|
||||
* False implies this is a "top level" request.
|
||||
*/
|
||||
boolean isCascade();
|
||||
|
||||
/**
|
||||
* For an update or delete of a partially populated bean this is the set of
|
||||
* loaded properties and otherwise returns null.
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
package io.ebean.plugin;
|
||||
|
||||
import io.ebean.bean.EntityBean;
|
||||
|
||||
/**
|
||||
* Errorhandler to handle load errors and may be recover correct value.
|
||||
*
|
||||
* @author Roland Praml, FOCONIS AG
|
||||
*
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface LoadErrorHandler {
|
||||
void handleLoadError(EntityBean bean, Property prop, String fullName, Exception e);
|
||||
}
|
||||
@@ -71,6 +71,20 @@ public class AnnotationUtil {
|
||||
return typeGet(clazz, annotation) != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if an element is annotated with an annotation of given type searching meta-annotations.
|
||||
*/
|
||||
public static boolean metaHas(AnnotatedElement element, Class<?> annotationType) {
|
||||
return !metaFindAll(element, annotationType).isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Find all the annotations of a given type searching meta-annotations.
|
||||
*/
|
||||
public static Set<Annotation> metaFindAll(AnnotatedElement element, Class<?> annotationType) {
|
||||
return metaFindAllFor(element, Collections.singleton(annotationType));
|
||||
}
|
||||
|
||||
/**
|
||||
* Find all the annotations for the filter searching meta-annotations.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</parent>
|
||||
<!-- <parent>-->
|
||||
<!-- <groupId>org.avaje</groupId>-->
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
<scm>
|
||||
<developerConnection>scm:git:git@github.com:ebean-orm/ebean.git</developerConnection>
|
||||
<tag>ebean-parent-12.13.1</tag>
|
||||
<tag>ebean-parent-12.14.0</tag>
|
||||
</scm>
|
||||
|
||||
<name>ebean autotune</name>
|
||||
@@ -26,7 +26,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
+15
-15
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean bom</name>
|
||||
@@ -71,88 +71,88 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-generator</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-externalmapping-api</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-externalmapping-xml</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-autotune</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>querybean-generator</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>kotlin-querybean-generator</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-postgis</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-redis</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
@@ -16,7 +16,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
+5
-5
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-core</artifactId>
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
<scm>
|
||||
<developerConnection>scm:git:git@github.com:ebean-orm/ebean.git</developerConnection>
|
||||
<tag>ebean-parent-12.13.1</tag>
|
||||
<tag>ebean-parent-12.14.0</tag>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
@@ -41,19 +41,19 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-externalmapping-api</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -213,6 +213,11 @@ public final class PersistRequestBean<T> extends PersistRequest implements BeanP
|
||||
return beanDescriptor.docStoreMode(type, txnMode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCascade() {
|
||||
return Flags.isRecurse(flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the draftDirty property should be set to true for this request.
|
||||
*/
|
||||
|
||||
@@ -333,6 +333,13 @@ public final class DefaultPersister implements Persister {
|
||||
* Recursively delete the bean. This calls back to the EbeanServer.
|
||||
*/
|
||||
private int deleteRecurse(EntityBean detailBean, Transaction t, DeleteMode deleteMode) {
|
||||
return deleteRequest(createDeleteCascade(detailBean, t, deleteMode.persistType()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete without being a cascade.
|
||||
*/
|
||||
private int delete(EntityBean detailBean, Transaction t, DeleteMode deleteMode) {
|
||||
return deleteRequest(createDeleteRequest(detailBean, t, deleteMode.persistType()));
|
||||
}
|
||||
|
||||
@@ -560,7 +567,7 @@ public final class DefaultPersister implements Persister {
|
||||
}
|
||||
}
|
||||
|
||||
private void deleteList(List<?> beanList, SpiTransaction t, DeleteMode deleteMode, boolean children) {
|
||||
private void deleteCascade(List<?> beanList, SpiTransaction t, DeleteMode deleteMode, boolean children) {
|
||||
if (children) {
|
||||
t.depth(-1);
|
||||
t.checkBatchEscalationOnCollection();
|
||||
@@ -604,7 +611,7 @@ public final class DefaultPersister implements Persister {
|
||||
for (Object id : ids) {
|
||||
EntityBean bean = descriptor.createEntityBean();
|
||||
descriptor.convertSetId(id, bean);
|
||||
int rowCount = deleteRecurse(bean, transaction, deleteMode);
|
||||
int rowCount = delete(bean, transaction, deleteMode);
|
||||
if (rowCount == -1) {
|
||||
total = -1;
|
||||
} else if (total != -1) {
|
||||
@@ -656,7 +663,7 @@ public final class DefaultPersister implements Persister {
|
||||
t.logSummary("-- DeleteById of " + descriptor.name() + " ids[" + idList + "] requires fetch of foreign key values");
|
||||
}
|
||||
List<?> beanList = server.findList(q, t);
|
||||
deleteList(beanList, t, deleteMode, false);
|
||||
deleteCascade(beanList, t, deleteMode, false);
|
||||
return beanList.size();
|
||||
|
||||
} else {
|
||||
@@ -994,6 +1001,8 @@ public final class DefaultPersister implements Persister {
|
||||
executeSqlUpdate(sqlDelete, t);
|
||||
|
||||
} else {
|
||||
// TODO: Review first checking if many property is loaded and using the loaded beans
|
||||
// ... and only using findIdsByParentId() when the many property isn't loaded
|
||||
// Delete recurse using the Id values of the children
|
||||
Object parentId = desc.getId(parentBean);
|
||||
List<Object> idsByParentId = many.findIdsByParentId(parentId, null, t, excludeDetailIds, deleteMode.isHard());
|
||||
@@ -1017,7 +1026,7 @@ public final class DefaultPersister implements Persister {
|
||||
for (Object id : childIds) {
|
||||
refList.add(targetDesc.createReference(id, null));
|
||||
}
|
||||
deleteList(refList, t, deleteMode, true);
|
||||
deleteCascade(refList, t, deleteMode, true);
|
||||
} else {
|
||||
// perform delete by statement if possible
|
||||
delete(targetDesc, null, childIds, t, deleteMode);
|
||||
@@ -1157,6 +1166,10 @@ public final class DefaultPersister implements Persister {
|
||||
return createDeleteRequest(bean, t, type, Flags.ZERO);
|
||||
}
|
||||
|
||||
private <T> PersistRequestBean<T> createDeleteCascade(EntityBean bean, Transaction t, Type type) {
|
||||
return createDeleteRequest(bean, t, type, Flags.RECURSE);
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
private <T> PersistRequestBean<T> createDeleteRequest(Object bean, Transaction t, PersistRequest.Type type, int flags) {
|
||||
BeanManager<T> mgr = beanManager(bean.getClass());
|
||||
@@ -1167,7 +1180,7 @@ public final class DefaultPersister implements Persister {
|
||||
type = Type.DELETE_SOFT;
|
||||
}
|
||||
|
||||
PersistRequestBean<T> request = new PersistRequestBean<>(server, (T)bean, null, mgr, (SpiTransaction) t, persistExecute, type, flags);
|
||||
PersistRequestBean<T> request = new PersistRequestBean<>(server, (T) bean, null, mgr, (SpiTransaction) t, persistExecute, type, flags);
|
||||
request.initForSoftDelete();
|
||||
return request;
|
||||
}
|
||||
@@ -1186,7 +1199,7 @@ public final class DefaultPersister implements Persister {
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private <T> BeanManager<T> beanManager(Class<?> cls) {
|
||||
BeanManager<T> mgr = (BeanManager<T>)beanDescriptorManager.beanManager(cls);
|
||||
BeanManager<T> mgr = (BeanManager<T>) beanDescriptorManager.beanManager(cls);
|
||||
if (mgr == null) {
|
||||
throw new PersistenceException(errNotRegistered(cls));
|
||||
}
|
||||
|
||||
@@ -736,6 +736,8 @@ final class CQueryBuilder {
|
||||
return " order by count(*) desc, r1.attribute_";
|
||||
case COUNT_DESC_ATTR_DESC:
|
||||
return " order by count(*) desc, r1.attribute_ desc";
|
||||
case NO_ORDERING:
|
||||
return "";
|
||||
default:
|
||||
throw new IllegalArgumentException("Illegal enum: " + orderBy);
|
||||
}
|
||||
|
||||
@@ -337,11 +337,10 @@ public final class DefaultTypeManager implements TypeManager {
|
||||
Type genericType = prop.getGenericType();
|
||||
boolean hasJacksonAnnotations = objectMapperPresent && checkJacksonAnnotations(prop);
|
||||
|
||||
boolean keepSource = prop.getMutationDetection() == MutationDetection.SOURCE;
|
||||
if (type.equals(List.class)) {
|
||||
DocPropertyType docType = getDocType(genericType);
|
||||
if (!hasJacksonAnnotations && isValueTypeSimple(genericType)) {
|
||||
return ScalarTypeJsonList.typeFor(postgres, dbType, docType, prop.isNullable(), keepSource);
|
||||
return ScalarTypeJsonList.typeFor(postgres, dbType, docType, prop.isNullable(), jsonManager.keepSource(prop));
|
||||
} else {
|
||||
return createJsonObjectMapperType(prop, dbType, docType);
|
||||
}
|
||||
@@ -349,14 +348,14 @@ public final class DefaultTypeManager implements TypeManager {
|
||||
if (type.equals(Set.class)) {
|
||||
DocPropertyType docType = getDocType(genericType);
|
||||
if (!hasJacksonAnnotations && isValueTypeSimple(genericType)) {
|
||||
return ScalarTypeJsonSet.typeFor(postgres, dbType, docType, prop.isNullable(), keepSource);
|
||||
return ScalarTypeJsonSet.typeFor(postgres, dbType, docType, prop.isNullable(), jsonManager.keepSource(prop));
|
||||
} else {
|
||||
return createJsonObjectMapperType(prop, dbType, docType);
|
||||
}
|
||||
}
|
||||
if (type.equals(Map.class)) {
|
||||
if (!hasJacksonAnnotations && isMapValueTypeObject(genericType)) {
|
||||
return ScalarTypeJsonMap.typeFor(postgres, dbType, keepSource);
|
||||
return ScalarTypeJsonMap.typeFor(postgres, dbType, jsonManager.keepSource(prop));
|
||||
} else {
|
||||
return createJsonObjectMapperType(prop, dbType, DocPropertyType.OBJECT);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import io.ebean.ModifyAwareType;
|
||||
import io.ebean.annotation.MutationDetection;
|
||||
import io.ebean.config.dbplatform.DbPlatformType;
|
||||
import io.ebeaninternal.server.deploy.meta.DeployBeanProperty;
|
||||
|
||||
final class TypeJsonManager {
|
||||
|
||||
@@ -25,6 +26,17 @@ final class TypeJsonManager {
|
||||
return objectMapper;
|
||||
}
|
||||
|
||||
boolean keepSource(DeployBeanProperty prop) {
|
||||
if (prop.getMutationDetection() == MutationDetection.SOURCE) {
|
||||
return true;
|
||||
} else if (prop.getMutationDetection() == MutationDetection.DEFAULT) {
|
||||
prop.setMutationDetection(mutationDetection);
|
||||
return mutationDetection == MutationDetection.SOURCE;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
String postgresType(int dbType) {
|
||||
if (postgres) {
|
||||
switch (dbType) {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean ddl generation</name>
|
||||
@@ -28,14 +28,14 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
+5
@@ -14,6 +14,7 @@ class ClickHouseDbArray {
|
||||
mapping.put("varchar[]", "Array(String)");
|
||||
mapping.put("integer[]", "Array(UInt32)");
|
||||
mapping.put("bigint[]", "Array(UInt64)");
|
||||
mapping.put("float[]", "Array(Float32)");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -21,6 +22,10 @@ class ClickHouseDbArray {
|
||||
*/
|
||||
static String logicalToNative(String logicalArrayType) {
|
||||
int colonPos = logicalArrayType.indexOf(':');
|
||||
int bracketPos = logicalArrayType.indexOf('(');
|
||||
if (bracketPos > -1 && (bracketPos < colonPos || colonPos == -1)) {
|
||||
colonPos = bracketPos;
|
||||
}
|
||||
if (colonPos > -1) {
|
||||
logicalArrayType = logicalArrayType.substring(0, colonPos);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean external mapping api</name>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</parent>
|
||||
<!-- <parent>-->
|
||||
<!-- <groupId>org.avaje</groupId>-->
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
<scm>
|
||||
<developerConnection>scm:git:git@github.com:ebean-orm/ebean.git</developerConnection>
|
||||
<tag>ebean-parent-12.13.1</tag>
|
||||
<tag>ebean-parent-12.14.0</tag>
|
||||
</scm>
|
||||
|
||||
<name>ebean external mapping xml</name>
|
||||
@@ -33,7 +33,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-externalmapping-api</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -59,14 +59,14 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-generator</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
<?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">
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>12.14.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>ebean-kotlin</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<ebean-maven-plugin.version>12.13.0</ebean-maven-plugin.version>
|
||||
<kotlin.version>1.6.0</kotlin.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-stdlib-jdk8</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>12.14.0-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- test dependencies -->
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-test</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.avaje</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>1.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>12.14.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
<build>
|
||||
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
|
||||
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-maven-plugin</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
<configuration>
|
||||
<jvmTarget>1.8</jvmTarget>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>compile</id>
|
||||
<goals>
|
||||
<goal>compile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>test-compile</id>
|
||||
<goals>
|
||||
<goal>test-compile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>io.repaint.maven</groupId>
|
||||
<artifactId>tiles-maven-plugin</artifactId>
|
||||
<version>2.24</version>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<tiles>
|
||||
<tile>io.ebean.tile:enhancement:12.13.1</tile>
|
||||
</tiles>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,18 @@
|
||||
package org.example.domain
|
||||
|
||||
import io.ebean.Model
|
||||
import javax.persistence.Entity
|
||||
import javax.persistence.Id
|
||||
import javax.persistence.Version
|
||||
|
||||
@Entity
|
||||
class FooEntity(name: String) : Model() {
|
||||
|
||||
@Id
|
||||
var id: Long = 0
|
||||
|
||||
var name: String = name
|
||||
|
||||
@Version
|
||||
var version: Long = 0
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package org.example.domain
|
||||
|
||||
import io.ebean.DB
|
||||
import org.assertj.core.api.Assertions.assertThat
|
||||
import org.junit.jupiter.api.Test
|
||||
|
||||
class FooEntityTest {
|
||||
|
||||
@Test
|
||||
fun iud() {
|
||||
|
||||
val foo = FooEntity("hello")
|
||||
foo.save()
|
||||
|
||||
val found = DB.find(FooEntity::class.java, foo.id)
|
||||
assertThat(found).isNotNull
|
||||
|
||||
found?.delete()
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
ebean:
|
||||
test:
|
||||
platform: h2
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean postgis</name>
|
||||
@@ -23,7 +23,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean querybean</name>
|
||||
@@ -17,7 +17,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -56,21 +56,21 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-generator</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>querybean-generator</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
+7
-7
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-redis</artifactId>
|
||||
@@ -16,41 +16,41 @@
|
||||
<dependency>
|
||||
<groupId>redis.clients</groupId>
|
||||
<artifactId>jedis</artifactId>
|
||||
<version>3.6.3</version>
|
||||
<version>3.8.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>querybean-generator</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
+37
-21
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean test</name>
|
||||
@@ -29,14 +29,14 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-generator</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -56,7 +56,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test-docker</artifactId>
|
||||
<version>4.2</version>
|
||||
<version>4.3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -187,15 +187,46 @@
|
||||
|
||||
<dependency>
|
||||
<groupId>com.oracle.database.jdbc</groupId>
|
||||
<artifactId>ojdbc10</artifactId>
|
||||
<!-- Note: Using ojdbc10 here will affect loading other drivers on jdk8,
|
||||
because the driverManager will stop on first load error and stops loading
|
||||
other drivers -->
|
||||
<artifactId>ojdbc8</artifactId>
|
||||
<version>19.12.0.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.ibm.db2</groupId>
|
||||
<artifactId>jcc</artifactId>
|
||||
<version>11.5.6.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.xerial</groupId>
|
||||
<artifactId>sqlite-jdbc</artifactId>
|
||||
<version>3.36.0.3</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.nuodb.jdbc</groupId>
|
||||
<artifactId>nuodb-jdbc</artifactId>
|
||||
<version>22.0.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>ru.yandex.clickhouse</groupId>
|
||||
<artifactId>clickhouse-jdbc</artifactId>
|
||||
<version>0.3.1-patch</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
<version>1.2.3</version>
|
||||
<version>1.2.9</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -208,21 +239,6 @@
|
||||
|
||||
</dependencies>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>db2</id>
|
||||
<dependencies>
|
||||
<!-- https://mvnrepository.com/artifact/com.ibm.db2/jcc -->
|
||||
<dependency>
|
||||
<groupId>com.ibm.db2</groupId>
|
||||
<artifactId>jcc</artifactId>
|
||||
<version>11.5.5.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package io.ebean.test.config.platform;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
class Db2Setup implements PlatformSetup {
|
||||
|
||||
@Override
|
||||
public Properties setup(Config config) {
|
||||
|
||||
config.ddlMode("dropCreate");
|
||||
config.setDefaultPort(50000);
|
||||
config.setUsernameDefault();
|
||||
config.setPasswordDefault();
|
||||
config.setUrl("jdbc:db2://localhost:${port}/${databaseName}");
|
||||
config.setDriver("com.ibm.db2.jcc.DB2Driver");
|
||||
config.datasourceDefaults();
|
||||
|
||||
return dockerProperties(config);
|
||||
}
|
||||
|
||||
private Properties dockerProperties(Config dbConfig) {
|
||||
|
||||
if (!dbConfig.isUseDocker()) {
|
||||
return new Properties();
|
||||
}
|
||||
|
||||
dbConfig.setDockerVersion("11.5.6.0a");
|
||||
return dbConfig.getDockerProperties();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setupExtraDbDataSource(Config config) {
|
||||
// not supported yet
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLocal() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -34,6 +34,7 @@ public class PlatformAutoConfig {
|
||||
KNOWN_PLATFORMS.put("clickhouse", new ClickHouseSetup());
|
||||
KNOWN_PLATFORMS.put("cockroach", new CockroachSetup());
|
||||
KNOWN_PLATFORMS.put("hana", new HanaSetup());
|
||||
KNOWN_PLATFORMS.put("db2", new Db2Setup());
|
||||
}
|
||||
|
||||
private final DatabaseConfig config;
|
||||
|
||||
@@ -13,7 +13,7 @@ class SqlServerSetup implements PlatformSetup {
|
||||
config.setDefaultPort(1433);
|
||||
config.setUsernameDefault();
|
||||
config.setPassword("SqlS3rv#r");
|
||||
config.setUrl("jdbc:sqlserver://localhost:${port};databaseName=${databaseName}");
|
||||
config.setUrl("jdbc:sqlserver://localhost:${port};databaseName=${databaseName};sendTimeAsDateTime=false");
|
||||
config.setDriver("com.microsoft.sqlserver.jdbc.SQLServerDriver");
|
||||
config.datasourceDefaults();
|
||||
|
||||
|
||||
+14
-7
@@ -5,25 +5,32 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class BasicProfileLocationTest {
|
||||
class BasicProfileLocationTest {
|
||||
|
||||
@Test
|
||||
public void obtain() {
|
||||
void obtain() {
|
||||
|
||||
DProfileLocation loc = new DTimedProfileLocation(12, "foo", MetricFactory.get().createTimedMetric("junk"));
|
||||
|
||||
String javaVersion = System.getProperty("java.version");
|
||||
assertThat(loc.obtain()).isTrue();
|
||||
assertThat(loc.fullLocation()).endsWith(":12)");
|
||||
if (System.getProperty("java.version").startsWith("1.8")) {
|
||||
if (javaVersion.startsWith("1.8")) {
|
||||
assertThat(loc.fullLocation()).endsWith("invoke0(Native Method:12)");
|
||||
assertThat(loc.location()).isEqualTo("sun.reflect.NativeMethodAccessorImpl.invoke0");
|
||||
assertThat(loc.label()).isEqualTo("NativeMethodAccessorImpl.invoke0");
|
||||
} else if (javaVersion.startsWith("18")){
|
||||
assertThat(loc.fullLocation()).endsWith("jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)");
|
||||
assertThat(loc.location()).isEqualTo("java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke");
|
||||
assertThat(loc.label()).isEqualTo("DirectMethodHandleAccessor.invoke");
|
||||
} else {
|
||||
assertThat(loc.fullLocation()).endsWith("jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method:12)");
|
||||
assertThat(loc.location()).isEqualTo("java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0");
|
||||
assertThat(loc.label()).isEqualTo("NativeMethodAccessorImpl.invoke0");
|
||||
}
|
||||
assertThat(loc.label()).isEqualTo("NativeMethodAccessorImpl.invoke0");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void basic_trimPackage() {
|
||||
void basic_trimPackage() {
|
||||
|
||||
BasicProfileLocation loc = new BasicProfileLocation("com.foo.Bar.all");
|
||||
assertThat(loc.obtain()).isFalse();
|
||||
@@ -33,7 +40,7 @@ public class BasicProfileLocationTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void basic_trimSinglePackage() {
|
||||
void basic_trimSinglePackage() {
|
||||
|
||||
BasicProfileLocation loc = new BasicProfileLocation("foo.Bar.all");
|
||||
assertThat(loc.obtain()).isFalse();
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package main;
|
||||
|
||||
import io.ebean.docker.commands.Db2Config;
|
||||
import io.ebean.docker.commands.Db2Container;
|
||||
|
||||
public class StartDb2 {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
Db2Config config = new Db2Config("11.5.6.0a");
|
||||
config.setDbName("unit");
|
||||
config.setUser("unit");
|
||||
config.setPassword("unit");
|
||||
|
||||
// to change collation, charset and other parameters like pagesize:
|
||||
config.setCreateOptions("USING CODESET UTF-8 TERRITORY DE COLLATE USING IDENTITY PAGESIZE 32768");
|
||||
config.setConfigOptions("USING STRING_UNITS CODEUNITS32");
|
||||
|
||||
Db2Container container = new Db2Container(config);
|
||||
container.startWithDropCreate();
|
||||
}
|
||||
}
|
||||
@@ -13,13 +13,12 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
public class TestLoadBeanCache extends BaseTestCase {
|
||||
class TestLoadBeanCache extends BaseTestCase {
|
||||
|
||||
@Test
|
||||
public void testLoad() {
|
||||
void testLoad() {
|
||||
|
||||
ResetBasicData.reset();
|
||||
|
||||
@@ -35,32 +34,29 @@ public class TestLoadBeanCache extends BaseTestCase {
|
||||
// this will hit the cache
|
||||
Country nz = DB.find(Country.class, "NZ");
|
||||
|
||||
assertTrue(loadedNz == nz);
|
||||
assertSame(loadedNz, nz);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testLoadWithFindMap() {
|
||||
void testLoadWithFindMap() {
|
||||
|
||||
ResetBasicData.reset();
|
||||
|
||||
|
||||
List<Object> ids = DB.find(Customer.class).findIds();
|
||||
assertEquals(ids.size(), 4);
|
||||
assertThat(ids).isNotEmpty();
|
||||
|
||||
DB.getDefault().pluginApi().cacheManager().clearAll();
|
||||
|
||||
|
||||
// hit database
|
||||
LoggedSql.start();
|
||||
DB.find(Customer.class).where().idIn(ids).findMap();
|
||||
List<String> sql = LoggedSql.stop();
|
||||
assertThat(sql).hasSize(1);
|
||||
|
||||
|
||||
// hit beanCache
|
||||
LoggedSql.start();
|
||||
DB.find(Customer.class).where().idIn(ids).findMap();
|
||||
sql = LoggedSql.stop();
|
||||
assertThat(sql).hasSize(0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -5,13 +5,16 @@ import io.ebean.BaseTestCase;
|
||||
import io.ebean.DB;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.tests.model.basic.TWithPreInsert;
|
||||
import org.tests.model.basic.TWithPreInsertChild;
|
||||
import org.tests.model.basic.event.TWithPreInsertPersistAdapter;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
|
||||
public class TestPreInsertValidation extends BaseTestCase {
|
||||
class TestPreInsertValidation extends BaseTestCase {
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
void test() {
|
||||
|
||||
TWithPreInsert e = new TWithPreInsert();
|
||||
e.setTitle("Mister");
|
||||
@@ -22,15 +25,56 @@ public class TestPreInsertValidation extends BaseTestCase {
|
||||
// the save worked and name set in preInsert
|
||||
assertNotNull(e.getId());
|
||||
assertNotNull(e.getName());
|
||||
assertThat(e.requestCascadeState()).isEqualTo(2);
|
||||
|
||||
TWithPreInsert e1 = DB.find(TWithPreInsert.class, e.getId());
|
||||
assert e1 != null;
|
||||
|
||||
e1.setTitle("Missus");
|
||||
DB.save(e1);
|
||||
|
||||
assertThat(e1.requestCascadeState()).isEqualTo(12);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStatelessUpdate() {
|
||||
void test_cascade() {
|
||||
|
||||
TWithPreInsert e = new TWithPreInsert();
|
||||
e.setTitle("ParentCascading");
|
||||
e.children().add(new TWithPreInsertChild("Child0"));
|
||||
// the perInsert should populate the
|
||||
// name with should not be null
|
||||
DB.save(e);
|
||||
|
||||
// the save worked and name set in preInsert
|
||||
assertNotNull(e.getId());
|
||||
assertNotNull(e.getName());
|
||||
assertThat(e.requestCascadeState()).isEqualTo(2);
|
||||
assertThat(e.children().get(0).requestCascadeState()).isEqualTo(1);
|
||||
|
||||
TWithPreInsert e1 = DB.find(TWithPreInsert.class, e.getId());
|
||||
assert e1 != null;
|
||||
|
||||
e1.setTitle("ParentCascading-changed");
|
||||
TWithPreInsertChild childBean = e1.children().get(0);
|
||||
childBean.setName("Child0-changed");
|
||||
DB.save(e1);
|
||||
|
||||
assertThat(e1.requestCascadeState()).isEqualTo(12);
|
||||
assertThat(childBean.requestCascadeState()).isEqualTo(11);
|
||||
|
||||
DB.delete(e1);
|
||||
|
||||
assertThat(e1.requestCascadeState()).isEqualTo(22);
|
||||
|
||||
// assert that isCascade() was true for the child bean
|
||||
assertThat(TWithPreInsertPersistAdapter.cascadeDelete).hasSize(1);
|
||||
String deleteCascade = TWithPreInsertPersistAdapter.cascadeDelete.get(0);
|
||||
assertThat(deleteCascade).isEqualTo("class org.tests.model.basic.TWithPreInsertChild:1");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testStatelessUpdate() {
|
||||
|
||||
TWithPreInsert e = new TWithPreInsert();
|
||||
e.setName("BeanForUpdateTest");
|
||||
|
||||
@@ -14,6 +14,8 @@ import org.tests.idkeys.db.GenKeySeqB;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.junit.jupiter.api.Assumptions.assumeTrue;
|
||||
@@ -24,6 +26,7 @@ public class TestGeneratedKeys extends BaseTestCase {
|
||||
@ForPlatform(Platform.H2) // readSequenceValue is H2 specific
|
||||
public void testGenKeySeqA() throws SQLException {
|
||||
assumeTrue(idType() == IdType.SEQUENCE);
|
||||
|
||||
SpiEbeanServer server = spiEbeanServer();
|
||||
|
||||
try (Transaction tx = server.beginTransaction()) {
|
||||
@@ -69,20 +72,34 @@ public class TestGeneratedKeys extends BaseTestCase {
|
||||
}
|
||||
|
||||
private long readSequenceValue(Transaction tx, String sequence) throws SQLException {
|
||||
Statement stm = null;
|
||||
try {
|
||||
stm = tx.connection().createStatement();
|
||||
ResultSet rs = stm.executeQuery("select currval('" + sequence + "')");
|
||||
rs.next();
|
||||
String sql;
|
||||
switch (spiEbeanServer().databasePlatform().getPlatform().base()) {
|
||||
case H2 :
|
||||
sql = "select currval('" + sequence + "')";
|
||||
break;
|
||||
|
||||
case DB2 :
|
||||
sql = "values previous value for " + sequence;
|
||||
|
||||
break;
|
||||
case SQLSERVER :
|
||||
sql = "select current_value from sys.sequences where name = '" + sequence + "'";
|
||||
break;
|
||||
|
||||
case MARIADB :
|
||||
throw new UnsupportedOperationException("reading sequence value outside of the current connection is not supported. "
|
||||
+ "See https://mariadb.com/kb/en/previous-value-for-sequence_name/#description");
|
||||
|
||||
default :
|
||||
throw new UnsupportedOperationException("reading sequence value from "
|
||||
+ spiEbeanServer().databasePlatform().getPlatform()
|
||||
+ " is not supported.");
|
||||
|
||||
}
|
||||
try (Statement stm = tx.connection().createStatement()) {
|
||||
ResultSet rs = stm.executeQuery(sql);
|
||||
rs.next();
|
||||
return rs.getLong(1);
|
||||
} finally {
|
||||
if (stm != null) {
|
||||
try {
|
||||
stm.close();
|
||||
} catch (SQLException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,5 +126,25 @@ public class TestGeneratedKeys extends BaseTestCase {
|
||||
assertNotNull(al.getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@ForPlatform({Platform.H2, Platform.MARIADB, Platform.SQLSERVER, Platform.DB2})
|
||||
public void testGeneratedKeys() throws SQLException {
|
||||
assumeTrue(idType() == IdType.SEQUENCE);
|
||||
|
||||
SpiEbeanServer server = spiEbeanServer();
|
||||
List<Long> idList = new ArrayList<>(52);
|
||||
|
||||
try (Transaction tx = server.beginTransaction()) {
|
||||
// bigger than increment
|
||||
for (int i = 1; i < 52; i++) {
|
||||
GenKeySeqA gks = new GenKeySeqA();
|
||||
gks.setDescription("my description " + i);
|
||||
server.save(gks);
|
||||
assertFalse(idList.contains(gks.getId()));
|
||||
idList.add(gks.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
package org.tests.json;
|
||||
|
||||
import io.ebean.Database;
|
||||
import io.ebean.DatabaseFactory;
|
||||
import io.ebean.ValuePair;
|
||||
import io.ebean.annotation.ForPlatform;
|
||||
import io.ebean.annotation.MutationDetection;
|
||||
import io.ebean.annotation.Platform;
|
||||
import io.ebean.config.DatabaseConfig;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.tests.model.json.EBasicJsonList;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
class TestJsonSourceDefault {
|
||||
|
||||
@Test
|
||||
@ForPlatform(Platform.H2)
|
||||
@Disabled
|
||||
void testDirtyValues_diffSource() {
|
||||
DatabaseConfig config = new DatabaseConfig();
|
||||
config.getDataSourceConfig()
|
||||
.setUsername("sa")
|
||||
.setPassword("")
|
||||
.setUrl("jdbc:h2:mem:testJsonSourceDirtyValues");
|
||||
|
||||
config.setName("jsonSource");
|
||||
config.setDefaultServer(false);
|
||||
config.setRegister(false);
|
||||
config.setDdlGenerate(true);
|
||||
config.setDdlRun(true);
|
||||
config.setDdlExtra(false);
|
||||
config.addClass(EBasicJsonList.class);
|
||||
config.setJsonMutationDetection(MutationDetection.SOURCE);
|
||||
Database db = DatabaseFactory.create(config);
|
||||
try {
|
||||
assertThat(db).isNotNull();
|
||||
|
||||
EBasicJsonList bean = new EBasicJsonList();
|
||||
bean.getTags().add("aa");
|
||||
bean.getTags().add("bb");
|
||||
|
||||
db.save(bean);
|
||||
bean = db.find(EBasicJsonList.class, bean.getId());
|
||||
|
||||
bean.getTags().add("cc");
|
||||
final Map<String, ValuePair> dirtyValues = db.beanState(bean).dirtyValues();
|
||||
assertThat(dirtyValues).containsOnlyKeys("tags");
|
||||
|
||||
final ValuePair diff = dirtyValues.get("tags");
|
||||
assertThat(diff.getOldValue()).isInstanceOf(List.class).asList().containsExactly("aa", "bb");
|
||||
assertThat(diff.getNewValue()).isInstanceOf(List.class).asList().containsExactly("aa", "bb", "cc");
|
||||
} finally {
|
||||
if (db != null) {
|
||||
db.shutdown();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,10 +2,15 @@ package org.tests.model.basic;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static javax.persistence.CascadeType.ALL;
|
||||
|
||||
@Entity
|
||||
public class TWithPreInsert {
|
||||
public class TWithPreInsert implements TWithPreInsertCommon {
|
||||
|
||||
@Id
|
||||
private Integer id;
|
||||
@@ -15,6 +20,14 @@ public class TWithPreInsert {
|
||||
|
||||
private String title;
|
||||
|
||||
@OneToMany(cascade = ALL)
|
||||
private List<TWithPreInsertChild> children = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* For testing what happened in persist controller.
|
||||
*/
|
||||
transient int requestCascadeState;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -39,4 +52,15 @@ public class TWithPreInsert {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public List<TWithPreInsertChild> children() {
|
||||
return children;
|
||||
}
|
||||
|
||||
public int requestCascadeState() {
|
||||
return requestCascadeState;
|
||||
}
|
||||
|
||||
public void requestCascadeState(int requestCascadeState) {
|
||||
this.requestCascadeState = requestCascadeState;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package org.tests.model.basic;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Entity
|
||||
public class TWithPreInsertChild implements TWithPreInsertCommon {
|
||||
|
||||
@Id
|
||||
private Integer id;
|
||||
|
||||
@NotNull
|
||||
private String name;
|
||||
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* For testing what happened in persist controller.
|
||||
*/
|
||||
transient int requestCascadeState;
|
||||
|
||||
public TWithPreInsertChild(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public int requestCascadeState() {
|
||||
return requestCascadeState;
|
||||
}
|
||||
|
||||
public void requestCascadeState(int requestCascadeState) {
|
||||
this.requestCascadeState = requestCascadeState;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.tests.model.basic;
|
||||
|
||||
public interface TWithPreInsertCommon {
|
||||
|
||||
Integer getId();
|
||||
|
||||
String getName();
|
||||
|
||||
void setName(String name);
|
||||
|
||||
String getTitle();
|
||||
|
||||
void setTitle(String title);
|
||||
|
||||
void requestCascadeState(int requestCascadeState);
|
||||
}
|
||||
+26
-14
@@ -2,37 +2,49 @@ package org.tests.model.basic.event;
|
||||
|
||||
import io.ebean.event.BeanPersistAdapter;
|
||||
import io.ebean.event.BeanPersistRequest;
|
||||
import org.tests.model.basic.TWithPreInsert;
|
||||
import org.tests.model.basic.TWithPreInsertCommon;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TWithPreInsertPersistAdapter extends BeanPersistAdapter {
|
||||
|
||||
public static List<String> cascadeDelete = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public boolean isRegisterFor(Class<?> cls) {
|
||||
return TWithPreInsert.class.equals(cls);
|
||||
return TWithPreInsertCommon.class.isAssignableFrom(cls);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean preInsert(BeanPersistRequest<?> request) {
|
||||
|
||||
TWithPreInsert e = (TWithPreInsert) request.bean();
|
||||
if (e.getName() == null) {
|
||||
e.setName("set on preInsert");
|
||||
TWithPreInsertCommon bean = (TWithPreInsertCommon) request.bean();
|
||||
if (bean.getName() == null) {
|
||||
bean.setName("set on preInsert");
|
||||
}
|
||||
bean.requestCascadeState(request.isCascade() ? 1 : 2);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean preUpdate(BeanPersistRequest<?> request) {
|
||||
|
||||
TWithPreInsert b = (TWithPreInsert) request.bean();
|
||||
System.out.println("preUpdate - title is: " + b.getTitle());
|
||||
if (b.getTitle() == null) {
|
||||
b.setTitle("set on preUpdate");
|
||||
TWithPreInsertCommon bean = (TWithPreInsertCommon) request.bean();
|
||||
System.out.println("preUpdate - title is: " + bean.getTitle());
|
||||
if (bean.getTitle() == null) {
|
||||
bean.setTitle("set on preUpdate");
|
||||
}
|
||||
// request.getEbeanServer().refresh(b);
|
||||
// System.out.println("title is Mister:"+b.getTitle());
|
||||
|
||||
bean.requestCascadeState(request.isCascade() ? 11 : 12);
|
||||
return super.preUpdate(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean preDelete(BeanPersistRequest<?> request) {
|
||||
TWithPreInsertCommon bean = (TWithPreInsertCommon) request.bean();
|
||||
if (request.isCascade()) {
|
||||
cascadeDelete.add(bean.getClass() + ":" + bean.getId());
|
||||
} else {
|
||||
bean.requestCascadeState(22);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -646,6 +646,14 @@ public class TestQuerySingleAttribute extends BaseTestCase {
|
||||
.findSingleAttributeList();
|
||||
assertThat(list1.get(0)).isInstanceOf(CountedValue.class);
|
||||
//assertThat(list1.toString()).isEqualTo("[1: Tracy, 3: Jim1, 1: Jack, 3: Fred1, 1: Fiona, 3: Bugs1]");
|
||||
|
||||
query = DB.find(Contact.class).select("firstName");
|
||||
list1 = query
|
||||
.setCountDistinct(CountDistinctOrder.NO_ORDERING)
|
||||
.findSingleAttributeList();
|
||||
assertThat(list1.get(0)).isInstanceOf(CountedValue.class);
|
||||
assertThat(sqlOf(query)).contains("select r1.attribute_, count(*) from ("
|
||||
+ "select t0.first_name as attribute_ from contact t0");
|
||||
|
||||
query = DB.find(Contact.class).select("firstName");
|
||||
list1 = query
|
||||
|
||||
@@ -181,9 +181,9 @@ datasource.nuodb.password=test
|
||||
datasource.nuodb.url=jdbc:com.nuodb://localhost/testdb
|
||||
#datasource.nuodb.driver=com.nuodb.jdbc.Driver
|
||||
|
||||
datasource.db2.username=db2admin
|
||||
datasource.db2.password=veryverysecret#1234
|
||||
datasource.db2.url=jdbc:db2://127.0.0.1:50000/SAMPLE
|
||||
datasource.db2.username=unit
|
||||
datasource.db2.password=test
|
||||
datasource.db2.url=jdbc:db2://127.0.0.1:50000/unit
|
||||
#datasource.db2.driver=com.ibm.db2.jcc.DB2Driver
|
||||
|
||||
datasource.hana.username=EBEAN_TEST
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
ebean.test.platform=clickhouse
|
||||
ebean.test.dbName=clickhouse
|
||||
datasource.default=clickhouse
|
||||
datasource.clickhouse.autocommit=true
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
ebean.test.platform=cockroach
|
||||
ebean.test.dbName=unit
|
||||
datasource.default=cockroach
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
ebean.test.platform=db2
|
||||
ebean.test.dbName=unit
|
||||
ebean.test.dbPassword=unit
|
||||
datasource.default=db2-11
|
||||
@@ -0,0 +1,3 @@
|
||||
ebean.test.platform=h2
|
||||
datasource.default=h2-local
|
||||
ebean.test.dbName=test
|
||||
@@ -0,0 +1,8 @@
|
||||
# This starts an alternative mariadb version on port 7306
|
||||
ebean.test.platform=mariadb
|
||||
ebean.test.dbName=test_ebean
|
||||
ebean.test.dbPassword=unit
|
||||
ebean.test.mariadb.version=10.3
|
||||
ebean.test.mariadb.containerName=ut_mariadb-10-3
|
||||
ebean.test.mariadb.port=14308
|
||||
datasource.default=mariadb-103
|
||||
@@ -0,0 +1,6 @@
|
||||
ebean.test.platform=mariadb
|
||||
ebean.test.dbName=test_ebean
|
||||
ebean.test.mariadb.version=10.6
|
||||
ebean.test.mariadb.containerName=ut_mariadb-10-6
|
||||
ebean.test.mariadb.port=14307
|
||||
datasource.default=mariadb-106
|
||||
@@ -0,0 +1,6 @@
|
||||
# this starts a mysql instance on port 13306
|
||||
ebean.test.platform=mysql
|
||||
ebean.test.dbName=test_ebean
|
||||
# note: do not conflict with mariadb port
|
||||
#ebean.test.mysql.port=4306
|
||||
datasource.default=mysql-docker
|
||||
@@ -0,0 +1,3 @@
|
||||
ebean.test.platform=nuodb
|
||||
ebean.test.dbName=testdb
|
||||
ebean.test.nuodb.version=latest
|
||||
@@ -0,0 +1,3 @@
|
||||
ebean.test.platform=oracle
|
||||
ebean.test.dbName=oracle
|
||||
datasource.default=oracle-docker
|
||||
@@ -0,0 +1,3 @@
|
||||
ebean.test.platform=postgres
|
||||
datasource.default=postgres
|
||||
ebean.test.dbName=unit
|
||||
@@ -0,0 +1,4 @@
|
||||
ebean.test.platform=sqlite
|
||||
datasource.default=sqlite-local
|
||||
ebean.test.dbName=test.sqlite
|
||||
ebean.autoReadOnlyDataSource=false
|
||||
@@ -0,0 +1,10 @@
|
||||
ebean.test.platform=sqlserver
|
||||
ebean.test.dbName=test_ebean
|
||||
ebean.test.sqlserver.version=2017-latest
|
||||
ebean.test.sqlserver.containerName=local_sqlserver2017
|
||||
ebean.test.sqlserver.collation=LATIN1_GENERAL_100_CS_AS_SC
|
||||
ebean.test.sqlserver.port=9435
|
||||
ebean.test.sqlserver.url=jdbc:sqlserver://localhost:9435;databaseName=test_ebean;sendTimeAsDateTime=false
|
||||
|
||||
datasource.default=sqlserver2017
|
||||
ebean.sqlserver2017.databasePlatformName=sqlserver17
|
||||
@@ -0,0 +1,13 @@
|
||||
ebean.test.platform=sqlserver
|
||||
ebean.test.dbName=test_ebean
|
||||
ebean.test.sqlserver.version=2019-latest
|
||||
ebean.test.sqlserver.containerName=local_sqlserver2019
|
||||
ebean.test.sqlserver.collation=LATIN1_GENERAL_100_CS_AS_SC_UTF8
|
||||
ebean.test.sqlserver.port=9434
|
||||
ebean.test.sqlserver.url=jdbc:sqlserver://localhost:9434;databaseName=test_ebean;sendTimeAsDateTime=false
|
||||
datasource.default=sqlserver2019
|
||||
ebean.sqlserver2019.databasePlatformName=sqlserver17
|
||||
|
||||
## A case sensitive collation example:
|
||||
#ebean.test.sqlserver.collation=LATIN1_GENERAL_100_CI_AS_SC_UTF8
|
||||
#ebean.sqlserver2019.caseSensitiveCollation=false
|
||||
+4
-4
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</parent>
|
||||
|
||||
<name>ebean composite</name>
|
||||
@@ -22,20 +22,20 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Technically optional but most expected to use query beans -->
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
+13
-136
@@ -24,145 +24,22 @@ your run configuration:
|
||||
Platform Tests
|
||||
==============
|
||||
|
||||
By default, the `h2` platform is used. To test a different platform, add
|
||||
`-Ddatasource.default=xxx` to your maven command or JVM arguments.
|
||||
|
||||
'h2' platform
|
||||
-------------
|
||||
|
||||
Reqires no setup
|
||||
|
||||
run: `mvn clean test`
|
||||
|
||||
Current status: PASS
|
||||
Tests run: 1986, Failures: 0, Errors: 0, Skipped: 16
|
||||
|
||||
'pg' platform
|
||||
-------------
|
||||
|
||||
Reqirements
|
||||
- a locally installed PostgreSQL server with PostGis.
|
||||
- Create a user "unit" with password "unit" and a database "unit"
|
||||
- Give the user all permissions to that db
|
||||
|
||||
run: `mvn clean test -Ddatasource.default=pg`
|
||||
|
||||
Current status: PASS
|
||||
Tests run: 2166, Failures: 0, Errors: 0, Skipped: 25
|
||||
By default, the `h2` platform is used. To test a different platform, you can change the
|
||||
`datasource.default` in the `ebean.properties` file.
|
||||
|
||||
|
||||
Docker
|
||||
------
|
||||
Ebean 12 provides preconfigured docker containers now. To start a docker container,
|
||||
you can use the starters in `src/test/java/main` or specify one of the starter
|
||||
properties in the `testconfig` directory with `-Dprops.file=testconfig/ebean-XXX.properties`
|
||||
|
||||
'mysql' platform
|
||||
-------------
|
||||
Note: You will have to install docker on your system.
|
||||
- For debian, you can use `apt install docker.io`
|
||||
- For windows, install docker for windows https://docs.docker.com/desktop/windows/install/
|
||||
|
||||
Reqirements
|
||||
- a locally installed MySQL server.
|
||||
- Create a user "unit" with password "unit" and a database "unit"
|
||||
- Give the user all permissions to that db
|
||||
|
||||
run: `mvn clean test -Ddatasource.default=mysql`
|
||||
|
||||
Current status: PASS
|
||||
Tests run: 2166, Failures: 0, Errors: 0, Skipped: 33
|
||||
|
||||
|
||||
|
||||
'sqlserver' platform
|
||||
--------------------
|
||||
|
||||
Reqires an installed sqlserver - e.g. https://hub.docker.com/r/microsoft/mssql-server-linux/
|
||||
|
||||
- Create a user "ebean" with password "ebean" and a database "ebean_unittest"
|
||||
- Adjust the connection string and/or username in ebean.properties
|
||||
|
||||
run: `mvn clean test -Ddatasource.default=mssql`
|
||||
|
||||
Current status: PASS
|
||||
Tests run: 2166, Failures: 0, Errors: 0, Skipped: 39
|
||||
|
||||
|
||||
|
||||
'oracle' platform
|
||||
-----------------
|
||||
|
||||
Reqires a locally installed Oracle server.
|
||||
- Create a user "unit" with password "unit" with all permissions
|
||||
- The test wirtes directly to the "xe" SID - so do not use a productive server!
|
||||
- As the Oracle JDBC driver is only available on an oracle repository,
|
||||
you need a special maven setup as described [here](http://docs.oracle.com/middleware/1213/core/MAVEN/config_maven_repo.htm#MAVEN9010)
|
||||
|
||||
run: `mvn clean test -Ddatasource.default=ora -Poracle`
|
||||
|
||||
Current status: FAIL
|
||||
Tests run: 1986, Failures: 17, Errors: 34, Skipped: 16
|
||||
|
||||
|
||||
|
||||
'db2' platform
|
||||
--------------
|
||||
|
||||
Reqires a locally installed DB2 Express-C server.
|
||||
- Create a user "unit" with password "unit" with all permissions
|
||||
- Install the db2jcc4 driver (see pom.xml)
|
||||
|
||||
run: `mvn clean test -Ddatasource.default=db2 -Pdb2`
|
||||
|
||||
Current status: FAIL
|
||||
Tests run: 2166, Failures: 29, Errors: 58, Skipped: 30
|
||||
|
||||
|
||||
'sqlite' platform
|
||||
-----------------
|
||||
|
||||
Reqires no setup
|
||||
|
||||
run: `mvn clean test -Ddatasource.default=sqlite`
|
||||
|
||||
Current status: FAIL
|
||||
Tests run: 1986, Failures: 24, Errors: 86, Skipped: 16
|
||||
|
||||
After some time, the db locks up, every test takes 3 seconds and fails with
|
||||
"the database file is locked"
|
||||
|
||||
|
||||
|
||||
'hsqldb' platform
|
||||
-----------------
|
||||
|
||||
Reqires no setup
|
||||
|
||||
run: `mvn clean test -Ddatasource.default=hsqldb`
|
||||
|
||||
Current status: FAIL
|
||||
Tests run: 1980, Failures: 3, Errors: 657, Skipped: 16
|
||||
|
||||
|
||||
@Rob FYI
|
||||
The problem is https://sourceforge.net/p/hsqldb/bugs/1364/
|
||||
In `InsertHandler.getPstmt` the `meta.getIdentityDbColumns()` contains
|
||||
'id' in lowercase. Changing that to uppercase gives me this result:
|
||||
`Tests run: 1986, Failures: 2, Errors: 18, Skipped: 16`
|
||||
(as quick hack I added temporary a toUpperCase to BindableIdScalar.getIdentityColumn)
|
||||
|
||||
|
||||
'sqlanywhere' platform
|
||||
----------------------
|
||||
|
||||
TODO: not yet tested
|
||||
|
||||
|
||||
|
||||
'hana' platform
|
||||
--------------------
|
||||
|
||||
Requires an installed SAP HANA server - e.g. https://store.docker.com/images/sap-hana-express-edition
|
||||
|
||||
- Create a user `EBEAN_TEST` with password `Eb3an_test` in the tenant database `HXE`
|
||||
- Adjust the connection string and/or username in `ebean.properties`
|
||||
|
||||
run: `mvn clean test -Ddatasource.default=hana`
|
||||
|
||||
Current status: PASS
|
||||
Tests run: 2486, Failures: 0, Errors: 0, Skipped: 84
|
||||
Maven
|
||||
-----
|
||||
|
||||
Use the `-Dprops.file` parameter to start the test cases for a certain platform.
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</parent>
|
||||
|
||||
<name>kotlin querybean generator</name>
|
||||
@@ -12,7 +12,7 @@
|
||||
<artifactId>kotlin-querybean-generator</artifactId>
|
||||
|
||||
<properties>
|
||||
<kotlin.version>1.5.30-M1</kotlin.version>
|
||||
<kotlin.version>1.6.0</kotlin.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -29,7 +29,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-querybean</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-ddl-generator</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
<annotationProcessorPath>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>kotlin-querybean-generator</artifactId>
|
||||
<version>12.8.2</version>
|
||||
<version>12.13.0</version>
|
||||
</annotationProcessorPath>
|
||||
</annotationProcessorPaths>
|
||||
</configuration>
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
<parent>
|
||||
<groupId>org.avaje</groupId>
|
||||
<artifactId>java8-oss</artifactId>
|
||||
<version>3.2</version>
|
||||
<version>3.3</version>
|
||||
</parent>
|
||||
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>ebean parent</name>
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
<scm>
|
||||
<developerConnection>scm:git:git@github.com:ebean-orm/ebean.git</developerConnection>
|
||||
<tag>ebean-parent-12.13.1</tag>
|
||||
<tag>ebean-parent-12.14.0</tag>
|
||||
</scm>
|
||||
|
||||
<licenses>
|
||||
@@ -61,7 +61,7 @@
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
<version>1.2.3</version>
|
||||
<version>1.2.9</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -90,8 +90,25 @@
|
||||
<module>ebean-querybean</module>
|
||||
<module>ebean-postgis</module>
|
||||
<module>ebean-redis</module>
|
||||
<!-- <module>tests</module>-->
|
||||
<!-- <module>ebean-kotlin</module>-->
|
||||
|
||||
</modules>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>release</id>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>default</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<modules>
|
||||
<module>ebean-kotlin</module>
|
||||
<module>tests</module>
|
||||
</modules>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
</project>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>12.13.1</version>
|
||||
<version>12.14.0</version>
|
||||
</parent>
|
||||
|
||||
<name>querybean generator</name>
|
||||
|
||||
+21
-6
@@ -5,6 +5,7 @@
|
||||
<groupId>org.avaje</groupId>
|
||||
<artifactId>java8-oss</artifactId>
|
||||
<version>2.3</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
|
||||
<groupId>io.ebean</groupId>
|
||||
@@ -19,11 +20,25 @@
|
||||
<maven.deploy.skip>true</maven.deploy.skip>
|
||||
</properties>
|
||||
|
||||
<modules>
|
||||
<!-- test-java16 REQUIRES JDK 16 to run -->
|
||||
<!-- <module>test-java16</module>-->
|
||||
<!-- test-kotlin does NOT run with JDK 16!! -->
|
||||
<module>test-kotlin</module>
|
||||
</modules>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>jdk16plus</id>
|
||||
<activation>
|
||||
<jdk>[16,20]</jdk>
|
||||
</activation>
|
||||
<modules>
|
||||
<module>test-java16</module>
|
||||
</modules>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>jdk15less</id>
|
||||
<activation>
|
||||
<jdk>[8,15]</jdk>
|
||||
</activation>
|
||||
<modules>
|
||||
<module>test-kotlin</module>
|
||||
</modules>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -20,19 +20,19 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean</artifactId>
|
||||
<version>12.13.0-SNAPSHOT</version>
|
||||
<version>12.14.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
<version>1.2.3</version>
|
||||
<version>1.2.9</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>12.13.0-SNAPSHOT</version>
|
||||
<version>12.14.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
<path>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>querybean-generator</artifactId>
|
||||
<version>12.13.0-SNAPSHOT</version>
|
||||
<version>12.14.0-SNAPSHOT</version>
|
||||
</path>
|
||||
</annotationProcessorPaths>
|
||||
</configuration>
|
||||
|
||||
@@ -7,9 +7,10 @@
|
||||
<groupId>org.avaje</groupId>
|
||||
<artifactId>java11-oss</artifactId>
|
||||
<version>2.3</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
|
||||
<name>kotlin test</name>
|
||||
<name>test-kotlin</name>
|
||||
<description>Kotlin specific tests</description>
|
||||
<artifactId>test-kotlin</artifactId>
|
||||
<version>1.0</version>
|
||||
@@ -19,7 +20,7 @@
|
||||
<maven.compiler.target>11</maven.compiler.target>
|
||||
|
||||
<ebean-maven-plugin.version>12.13.0</ebean-maven-plugin.version>
|
||||
<kotlin.version>1.5.31</kotlin.version>
|
||||
<kotlin.version>1.6.0</kotlin.version>
|
||||
<jackson.version>2.12.1</jackson.version>
|
||||
<maven.deploy.skip>true</maven.deploy.skip>
|
||||
</properties>
|
||||
@@ -35,21 +36,21 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-test</artifactId>
|
||||
<version>12.13.0-SNAPSHOT</version>
|
||||
<version>12.14.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core</artifactId>
|
||||
<version>12.13.0-SNAPSHOT</version>
|
||||
<version>12.14.0-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
<version>1.2.3</version>
|
||||
<version>1.2.9</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user