Compare commits

..
Author SHA1 Message Date
Rob Bygrave 75f0a6815f [maven-release-plugin] prepare release ebean-parent-13.0.0 2022-03-31 14:17:03 +13:00
Rob Bygrave a473c20b24 Bump to 13.0.0-SNAPSHOT 2022-03-31 14:07:32 +13:00
Rob Bygrave 540b414443 Bump to 13.0.0-SNAPSHOT 2022-03-31 14:07:00 +13:00
Rob Bygrave 7dca282eb6 Bump to 13.0.0-SNAPSHOT 2022-03-31 14:04:54 +13:00
Rob BygraveandGitHub de905ccd60 Merge pull request #2622 from ebean-orm/feature/java11-module-path
#2374 - Bump to Java 11 and module-path
2022-03-31 10:13:26 +13:00
Rob Bygrave aa2490cfb4 EA build - remove valhalla due to javadoc error
javadoc: error - The code being documented uses packages in the unnamed module, but the packages defined in https://ebean.io/platforms/ebean-platform-h2/apidocs/ are in named modules.
2022-03-31 09:57:55 +13:00
Rob Bygrave 587d673684 Adding requires com.fasterxml.jackson.annotation and ebean-test needs jupiter as provided scope
Interesting these changes are required for compilation against Java 11, not required for Java 17+.
2022-03-31 09:17:22 +13:00
Rob Bygrave 472db65ac6 Adding requires io.avaje.classpath.scanner; 2022-03-31 09:00:16 +13:00
Rob Bygrave 64e4e674ac ebean-core - Adding requires static com.fasterxml.jackson.annotation; 2022-03-31 08:51:51 +13:00
Rob Bygrave 24d8f38b1d #2374 - Bump to Java 11 and module-path 2022-03-31 08:42:14 +13:00
Rob Bygrave 79be375f54 Modify GH workflows to not build against Java 8, Java 11+ now 2022-03-30 19:04:49 +13:00
Rob BygraveandGitHub e95eae4ee6 Merge pull request #2621 from ebean-orm/feature/platform-modules-2
Refactor extract separate modules for each platform from ebean-api dbplatform
2022-03-30 19:01:22 +13:00
Rob Bygrave e71e16c1ee Refactor extract separate modules for each platform from ebean-api dbplatform 2022-03-30 17:11:36 +13:00
Rob Bygrave 514bba4130 bump versions in test modules after release 2022-03-29 23:04:31 +13:00
Rob Bygrave d31aa2b24c [maven-release-plugin] prepare for next development iteration 2022-03-29 22:49:50 +13:00
Rob Bygrave d834817dc2 [maven-release-plugin] prepare release ebean-parent-12.16.1 2022-03-29 22:49:42 +13:00
Rob Bygrave 4cad515110 #2619 - Lack of setNullParameter() functionality on io.ebean.SqlQuery interface 2022-03-29 22:41:36 +13:00
Rob Bygrave aa89df5f00 Merge branch 'master' of github.com:ebean-orm/ebean 2022-03-29 22:10:54 +13:00
Rob Bygrave 29f7375468 Bump ebean-agent to 12.16.1 2022-03-29 22:10:40 +13:00
Rob BygraveandGitHub 3e4d7c9b5a Merge pull request #2617 from FOCONIS/json-update-existing
ENH: JsonContext accepts a bean as target
2022-03-29 08:38:29 +13:00
Rob BygraveandGitHub fa34c39d92 Merge pull request #2615 from FOCONIS/tidy-code
Tidy, remove unused imports - Suggested changes (no code change)
2022-03-29 08:28:20 +13:00
Roland Praml ffeb630e7e JsonContext accepts a bean as target 2022-03-28 15:38:44 +02:00
Roland Praml 7666775d1a Suggested changes (no code change) 2022-03-28 14:39:12 +02:00
Rob Bygrave f95212eeb3 #2613 - Bump ebean-migration to 12.16.1 2022-03-28 14:36:10 +13:00
Rob Bygrave 5c3b680c8a #2612 - Incorrect DDL generation for MySql on history tables that use quoted identifiers 2022-03-28 13:05:59 +13:00
Rob Bygrave c8bb3c7b57 Fix test ebean-redis ClusterTest such that it allows for background thread sync to redis 2022-03-28 09:23:55 +13:00
Rob Bygrave dcd3bfee4c Fix test ConfigTest such that it doesn't set the RunOnceMarker
When tests are run using for example -Dprops.file=testconfig/ebean-postgres.properties ... then we want ebean-test AutoConfigureForTesting to run and setup the default datasource appropriately. If ConfigTest runs before that then it sets the RunOnceMarker and the default datasource isn't adjusted
2022-03-28 09:12:13 +13:00
Rob Bygrave b85bb5f459 Refactor tests, move some unit tests to ebean-api 2022-03-27 20:31:17 +13:00
Rob Bygrave 426d314e63 Refactor tests, move internal type tests to ebean-core 2022-03-27 20:20:35 +13:00
Rob Bygrave e3e5414157 Refactor tests, move some internal expression tests to ebean-core 2022-03-27 19:55:34 +13:00
Rob Bygrave 28088a5e54 Refactor tests, move some internal deploy tests to ebean-core 2022-03-27 17:44:43 +13:00
Rob Bygrave 2acdf2f4bf Refactor tests, move some internal core tests to ebean-core 2022-03-27 17:06:52 +13:00
Rob Bygrave 785a027dd6 Refactor tests, move some cache tests to ebean-core 2022-03-27 16:49:28 +13:00
Rob Bygrave 88005dbe09 Refactor tests, move changelog tests 2022-03-25 18:44:24 +13:00
Rob Bygrave 88acd8190a Refactor tests, move db migration tests 2022-03-25 18:23:23 +13:00
Rob Bygrave 72963bc9fb Refactor tests, move DbPrimaryTest to ebean-api 2022-03-25 18:07:29 +13:00
Rob BygraveandGitHub 6a552cd7d1 Merge pull request #2610 from FOCONIS/remove-unused-imports
No effective code change: Removed unused imports
2022-03-24 22:53:56 +13:00
Roland Praml c40b9738d1 No effective code change: Removed unused imports 2022-03-24 09:23:39 +01:00
Rob Bygrave 84a64f9640 Refactor tests, move BaseTestCase and annotations @ForPlatform @IgnorePlatform 2022-03-24 18:52:37 +13:00
Rob Bygrave e4c06432a0 Move some more unit tests from ebean-test back to ebean-core 2022-03-24 18:48:59 +13:00
Rob Bygrave f58d6038c7 Move some unit tests from ebean-test back to ebean-core 2022-03-24 18:21:48 +13:00
Rob Bygrave f270c52c00 Bump maven-compiler-plugin 2022-03-24 16:58:41 +13:00
Rob Bygrave e6ea85a193 #2609 - Fix module-info export io.ebean.config.dbplatform.yugabyte 2022-03-24 16:51:18 +13:00
Rob Bygrave 17f408681c No functional change - final methods on internal RsetDataReader 2022-03-24 12:01:22 +13:00
Rob Bygrave fcf6f5f384 No effective change - typo in javadoc 2022-03-24 11:32:50 +13:00
Rob Bygrave d98c49e266 Update test generated db2 index migration files 2022-03-23 22:31:32 +13:00
Rob Bygrave 79213e7194 Merge branch 'master' of github.com:ebean-orm/ebean 2022-03-23 22:29:16 +13:00
Rob Bygrave bc1f7040da Merge branch 'FOCONIS-tmp-tablespace' 2022-03-23 22:27:44 +13:00
Rob Bygrave f157c2da7f Merge branch 'tmp-tablespace' of https://github.com/FOCONIS/ebean into FOCONIS-tmp-tablespace 2022-03-23 22:27:17 +13:00
Rob BygraveandGitHub 33b18fb837 Merge pull request #2607 from FOCONIS/some-todos
DDL: Support schema in history entities and ignore case in DB2 procedures
2022-03-23 16:46:31 +13:00
Rob BygraveandGitHub 1f8a6b0668 Update README.md 2022-03-23 13:16:17 +13:00
Rob BygraveandGitHub 85a971323a Update early access build badges 2022-03-23 13:10:57 +13:00
Rob Bygrave f1b626a182 Merge branch 'master' of github.com:ebean-orm/ebean 2022-03-23 13:00:44 +13:00
Rob Bygrave cc043316ee Update EA build name 2022-03-23 13:00:30 +13:00
Rob BygraveandGitHub c656436d09 Update README.md 2022-03-23 12:31:22 +13:00
Roland Praml 250e66819b Reference scripts 2022-03-22 17:05:04 +01:00
Roland Praml 3e4cc3b3d6 Add tablespace support for DB2 2022-03-22 17:03:38 +01:00
Roland Praml f1950d479e Added testcase with upper and lower case characters 2022-03-22 10:43:34 +01:00
Roland Praml 00686fcccf DB2: ignore case in "drop if exists" checks 2022-03-22 09:58:20 +01:00
Roland Praml 4fe8ef2b23 Support schema in history-entities 2022-03-22 09:42:19 +01:00
Rob Bygrave baddc76961 Refactor tidy grammar in server/expression classes 2022-03-22 16:48:47 +13:00
Rob Bygrave de4140aaac #2600 - Pending drops migration with the same version of the target migration cause trouble 2022-03-22 16:20:06 +13:00
Rob BygraveandGitHub 66aa772f4a Merge pull request #2603 from FOCONIS/remove-lowertablename
Refactored DDL generation to correctly handle quoted identifiers
2022-03-22 09:02:42 +13:00
Rob BygraveandGitHub f745cfaab3 Merge pull request #2604 from FOCONIS/remove-lowertablename2
Remove LowerTableName
2022-03-22 08:38:14 +13:00
Roland Praml 8640b4a1a0 Fix: Check if pendingDrops are used correctly 2022-03-21 15:20:41 +01:00
Roland Praml 5e87706055 Fix: check newTable for history flag 2022-03-21 15:05:29 +01:00
Roland Praml 0d765d6583 Reference scripts 2022-03-21 15:02:06 +01:00
Roland Praml 2a924d8d32 Add more quotes, for history tables 2022-03-21 15:01:43 +01:00
Roland Praml 04d2a20945 Add testcase, that uses all kinds of reserved keywords 2022-03-21 13:48:48 +01:00
Roland Praml 4077d906d1 ADD: Support for quoted identifiers 2022-03-21 13:34:29 +01:00
Roland Praml 7e3fbbba62 Refactor: use normalized table names for history 2022-03-21 11:52:00 +01:00
Roland Praml 3db9a17c6a Refactored DbTriggerBasedHistory: always use historyTableName 2022-03-21 11:15:13 +01:00
Roland Praml 327babbfa2 Reference scripts 2022-03-21 11:08:54 +01:00
Roland Praml 0a1acb3f9b Fix: DB2-History table must be an exact copy 2022-03-21 11:08:41 +01:00
Roland Praml a2e27b9e00 fixed test case 2022-03-21 11:02:14 +01:00
Roland Praml a8ad93823a Removed 'lowerTableName' and 'lowerColumnName' 2022-03-18 08:56:43 +01:00
Rob Bygrave 5eb790e54d Merge branch 'master' of github.com:ebean-orm/ebean 2022-03-18 11:08:29 +13:00
Rob Bygrave c44ae96e09 Add badge to README for JDK EA 2022-03-18 11:08:11 +13:00
Rob BygraveandGitHub d540bf4d16 Merge pull request #2601 from FOCONIS/ddl-refactor9
Extended @Column support for DB2
2022-03-18 09:25:56 +13:00
Roland Praml ab6f5daec3 FIX LargeValueInsert-Test for DB2 2022-03-17 13:26:54 +01:00
Roland Praml d7a7ef097b Reference scripts 2022-03-17 13:14:11 +01:00
Roland Praml 8f746196ab Support for extra colum options for DB2 2022-03-17 13:11:48 +01:00
Roland Praml eb1ed0bdd0 DbColumDefault must be returned although if individual columnDefinition is specified (cases no DDL change)
We support optional platform columnDefinitions now. E.g. "db2;clob(64M);" - so we must not ignore @DbDefault for all other platforms
2022-03-17 13:07:52 +01:00
Roland Praml 37ab71cb7c Reference scripts 2022-03-17 13:03:55 +01:00
Roland Praml 74720a840d DbMigration: Do only real type changes 2022-03-17 13:01:25 +01:00
Rob Bygrave 923f83cafb Bump after release to 12.16.1-SNAPSHOT 2022-03-17 21:37:56 +13:00
Rob Bygrave 2faaf5f186 [maven-release-plugin] prepare for next development iteration 2022-03-16 22:49:23 +13:00
1412 changed files with 12673 additions and 3999 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java_version: [8]
java_version: [11]
os: [ubuntu-latest]
steps:
+4 -2
View File
@@ -1,5 +1,5 @@
name: JDK EA
name: ebean EA
on:
workflow_dispatch:
@@ -16,7 +16,9 @@ jobs:
strategy:
fail-fast: false
matrix:
java_version: [17,18,19,loom,valhalla,metropolis,panama]
## valhalla - failing on javadoc with:
## javadoc: error - The code being documented uses packages in the unnamed module, but the packages defined in https://ebean.io/platforms/ebean-platform-h2/apidocs/ are in named modules.
java_version: [17,18,19,loom,metropolis,panama]
os: [ubuntu-latest]
steps:
+1 -1
View File
@@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java_version: [8.0.192, 8, 11.0.3, 11, 17]
java_version: [11, 17]
os: [ubuntu-latest]
steps:
+14 -5
View File
@@ -11,6 +11,15 @@
[![SqlServer](https://github.com/ebean-orm/ebean/actions/workflows/sqlserver.yml/badge.svg)](https://github.com/ebean-orm/ebean/actions/workflows/sqlserver.yml)
[![Yugabyte](https://github.com/ebean-orm/ebean/actions/workflows/yugabyte.yml/badge.svg)](https://github.com/ebean-orm/ebean/actions/workflows/yugabyte.yml)
#### Builds against EA (Early Access) versions of Java (19, Loom, panama etc)
[![ebean EA](https://github.com/ebean-orm/ebean/actions/workflows/jdk-ea.yml/badge.svg)](https://github.com/ebean-orm/ebean/actions/workflows/jdk-ea.yml)
[![datasource EA](https://github.com/ebean-orm/ebean-datasource/actions/workflows/jdk-ea.yml/badge.svg)](https://github.com/ebean-orm/ebean-datasource/actions/workflows/jdk-ea.yml)
[![migration EA](https://github.com/ebean-orm/ebean-migration/actions/workflows/jdk-ea.yml/badge.svg)](https://github.com/ebean-orm/ebean-migration/actions/workflows/jdk-ea.yml)
[![test-docker EA](https://github.com/ebean-orm/ebean-test-docker/actions/workflows/jdk-ea.yml/badge.svg)](https://github.com/ebean-orm/ebean-test-docker/actions/workflows/jdk-ea.yml)
# Sponsors
<table>
<tbody>
@@ -39,15 +48,15 @@
</tbody>
</table>
# Need help?
## Need help?
Post questions or issues to the Ebean google group - https://groups.google.com/forum/#!forum/ebean
# Documentation
## Documentation
Goto [https://ebean.io/docs/](https://ebean.io/docs/)
## Maven central links:
[Maven central - ebean](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22io.ebean%22%20AND%20a%3A%22ebean%22 "maven central ebean")
## Maven central
[Maven central - io.ebean](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22io.ebean%22%20)
[Maven central - all related projects](http://search.maven.org/#search%7Cga%7C1%7Cebean "maven central all related projects")
+53
View File
@@ -0,0 +1,53 @@
<?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>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.0.0</version>
</parent>
<name>ebean-clickhouse</name>
<description>ebean-clickhouse composite</description>
<artifactId>ebean-clickhouse</artifactId>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-datasource</artifactId>
<version>${ebean-datasource.version}</version>
</dependency>
<!-- Technically optional but most expected to use query beans -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-clickhouse</artifactId>
<version>13.0.0</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.0.0</tag>
</scm>
</project>
@@ -0,0 +1,7 @@
package io.ebean.clickhouse.assembly;
/**
* Nothing interesting here - required placeholder for javadoc.
*/
public class Assembly {
}
@@ -0,0 +1,9 @@
module io.ebean.clickhouse {
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.clickhouse;
}
+53
View File
@@ -0,0 +1,53 @@
<?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>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.0.0</version>
</parent>
<name>ebean-cockroach</name>
<description>ebean-cockroach composite</description>
<artifactId>ebean-cockroach</artifactId>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-datasource</artifactId>
<version>${ebean-datasource.version}</version>
</dependency>
<!-- Technically optional but most expected to use query beans -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>13.0.0</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.0.0</tag>
</scm>
</project>
@@ -0,0 +1,7 @@
package io.ebean.cockroach.assembly;
/**
* Nothing interesting here - required placeholder for javadoc.
*/
public class Assembly {
}
@@ -0,0 +1,9 @@
module io.ebean.cockroach {
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;
}
+53
View File
@@ -0,0 +1,53 @@
<?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>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.0.0</version>
</parent>
<name>ebean-db2</name>
<description>ebean-db2 composite</description>
<artifactId>ebean-db2</artifactId>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-datasource</artifactId>
<version>${ebean-datasource.version}</version>
</dependency>
<!-- Technically optional but most expected to use query beans -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-db2</artifactId>
<version>13.0.0</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.0.0</tag>
</scm>
</project>
@@ -0,0 +1,7 @@
package io.ebean.db2.assembly;
/**
* Nothing interesting here - required placeholder for javadoc.
*/
public class Assembly {
}
@@ -0,0 +1,9 @@
module io.ebean.db2 {
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.db2;
}
+53
View File
@@ -0,0 +1,53 @@
<?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>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.0.0</version>
</parent>
<name>ebean-h2</name>
<description>ebean-h2 composite</description>
<artifactId>ebean-h2</artifactId>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-datasource</artifactId>
<version>${ebean-datasource.version}</version>
</dependency>
<!-- Technically optional but most expected to use query beans -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-h2</artifactId>
<version>13.0.0</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.0.0</tag>
</scm>
</project>
@@ -0,0 +1,7 @@
package io.ebean.h2.assembly;
/**
* Nothing interesting here - required placeholder for javadoc.
*/
public class Assembly {
}
@@ -0,0 +1,9 @@
module io.ebean.h2 {
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.h2;
}
+53
View File
@@ -0,0 +1,53 @@
<?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>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.0.0</version>
</parent>
<name>ebean-hana</name>
<description>ebean-hana composite</description>
<artifactId>ebean-hana</artifactId>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-datasource</artifactId>
<version>${ebean-datasource.version}</version>
</dependency>
<!-- Technically optional but most expected to use query beans -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-hana</artifactId>
<version>13.0.0</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.0.0</tag>
</scm>
</project>
@@ -0,0 +1,7 @@
package io.ebean.hana.assembly;
/**
* Nothing interesting here - required placeholder for javadoc.
*/
public class Assembly {
}
@@ -0,0 +1,9 @@
module io.ebean.hana {
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.hana;
}
+53
View File
@@ -0,0 +1,53 @@
<?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>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.0.0</version>
</parent>
<name>ebean-mariadb</name>
<description>ebean-mariadb composite</description>
<artifactId>ebean-mariadb</artifactId>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-datasource</artifactId>
<version>${ebean-datasource.version}</version>
</dependency>
<!-- Technically optional but most expected to use query beans -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-mariadb</artifactId>
<version>13.0.0</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.0.0</tag>
</scm>
</project>
@@ -0,0 +1,7 @@
package io.ebean.mariadb.assembly;
/**
* Nothing interesting here - required placeholder for javadoc.
*/
public class Assembly {
}
@@ -0,0 +1,9 @@
module io.ebean.mariadb {
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.mariadb;
}
+53
View File
@@ -0,0 +1,53 @@
<?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>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.0.0</version>
</parent>
<name>ebean-mysql</name>
<description>ebean-mysql composite</description>
<artifactId>ebean-mysql</artifactId>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-datasource</artifactId>
<version>${ebean-datasource.version}</version>
</dependency>
<!-- Technically optional but most expected to use query beans -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-mysql</artifactId>
<version>13.0.0</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.0.0</tag>
</scm>
</project>
@@ -0,0 +1,7 @@
package io.ebean.mysql.assembly;
/**
* Nothing interesting here - required placeholder for javadoc.
*/
public class Assembly {
}
@@ -0,0 +1,9 @@
module io.ebean.mysql {
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.mysql;
}
+53
View File
@@ -0,0 +1,53 @@
<?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>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.0.0</version>
</parent>
<name>ebean-nuodb</name>
<description>ebean-nuodb composite</description>
<artifactId>ebean-nuodb</artifactId>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-datasource</artifactId>
<version>${ebean-datasource.version}</version>
</dependency>
<!-- Technically optional but most expected to use query beans -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-nuodb</artifactId>
<version>13.0.0</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.0.0</tag>
</scm>
</project>
@@ -0,0 +1,7 @@
package io.ebean.nuodb.assembly;
/**
* Nothing interesting here - required placeholder for javadoc.
*/
public class Assembly {
}
@@ -0,0 +1,9 @@
module io.ebean.nuodb {
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.nuodb;
}
+53
View File
@@ -0,0 +1,53 @@
<?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>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.0.0</version>
</parent>
<name>ebean-oracle</name>
<description>ebean-oracle composite</description>
<artifactId>ebean-oracle</artifactId>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-datasource</artifactId>
<version>${ebean-datasource.version}</version>
</dependency>
<!-- Technically optional but most expected to use query beans -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-oracle</artifactId>
<version>13.0.0</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.0.0</tag>
</scm>
</project>
@@ -0,0 +1,7 @@
package io.ebean.oracle.assembly;
/**
* Nothing interesting here - required placeholder for javadoc.
*/
public class Assembly {
}
@@ -0,0 +1,9 @@
module io.ebean.oracle {
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.oracle;
}
+53
View File
@@ -0,0 +1,53 @@
<?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>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.0.0</version>
</parent>
<name>ebean-postgres</name>
<description>ebean-postgres composite</description>
<artifactId>ebean-postgres</artifactId>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-datasource</artifactId>
<version>${ebean-datasource.version}</version>
</dependency>
<!-- Technically optional but most expected to use query beans -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>13.0.0</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.0.0</tag>
</scm>
</project>
@@ -0,0 +1,7 @@
package io.ebean.postgres.assembly;
/**
* Nothing interesting here - required placeholder for javadoc.
*/
public class Assembly {
}
@@ -0,0 +1,9 @@
module io.ebean.postgres {
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;
}
+53
View File
@@ -0,0 +1,53 @@
<?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>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.0.0</version>
</parent>
<name>ebean-sqlite</name>
<description>ebean-sqlite composite</description>
<artifactId>ebean-sqlite</artifactId>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-datasource</artifactId>
<version>${ebean-datasource.version}</version>
</dependency>
<!-- Technically optional but most expected to use query beans -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-sqlite</artifactId>
<version>13.0.0</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.0.0</tag>
</scm>
</project>
@@ -0,0 +1,7 @@
package io.ebean.sqlite.assembly;
/**
* Nothing interesting here - required placeholder for javadoc.
*/
public class Assembly {
}
@@ -0,0 +1,9 @@
module io.ebean.sqlite {
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.sqlite;
}
+53
View File
@@ -0,0 +1,53 @@
<?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>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.0.0</version>
</parent>
<name>ebean-sqlserver</name>
<description>ebean-sqlserver composite</description>
<artifactId>ebean-sqlserver</artifactId>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-datasource</artifactId>
<version>${ebean-datasource.version}</version>
</dependency>
<!-- Technically optional but most expected to use query beans -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-sqlserver</artifactId>
<version>13.0.0</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.0.0</tag>
</scm>
</project>
@@ -0,0 +1,7 @@
package io.ebean.sqlserver.assembly;
/**
* Nothing interesting here - required placeholder for javadoc.
*/
public class Assembly {
}
@@ -0,0 +1,9 @@
module io.ebean.sqlserver {
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.sqlserver;
}
+53
View File
@@ -0,0 +1,53 @@
<?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>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.0.0</version>
</parent>
<name>ebean-yugabyte</name>
<description>ebean-yugabyte composite</description>
<artifactId>ebean-yugabyte</artifactId>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-datasource</artifactId>
<version>${ebean-datasource.version}</version>
</dependency>
<!-- Technically optional but most expected to use query beans -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>13.0.0</version>
</dependency>
</dependencies>
<scm>
<tag>ebean-parent-13.0.0</tag>
</scm>
</project>
@@ -0,0 +1,7 @@
package io.ebean.yugabyte.assembly;
/**
* Nothing interesting here - required placeholder for javadoc.
*/
public class Assembly {
}
@@ -0,0 +1,9 @@
module io.ebean.yugabyte {
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;
}
+27 -32
View File
@@ -2,57 +2,52 @@
<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>
<artifactId>composites</artifactId>
<groupId>io.ebean</groupId>
<version>12.16.0</version>
<version>13.0.0</version>
</parent>
<name>ebean composite</name>
<description>Composite of common runtime dependencies</description>
<name>ebean (all platforms)</name>
<description>composite of common runtime dependencies for all platforms</description>
<artifactId>ebean</artifactId>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.0.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-api</artifactId>
<version>12.16.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>12.16.0</version>
</dependency>
<!-- Technically optional but most expected to use query beans -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>12.16.0</version>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-all</artifactId>
<version>13.0.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.24</version>
<extensions>true</extensions>
<configuration>
<tiles>
<tile>io.avaje.tile:moditech-module:1.0</tile>
</tiles>
</configuration>
</plugin>
</plugins>
</build>
<scm>
<tag>ebean-parent-13.0.0</tag>
</scm>
</project>
@@ -2,6 +2,7 @@ module io.ebean {
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.all;
}
+32
View File
@@ -0,0 +1,32 @@
<?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>13.0.0</version>
</parent>
<artifactId>composites</artifactId>
<packaging>pom</packaging>
<modules>
<module>ebean</module>
<module>ebean-clickhouse</module>
<module>ebean-cockroach</module>
<module>ebean-db2</module>
<module>ebean-h2</module>
<module>ebean-hana</module>
<!-- <module>hsqldb</module>-->
<module>ebean-mariadb</module>
<module>ebean-mysql</module>
<module>ebean-nuodb</module>
<module>ebean-oracle</module>
<module>ebean-postgres</module>
<!-- <module>sqlanywhere</module>-->
<module>ebean-sqlite</module>
<module>ebean-sqlserver</module>
<module>ebean-yugabyte</module>
</modules>
</project>
+2 -26
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>12.16.0</version>
<version>13.0.0</version>
</parent>
<name>ebean api</name>
@@ -49,7 +49,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-annotation</artifactId>
<version>7.6</version>
<version>7.8</version>
</dependency>
<dependency>
@@ -80,15 +80,6 @@
<optional>true</optional>
</dependency>
<!-- Provided scope so that the H2HistoryTrigger can live in Ebean core
and not require a separate module for it -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>${h2database.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
@@ -112,19 +103,4 @@
</dependencies>
<build>
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.24</version>
<extensions>true</extensions>
<configuration>
<tiles>
<tile>io.avaje.tile:moditech-module:1.0</tile>
</tiles>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -300,7 +300,7 @@ public interface Database {
* Create a new instance of T that is an EntityBean.
* <p>
* Useful if you use BeanPostConstructListeners or &#64;PostConstruct Annotations.
* In this case you should not use "new Bean...()". Making all bean construtors protected
* In this case you should not use "new Bean...()". Making all bean constructors protected
* could be a good idea here.
* </p>
*/
@@ -246,6 +246,16 @@ public interface SqlQuery extends Serializable, CancelableQuery {
*/
SqlQuery setParameter(Object value);
/**
* Set a null parameter by position.
*/
SqlQuery setNullParameter(int position, int jdbcType);
/**
* Set a null parameter by name.
*/
SqlQuery setNullParameter(String name, int jdbcType);
/**
* Bind the parameter by its index position (1 based like JDBC).
* <p>
@@ -184,17 +184,4 @@ public class DbConstraintNaming {
return normalise.normaliseColumn(tableName);
}
/**
* Lower case the table name checking for quoted identifiers.
*/
public String lowerTableName(String tableName) {
return normalise.lowerTableName(tableName);
}
/**
* Lower case the column name checking for quoted identifiers.
*/
public String lowerColumnName(String name) {
return normalise.lowerColumnName(name);
}
}
@@ -55,53 +55,19 @@ public class DbConstraintNormalise {
return value.replace("(","").replace(")","");
}
/**
* Lower case the table name checking for quoted identifiers.
*/
public String lowerTableName(String tableName) {
if (lowerCaseTables && notQuoted(tableName)) {
return tableName.toLowerCase();
}
return tableName;
}
/**
* Lower case the column name checking for quoted identifiers.
*/
public String lowerColumnName(String name) {
if (lowerCaseColumns && notQuoted(name)) {
return name.toLowerCase();
}
return name;
}
/**
* Trim off the platform quoted identifier quotes like [ ' and ".
*/
public boolean notQuoted(String tableName) {
public String trimQuotes(String identifier) {
// remove quoted identifier characters
for (String quotedIdentifier : quotedIdentifiers) {
if (tableName.contains(quotedIdentifier)) {
return false;
}
}
return true;
}
/**
* Trim off the platform quoted identifier quotes like [ ' and ".
*/
public String trimQuotes(String tableName) {
if (tableName == null) {
if (identifier == null) {
return "";
}
// remove quoted identifier characters
for (String quotedIdentifier : quotedIdentifiers) {
tableName = tableName.replace(quotedIdentifier, "");
identifier = identifier.replace(quotedIdentifier, "");
}
return tableName;
return identifier;
}
@@ -165,7 +165,7 @@ public class DatabasePlatform {
* want to use quoted identifiers for. The backticks get converted to the
* appropriate characters in convertQuotedIdentifiers
*/
private static final char BACK_TICK = '`';
private static final char[] QUOTED_IDENTIFIERS = new char[] { '"', '\'', '[', ']', '`' };
/**
* The non-escaped like clause (to stop slash being escaped on some platforms).
@@ -662,8 +662,8 @@ public class DatabasePlatform {
public String convertQuotedIdentifiers(String dbName) {
// Ignore null values e.g. schema name or catalog
if (dbName != null && !dbName.isEmpty()) {
if (dbName.charAt(0) == BACK_TICK) {
if (dbName.charAt(dbName.length() - 1) == BACK_TICK) {
if (isQuote(dbName.charAt(0))) {
if (isQuote(dbName.charAt(dbName.length() - 1))) {
return openQuote + dbName.substring(1, dbName.length() - 1) + closeQuote;
} else {
log.error("Missing backquote on [" + dbName + "]");
@@ -675,6 +675,15 @@ public class DatabasePlatform {
return dbName;
}
private boolean isQuote(char ch) {
for (char identifer : QUOTED_IDENTIFIERS) {
if (identifer == ch) {
return true;
}
}
return false;
}
/**
* Remove quoted identifier quotes from the table or column name if present.
*/
@@ -0,0 +1,46 @@
package io.ebean.config.dbplatform;
import io.ebean.annotation.Platform;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
/**
* Provides DatabasePlatform matching by name, JDBC product name and specific platform enum.
* <p>
* DatabasePlatformProvider implementations are service loaded and custom implementations
* can be added and used via the service loading mechanism.
*/
public interface DatabasePlatformProvider {
/**
* Match on the lower case platform name.
*/
boolean match(String name);
/**
* Create the platform based on the lower case platform name.
*/
DatabasePlatform create(String name);
/**
* Match on the lower case JDBC metadata product name.
*/
boolean matchByProductName(String productName);
/**
* Create the platform based on the lower case JDBC metadata product name.
*/
DatabasePlatform create(int majorVersion, int minorVersion, DatabaseMetaData meta, Connection connection);
/**
* Match on the specific platform.
*/
boolean matchPlatform(Platform platform);
/**
* Create the specific platform.
*/
DatabasePlatform create(Platform platform);
}
@@ -1,4 +0,0 @@
/**
* Clickhouse DB specific support.
*/
package io.ebean.config.dbplatform.clickhouse;
@@ -1,4 +0,0 @@
/**
* Cockroach DB specific support.
*/
package io.ebean.config.dbplatform.cockroach;
@@ -1,4 +0,0 @@
/**
* DB2 specific support.
*/
package io.ebean.config.dbplatform.db2;
@@ -1,4 +0,0 @@
/**
* H2 specific support.
*/
package io.ebean.config.dbplatform.h2;
@@ -1,4 +0,0 @@
/**
* SAP HANA specific support.
*/
package io.ebean.config.dbplatform.hana;
@@ -1,4 +0,0 @@
/**
* Hsqldb specific support.
*/
package io.ebean.config.dbplatform.hsqldb;
@@ -1,4 +0,0 @@
/**
* MySql specific support.
*/
package io.ebean.config.dbplatform.mysql;
@@ -1,4 +0,0 @@
/**
* NuoDB specific support.
*/
package io.ebean.config.dbplatform.nuodb;
@@ -1,4 +0,0 @@
/**
* Oracle specific support.
*/
package io.ebean.config.dbplatform.oracle;
@@ -1,4 +0,0 @@
/**
* Postgres specific support.
*/
package io.ebean.config.dbplatform.postgres;
@@ -1,4 +0,0 @@
/**
* SqlAnywhere specific support.
*/
package io.ebean.config.dbplatform.sqlanywhere;
@@ -1,4 +0,0 @@
/**
* Sqlite specific support.
*/
package io.ebean.config.dbplatform.sqlite;
@@ -1,4 +0,0 @@
/**
* SqlServer specific support.
*/
package io.ebean.config.dbplatform.sqlserver;
@@ -1,12 +0,0 @@
package io.ebean.config.dbplatform.yugabyte;
import io.ebean.annotation.Platform;
import io.ebean.config.dbplatform.postgres.PostgresPlatform;
public class YugabytePlaform extends PostgresPlatform {
public YugabytePlaform() {
super();
this.platform = Platform.YUGABYTE;
}
}
@@ -12,11 +12,18 @@ import io.ebean.bean.PersistenceContext;
*/
public interface JsonBeanReader<T> {
/**
* Read the JSON into given bean. Will update existing properties.
*/
T read(T target);
/**
* Read the JSON returning a bean.
*/
T read();
default T read() {
return read(null);
}
/**
* Create a new reader taking the context from the existing one but using a new JsonParser.
*/
@@ -58,12 +58,60 @@ public interface JsonContext {
*/
<T> T toBean(Class<T> cls, JsonParser parser, JsonReadOptions options) throws JsonIOException;
/**
* Read json parser input into a given Bean. <br>
* Note: This is a kind of "update". Only properties in the json will be modified. Embedded Lists and Maps will become new
* instances, so the object identity will not be preserved here.
*
* @throws JsonIOException When IOException occurs
*/
<T> void toBean(T target, JsonParser parser) throws JsonIOException;
/**
* Read json parser input into a given Bean additionally using JsonReadOptions.<br>
* See {@link #toBean(Class, JsonParser)} for details modified.
*
* @throws JsonIOException When IOException occurs
*/
<T> void toBean(T target, JsonParser parser, JsonReadOptions options) throws JsonIOException;
/**
* Read json reader input into a given Bean.<br>
* See {@link #toBean(Class, JsonParser)} for details
*
* @throws JsonIOException When IOException occurs
*/
<T> void toBean(T target, Reader json) throws JsonIOException;
/**
* Read json reader input into a given Bean additionally using JsonReadOptions.<br>
* See {@link #toBean(Class, JsonParser)} for details modified.
*
* @throws JsonIOException When IOException occurs
*/
<T> void toBean(T target, Reader json, JsonReadOptions options) throws JsonIOException;
/**
* Read json string input into a given Bean.<br>
* See {@link #toBean(Class, JsonParser)} for details
*
* @throws JsonIOException When IOException occurs
*/
<T> void toBean(T target, String json) throws JsonIOException;
/**
* Read json string input into a given Bean additionally using JsonReadOptions.<br>
* See {@link #toBean(Class, JsonParser)} for details
*
* @throws JsonIOException When IOException occurs
*/
<T> void toBean(T target, String json, JsonReadOptions options) throws JsonIOException;
/**
* Create and return a new bean reading for the bean type given the JSON options and source.
* <p>
* Note that JsonOption provides an option for setting a persistence context and also enabling
* further lazy loading. Further lazy loading requires a persistence context so if that is set
* on then a persistence context is created if there is not one set.
* Note that JsonOption provides an option for setting a persistence context and also enabling further lazy loading. Further lazy
* loading requires a persistence context so if that is set on then a persistence context is created if there is not one set.
*/
<T> JsonBeanReader<T> createBeanReader(Class<T> cls, JsonParser parser, JsonReadOptions options) throws JsonIOException;
@@ -1,6 +1,7 @@
module io.ebean.api {
uses io.ebean.config.AutoConfigure;
uses io.ebean.config.dbplatform.DatabasePlatformProvider;
uses io.ebean.datasource.DataSourceAlertFactory;
uses io.ebean.metric.MetricFactory;
uses io.ebean.service.SpiContainerFactory;
@@ -10,16 +11,15 @@ module io.ebean.api {
requires transitive java.sql;
requires transitive io.avaje.config;
requires transitive io.avaje.lang;
requires transitive persistence.api;
requires transitive io.ebean.annotation;
requires transitive io.ebean.datasource.api;
requires transitive org.slf4j;
requires static io.ebean.types;
requires static io.avaje.jsr305x;
requires static com.fasterxml.jackson.core;
requires static javax.servlet.api;
requires static com.h2database;
exports io.ebean;
exports io.ebean.bean;
@@ -27,20 +27,6 @@ module io.ebean.api {
exports io.ebean.meta;
exports io.ebean.config;
exports io.ebean.config.dbplatform;
exports io.ebean.config.dbplatform.clickhouse;
exports io.ebean.config.dbplatform.h2;
exports io.ebean.config.dbplatform.db2;
exports io.ebean.config.dbplatform.cockroach;
exports io.ebean.config.dbplatform.hana;
exports io.ebean.config.dbplatform.hsqldb;
exports io.ebean.config.dbplatform.mariadb;
exports io.ebean.config.dbplatform.mysql;
exports io.ebean.config.dbplatform.nuodb;
exports io.ebean.config.dbplatform.oracle;
exports io.ebean.config.dbplatform.postgres;
exports io.ebean.config.dbplatform.sqlanywhere;
exports io.ebean.config.dbplatform.sqlite;
exports io.ebean.config.dbplatform.sqlserver;
exports io.ebean.event;
exports io.ebean.event.readaudit;
exports io.ebean.event.changelog;
@@ -0,0 +1,29 @@
package io.ebean;
import org.junit.jupiter.api.Test;
import java.util.Properties;
import static org.junit.jupiter.api.Assertions.*;
class DbPrimaryTest {
@Test
void testIsSkipPrimaryServer() {
DbPrimary.setSkip(true);
assertTrue(DbPrimary.isSkip());
DbPrimary.setSkip(false);
assertFalse(DbPrimary.isSkip());
}
@Test
void testGetPrimaryServerName() {
assertEquals("h2", DbPrimary.getDefaultServerName());
}
@Test
void testLoadProperties() {
Properties properties = DbPrimary.getProperties();
assertFalse(properties.isEmpty());
}
}
@@ -1,5 +1,6 @@
package io.ebean.config.dbplatform;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import java.sql.Types;
@@ -13,7 +14,7 @@ public class DbPlatformTypeLookupTest {
@Test
public void byName() throws Exception {
assertEquals(lookup.byName("DECIMAL"), DbType.DECIMAL);
Assertions.assertEquals(lookup.byName("DECIMAL"), DbType.DECIMAL);
assertEquals(lookup.byName("Decimal"), DbType.DECIMAL);
assertEquals(lookup.byName("decimal"), DbType.DECIMAL);
@@ -1,25 +1,12 @@
package io.ebean.text;
import io.ebean.BaseTestCase;
import io.ebean.DB;
import io.ebean.FetchPath;
import io.ebean.Query;
import io.ebean.test.LoggedSql;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tests.model.basic.Customer;
import org.tests.model.basic.ResetBasicData;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.*;
public class PathPropertiesTests extends BaseTestCase {
private static final Logger log = LoggerFactory.getLogger(PathPropertiesTests.class);
public class PathPropertiesTests {
@Test
public void test_noParentheses() {
@@ -197,34 +184,4 @@ public class PathPropertiesTests extends BaseTestCase {
assertFalse(root.includesPath("customer", "shippingAddress"));
}
@Test
public void example_withQueryAndJson() {
ResetBasicData.reset();
PathProperties pathProps = PathProperties.parse("id,name,billingAddress(city),shippingAddress(*))");
Query<Customer> query = DB.find(Customer.class)
.where().lt("id", 2)
.query();
pathProps.apply(query);
List<Customer> list = query.findList();
String asJson = DB.json().toJson(list, pathProps);
log.info("Json: {}", asJson);
}
@Test
public void test_withAllPropsQuery() {
PathProperties root = PathProperties.parse("*,billingAddress(line1)");
LoggedSql.start();
Query<Customer> query = DB.find(Customer.class).apply(root);
query.findList();
List<String> sql = LoggedSql.stop();
assertThat(sql).hasSize(1);
assertThat(sql.get(0)).contains("select t0.id, t0.status, t0.name, t0.smallnote, t0.anniversary, t0.cretime, t0.updtime, t0.version, t0.shipping_address_id, t1.id, t1.line_1 from o_customer t0 left join o_address t1 on t1.id = t0.billing_address_id;");
}
}
@@ -0,0 +1 @@
datasource.default=h2
+10 -4
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>12.16.0</version>
<version>13.0.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.16.0</tag>
<tag>ebean-parent-13.0.0</tag>
</scm>
<name>ebean autotune</name>
@@ -26,7 +26,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>12.16.0</version>
<version>13.0.0</version>
<scope>provided</scope>
</dependency>
@@ -52,6 +52,13 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-h2</artifactId>
<version>13.0.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
@@ -64,7 +71,6 @@
<configuration>
<tiles>
<tile>io.ebean.tile:enhancement:12.15.0</tile>
<tile>io.avaje.tile:moditech-module:1.0</tile>
</tiles>
</configuration>
</plugin>
+15 -15
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>12.16.0</version>
<version>13.0.0</version>
</parent>
<name>ebean bom</name>
@@ -71,88 +71,88 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean</artifactId>
<version>12.16.0</version>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>12.16.0</version>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>12.16.0</version>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core-type</artifactId>
<version>12.16.0</version>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-ddl-generator</artifactId>
<version>12.16.0</version>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-externalmapping-api</artifactId>
<version>12.16.0</version>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-externalmapping-xml</artifactId>
<version>12.16.0</version>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-autotune</artifactId>
<version>12.16.0</version>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>12.16.0</version>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>querybean-generator</artifactId>
<version>12.16.0</version>
<version>13.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>kotlin-querybean-generator</artifactId>
<version>12.16.0</version>
<version>13.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>12.16.0</version>
<version>13.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-postgis</artifactId>
<version>12.16.0</version>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-redis</artifactId>
<version>12.16.0</version>
<version>13.0.0</version>
</dependency>
</dependencies>
+2 -17
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>12.16.0</version>
<version>13.0.0</version>
</parent>
<artifactId>ebean-core-type</artifactId>
@@ -16,7 +16,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>12.16.0</version>
<version>13.0.0</version>
</dependency>
<dependency>
@@ -28,19 +28,4 @@
</dependencies>
<build>
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.24</version>
<extensions>true</extensions>
<configuration>
<tiles>
<tile>io.avaje.tile:moditech-module:1.0</tile>
</tiles>
</configuration>
</plugin>
</plugins>
</build>
</project>
+25 -17
View File
@@ -3,7 +3,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>12.16.0</version>
<version>13.0.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.16.0</tag>
<tag>ebean-parent-13.0.0</tag>
</scm>
<dependencies>
@@ -41,19 +41,19 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>12.16.0</version>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core-type</artifactId>
<version>12.16.0</version>
<version>13.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-externalmapping-api</artifactId>
<version>12.16.0</version>
<version>13.0.0</version>
</dependency>
<dependency>
@@ -141,6 +141,26 @@
</dependency>
<!-- Test scope -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-h2</artifactId>
<version>13.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>13.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-sqlserver</artifactId>
<version>13.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
@@ -228,18 +248,6 @@
</executions>
</plugin>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.24</version>
<extensions>true</extensions>
<configuration>
<tiles>
<tile>io.avaje.tile:moditech-module:1.0</tile>
</tiles>
</configuration>
</plugin>
</plugins>
</build>
@@ -167,7 +167,7 @@ public final class BindParams implements Serializable {
*/
@SuppressWarnings("rawtypes")
public void setParameter(int position, Object value) {
assert value != null : "use setNullParameter";
//TODO: Review - assert value != null : "use setNullParameter";
Param p = getParam(position);
if (value instanceof Collection) {
// use of postgres ANY with positioned parameter
@@ -219,7 +219,7 @@ public final class BindParams implements Serializable {
* Set a named In parameter that is not null.
*/
public Param setParameter(String name, Object value) {
assert value != null : "use setNullParameter";
// TODO: Review - assert value != null : "use setNullParameter";
Param p = getParam(name);
p.setInValue(value);
return p;
@@ -35,7 +35,7 @@ public final class CacheIdLookupMany<T> implements CacheIdLookup<T> {
@Override
public List<T> removeHits(BeanCacheResult<T> cacheResult) {
Set<Object> hitIds = new HashSet<>();
List<T> beans = new ArrayList<>(hitIds.size());
List<T> beans = new ArrayList<>();
for (BeanCacheResult.Entry<T> hit : cacheResult.hits()) {
hitIds.add(hit.getKey());
beans.add(hit.getBean());
@@ -2,36 +2,18 @@ package io.ebeaninternal.server.core;
import io.ebean.config.DatabaseConfig;
import io.ebean.config.dbplatform.DatabasePlatform;
import io.ebean.config.dbplatform.clickhouse.ClickHousePlatform;
import io.ebean.config.dbplatform.cockroach.CockroachPlatform;
import io.ebean.config.dbplatform.db2.DB2ForIPlatform;
import io.ebean.config.dbplatform.db2.DB2LegacyPlatform;
import io.ebean.config.dbplatform.db2.DB2LuwPlatform;
import io.ebean.config.dbplatform.db2.DB2ZosPlatform;
import io.ebean.config.dbplatform.h2.H2Platform;
import io.ebean.config.dbplatform.hana.HanaPlatform;
import io.ebean.config.dbplatform.hsqldb.HsqldbPlatform;
import io.ebean.config.dbplatform.mariadb.MariaDbPlatform;
import io.ebean.config.dbplatform.mysql.MySql55Platform;
import io.ebean.config.dbplatform.mysql.MySqlPlatform;
import io.ebean.config.dbplatform.nuodb.NuoDbPlatform;
import io.ebean.config.dbplatform.oracle.Oracle11Platform;
import io.ebean.config.dbplatform.oracle.Oracle12Platform;
import io.ebean.config.dbplatform.oracle.OraclePlatform;
import io.ebean.config.dbplatform.postgres.Postgres9Platform;
import io.ebean.config.dbplatform.postgres.PostgresPlatform;
import io.ebean.config.dbplatform.sqlanywhere.SqlAnywherePlatform;
import io.ebean.config.dbplatform.sqlite.SQLitePlatform;
import io.ebean.config.dbplatform.sqlserver.SqlServer16Platform;
import io.ebean.config.dbplatform.sqlserver.SqlServer17Platform;
import io.ebean.config.dbplatform.yugabyte.YugabytePlaform;
import io.ebean.config.dbplatform.DatabasePlatformProvider;
import io.ebeaninternal.api.CoreLog;
import io.ebeaninternal.api.DbOffline;
import javax.persistence.PersistenceException;
import javax.sql.DataSource;
import java.sql.*;
import java.util.Locale;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.ServiceLoader;
/**
* Create a DatabasePlatform from the configuration.
@@ -41,6 +23,14 @@ import java.util.Locale;
*/
public class DatabasePlatformFactory {
private final List<DatabasePlatformProvider> providers = new ArrayList<>();
public DatabasePlatformFactory() {
for (DatabasePlatformProvider platformProvider : ServiceLoader.load(DatabasePlatformProvider.class)) {
providers.add(platformProvider);
}
}
/**
* Create the appropriate database specific platform.
*/
@@ -71,68 +61,10 @@ public class DatabasePlatformFactory {
*/
private DatabasePlatform byDatabaseName(String dbName) {
dbName = dbName.toLowerCase();
if (dbName.equals("h2")) {
return new H2Platform();
}
if (dbName.equals("mariadb")) {
return new MariaDbPlatform();
}
if (dbName.equals("mysql")) {
return new MySqlPlatform();
}
if (dbName.equals("mysql55")) {
return new MySql55Platform();
}
if (dbName.equals("postgres") || dbName.equals("postgres9")) {
return new PostgresPlatform();
}
if (dbName.equals("oracle11") || dbName.equals("oracle10") || dbName.equals("oracle9")) {
return new Oracle11Platform();
}
if (dbName.equals("oracle12")) {
return new Oracle12Platform();
}
if (dbName.equals("oracle")) {
return new OraclePlatform();
}
if (dbName.equals("sqlserver16")) {
return new SqlServer16Platform();
}
if (dbName.equals("sqlserver17")) {
return new SqlServer17Platform();
}
if (dbName.equals("sqlserver")) {
throw new IllegalArgumentException("Please choose the more specific sqlserver16 or sqlserver17 platform. Refer to issue #1340 for details");
}
if (dbName.equals("sqlanywhere")) {
return new SqlAnywherePlatform();
}
if (dbName.equals("db2")) {
throw new IllegalArgumentException("Please choose the more specific db2luw/db2zos/db2fori platform. Refer to issue #2514 for details");
}
if (dbName.equals("db2legacy")) {
return new DB2LegacyPlatform();
}
if (dbName.equals("db2zos")) {
return new DB2ZosPlatform();
}
if (dbName.equals("db2fori")) {
return new DB2ForIPlatform();
}
if (dbName.equals("db2luw")) {
return new DB2LuwPlatform();
}
if (dbName.equals("clickhouse")) {
return new ClickHousePlatform();
}
if (dbName.equals("nuodb")) {
return new NuoDbPlatform();
}
if (dbName.equals("sqlite")) {
return new SQLitePlatform();
}
if (dbName.equals("hana")) {
return new HanaPlatform();
for (DatabasePlatformProvider provider : providers) {
if (provider.match(dbName)) {
return provider.create(dbName);
}
}
throw new RuntimeException("database platform " + dbName + " is not known?");
}
@@ -156,79 +88,15 @@ public class DatabasePlatformFactory {
final int majorVersion = metaData.getDatabaseMajorVersion();
final int minorVersion = metaData.getDatabaseMinorVersion();
CoreLog.log.debug("platform for productName[{}] version[{}.{}]", dbProductName, majorVersion, minorVersion);
if (dbProductName.contains("oracle")) {
return oracleVersion(majorVersion);
} else if (dbProductName.contains("microsoft")) {
throw new IllegalArgumentException("For SqlServer please explicitly choose either sqlserver16 or sqlserver17 as the platform via DatabaseConfig.setDatabasePlatformName. Refer to issue #1340 for more details");
} else if (dbProductName.contains("h2")) {
return new H2Platform();
} else if (dbProductName.contains("hsql database engine")) {
return new HsqldbPlatform();
} else if (dbProductName.contains("postgres")) {
String productVersion = metaData.getDatabaseProductVersion().toLowerCase(Locale.ENGLISH);
return readPostgres(connection, majorVersion, productVersion);
} else if (dbProductName.contains("mariadb")) {
return new MariaDbPlatform();
} else if (dbProductName.contains("mysql")) {
return mysqlVersion(majorVersion, minorVersion);
} else if (dbProductName.contains("nuo")) {
return new NuoDbPlatform();
} else if (dbProductName.contains("sqlite")) {
return new SQLitePlatform();
} else if (dbProductName.contains("db2")) {
throw new IllegalArgumentException("For DB2 please explicitly choose either db2legacy/db2luw/db2zos/db2fori platform. Refer to issue #2514 for details");
} else if (dbProductName.contains("sql anywhere")) {
return new SqlAnywherePlatform();
} else if (dbProductName.contains("hdb")) {
return new HanaPlatform();
} else if (dbProductName.contains("clickhouse")) {
return new ClickHousePlatform();
}
// use the standard one
return new DatabasePlatform();
}
private DatabasePlatform oracleVersion(int majorVersion) {
if (majorVersion < 12) {
return new Oracle11Platform();
}
if (majorVersion < 13) {
return new Oracle12Platform();
}
return new OraclePlatform();
}
private DatabasePlatform mysqlVersion(int majorVersion, int minorVersion) {
if (majorVersion <= 5 && minorVersion <= 5) {
return new MySql55Platform();
}
return new MySqlPlatform();
}
/**
* Use a select version() query as it could be Postgres or CockroachDB.
*/
private static DatabasePlatform readPostgres(Connection connection, int majorVersion, String productVersion) {
if (productVersion.contains("-yb-")) {
return new YugabytePlaform();
}
try (PreparedStatement statement = connection.prepareStatement("select version() as \"version\"")) {
try (ResultSet resultSet = statement.executeQuery()) {
if (resultSet.next()) {
productVersion = resultSet.getString("version").toLowerCase();
if (productVersion.contains("cockroach")) {
return new CockroachPlatform();
}
}
for (DatabasePlatformProvider provider : providers) {
if (provider.matchByProductName(dbProductName)) {
return provider.create(majorVersion, minorVersion, metaData, connection);
}
} catch (SQLException e) {
CoreLog.log.warn("Error running detection query on Postgres", e);
}
if (majorVersion <= 9) {
return new Postgres9Platform();
}
return new PostgresPlatform();
throw new IllegalStateException("Unable to determine the appropriate ebean platform given database product name [" + dbProductName
+ "] and ebean platform providers " + providers + ". With ebean 13+ we now have separate platforms (ebean-postgres, ebean-mysql etc)"
+ " and should use database specific platform dependency like ebean-postgres. Note that we can use ebean-platform-all to include"
+ " all the platforms.");
}
}
@@ -10,7 +10,6 @@ import io.ebean.config.ServerConfigProvider;
import io.ebean.config.TenantMode;
import io.ebean.config.UnderscoreNamingConvention;
import io.ebean.config.dbplatform.DatabasePlatform;
import io.ebean.config.dbplatform.h2.H2Platform;
import io.ebean.event.ShutdownManager;
import io.ebean.service.SpiContainer;
import io.ebeaninternal.api.CoreLog;
@@ -24,6 +23,7 @@ import io.ebeaninternal.server.executor.DefaultBackgroundExecutor;
import org.slf4j.Logger;
import javax.persistence.PersistenceException;
import java.net.URL;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;
@@ -86,7 +86,7 @@ public final class DefaultContainer implements SpiContainer {
boolean online = true;
if (config.isDocStoreOnly()) {
config.setDatabasePlatform(new H2Platform());
config.setDatabasePlatform(new DatabasePlatform());
} else {
TenantMode tenantMode = config.getTenantMode();
if (TenantMode.DB != tenantMode) {
@@ -137,9 +137,21 @@ public final class DefaultContainer implements SpiContainer {
}
if (config.isAutoLoadModuleInfo()) {
// auto register entity classes
boolean found = false;
for (ModuleInfoLoader loader : ServiceLoader.load(ModuleInfoLoader.class)) {
config.addAll(loader.classesFor(config.getName(), config.isDefaultServer()));
found = true;
}
if (!found) {
checkMissingModulePathProvides();
}
}
}
private void checkMissingModulePathProvides() {
URL servicesFile = ClassLoader.getSystemResource("META-INF/services/io.ebean.config.ModuleInfoLoader");
if (servicesFile != null) {
log.error("module-info.java is probably missing 'provides io.ebean.config.ModuleInfoLoader with _Ebean$ModuleInfo' clause. ModuleInfoLoader exists but was not service loaded.");
}
}
@@ -121,6 +121,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
private final boolean softDelete;
private final String draftTable;
private final PartitionMeta partitionMeta;
private final TablespaceMeta tablespaceMeta;
private final String storageEngine;
private final String dbComment;
private final boolean readAuditing;
@@ -275,6 +276,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
this.dependentTables = deploy.getDependentTables();
this.dbComment = deploy.getDbComment();
this.partitionMeta = deploy.getPartitionMeta();
this.tablespaceMeta = deploy.getTablespaceMeta();
this.storageEngine = deploy.getStorageEngine();
this.autoTunable = beanFinder == null && (entityType == EntityType.ORM || entityType == EntityType.VIEW);
// helper object used to derive lists of properties
@@ -2671,6 +2673,13 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
public PartitionMeta partitionMeta() {
return partitionMeta;
}
/**
* Return the tablespace details of the bean.
*/
public TablespaceMeta tablespaceMeta() {
return tablespaceMeta;
}
/**
* Return the storage engine.
@@ -3372,12 +3381,12 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
jsonHelp.jsonWriteProperties(writeJson, bean);
}
public T jsonRead(SpiJsonReader jsonRead, String path) throws IOException {
return jsonHelp.jsonRead(jsonRead, path, true);
public T jsonRead(SpiJsonReader jsonRead, String path, T target) throws IOException {
return jsonHelp.jsonRead(jsonRead, path, true, target);
}
T jsonReadObject(SpiJsonReader jsonRead, String path) throws IOException {
return jsonHelp.jsonRead(jsonRead, path, false);
T jsonReadObject(SpiJsonReader jsonRead, String path, T target) throws IOException {
return jsonHelp.jsonRead(jsonRead, path, false, target);
}
public List<BeanProperty[]> uniqueProps() {
@@ -61,13 +61,13 @@ class BeanDescriptorElementEmbedded<T> extends BeanDescriptorElement<T> {
}
@Override
public T jsonRead(SpiJsonReader jsonRead, String path) throws IOException {
return readJsonElement(jsonRead, path);
public T jsonRead(SpiJsonReader jsonRead, String path, T target) throws IOException {
return readJsonElement(jsonRead, path, target);
}
@SuppressWarnings("unchecked")
T readJsonElement(SpiJsonReader jsonRead, String path) throws IOException {
return (T)targetDescriptor.jsonRead(jsonRead, path);
T readJsonElement(SpiJsonReader jsonRead, String path, T target) throws IOException {
return (T)targetDescriptor.jsonRead(jsonRead, path, target);
}
void writeJsonElement(SpiJsonWriter ctx, Object element) {
@@ -58,13 +58,13 @@ class BeanDescriptorElementEmbeddedMap<T> extends BeanDescriptorElementEmbedded<
}
if (stringKey) {
parser.nextToken();
Object val = readJsonElement(readJson, null);
Object val = readJsonElement(readJson, null, null); // CHECKME: Update existing map entry here?
add.addKeyValue(fieldName, val);
} else {
parser.nextFieldName();
Object key = scalarTypeKey.jsonRead(parser);
parser.nextFieldName();
Object val = readJsonElement(readJson, null);
Object val = readJsonElement(readJson, null, null); // CHECKME: Update existing map entry here?
add.addKeyValue(key, val);
}
} while (true);
@@ -65,7 +65,7 @@ final class BeanDescriptorJsonHelp<T> {
}
@SuppressWarnings("unchecked")
T jsonRead(SpiJsonReader jsonRead, String path, boolean withInheritance) throws IOException {
T jsonRead(SpiJsonReader jsonRead, String path, boolean withInheritance, T target) throws IOException {
JsonParser parser = jsonRead.getParser();
//noinspection StatementWithEmptyBody
if (parser.getCurrentToken() == JsonToken.START_OBJECT) {
@@ -82,7 +82,7 @@ final class BeanDescriptorJsonHelp<T> {
}
if (desc.inheritInfo == null || !withInheritance) {
return jsonReadObject(jsonRead, path);
return jsonReadObject(jsonRead, path, target);
}
ObjectNode node = jsonRead.getObjectMapper().readTree(parser);
@@ -97,17 +97,25 @@ final class BeanDescriptorJsonHelp<T> {
JsonNode discNode = node.get(discColumn);
if (discNode == null || discNode.isNull()) {
if (!desc.isAbstractType()) {
return desc.jsonReadObject(newReader, path);
return desc.jsonReadObject(newReader, path, target);
}
String msg = "Error reading inheritance discriminator - expected [" + discColumn + "] but no json key?";
throw new JsonParseException(newParser, msg, parser.getCurrentLocation());
}
return (T) inheritInfo.readType(discNode.asText()).desc().jsonReadObject(newReader, path);
BeanDescriptor<T> inheritDesc = (BeanDescriptor<T>) inheritInfo.readType(discNode.asText()).desc();
return inheritDesc.jsonReadObject(newReader, path, target);
}
private T jsonReadObject(SpiJsonReader readJson, String path) throws IOException {
EntityBean bean = desc.createEntityBeanForJson();
private T jsonReadObject(SpiJsonReader readJson, String path, T target) throws IOException {
EntityBean bean;
if (target == null) {
bean = desc.createEntityBeanForJson();
} else if (desc.beanType.isInstance(target)) {
bean = (EntityBean) target;
} else {
throw new ClassCastException(target.getClass().getName() + " provided, but " + desc.beanType.getClass().getName() + " expected");
}
return jsonReadProperties(readJson, bean, path);
}
@@ -562,7 +562,29 @@ public final class BeanDescriptorManager implements BeanDescriptorMap, SpiBeanTy
@SuppressWarnings("unchecked")
public <T> BeanManager<T> beanManager(Class<T> entityType) {
return (BeanManager<T>) beanManager(entityType.getName());
BeanManager<T> mgr = (BeanManager<T>) beanManager(entityType.getName());
if (mgr == null) {
errorBeanNotRegistered(entityType);
}
return mgr;
}
private <T> void errorBeanNotRegistered(Class<T> entityType) {
if (beanManagerMap.isEmpty()) {
throw new PersistenceException(errNothingRegistered());
} else {
throw new PersistenceException(errNotRegistered(entityType));
}
}
private <T> String errNothingRegistered() {
return "There are no registered entities. If using query beans, that generates _Ebean$ModuleInfo.java into " +
"generated sources and is service loaded. If using module-info.java, then probably missing 'provides io.ebean.config.ModuleInfoLoader with _Ebean$ModuleInfo' clause.";
}
private String errNotRegistered(Class<?> beanClass) {
return "The type [" + beanClass + "] is not a registered entity?"
+ " If you don't explicitly list the entity classes to use Ebean will search for them in the classpath.";
}
private BeanManager<?> beanManager(String beanClassName) {
@@ -1004,7 +1004,7 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
* Return the DB column default to use for DDL.
*/
public String dbColumnDefault() {
return dbColumnDefn != null ? null : dbColumnDefault;
return dbColumnDefault;
}
/**
@@ -1016,7 +1016,8 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
BeanCollection<?> collection = createEmpty(parentBean);
BeanCollectionAdd add = beanCollectionAdd(collection);
do {
EntityBean detailBean = (EntityBean) targetDescriptor.jsonRead(readJson, name);
// CHECKME: Update existing list entry here?
EntityBean detailBean = (EntityBean) targetDescriptor.jsonRead(readJson, name, null);
if (detailBean == null) {
// read the entire array
break;
@@ -783,7 +783,8 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
@Override
public void jsonRead(SpiJsonReader readJson, EntityBean bean) throws IOException {
if (jsonDeserialize && targetDescriptor != null) {
T assocBean = targetDescriptor.jsonRead(readJson, name);
T target = (T) value(bean);
T assocBean = targetDescriptor.jsonRead(readJson, name, target);
setValue(bean, assocBean);
}
}
@@ -0,0 +1,59 @@
package io.ebeaninternal.server.deploy;
import java.util.Objects;
/**
* Meta data for table spaces. If table space is configured, tablespaceName, indexTablespace, lobTablespace is never null;
*
* @author Noemi Szemenyei, FOCONIS AG
*
*/
public final class TablespaceMeta {
private final String tablespaceName;
private final String indexTablespace;
private final String lobTablespace;
public TablespaceMeta(String tablespaceName, String indexTablespace, String lobTablespace) {
this.tablespaceName = tablespaceName;
this.indexTablespace = indexTablespace;
this.lobTablespace = lobTablespace;
}
public String getTablespaceName() {
return tablespaceName;
}
public String getIndexTablespace() {
return indexTablespace;
}
public String getLobTablespace() {
return lobTablespace;
}
@Override
public int hashCode() {
return Objects.hash(indexTablespace, tablespaceName, lobTablespace);
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
TablespaceMeta other = (TablespaceMeta) obj;
return Objects.equals(indexTablespace, other.indexTablespace)
&& Objects.equals(tablespaceName, other.tablespaceName)
&& Objects.equals(lobTablespace, other.lobTablespace);
}
@Override
public String toString() {
return "tablespace=" + tablespaceName + ", indexTablespace=" + indexTablespace + ", lobTablespace=" + lobTablespace;
}
}
@@ -32,6 +32,7 @@ import io.ebeaninternal.server.deploy.IndexDefinition;
import io.ebeaninternal.server.deploy.InheritInfo;
import io.ebeaninternal.server.deploy.PartitionMeta;
import io.ebeaninternal.server.deploy.TableJoin;
import io.ebeaninternal.server.deploy.TablespaceMeta;
import io.ebeaninternal.server.deploy.parse.DeployBeanInfo;
import io.ebeaninternal.server.idgen.UuidV1IdGenerator;
import io.ebeaninternal.server.idgen.UuidV1RndIdGenerator;
@@ -135,6 +136,7 @@ public class DeployBeanDescriptor<T> {
private ChangeLogFilter changeLogFilter;
private String dbComment;
private PartitionMeta partitionMeta;
private TablespaceMeta tablespaceMeta;
/**
* One of NONE, INDEX or EMBEDDED.
*/
@@ -252,6 +254,14 @@ public class DeployBeanDescriptor<T> {
}
return partitionMeta;
}
public void setTablespaceMeta(TablespaceMeta tablespaceMeta) {
this.tablespaceMeta = tablespaceMeta;
}
public TablespaceMeta getTablespaceMeta() {
return tablespaceMeta;
}
public void setDraftable() {
draftable = true;
@@ -12,6 +12,7 @@ import io.ebean.annotation.Index;
import io.ebean.annotation.InvalidateQueryCache;
import io.ebean.annotation.ReadAudit;
import io.ebean.annotation.StorageEngine;
import io.ebean.annotation.Tablespace;
import io.ebean.annotation.View;
import io.ebean.config.TableName;
import io.ebeaninternal.api.CoreLog;
@@ -19,6 +20,7 @@ import io.ebeaninternal.server.deploy.BeanDescriptor.EntityType;
import io.ebeaninternal.server.deploy.IndexDefinition;
import io.ebeaninternal.server.deploy.InheritInfo;
import io.ebeaninternal.server.deploy.PartitionMeta;
import io.ebeaninternal.server.deploy.TablespaceMeta;
import io.ebeaninternal.server.deploy.meta.DeployBeanProperty;
import javax.persistence.AttributeOverride;
@@ -154,6 +156,18 @@ final class AnnotationClass extends AnnotationParser {
if (partition != null) {
descriptor.setPartitionMeta(new PartitionMeta(partition.mode(), partition.property()));
}
Tablespace tablespace = typeGet(cls, Tablespace.class);
if (tablespace != null) {
String indexTs = tablespace.index();
if("".equals(indexTs)) {
indexTs = tablespace.value();
}
String lobTs = tablespace.lob();
if("".equals(lobTs)) {
lobTs = tablespace.value();
}
descriptor.setTablespaceMeta(new TablespaceMeta(tablespace.value(), indexTs, lobTs));
}
Draftable draftable = typeGet(cls, Draftable.class);
if (draftable != null) {
descriptor.setDraftable();

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