Compare commits

...
Author SHA1 Message Date
Rob Bygrave 6e163b9f5c #3393 Fix for 12.x to support "NoTimeZone" to bypass MySQL JDBC use of Timezone Calendar 2024-04-17 22:57:55 +12:00
Rob Bygrave 63336bafe5 [maven-release-plugin] prepare for next development iteration 2023-09-07 14:50:26 +12:00
Rob Bygrave 97ca198b7c [maven-release-plugin] prepare release ebean-parent-12.16.2 2023-09-07 14:50:18 +12:00
Rob BygraveandGitHub 88fd59e164 Merge pull request #3218 from ebean-orm/backport-12x/3173-BeanSet-init-loading
[12x] Backport of fix for #3173 BeanSet init(), initClear() and BeanMap
2023-09-07 14:45:59 +12:00
Rob Bygrave 5b9ef2daec [12x] Backport of fix for #3173 BeanSet init(), initClear() and BeanMap
- BeanSet init() and initClear() load with onlyIds false because the expectation is that with BeanSet the equals/hashCode implementation can use a property
- BeanMap lazy loading, include the mapKey if defined in the lazy loading query
2023-09-07 14:44:17 +12: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
Rob Bygrave ef8d9c7eb0 [maven-release-plugin] prepare release ebean-parent-12.16.0 2022-03-16 22:49:16 +13:00
Rob Bygrave a464c763d0 Bump parent pom 2022-03-16 22:45:57 +13:00
Rob Bygrave d4d1e571d3 Fix test assert for multi-database 2022-03-16 22:37:54 +13:00
Rob Bygrave 92e85e32a2 #2598 - H2 + @Lob String fails with - Error[Value too long for column "CHARACTER VARYING": "... (1048577)" [22001-210]] 2022-03-16 22:13:52 +13:00
Rob Bygrave ff1b01e5ca Bump agent to 12.16.0 + test and provided dependencies 2022-03-16 22:13:07 +13:00
Rob Bygrave 327f25c568 No functional change - refactor tidy dealing with some internal warnings
protected not needed on final classes
2022-03-16 18:51:12 +13:00
Rob BygraveandGitHub 00a1324c52 Merge pull request #2596 from FOCONIS/ddl-refactor8
DDl-Refactor: Add DB2 Reorg support and history support
2022-03-16 18:47:58 +13:00
Rob Bygrave 75b9df942c No effective change - tidy TestWithCacheAndLazyLoad 2022-03-16 18:38:47 +13:00
Rob Bygrave 946b390037 Merge branch 'FOCONIS-lazyload-npe' 2022-03-16 18:37:48 +13:00
Rob Bygrave 3a1e1e23f5 Merge branch 'lazyload-npe' of https://github.com/FOCONIS/ebean into FOCONIS-lazyload-npe 2022-03-16 18:14:22 +13:00
Rob Bygrave d9ea465102 Support running tests against java 19 2022-03-16 18:02:07 +13:00
Rob Bygrave 3bc7f061eb Bump test dependencies for junit, assertj, mockito 2022-03-16 17:55:37 +13:00
Rob Bygrave 0bc07d38b2 Add Oracle GH workflow for JDK EA 18,19,loom,valhalla,metropolis,panama 2022-03-16 12:13:29 +13:00
Roland Praml 79f6d6d0f0 Ignored query plans for DB2 2022-03-15 17:18:34 +01:00
Roland Praml 782e41098d enabled history tests 2022-03-15 16:56:00 +01:00
Roland Praml 0225fddf6d FIX: AlterColumnTest 2022-03-15 16:31:43 +01:00
Roland Praml be3e08018e Reference Scripts 2022-03-15 15:59:50 +01:00
Roland Praml c9204eed3f DB2: HistorySupport added 2022-03-15 15:59:33 +01:00
Noemi Szemenyei edb6a0ebe2 performance boost list --> set
(cherry picked from commit 2478aded70)
2022-03-15 13:21:10 +01:00
Noemi Szemenyei 826b507b77 Suggested fix
(cherry picked from commit 52ca271a13)
2022-03-15 13:21:02 +01:00
Noemi Szemenyei 8ad8f47c6b Created failing test case
(cherry picked from commit 2b21588c90)
2022-03-15 13:20:16 +01:00
Rob BygraveandGitHub 5944777a13 Merge pull request #2594 from FOCONIS/ddl-refactor7
[DDL-Refactor] History table generation
2022-03-15 09:23:30 +13:00
Roland Praml 05a1b0d64e DB2: Migration is working now 2022-03-14 16:31:34 +01:00
Roland Praml 4d62958645 Updated DDL scripts to support notnull -> null transitions 2022-03-14 14:13:56 +01:00
Roland Praml 610a8b2df6 FIX: notNull -> null transition must be applied also to history 2022-03-14 14:13:10 +01:00
Roland Praml 5b8bb41598 Postgres: Drops history support during alter and restores it after that 2022-03-14 14:08:42 +01:00
Roland Praml 9e16d955ae Sqlserver: no effective code change 2022-03-14 14:06:25 +01:00
Roland Praml 197bb0509a Nuodb: no effective ddl change 2022-03-14 14:05:42 +01:00
Roland Praml 5536aeb829 Mysql: locks only one table at once 2022-03-14 14:04:59 +01:00
Roland Praml d629fb2dbd MariaDB uses '@@system_versioning_alter_history = 1' now. Removed obsolete "lock tables" statements 2022-03-14 14:01:21 +01:00
Roland Praml 10c01574d2 H2: No effective change Statements reordered 2022-03-14 13:12:24 +01:00
Roland Praml cfad20c8e1 Refactored Hisotry generation 2022-03-14 13:11:00 +01:00
Rob Bygrave 0ea375b4fc Merge branch 'FOCONIS-ddl-clickhouse' 2022-03-14 16:54:07 +13:00
Rob Bygrave 71fce1b4c5 #2575 Tidy up for [DDL-ClickHouse] fixes for ClickHouse platform 2022-03-14 16:53:51 +13:00
Rob Bygrave db60065389 Merge branch 'ddl-clickhouse' of https://github.com/FOCONIS/ebean into FOCONIS-ddl-clickhouse 2022-03-14 16:51:27 +13:00
Rob Bygrave d3a765a532 Tidy whitespace only, no effective change 2022-03-14 16:19:02 +13:00
Rob Bygrave fd4be0ca59 #2593 - Tidy SqlTreeBuilder to not add duplicate BeanProperties 2022-03-14 16:16:14 +13:00
Rob Bygrave 267a81b792 #25890 - Tidy only, no effective change for BackgroundExecutorWrapper 2022-03-14 15:46:21 +13:00
Rob Bygrave 1615beadd1 Merge branch 'master' of github.com:ebean-orm/ebean 2022-03-14 15:37:52 +13:00
Rob Bygrave a3e5c3de72 Merge branch 'FOCONIS-Bug-wrong-join-inheritance-dbforeignkey' 2022-03-14 15:37:38 +13:00
Rob Bygrave 267b1b7303 #2580 - Fix for Wrong join in query with @Inheritance
Effectively delays an extra join added via BeanPropertyAssocOne with inheritance, such that this only occurs if a SqlTreeNode child doesn't add the join.
2022-03-14 15:37:12 +13:00
Rob Bygrave c902caed24 Fix is to delay the extra join added via BeanPropertyAssocOne until after the children nodes have joined.
In this way the join is ONLY added if not already done so via a child node (SqlTreeNode).
2022-03-14 15:32:42 +13:00
Rob BygraveandGitHub 662666e1a4 Merge pull request #2590 from FOCONIS/background-executor-wrapper
Provide custom BackgroundExecutorWrapper to pass thread locals
2022-03-14 10:40:37 +13:00
Rob BygraveandGitHub 394f245e33 Merge pull request #2591 from FOCONIS/ddl-refactor6
[DDL-refactor] Sorted the statements, so that they are going to the correct buffers
2022-03-14 09:17:17 +13:00
Roland Praml 89da952b15 updated scripts 2022-03-11 15:35:15 +01:00
Roland Praml d927b8c2c2 [DDL-refactor] Sorted the statements, so that they are going to the correct buffers 2022-03-11 15:34:37 +01:00
Noemi Szemenyei 6867c4568c fix db.shutdown()
(cherry picked from commit 33d17d0f49)
2022-03-11 13:32:08 +01:00
Noemi Szemenyei e0e572a8b4 update
(cherry picked from commit dab8ed8a3b)
2022-03-11 13:31:58 +01:00
Noemi Szemenyei 3c7555de36 Provide custom BackgroundExecutorWrapper to pass thread locals
(cherry picked from commit 336accf447)
2022-03-11 13:31:50 +01:00
Rob BygraveandGitHub 75662aac5c Merge pull request #2589 from FOCONIS/ddl-refactor5
No effective DDL change - refactor whitespace and add buffer comments
2022-03-11 10:38:14 +13:00
Roland Praml e4ddcbd40a Reference scripts 2022-03-10 13:39:59 +01:00
Roland Praml a8f390c3b7 No effective DDL change - removed obsolete whitespaces 2022-03-10 13:31:12 +01:00
Roland Praml f1b196cf2e FIX: tests and pushed reference ddl scripts 2022-03-10 13:24:39 +01:00
Roland Praml 04675ea76b No effective DDL change, just added buffer comments in DDL 2022-03-10 13:24:01 +01:00
Rob Bygrave 8e44ad71e8 Merge branch 'Bug-wrong-join-inheritance-dbforeignkey' of https://github.com/FOCONIS/ebean into FOCONIS-Bug-wrong-join-inheritance-dbforeignkey 2022-03-10 16:24:14 +13:00
Rob Bygrave febd56c9c0 #2581 - SoftDelete on @OneToMany is ignored after refresh() (since 12.11.5) 2022-03-10 16:19:11 +13:00
Rob Bygrave 0d3649853a Bump provided optional Jackson dependency to 2.13.2 2022-03-10 15:33:33 +13:00
Rob Bygrave beed67567a #2588 - [postgis-jdbc] Bump postgis-jdbc dependency from 2.2.1 to 2.5.1 2022-03-10 15:33:00 +13:00
Rob BygraveandGitHub 0fe0803374 Merge pull request #2587 from FOCONIS/ddl-refactor4
[Ddl refactor] Alter Table changes are grouped by table name.
2022-03-10 13:00:44 +13:00
Roland Praml 5fd7aca3d9 Fixed test cases 2022-03-09 16:17:04 +01:00
Rob BygraveandGitHub 348fecddf7 Merge pull request #2586 from FOCONIS/ddl-refactor3
[Clickhouse] Refactored columnNotNull
2022-03-09 22:10:59 +13:00
Rob BygraveandGitHub b333449d84 Merge pull request #2584 from FOCONIS/hazelcast-unmodifiable-map
Small code change for Hazelcast 4.1.5
2022-03-09 16:10:39 +13:00
Rob BygraveandGitHub 87a97c2889 Merge pull request #2585 from FOCONIS/ddl-refactor2
Fix DDL Default handling & Prepared PlatformDdl to to have only one 'alterColumn' method
2022-03-09 16:07:30 +13:00
Roland Praml 790147e42d Reviewed DDL changes - all changes are plausible 2022-03-08 17:28:39 +01:00
Roland Praml 3a93abaa7f Only moves in DDL (checked with git -c color.diff.newMoved=black -c color.diff.oldMoved=black diff --color-moved=plain '*.sql') 2022-03-08 12:43:54 +01:00
Roland Praml 1049d951d9 Code changes to group alterTables by tableName 2022-03-08 12:39:44 +01:00
Roland Praml c3bdac5271 [Clickhouse] Refactored columnNotNull 2022-03-07 16:41:27 +01:00
Roland Praml 9bcba0b80d Sql-scripts 2022-03-07 15:40:45 +01:00
Roland Praml 1529a2f12b Prepared PlatformDdl to to have only one 'alterColumn' method (required for further refactoring) 2022-03-07 15:35:36 +01:00
Noemi Szemenyei b41b6da40e iterator.remove() is not needed 2022-03-04 08:20:44 +01:00
Rob BygraveandGitHub 4285cbaeb2 Merge pull request #2583 from ebean-orm/feature/2582-bg-executor
#2582 - Fix for regression, BackgroundExecutor is bounded (since 12.6.2)
2022-03-04 11:15:23 +13:00
Rob BygraveandGitHub 26fd7c5498 Merge pull request #2578 from ebean-orm/feature/bump-ddl-runner
Bump to ebean-ddl-runner 1.3
2022-03-04 11:14:35 +13:00
Rob BygraveandGitHub 6ec4e4b965 Merge branch 'master' into feature/bump-ddl-runner 2022-03-04 10:26:17 +13:00
Rob Bygrave e3a20a351d #2582 - Fix for regression, BackgroundExecutor is bounded (since 12.6.2)
The change for #2121 brought in a regression where the scheduledExecutorService was used for processing ALL submitted tasks (not just scheduled ones) and is a bounded executor service.  Previously non-scheduled tasks went to a "newCachedThreadPool" based executor service and with this change we are moving back to that (via restoring and using the DaemonExecutorService for those tasks).
2022-03-04 10:21:56 +13:00
Alexander Wagner 9b8f7be98f Bug: Wrong join in query with @Inheritance and @DbForeignKey
(cherry picked from commit 4bcadbb4da3f0defbcc58802e621442d948df38a)
2022-03-02 11:50:57 +01:00
Rob Bygrave 61f5442e3b #2579 - Bump to ebean-migration 12.16.0, support both basePlatform and platform for finding/running migrations
Fix ebean-migration-auto.version to 1.2
2022-03-02 12:30:32 +13:00
Rob Bygrave c5acd31da4 #2579 - Bump to ebean-migration 12.16.0, support both basePlatform and platform for finding/running migrations 2022-03-02 12:25:57 +13:00
Rob Bygrave 49fde7654e Bump to 12.16.0-SNAPSHOT 2022-03-02 12:17:38 +13:00
Rob Bygrave 05338531ed Bump versions after release 2022-03-01 23:01:09 +13:00
Rob Bygrave eb4d906814 [maven-release-plugin] prepare for next development iteration 2022-03-01 22:47:01 +13:00
Rob Bygrave 2a96a59deb [maven-release-plugin] prepare release ebean-parent-12.15.1 2022-03-01 22:46:55 +13:00
Rob Bygrave f571da5154 Bump to ebean-ddl-runner 1.3 2022-03-01 22:35:40 +13:00
Rob Bygrave ffad9abeef #2577 - Refactor internals remove no longer needed DdlAutoCommit platform option 2022-03-01 22:32:09 +13:00
Rob Bygrave e8df81d78a DbMigrationTest ignore Yugabyte at this stage 2022-03-01 21:29:17 +13:00
Rob Bygrave ed19a96801 Tidy DbMigrationTest after fix for #2576 2022-03-01 21:01:48 +13:00
Rob Bygrave 6d27e30b88 [H2] Use LocalDateTime in H2HistoryTrigger with microsecond precision - fix DbMigrationTest 2022-03-01 20:52:39 +13:00
Rob Bygrave 52aa1a2d91 For Multi-jdk build failure - tweak DbMigrationTest, add another hack 1 milli sleep 2022-03-01 20:30:49 +13:00
Rob Bygrave ddbd816f6d For Multi-jdk build failure - tweak DbMigrationTest, add hack comment 2022-03-01 16:23:58 +13:00
Rob Bygrave 00940c2b31 For Multi-jdk build failure - tweak DbMigrationTest 2022-03-01 12:10:28 +13:00
Rob Bygrave 708ec64893 For Multi-jdk build failure - check if H2HistoryTrigger should bump 1ms if needed 2022-03-01 11:59:37 +13:00
Rob Bygrave d0dd2d8203 Add a more useful implementation for Version.toString() 2022-03-01 11:34:07 +13:00
Rob Bygrave faa921ac27 Update DbMigrationTest to include platform for some asserts 2022-03-01 11:22:40 +13:00
Rob Bygrave f2a99c7b01 Update DbMigrationTest to include platform for some asserts 2022-03-01 11:03:37 +13:00
Rob BygraveandGitHub b6ea9df444 Merge pull request #2574 from FOCONIS/ddl-cockroach
[DDL-Cockroach] Fixes for Cockroach platform
2022-02-28 11:25:21 +13:00
Rob BygraveandGitHub e6cde5862d Merge pull request #2573 from FOCONIS/ddl-hana
[DDL-hana] HANA always requires stored procedures
2022-02-28 11:24:05 +13:00
Rob BygraveandGitHub dec927bf9a Merge pull request #2571 from FOCONIS/ddl-sqlite
[DDL-SqLite] Modified SqLite platform to generate at least non failing migration scripts
2022-02-28 11:20:20 +13:00
Rob BygraveandGitHub ae41471c74 Merge pull request #2570 from FOCONIS/ddl-oracle-fixes
[DDL-Oracle] Fix drop default and ignore erros when trying to drop non existent objects
2022-02-28 11:19:43 +13:00
Rob BygraveandGitHub 843d9d2700 Merge pull request #2569 from FOCONIS/ddl-extend-test
[DDL-common] Extended DbMigrationTest to run on all platforms
2022-02-28 11:16:59 +13:00
Roland Praml 475fd38be5 FIX: PlatformDdl-tests 2022-02-25 15:44:54 +01:00
Roland Praml b88e4a35f8 Ddl fixes for clickhouse platform 2022-02-25 12:10:54 +01:00
Roland Praml c82f3783f0 Fixes for Cockroach platform 2022-02-25 12:10:06 +01:00
Roland Praml bf99f9d08d Fix: HANA always requires stored procedures (similar to SqlServer), Fix: default value on intermediate alters 2022-02-25 12:09:09 +01:00
Roland Praml f30c3869b6 Modified SqLite platform to generate at least non failing migration scripts.
Note: If you want to alter a table in SqLite, the best option is to recreate the table with the new layout
2022-02-25 12:07:06 +01:00
Roland Praml 3b32e4c018 Oracle: Fix DB name to match with docker container 2022-02-25 12:06:09 +01:00
Roland Praml e0669e9a9f DDL generation fixes fpr oracle platform (fix drop default, do "drop if exists" with error handlers) 2022-02-25 12:05:53 +01:00
Roland Praml 95b1488aed Extended DbMigrationTest to run on all platforms 2022-02-25 12:04:24 +01:00
Rob BygraveandGitHub 897a97d415 Merge pull request #2568 from FOCONIS/Tidy-up-code
Removed unused imports and add missing Override statements (no effective code change)
2022-02-25 14:29:30 +13:00
Rob BygraveandGitHub 1d71f617c2 Merge pull request #2567 from FOCONIS/tidy-up-ddl-generation
Tidy up ddl generation (no effective code change)
2022-02-25 14:28:20 +13:00
Roland Praml 1ca5789112 Removed unused imports and add missing Override statements (no effective code change) 2022-02-24 08:03:26 +01:00
Roland Praml 70ec8a3891 Removed unused code 2022-02-23 11:17:16 +01:00
Roland Praml 2dfa9d2e77 No effective code change: Normalized "DdlWrite write" to "DdlWrite writer" 2022-02-23 11:14:22 +01:00
Rob Bygrave 29a5a13dd9 Merge branch 'master' of github.com:ebean-orm/ebean 2022-02-22 14:52:14 +13:00
Rob Bygrave 7a3494ebd9 Update to the newer Apache2 licence text (from older Apache2 license text) 2022-02-22 14:51:54 +13:00
Rob BygraveandGitHub 915bf29eaf Merge pull request #2557 from FOCONIS/add-reorg-support
Refactored DDL generation
2022-02-22 13:19:51 +13:00
Rob Bygrave dad4837b50 No change - format code only 2022-02-22 13:15:28 +13:00
Rob BygraveandGitHub 8fa8c687e9 Merge pull request #2563 from FOCONIS/platform-specific-columndefinition
Different ColumnDefinition for different platforms
2022-02-22 13:13:43 +13:00
Rob Bygrave aff54f5cf7 Merge branch 'FOCONIS-bug-save-one-to-one-version-cascade' 2022-02-22 13:08:05 +13:00
Rob Bygrave fa0336a404 Merge branch 'bug-save-one-to-one-version-cascade' of https://github.com/FOCONIS/ebean into FOCONIS-bug-save-one-to-one-version-cascade 2022-02-22 13:00:41 +13:00
Noemi Szemenyei 7ccea9ff7e migrations 2022-02-18 10:03:04 +01:00
Noemi Szemenyei c2e4f862bc default columnDef should be calculated from ebean 2022-02-18 10:02:48 +01:00
Roland Praml 36bda117a6 No effective code change: Tidy up (organize imports/fix java warnings) 2022-02-17 14:47:05 +01:00
Roland Praml 08838770e9 No effective code change: Removed obsolete IOExceptions 2022-02-17 14:45:02 +01:00
Noemi Szemenyei 137a7950ff new migrations 2022-02-17 09:53:26 +01:00
Noemi Szemenyei e3980a14a2 review changes 2022-02-17 09:52:23 +01:00
Rob BygraveandGitHub ca9f48d019 Merge pull request #2562 from ebean-orm/dependabot/maven/ebean-test/org.postgresql-postgresql-42.3.3
Bump postgresql from 42.3.2 to 42.3.3 in /ebean-test
2022-02-17 21:44:01 +13:00
Rob BygraveandGitHub e83e6b0f8f Merge pull request #2561 from ebean-orm/dependabot/maven/ebean-core/org.postgresql-postgresql-42.3.3
Bump postgresql from 42.3.2 to 42.3.3 in /ebean-core
2022-02-17 21:43:49 +13:00
Rob BygraveandGitHub 7d18329c18 Merge pull request #2560 from ebean-orm/dependabot/maven/ebean-postgis/org.postgresql-postgresql-42.3.3
Bump postgresql from 42.3.2 to 42.3.3 in /ebean-postgis
2022-02-17 21:43:37 +13:00
Noemi Szemenyei c6fa60f28c migrations 2022-02-17 08:16:35 +01:00
Noemi Szemenyei 3ab7ebe5e6 new property for test 2022-02-17 08:14:51 +01:00
Noemi Szemenyei 48e875714b solution v1
(cherry picked from commit 3d83c6bd0e2bcca6fc04f73ce08983266b9df636)
2022-02-17 08:13:39 +01:00
dependabot[bot]andGitHub 5ba93ed927 Bump postgresql from 42.3.2 to 42.3.3 in /ebean-test
Bumps [postgresql](https://github.com/pgjdbc/pgjdbc) from 42.3.2 to 42.3.3.
- [Release notes](https://github.com/pgjdbc/pgjdbc/releases)
- [Changelog](https://github.com/pgjdbc/pgjdbc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pgjdbc/pgjdbc/compare/REL42.3.2...REL42.3.3)

---
updated-dependencies:
- dependency-name: org.postgresql:postgresql
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-16 01:19:58 +00:00
dependabot[bot]andGitHub 9974102f1a Bump postgresql from 42.3.2 to 42.3.3 in /ebean-core
Bumps [postgresql](https://github.com/pgjdbc/pgjdbc) from 42.3.2 to 42.3.3.
- [Release notes](https://github.com/pgjdbc/pgjdbc/releases)
- [Changelog](https://github.com/pgjdbc/pgjdbc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pgjdbc/pgjdbc/compare/REL42.3.2...REL42.3.3)

---
updated-dependencies:
- dependency-name: org.postgresql:postgresql
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-16 01:19:22 +00:00
dependabot[bot]andGitHub ba27e09179 Bump postgresql from 42.3.2 to 42.3.3 in /ebean-postgis
Bumps [postgresql](https://github.com/pgjdbc/pgjdbc) from 42.3.2 to 42.3.3.
- [Release notes](https://github.com/pgjdbc/pgjdbc/releases)
- [Changelog](https://github.com/pgjdbc/pgjdbc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pgjdbc/pgjdbc/compare/REL42.3.2...REL42.3.3)

---
updated-dependencies:
- dependency-name: org.postgresql:postgresql
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-16 01:18:59 +00:00
Alexander Wagner 90066eee0c Possible fix 2022-02-11 10:31:24 +01:00
Roland Praml 53c8827a52 Refactor: remove MConfiguration from BaseDdlBuffer (it is unused, and may/should be re-added to the DdlWrite when needed) 2022-02-08 16:21:25 +01:00
Alexander Wagner 3bb6f0ca65 Bug: save with cascade of @OneToOne + @Version model sets version to 1
(cherry picked from commit 1570e1800d)
2022-02-08 16:08:13 +01:00
Roland Praml 6e5eb6b963 Refactor: BaseDdlBuffer uses StringBuilder instead of StringWriter. Makes IOException obsolete. 2022-02-08 16:04:14 +01:00
Rob BygraveandGitHub 7bea0d0eb2 Merge pull request #2551 from FOCONIS/move-testcase
Move DbMigration-Tests to ebean-test
2022-02-08 10:23:40 +13:00
Rob BygraveandGitHub 5a07a54544 Merge pull request #2555 from FOCONIS/clickhouse-dbarray-type-missing
ClickHouseDb - decimal[] array type missing
2022-02-08 10:12:46 +13:00
Rob BygraveandGitHub 684508b7ea Merge pull request #2554 from FOCONIS/add-stored-procs-mysql
generate mysql StoredProcs for column deletion also for mariadb
2022-02-08 10:12:13 +13:00
Rob BygraveandGitHub ab72fd97b9 Merge pull request #2553 from FOCONIS/add-yugabyte-platform
Add Yugabyte-Platform to DefaultDbMigration
2022-02-08 10:11:33 +13:00
Rob BygraveandGitHub 8486415249 Merge pull request #2552 from FOCONIS/flaky-dtimedmetrictest
DTimedMetricTest fails sometimes (flaky test)
2022-02-08 10:10:36 +13:00
Roland Praml 6a74b84b8c Comments and mysql fixes 2022-02-07 17:07:01 +01:00
Roland Praml 999be3e0a7 ClickHouseDb - decimal[] array type missing 2022-02-07 16:40:11 +01:00
Roland Praml a656b55526 generate mysql StoredProcs for column deletion also for mariadb 2022-02-07 16:37:15 +01:00
Roland Praml dabb1451e9 Add Yugabyte-Platform to DefaultDbMigration 2022-02-07 16:34:39 +01:00
Roland Praml cde00650ca DTimedMetricTest fails sometimes 2022-02-07 16:27:09 +01:00
Roland Praml 6b96bea480 Disabled Yugabyte 2022-02-07 16:23:50 +01:00
Roland Praml a731bfdfaf Multi-platform tests 2022-02-07 16:04:59 +01:00
Roland Praml 0ee153d6bc Add: ElementCollection 2022-02-07 14:08:26 +01:00
Roland Praml cb89b903fd Regenerated scripts & tests 2022-02-07 14:07:10 +01:00
Roland Praml a93e2e05c5 Moved DbMigrationtests test to "ebean-tests" 2022-02-07 11:55:41 +01:00
Rob BygraveandGitHub 05ad6da7e6 Merge pull request #2550 from ebean-orm/feature/cockroach-like
CockroachDB - Now supports LIKE ESCAPE and no longer needs Autocommit for DDL
2022-02-04 17:02:33 +13:00
Rob Bygrave 0d3ea9626c CockroachDB - Now supports LIKE ESCAPE and no longer needs Autocommit for DDL 2022-02-04 17:02:01 +13:00
Rob Bygrave b8b83c2ec8 Update more tests for CockroachDB 2022-02-04 16:59:16 +13:00
Rob Bygrave d05dfae1d7 Merge branch 'master' of github.com:ebean-orm/ebean 2022-02-04 15:55:26 +13:00
Rob Bygrave d0fcd4a13a #2549 - Fix DefaultPersister to expose non RuntimeExceptions on insert/update/delete. Not hide NoClassDefFoundError etc 2022-02-04 15:55:00 +13:00
Rob BygraveandGitHub b02adeccc1 Merge pull request #2548 from ebean-orm/feature/tests-for-cockroach
CockroachDB - Modify tests, use BigDecimal over Double etc
2022-02-04 11:04:55 +13:00
Rob Bygrave b3f110b7a5 CockroachDB - Modify tests, use BigDecimal over Double etc 2022-02-04 10:42:07 +13:00
Rob Bygrave daf0ba67a4 #2547 - CockroachDB - Use ON DISTINCT ... like Postgres and Yugabyte 2022-02-04 08:58:21 +13:00
Rob Bygrave cf3499f0e4 #2547 - Update BaseTestCase to include CockroachDB 2022-02-04 08:41:34 +13:00
Rob Bygrave a72cbaf243 #2547 - Cockroach identity DDL - Changing to use standard GENERATED ... AS IDENTITY syntax 2022-02-04 08:40:23 +13:00
Rob Bygrave 9ea2811aa3 Add H2Database build badge 2022-02-03 17:13:45 +13:00
Rob Bygrave 0abef7396f Add H2Database build workflow 2022-02-03 16:41:58 +13:00
Rob Bygrave 101d9e85ef Add H2Database build workflow 2022-02-03 16:38:17 +13:00
Rob Bygrave 7a3be45efd Add Yugabyte build badge to README 2022-02-03 16:22:53 +13:00
Rob Bygrave f4d92eed18 Bump test modules to 12.15.1-SNAPSHOT after release 2022-02-03 09:19:10 +13:00
Rob Bygrave db6f2cba75 [maven-release-plugin] prepare for next development iteration 2022-02-03 09:02:38 +13:00
Rob Bygrave 6f694eb6ca [maven-release-plugin] prepare release ebean-parent-12.15.0 2022-02-03 09:02:30 +13:00
Rob Bygrave 539633c963 Adjust Multi-database platform 2022-02-02 23:40:58 +13:00
Rob Bygrave 8e05956f6b Default tests to use H2 2022-02-02 23:39:15 +13:00
Rob Bygrave 94951a5476 Yugabyte - use distinct on clause with Yugabyte (like Postgres) 2022-02-02 23:38:50 +13:00
Rob BygraveandGitHub 2cd769d00f Merge pull request #2546 from ebean-orm/feature/yugabyte-mutlivaluebind
Modify tests to use isPostgresCompatible() (to effectively include Yugabyte)
2022-02-02 23:26:12 +13:00
Rob Bygrave 389f2bcd2f Modify tests to use isPostgresCompatible() (to effectively include Yugabyte) 2022-02-02 23:25:13 +13:00
Rob BygraveandGitHub 1ba259d15d Merge pull request #2545 from ebean-orm/feature/yugabyte-mutlivaluebind
Yugabyte - Use MultiValueBind like Postgres (that is, ANY(?) clause in sqlQuery/sqlUpdate)
2022-02-02 23:03:33 +13:00
Rob Bygrave 4899f23773 Yugabyte - Use MultiValueBind like Postgres (that is, ANY(?) clause in sqlQuery/sqlUpdate) 2022-02-02 23:02:32 +13:00
Rob Bygrave 771e9ff069 Tidy tests only - EqlParserTest, EbeanServer_deleteAllByIdTest 2022-02-02 23:00:06 +13:00
Rob Bygrave 7d27c06483 Bump jaxb-runtime dependency 2022-02-02 22:30:37 +13:00
Rob Bygrave d6a8643fe4 Support @DbArray of BigDecimal 2022-02-02 22:22:42 +13:00
Rob BygraveandGitHub 97c714d945 Merge pull request #2544 from ebean-orm/feature/dbarray_bigdecimal
Support @DbArray of BigDecimal
2022-02-02 22:08:48 +13:00
Rob Bygrave 57f6668b37 Support @DbArray of BigDecimal 2022-02-02 21:57:39 +13:00
Rob Bygrave 9d506b4397 Bump test dependencies 2022-02-02 20:48:55 +13:00
Rob Bygrave 5a12cc58d1 Bump Postgres test dependencies to 42.3.2 2022-02-02 17:18:14 +13:00
Rob Bygrave f7c83411c2 #2415 - SQL for Index and Foreign Key didn't get generated if I map ID column after @ManyToOne
Allow declaring the column twice with scalar type after ManyToOne type
2022-02-02 17:12:18 +13:00
Rob BygraveandGitHub a02fee7de0 Merge pull request #2539 from ebean-orm/feature/performance-pathmaps
#2507 - Script runner does not work with file system path
2022-02-02 13:03:45 +13:00
Rob Bygrave 170e323ee9 #2507 - Script runner does not work with file system path 2022-02-02 13:02:49 +13:00
Rob BygraveandGitHub 4555f3da51 Merge pull request #2538 from ebean-orm/feature/performance-pathmaps
Performance - cache the path maps used for load context
2022-02-02 12:30:56 +13:00
Rob Bygrave 376b3a9f13 #2538 - Tidy CQuery use of path() 2022-02-02 12:20:33 +13:00
Rob Bygrave 43af5343a4 Performance - cache the path maps used for load context
- Cache the path maps
- Include the ToOne paths
- Use empty map for null prefix
2022-02-02 12:10:02 +13:00
Rob Bygrave 886f539fc4 Refactor tidy SqlTreeNodeBean 2022-02-02 11:30:56 +13:00
Rob Bygrave 1035d74113 Bump to 12.15.0-SNAPSHOT 2022-02-02 11:20:59 +13:00
Rob Bygrave 26a4feb5ba Bump to 12.15.0-SNAPSHOT 2022-02-02 11:14:36 +13:00
Rob Bygrave a1c0e21234 Bump to 12.15.0-SNAPSHOT 2022-02-02 10:59:04 +13:00
Rob Bygrave cbe133dd68 #2509 - Bump jedis client to 4.1.1 2022-02-02 10:56:59 +13:00
Rob BygraveandGitHub 4b1fe063b0 Merge pull request #2531 from FOCONIS/db2/persist-batch-on-cascade
Set persistBatchOnCascade to ALL for newer DB2 versions
2022-02-02 09:06:39 +13:00
Rob Bygrave 15f1bd310b #2521 - Refactor inline index++ 2022-02-02 09:05:14 +13:00
Rob Bygrave 6e3e9bd4f7 git push origin masterMerge branch 'FOCONIS-db2/fix-get-generated-keys' 2022-02-02 09:00:01 +13:00
Rob Bygrave fddcc64741 #2521 - Move horrible DB2 hack into DB2GetKeys 2022-02-02 08:59:41 +13:00
Rob Bygrave ed917c55f1 Merge branch 'db2/fix-get-generated-keys' of https://github.com/FOCONIS/ebean into FOCONIS-db2/fix-get-generated-keys 2022-02-02 08:46:42 +13:00
Rob Bygrave 17fed0ebd8 Tidy test only - TestNestedBeginRequiresNew 2022-02-01 15:18:06 +13:00
Rob BygraveandGitHub 2dcd17830a Merge pull request #2536 from ebean-orm/feature/ebeantest-pg14
ebean-test - bump Postgres default container to 14
2022-02-01 13:46:09 +13:00
Rob Bygrave a412873da6 ebean-test - bump Postgres default container to 14 2022-02-01 13:36:37 +13:00
Rob BygraveandGitHub 7f5370c709 Merge pull request #2535 from ebean-orm/feature/yugabyte-workflow-build
Yugabyte - Add specific github workflow build
2022-02-01 13:33:28 +13:00
Rob Bygrave 9470a1376c Yugabyte - Add specific github workflow build 2022-02-01 13:32:55 +13:00
Rob BygraveandGitHub 7f5b65cf45 Merge pull request #2534 from ebean-orm/feature/yugabyte-test
Yugabyte - ebean-test support via ebean.test.platform=yugabyte
2022-02-01 13:30:49 +13:00
Rob Bygrave 6d0f5aea82 Yugabyte - ebean-test support via ebean.test.platform=yugabyte 2022-02-01 13:26:05 +13:00
Rob Bygrave 530a75b591 DB - test ddl changes 2022-02-01 13:24:50 +13:00
Rob Bygrave 13cfaba0c8 Yugabyte - Disable commit and continue test for Yugabyte (failing occasionally, need to review) 2022-02-01 11:55:26 +13:00
Rob Bygrave 1fa92efb63 Yugabyte - Adjust DbJsonTest wrt ordering in content, use JSON assertContainsResource()
Highlights that the DbJson assertContains() asserts are better longer term approach (over content matching asserts)
2022-02-01 11:55:15 +13:00
Rob Bygrave bc477c64cb Yugabyte - Disable commit and continue test for Yugabyte (failing occasionally, need to review) 2022-02-01 11:53:03 +13:00
Rob Bygrave 804098149e Yugabyte - Tidy tests with element collections not maintaining ordering 2022-02-01 11:51:46 +13:00
Rob Bygrave 567ad92050 Yugabyte - Tidy tests 2022-02-01 10:41:29 +13:00
Rob BygraveandGitHub 3a84cb8623 Merge pull request #2533 from ebean-orm/feature/yugabyte-json-hstore
Yugabyte - Fix some tests for running against Yugabyte
2022-02-01 09:50:05 +13:00
Rob Bygrave b4ddbe38ee Yugabyte - Fix some tests for running against Yugabyte 2022-02-01 09:49:23 +13:00
Rob BygraveandGitHub 01722b334b Merge pull request #2532 from FOCONIS/db2/unique_indices_with_null_columns
DB2 Support for unique indices with null columns
2022-02-01 08:16:43 +13:00
Rob BygraveandGitHub 0a780523cf Merge pull request #2529 from ebean-orm/feature/yugabyte-json-hstore
Yugabyte - Use Postgres ScalarTypes for JSON/JSONB but not HSTORE
2022-02-01 07:56:26 +13:00
Roland PramlandJonas Pöhler f2e04d9fbf DB2. Support for unique indices with null columns
(cherry picked from commit 23a5d577a6)
2022-01-31 13:58:40 +01:00
Jonas Pöhler 4b8565e7c7 FIX: we can set persistBatchOnCascade to ALL for newer DB2 versions 2022-01-31 11:32:22 +01:00
Rob Bygrave 1359d534d5 Yugabyte - Use Postgres ScalarTypes for JSON/JSONB but not HSTORE 2022-01-29 17:05:12 +13:00
Rob BygraveandGitHub 94ae513d85 Merge pull request #2522 from FOCONIS/db2/check-exception-chain
DB2: SqlCodeTranslator must check exception chain
2022-01-29 15:33:46 +13:00
Rob BygraveandGitHub d58c56484e Merge pull request #2517 from FOCONIS/fix-datasource
FIX: Datasource was not initialized in offline mode.
2022-01-29 15:28:53 +13:00
Rob BygraveandGitHub 75a27fa2d6 Merge pull request #2511 from FOCONIS/unselect-lobs
Unselect LOBs when making a distinct select
2022-01-29 15:25:00 +13:00
Rob BygraveandGitHub cc1c08cd34 Merge pull request #2528 from FOCONIS/db2/disabled-tests
DB2 Fix tests for DB2
2022-01-29 15:19:01 +13:00
Rob BygraveandGitHub 029cde12db Merge pull request #2527 from FOCONIS/db2/fix-sequence
DB2: Fix Sequence generator
2022-01-29 15:16:24 +13:00
Rob BygraveandGitHub b33914ab2f Merge pull request #2526 from FOCONIS/db2/no-null-values
DB2: Do not try to update deferred null values (Discovered by TestPrinterStateIssue)
2022-01-29 15:15:33 +13:00
Rob BygraveandGitHub d571a6c354 Merge pull request #2525 from FOCONIS/db2/truncate
DB2: truncate needs commit after each statement
2022-01-29 15:13:29 +13:00
Rob BygraveandGitHub 95b19569e4 Merge pull request #2524 from FOCONIS/db2/nocompressedid
DB2 does not support ids in compressed form
2022-01-29 15:12:25 +13:00
Rob BygraveandGitHub a9560c6664 Merge pull request #2523 from FOCONIS/db2/sqllimiter
DB2: FIX Db2SqlLimiter & tests
2022-01-29 15:11:33 +13:00
Rob BygraveandGitHub 235822bcb2 Merge pull request #2520 from FOCONIS/db2/fix-raw-like
DB2: Fix Raw like
2022-01-29 15:07:41 +13:00
Rob BygraveandGitHub 5a024ea19f Merge pull request #2519 from FOCONIS/db2/fix-default-values
DB2: Fix default values for auto generated ids
2022-01-29 15:06:54 +13:00
Rob BygraveandGitHub 399f8b92fa Merge pull request #2518 from FOCONIS/db2/fix-concat-operator
DB2: Fix Concat operator
2022-01-29 15:05:58 +13:00
Rob BygraveandGitHub be93263015 Merge pull request #2513 from FOCONIS/h2-backward-compat
Test against H2 1.4.199
2022-01-29 11:23:19 +13:00
Roland Praml b4fe4ec8b9 ADD.profile and autodetect code 2022-01-28 16:04:35 +01:00
Roland Praml 8c9f5f4a22 Disabled more tests for DB2 2022-01-28 11:38:11 +01:00
Roland Praml 953f8054e6 FIX: Clean up tests 2022-01-28 11:38:01 +01:00
Roland Praml aadb791980 FIX: isSame replaceed by isEqualTo 2022-01-28 11:37:48 +01:00
Roland Praml 7430f97c9c fix compile errors for EqlParserTest 2022-01-28 11:37:30 +01:00
Roland Praml ba21eeaadb DB2: Do not try to update deferred null values (Discovered by TestPrinterStateIssue) 2022-01-28 10:59:16 +01:00
Roland Praml c0e827ffda DB2: Fix Sequence generator 2022-01-28 10:57:41 +01:00
Roland Praml 3b30708dfc DB2: truncate needs commit after each statement 2022-01-28 10:56:01 +01:00
Roland Praml 9f9184ac6a DB2 does not support ids in compressed form 2022-01-28 10:53:51 +01:00
Roland Praml 5845f94303 DB2:ignored tests 2022-01-28 10:28:02 +01:00
Roland Praml dd824ffe52 DB2: Fix EqlParserTests similar to HANA 2022-01-28 10:27:50 +01:00
Roland Praml e5d29afa4c DB2: Disabled test for encryption, as it is not supported for Db2 2022-01-28 10:27:39 +01:00
Roland Praml 5ae5e408e3 DB2: FIX Db2SqlLimiter & tests 2022-01-28 10:23:22 +01:00
Roland Praml 90f6d0707f DB2: SqlCodeTranslator must check exception chain 2022-01-28 10:21:55 +01:00
Roland Praml 0310601e31 DB2: Fix getGenerateKeys (ungly workaround) 2022-01-28 10:06:34 +01:00
Roland Praml 015dd00b8e DB2: Fix Raw like 2022-01-28 10:04:20 +01:00
Roland Praml 6d978add29 DB2: Fix default values 2022-01-28 09:47:49 +01:00
Roland Praml e529232f76 DB2: Fix insert default values 2022-01-28 09:47:04 +01:00
Roland Praml d982ac73b7 DB2: Fix Concat operator 2022-01-28 09:38:41 +01:00
Roland Praml ddaff81b9c FIX: Datasource was not initialized in offline mode. 2022-01-28 09:29:12 +01:00
Rob BygraveandGitHub 1d11666945 Merge pull request #2516 from ebean-orm/feature/yugabyte-platform-ddl
Yugabyte platform support - Automatic detection and DDL support
2022-01-28 17:45:46 +13:00
Rob Bygrave 223e5160dc #2516 - Touch StartYugabyte 2022-01-28 17:26:58 +13:00
Rob Bygrave 64605b5090 Yugabyte platform support - Automatic detection and DDL support
- Automatic detection similar to Cockroach
- DDL very similar to Postgres but no CREATE TABLE LIKE support (for history DDL)
2022-01-28 17:04:19 +13:00
Rob Bygrave 425124d8f7 Adjust README for build badge changes 2022-01-28 10:55:22 +13:00
Rob Bygrave 6af8968280 Adjust workflow build for Oracle 18 2022-01-28 10:44:25 +13:00
Rob Bygrave a9bee03ba7 Add workflow build for Oracle 18 2022-01-28 09:57:49 +13:00
Rob BygraveandGitHub 302cc426bd Merge pull request #2515 from ebean-orm/feature/oracle-maxInBinding
Add maxInBinding - Oracle support for large delete by ids
2022-01-28 09:50:01 +13:00
Rob Bygrave 44462e3513 Add maxInBinding - Oracle support for large delete by ids 2022-01-28 09:46:03 +13:00
Rob Bygrave b748c598a1 build workflow rename for DB2 LUW 2022-01-28 09:04:56 +13:00
Rob Bygrave dbac184b4c Rename build workflows 2022-01-28 08:58:25 +13:00
Rob Bygrave 29c5916203 Add build workflow for db2 2022-01-28 08:54:21 +13:00
Rob BygraveandGitHub 827315a11d Merge pull request #2509 from ebean-orm/feature/jedis-4x
Support jedis 4.1.0 client (ScanParams, ScanResult in different package now)
2022-01-28 08:37:28 +13:00
Rob BygraveandGitHub 14ef8f6e0d Merge pull request #2512 from FOCONIS/introduce-db2
ADD: different DB2 platforms
2022-01-28 08:17:03 +13:00
Roland Praml 5b63434f13 reindent code and linked #2514 2022-01-27 16:43:35 +01:00
Roland Praml 3e8cc87f01 Add: github workflow for db2 2022-01-27 16:02:18 +01:00
Roland Praml 190b4ef588 Made some fixes in wrong ddl generation 2022-01-27 15:58:44 +01:00
Roland Praml 4a20c9eb99 Test against H2 1.4.199 2022-01-27 13:56:21 +01:00
Roland Praml d8c2b3d583 FIX: Compile errors 2022-01-27 10:34:25 +01:00
Roland Praml 48c8f5e2ca ADD: different DB2 platforms 2022-01-27 10:09:31 +01:00
Noemi SzemenyeiandRoland Praml 69a753fc4f DB2:Unselect LOBs when making a distinct select 2022-01-27 08:34:51 +01:00
Roland Praml b9ba6b2db5 DB2: Adapted Noemi's patch to new ebean version 2022-01-27 07:57:35 +01:00
Rob Bygrave 7a6071ac9a Support jedis 4.1.0 client (ScanParams, ScanResult in different package now) 2022-01-27 09:20:23 +13:00
Rob Bygrave 404b167bcc #2508 - Bump ebean-datasource to 7.5 2022-01-27 09:13:20 +13:00
Rob Bygrave 7278db56ea Modify test TestUuidGenerator to allow odd jvm variance in root error message 2022-01-27 09:12:57 +13:00
Rob BygraveandGitHub 1dc5ecc81f Merge pull request #2506 from FOCONIS/fix-localdate-databind
DB2: Fix: DataBind/Read of native LocalDates
2022-01-27 09:02:04 +13:00
Rob BygraveandGitHub c39661e2c2 Merge pull request #2505 from FOCONIS/refactor-uuid-v1-generator
Refactor UUID generator. Add uuid-property to serverConfig (#57)
2022-01-27 08:55:48 +13:00
Rob BygraveandGitHub a702bbb5ee Merge pull request #2504 from FOCONIS/sqlserver-delete-problem
Cannot delete bean with more than 2100 child beans on SqlServer
2022-01-27 08:54:27 +13:00
Roland PramlandRoland Praml 1982027300 Organized imports 2022-01-26 16:55:50 +01:00
Roland PramlandRoland Praml 2e1a6eec04 DB2: Fix: DataBind/Read of native LocalDates 2022-01-26 16:51:55 +01:00
Roland PramlandRoland Praml e5f37e638c Refactor UUID generator. Add uuid-property to serverConfig (#57)
Co-authored-by: Roland Praml <roland.praml@foconis.de>
2022-01-26 12:05:12 +01:00
Roland Praml 7ffea8e922 FIX: DeleteBatch for SQLServer 2022-01-26 11:59:35 +01:00
Roland Praml 315640df6b ADD: Failing test case 2022-01-26 11:59:17 +01:00
Rob Bygrave 78a647a72e Merge branch 'master' of github.com:ebean-orm/ebean 2022-01-26 22:42:10 +13:00
Rob Bygrave 7ffd2f1886 #2501 Modify pom use ${h2database.version} 2022-01-26 22:41:55 +13:00
Rob BygraveandGitHub 0087eabb4e Merge pull request #2502 from FOCONIS/fix-composite-id-in-select-distinct
Fix: composite id in select distinct queries
2022-01-26 22:22:18 +13:00
Rob BygraveandGitHub 5f0731f975 Merge pull request #2499 from ebean-orm/dependabot/maven/ebean-core/com.h2database-h2-2.1.210
Bump h2 from 1.4.199 to 2.1.210 in /ebean-core
2022-01-26 22:19:14 +13:00
Rob BygraveandGitHub 85e31899b9 Merge pull request #2498 from ebean-orm/dependabot/maven/ebean-test/com.h2database-h2-2.1.210
Bump h2 from 1.4.199 to 2.1.210 in /ebean-test
2022-01-26 22:18:50 +13:00
Rob BygraveandGitHub 3337541ac4 Merge pull request #2497 from ebean-orm/dependabot/maven/ebean-api/com.h2database-h2-2.1.210
Bump h2 from 1.4.199 to 2.1.210 in /ebean-api
2022-01-26 22:18:18 +13:00
Rob Bygrave b123b06f4d Merge branch 'wip/h2database-v2' 2022-01-26 22:08:52 +13:00
Rob Bygrave 17df5a2c16 Merge branch 'master' into wip/h2database-v2 2022-01-26 22:07:20 +13:00
Rob BygraveandGitHub e13aaefee1 Merge pull request #2500 from ebean-orm/feature/refactor-sqltreeload
Refactor internals split result load functionality from SqlTreeNode into SqlTreeLoad
2022-01-26 22:04:42 +13:00
Rob Bygrave 09ce693da2 Merge branch 'feature/refactor-sqltreeload' of github.com:ebean-orm/ebean into feature/refactor-sqltreeload 2022-01-26 22:00:40 +13:00
Rob Bygrave 17f7be72f4 Touch README.md 2022-01-26 22:00:28 +13:00
Rob Bygrave 23061473c7 Refactor internals split result load functionality from SqlTreeNode into SqlTreeLoad 2022-01-26 22:00:28 +13:00
Rob Bygrave 0944b87283 Merge branch 'wip/h2database-v2' of github.com:ebean-orm/ebean into wip/h2database-v2 2022-01-26 21:58:12 +13:00
Rob Bygrave 86768dfe4d Touch application-test.properties 2022-01-26 21:57:41 +13:00
Rob Bygrave ffdafc796b Touch README.md 2022-01-26 21:54:19 +13:00
Rob Bygrave 5466c6a350 Reduce logging when running Build tests 2022-01-26 21:51:48 +13:00
Rob Bygrave 7e0ac5a73a Fix issues with tests - tidy ResetBasicData 2022-01-26 21:47:00 +13:00
Noemi Szemenyei 008e1849a2 FIX: other queries for other platforms 2022-01-26 08:25:38 +01:00
Noemi Szemenyei dcf60a3d1c Trigger Build 2022-01-26 08:09:42 +01:00
Rob Bygrave 774cab327d Fix issues with test ordering - ordering in ResetBasicData 2022-01-26 17:23:18 +13:00
Rob Bygrave 2f824c99ea Fix issues with test ordering 2022-01-26 16:53:38 +13:00
Rob Bygrave 1a54fc12ad Test logging enabled for investigating CI Build issue 2022-01-26 15:48:03 +13:00
Rob Bygrave a1d6b280bc Bump test parent poms 2022-01-26 14:58:38 +13:00
Rob Bygrave fa561e5197 CI Build with single test and bump enhancement tiles 2022-01-26 14:52:32 +13:00
Rob Bygrave 4a8231a6cc CI Build using adopt distribution 2022-01-26 14:38:52 +13:00
Rob Bygrave 5cb486c745 CI Build without maven cache 2022-01-26 14:18:02 +13:00
Noemi Szemenyei dd26dc342d FIX: select properties of the embedded Id
(cherry picked from commit 58e952b1ec)
2022-01-25 09:42:27 +01:00
Noemi Szemenyei 7733e9382c ADD: failing test with select distinct with composite key and T0.NULL
(cherry picked from commit a08ba194b7)
2022-01-25 09:42:04 +01:00
Rob BygraveandGitHub bc6d2fb3be Merge branch 'master' into wip/h2database-v2 2022-01-25 21:30:36 +13:00
Rob Bygrave a9dbc036e9 Support H2database 2.x 2022-01-25 21:28:09 +13:00
Rob Bygrave 8d29a3a575 Bind LocalDate directly using JDBC driver to convert
This addresses issues with dates before 1900-01-01 with H2Database
2022-01-25 21:27:32 +13:00
Rob Bygrave 4158ac4665 Refactor internals split result load functionality from SqlTreeNode into SqlTreeLoad 2022-01-25 13:44:23 +13:00
dependabot[bot]andGitHub ddab6e65b7 Bump h2 from 1.4.199 to 2.1.210 in /ebean-core
Bumps [h2](https://github.com/h2database/h2database) from 1.4.199 to 2.1.210.
- [Release notes](https://github.com/h2database/h2database/releases)
- [Commits](https://github.com/h2database/h2database/compare/version-1.4.199...version-2.1.210)

---
updated-dependencies:
- dependency-name: com.h2database:h2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-21 23:47:28 +00:00
dependabot[bot]andGitHub bbede04a56 Bump h2 from 1.4.199 to 2.1.210 in /ebean-test
Bumps [h2](https://github.com/h2database/h2database) from 1.4.199 to 2.1.210.
- [Release notes](https://github.com/h2database/h2database/releases)
- [Commits](https://github.com/h2database/h2database/compare/version-1.4.199...version-2.1.210)

---
updated-dependencies:
- dependency-name: com.h2database:h2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-21 23:47:27 +00:00
dependabot[bot]andGitHub 9df96b0294 Bump h2 from 1.4.199 to 2.1.210 in /ebean-api
Bumps [h2](https://github.com/h2database/h2database) from 1.4.199 to 2.1.210.
- [Release notes](https://github.com/h2database/h2database/releases)
- [Commits](https://github.com/h2database/h2database/compare/version-1.4.199...version-2.1.210)

---
updated-dependencies:
- dependency-name: com.h2database:h2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-21 23:47:27 +00:00
Rob Bygrave 6a6b6b8200 Bump ebean-kotlin to 12.14.2-SNAPSHOT 2022-01-21 17:38:59 +13:00
Rob Bygrave e26e093680 Bump test poms to 12.14.2-SNAPSHOT 2022-01-21 17:38:03 +13:00
Rob BygraveandGitHub fc107115c6 Merge pull request #2494 from ebean-orm/FOCONIS-pr/enh/stored_procedures_mysql_drop_column
Optionally allow use of stored procedures for MySql to drop columns in db migration
2022-01-21 17:26:22 +13:00
Rob Bygrave 0139ad891e #2403 - table partitioning (Postgres only at this point) is always included + simplify skip logic 2022-01-21 17:20:21 +13:00
Rob Bygrave 4f70c09690 Merge branch 'pr/enh/stored_procedures_mysql_drop_column' of https://github.com/FOCONIS/ebean into FOCONIS-pr/enh/stored_procedures_mysql_drop_column 2022-01-21 17:06:48 +13:00
Rob Bygrave df8ae18bf6 [maven-release-plugin] prepare for next development iteration 2022-01-17 22:31:00 +13:00
Rob Bygrave 8edaabf755 [maven-release-plugin] prepare release ebean-parent-12.14.1 2022-01-17 22:30:53 +13:00
Rob Bygrave 25eea42211 Bump to ebean-migration 12.13.0 and ebean-agent 12.14.1 2022-01-17 22:28:36 +13:00
Rob Bygrave 263f6cdeba Tidy OraclePlatform only 2022-01-17 22:10:53 +13:00
Rob Bygrave 38f1967e60 #2473 - Oracle - column alias - Change such that OraclePlatform doesn't use column alias
So with #2254 we regressed OraclePlatform to use column alias. This really should have introduced an Oracle12 platform instead. 18c onwards and we don't want the column alias.
2022-01-17 22:10:21 +13:00
Rob Bygrave 6eb8eb0dd2 #2473 Tidy BasicSqlAnsiLimiter only, no functional change 2022-01-17 21:58:33 +13:00
Rob Bygrave 1165d857d8 Fix test ParentQueryTest 2022-01-17 21:57:14 +13:00
Rob Bygrave 874c2f5231 #2492 - Fix for Oracle platform when insert only default values 2022-01-17 21:42:09 +13:00
Rob Bygrave 88ab852855 No real change, tidy DbExpressionHandlerFactory only 2022-01-17 21:28:45 +13:00
Rob Bygrave b577331524 #2492 - Fix for Oracle platform when insert only default values 2022-01-17 21:27:42 +13:00
Rob Bygrave ec45fc1c86 Fix tests for Oracle - BITADD in @Where clause expression 2022-01-17 21:26:19 +13:00
Rob Bygrave e65876e8ed #2477 - Add failing test case (disable for the moment) 2022-01-17 20:58:19 +13:00
Rob BygraveandGitHub 5453037172 Merge pull request #2491 from ebean-orm/feature/2476-elementCollectionConstructor
#2476 - Fix for element collection on bean with default constructor
2022-01-17 15:41:33 +13:00
Rob Bygrave 9b116c9bf6 #2476 - tidy tests 2022-01-17 15:38:41 +13:00
Rob Bygrave 82862deccc #2476 - Fix for element collection on bean with default constructor
Note that we can look for a better longer term fix which might would look at treating element collection more like ToMany collections in terms of enhancement.
2022-01-17 15:36:26 +13:00
Rob Bygrave 1c83bbe0b0 #2476 - Failing test for element collection on bean with default constructor 2022-01-17 15:33:13 +13:00
Rob BygraveandGitHub f16f34f35f Merge pull request #2488 from ebean-orm/feature/2487
#2487 - ebean-test support Docker In Docker - docker container's hostname rather than hardcoded "localhost"
2022-01-14 16:32:04 +13:00
Rob Bygrave 38bc5b2fea #2488 - refactor extract logic into DockerHost helper, fix RedisSetup, pass docker host to ebean-test-docker 2022-01-14 16:27:04 +13:00
Rob Bygrave 356dc5eb19 #2487 - ebean-test support Docker In Docker - docker container's hostname rather than hardcoded "localhost" 2022-01-13 15:02:38 +13:00
Rob BygraveandGitHub c5779133bc Merge pull request #2485 from FOCONIS/fix-utf8-problems-with-specialchars
Fix utf8 problems with specialchars
2022-01-13 11:05:27 +13:00
Rob BygraveandGitHub b8b6311348 Merge pull request #2447 from FOCONIS/fix-scalartype-problem2
Traverse class hierarchy, when searching for ScalarType
2022-01-13 10:58:05 +13:00
FOCONIS\szemenyei 8eed983fbb restore old test 2022-01-12 08:37:46 +01:00
Rob BygraveandGitHub 7cfecb83a9 Merge pull request #2486 from bigjimlefou/fixWindows
Fix some tests failing on Windows
2022-01-12 09:17:37 +13:00
bigjimlefou e92939a34d Fix failing test on Windows platform 2022-01-11 15:41:20 +01:00
bigjimlefou 408b982eb3 Use of platform-specific specific file separator 2022-01-11 15:41:19 +01:00
bigjimlefou dd7e7711a8 Use of platform-specific specific file separator 2022-01-11 15:41:19 +01:00
bigjimlefou 5a3f7853a6 Fix failing test on Windows platform. 2022-01-11 15:41:19 +01:00
Roland PramlandFOCONIS\szemenyei 01847e44de Always use UTF-8 2022-01-11 10:11:13 +01:00
FOCONIS\szemenyei 0cf9f0bf58 Revert "at first revert solution"
This reverts commit b01b44af10.
2022-01-11 09:49:02 +01:00
FOCONIS\szemenyei b01b44af10 at first revert solution 2022-01-11 09:48:47 +01:00
FOCONIS\szemenyei 8d85000970 Fix Checksum calculate() with special characters
(cherry picked from commit e9efd5a702)
2022-01-11 09:47:44 +01:00
Jonas Pöhler e7f9c63502 Clear up some possible confusion in the test 2022-01-05 15:46:34 +01:00
Jonas Pöhler eb21b41fba Refactor and fixes for interfaces (like Path) + extend existing tests 2022-01-05 14:22:24 +01:00
Jonas Pöhler 3dc6c567a0 Merge remote-tracking branch 'ebean/master' into fix-scalartype-problem2 2022-01-05 13:34:29 +01:00
Rob BygraveandGitHub 18eed47306 Merge pull request #2475 from bigjimlefou/fixLocale
Fix locale problem with TestCsvReader and TestCsvReaderWithCallback.
2021-12-24 11:10:05 +13:00
Cédric Sougné 9ddf1333ed Fix locale problem with TestCsvReader and TestCsvReaderWithCallback. 2021-12-23 17:19:44 +01:00
Rob Bygrave 73896d375f Bump test modules to 12.14.1-SNAPSHOT after release 2021-12-20 16:49:18 +13:00
Rob Bygrave 3f645211a6 [maven-release-plugin] prepare for next development iteration 2021-12-20 16:34:23 +13:00
Rob Bygrave 451e2fa93c [maven-release-plugin] prepare release ebean-parent-12.14.0 2021-12-20 16:34:17 +13:00
Rob Bygrave 2ff3b0acb7 Update gitflow cron schedule for mariadb, sqlserver, jdk-18 2021-12-20 16:20:08 +13:00
tFellnerandGitHub 42594533da Support for Sequences in MariaDB (#2304)
* Support for Sequneces in MariaDB

* clean up readSequenceValue in test class

* remove flakiness

* remove change for later discussion

* replace deprecated methods

* strictly allow sequences
2021-12-20 16:11:30 +13:00
Rob Bygrave 678494f331 Bump version of logback used in tests only 2021-12-20 16:09:33 +13:00
Rob Bygrave 361df6732a #2472 - BeanPersistController and isCascade() for delete requests (following #2458) 2021-12-20 15:49:58 +13:00
Rob Bygrave c3320f4a0b Bump version to 12.14.0-SNAPSHOT 2021-12-20 13:14:34 +13:00
Rob Bygrave c411d9a665 Bump version to 12.14.0-SNAPSHOT 2021-12-20 12:47:36 +13:00
Rob Bygrave 8ea2c31076 #2471 - Bump avaje-config to 1.7 (from 1.5) with removed jndi lookup for DataSource 2021-12-20 12:45:30 +13:00
Rob Bygrave 254b0df16b #2470 - Bump jedis to version 3.8.0 (from 3.6.3) 2021-12-20 12:40:41 +13:00
Rob Bygrave c0f4451d20 Fix pom versions in test only modules after release 2021-12-20 10:47:26 +13:00
Rob BygraveandGitHub 6c544a2835 Merge pull request #2468 from FOCONIS/pr/fix/jdbc_url_sqlserver_tests
Unify JDBC URL for SqlServer (analog to testconfig-files)
2021-12-20 10:29:58 +13:00
Rob BygraveandGitHub 227d18bbf0 Merge pull request #2469 from FOCONIS/pr/enh/helper_methods_annotation_util
Add metaHas and metaFindAll in AnnotationUtil
2021-12-20 10:28:32 +13:00
Rob BygraveandGitHub 18cdd2ed7a Merge pull request #2466 from FOCONIS/pr/fix/remove_unused_load_error_handler
Remove unused LoadErrorHandler interface
2021-12-20 10:27:14 +13:00
Jonas Pöhler 91d1fb8cea ADD: javadoc 2021-12-17 15:10:30 +01:00
Jonas Pöhler 058021f8d0 ADD: metaHas and metaFindAll as functional sugar 2021-12-17 13:56:08 +01:00
Roland PramlandJonas Pöhler f4d270e8b5 FIX: JDBC URL for SqlServer (similar to testconfig-files) 2021-12-17 13:26:00 +01:00
Jonas Pöhler 7b8052c097 Merge remote-tracking branch 'ebean/master' into pr/fix/remove_unused_load_error_handler 2021-12-17 13:22:46 +01:00
Rob Bygrave 68b7deba9d Put back h2database to 1.4.199 as 2.x breaks way too many things, need to work on that 2021-12-17 23:25:49 +13:00
Rob Bygrave 860aad11ce WIP h2database v2 2021-12-17 23:22:25 +13:00
Roland PramlandJonas Pöhler 65e924feaa Deleted obsolete LoadErrorHandler 2021-12-17 10:44:42 +01:00
Rob Bygrave 6cc5e83b01 Merge branch 'master' of github.com:ebean-orm/ebean 2021-12-17 21:47:17 +13:00
Rob Bygrave 752d5d4782 Remove pom.xml.releaseBackup from barfed release 2021-12-17 21:47:07 +13:00
Rob BygraveandGitHub 20fdbfc972 Merge pull request #2463 from ebean-orm/dependabot/maven/ebean-test/com.h2database-h2-2.0.202
Bump h2 from 1.4.199 to 2.0.202 in /ebean-test
2021-12-17 21:44:21 +13:00
Rob Bygrave bd01dfd29a Bump parent pom, moved to s01.oss.sonatype.org 2021-12-17 20:57:46 +13:00
Rob Bygrave 6a9b5944a3 Remove release.properties that somehow got into git after release 2021-12-17 20:55:19 +13:00
dependabot[bot]andGitHub 6e31de6f2e Bump h2 from 1.4.199 to 2.0.202 in /ebean-test
Bumps [h2](https://github.com/h2database/h2database) from 1.4.199 to 2.0.202.
- [Release notes](https://github.com/h2database/h2database/releases)
- [Commits](https://github.com/h2database/h2database/compare/version-1.4.199...version-2.0.202)

---
updated-dependencies:
- dependency-name: com.h2database:h2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-17 04:33:53 +00:00
Rob Bygrave 5fddc37037 [maven-release-plugin] prepare for next development iteration 2021-12-17 17:26:43 +13:00
Rob Bygrave ca6e3963db [maven-release-plugin] prepare release ebean-parent-12.13.2 2021-12-17 17:26:36 +13:00
Rob BygraveandGitHub a966557b68 Merge pull request #2459 from ebean-orm/feature/2458-isCascade
#2458 - Add BeanPersistController.isCascade() to identify cascade vs "top level" persist requests
2021-12-17 10:54:19 +13:00
Rob Bygrave 1a6a426683 #2458 - Add BeanPersistController.isCascade() to identify cascade vs "top level" persist requests 2021-12-17 10:43:27 +13:00
Rob Bygrave dd43fe4db3 Update pom in ebean-kotlin empty module to use java 1.8 2021-12-15 21:49:34 +13:00
Rob Bygrave b4ebeb0070 #2445 - update test generated ddl as part of ... Put back DB2 maxTableNameLength=18, maxConstraintNameLength=18 2021-12-15 21:49:02 +13:00
Rob Bygrave 0dbf982293 Javadoc only update in PlatformConfig 2021-12-15 21:47:58 +13:00
Rob BygraveandGitHub 12d7184f02 Merge pull request #2454 from ebean-orm/feature/2445-revert-maxTableNameLength
#2445 - Put back DB2 maxTableNameLength=18, maxConstraintNameLength=18
2021-12-14 10:24:59 +13:00
Rob Bygrave c3295f1145 #2445 - Put back DB2 maxTableNameLength=18, maxConstraintNameLength=18 2021-12-13 20:54:49 +13:00
Rob Bygrave 9bdcd6c55e #2452 - server-wide defaultJsonMutation SOURCE is not honored by DbJson scalar types (e.g. List<String>) 2021-12-07 18:13:17 +13:00
Rob Bygrave b627794f8f #2451 - Initial add of ebean-kotlin module, home of kotlin extension 2021-12-07 16:25:46 +13:00
Rob Bygrave b9f3ff24e9 Tidy test only - BasicProfileLocationTest 2021-12-07 15:25:02 +13:00
Rob Bygrave 9752eced1f Adjust tests for JDK 18-ea build 2021-12-07 15:24:19 +13:00
Rob Bygrave e7aa1fdac5 Update badges on README 2021-12-07 15:21:43 +13:00
Rob Bygrave 9d26ab2103 Adjust tests for JDK 18-ea build 2021-12-07 15:15:21 +13:00
Rob Bygrave 103f965182 Add github workflow for JDK 18-ea build 2021-12-07 14:51:53 +13:00
Rob Bygrave d28d9a6176 Follow up to #2448 - Fix maven warning 2021-12-07 14:47:49 +13:00
Rob BygraveandGitHub 173b81a64b Merge pull request #2448 from FOCONIS/fix-pom
Fix maven warning
2021-12-07 14:43:03 +13:00
Rob BygraveandGitHub 135b1e3b57 Merge pull request #2450 from carldea/master
Using TCK Tested JDK builds of OpenJDK Making the switch to Zulu
2021-12-07 14:20:57 +13:00
Carl DeaandGitHub 888109d706 Using TCK Tested JDK builds of OpenJDK
The AdoptOpenJDK has been discontinued since July 2021 (https://adoptopenjdk.net). Switching the distribution to Azul Zulu. When using Zulu you get all the latest updated (TCK Tested) builds for all versions of OpenJDK.
2021-12-06 15:00:49 -05:00
Carl DeaandGitHub 8cd6d50def Using TCK Tested JDK builds of OpenJDK
The AdoptOpenJDK has been discontinued since July 2021 (https://adoptopenjdk.net). Switching the distribution to Azul Zulu. When using Zulu you get all the latest updated (TCK Tested) builds for all versions of OpenJDK
2021-12-06 14:59:41 -05:00
Roland Praml 272b316ecc some more changes 2021-12-02 11:29:45 +01:00
Roland Praml e95edad04b Fix maven warning 2021-12-02 11:23:38 +01:00
Roland Praml f830662cce Improve TypeManager - cache typeNotFound information. 2021-12-02 11:18:22 +01:00
Roland Praml 84ac737ceb ADD: Testcase for Calendar 2021-12-02 10:42:49 +01:00
Roland Praml 483f0398b2 Fix: 'No ScalarType registered for class java.util.GregorianCalendar' - check all registered scalar type if no exact match was found 2021-12-02 08:30:24 +01:00
Rob Bygrave d934d44164 update README adding more badges 2021-12-01 22:14:11 +13:00
Rob Bygrave a2ad1aaf6e update test github workflows 2021-12-01 17:51:04 +13:00
Rob Bygrave a0b6a13e6c update test github workflows for sqlserver and mariadb 2021-12-01 17:27:26 +13:00
Rob Bygrave a65340b939 update test github workflows for sqlserver and mariadb 2021-12-01 17:26:24 +13:00
Rob Bygrave 0279f8b1ad add some test github workflows for sqlserver and mariadb 2021-12-01 16:02:32 +13:00
Rob Bygrave bd2faed6a0 Update readme add badge for multi-jdk build 2021-12-01 15:54:01 +13:00
Rob Bygrave a0e2155ec2 add github workflow multi-jdk-build.yml 2021-12-01 15:44:17 +13:00
Rob Bygrave 5ff9171aaf Bump kotlin version to test against, use maven profiles for test module activation 2021-12-01 15:41:04 +13:00
Rob Bygrave 4d7936c1a6 add mariadb to multi-platform-test.yml 2021-12-01 13:54:55 +13:00
Rob Bygrave 552145db37 add sqlserver 2019 and 2017 testing to multi-platform-test.yml - adjust port for 2017 2021-12-01 13:17:54 +13:00
Rob Bygrave 0504cdc2d8 add sqlserver 2019 and 2017 testing to multi-platform-test.yml 2021-12-01 13:00:36 +13:00
Rob Bygrave a380b609cd add git workflow multi-platform-test 2021-12-01 09:55:22 +13:00
Rob Bygrave 65ac083872 add git workflow multi-platform-test 2021-12-01 09:52:59 +13:00
Rob Bygrave a82dca24da changed generated migrations from db2 change in #2445 2021-12-01 09:52:39 +13:00
Rob BygraveandGitHub 466a616f3e Merge pull request #2445 from FOCONIS/improve-testing
Improve testing, add DB2 Docker testing support to ebean-test
2021-12-01 09:35:45 +13:00
Rob BygraveandGitHub a0552387f8 Merge pull request #2446 from FOCONIS/fix-count-distinc-order-no-ordering
NPE Fix with .setCountDistinct(CountDistinctOrder.NO_ORDERING)
2021-12-01 09:28:54 +13:00
Noemi Szemenyei 25bc0e947d NPE Fix with .setCountDistinct(CountDistinctOrder.NO_ORDERING) 2021-11-30 10:21:34 +01:00
Jonas Pöhler c67e66c0ca Merge remote-tracking branch 'ebean/master' into pr/enh/stored_procedures_mysql_drop_column 2021-11-26 15:58:50 +01:00
Jonas Pöhler b60f9201a9 FIX: MysqlGenerateMigrationTest now clears pendingDrops System-Property 2021-11-26 15:58:20 +01:00
Roland Praml f8253a1252 add ebean-test properties for various containers and adjusted documentation 2021-11-26 15:32:11 +01:00
Roland Praml 2581d82cff FIX: Sqlite does not support ResultSetConcurrencyModeUpdatable 2021-11-26 15:02:46 +01:00
Roland Praml 331ea90e14 Fix: Support conversion of varchar[](300) array type for Clickhouse 2021-11-26 15:02:01 +01:00
Roland Praml dfb1d6ab54 ADD: Db2 container support 2021-11-26 15:01:15 +01:00
Roland Praml 067f4bfdea ADD JDBC-drivers to POM 2021-11-26 14:55:28 +01:00
Rob Bygrave 0a71ad624e [maven-release-plugin] prepare for next development iteration 2021-11-26 21:57:10 +13:00
Rob Bygrave 09115a824d [maven-release-plugin] prepare release ebean-parent-12.13.1 2021-11-26 21:57:04 +13:00
Rob Bygrave 28d4d07966 test config only, stop dumping metrics on jvm shutdown 2021-11-26 21:52:40 +13:00
Rob Bygrave c3e91fed65 Tidy TestElementCollectionBasicSet only 2021-11-26 21:33:26 +13:00
Rob Bygrave 2cad98ad26 Move DetermineManyType into io.ebeaninternal.server.deploy.parse
This allows it to be package private
2021-11-26 21:25:54 +13:00
Rob Bygrave 8a25a7b6ec #2444 - exists and findCount queries produce NPE on entity defined with IdClass - SqlTreeProperties.add(SqlTreeProperties.java:38) 2021-11-26 21:10:31 +13:00
Rob Bygrave 83fbfd1b2a No effective change - tidy inline for ImportedIdEmbedded, ImportedIdSimple 2021-11-26 20:54:28 +13:00
Rob Bygrave a9c6cd15a1 #2433 - Postgres JSONB dirty checking - trim json 2021-11-26 16:39:09 +13:00
Rob Bygrave 63b9b42dc8 #2433 - Postgres JSONB dirty checking - trim json 2021-11-26 16:34:15 +13:00
Rob Bygrave 268146df85 Tidy up TypeManager API after #2435 2021-11-26 14:55:16 +13:00
Rob Bygrave d05a77e755 reset test datasource back to h2 2021-11-26 14:48:45 +13:00
Rob Bygrave 69c768b3be Merge branch 'majkiw-master' 2021-11-26 14:46:42 +13:00
Rob Bygrave 07f9bf98c3 #2436 - SQL Update doesn't handle named parameters for array types in Postgres 2021-11-26 14:46:06 +13:00
Rob Bygrave 9af64f61f7 #2435 - Fix DBArray is not loaded in asDto Postgres queries 2021-11-26 14:32:47 +13:00
Rob Bygrave c1a78d3c8b Merge branch 'master' of https://github.com/majkiw/ebean into majkiw-master 2021-11-25 18:53:28 +13:00
Rob Bygrave 08fc7399ec Tidy DefaultTypeManager with enhanced for 2021-11-25 18:30:00 +13:00
Rob Bygrave 86d805c9fa Tidy internals only for OrmQueryRequest after merge of #2442 2021-11-22 15:21:03 +13:00
Rob BygraveandGitHub 34135360ed Merge pull request #2442 from FOCONIS/findmap-with-beancache-without-mapkey
findMap() with beanCache should use idPoperty if mapKey = null
2021-11-22 15:15:07 +13:00
Rob Bygrave 53b4d6fd73 Merge branch 'FOCONIS-assume-infoInherit-infoType-without-children' 2021-11-22 15:12:29 +13:00
Rob Bygrave 1114ccfb3a #2441 Flatten and re-order if block in AssocOneHelpRefInherit when determining BeanDescriptor 2021-11-22 15:12:18 +13:00
Rob Bygrave b4403c58d1 Merge branch 'assume-infoInherit-infoType-without-children' of https://github.com/FOCONIS/ebean into FOCONIS-assume-infoInherit-infoType-without-children 2021-11-22 15:06:34 +13:00
Rob Bygrave 951903db76 Merge branch 'FOCONIS-json-deserialize-references' 2021-11-22 15:00:14 +13:00
Rob Bygrave 093d111524 #2440 - Re-use existing referenceIdPropertyOnly() method 2021-11-22 14:59:40 +13:00
Rob Bygrave 08e166a9b7 Merge branch 'json-deserialize-references' of https://github.com/FOCONIS/ebean into FOCONIS-json-deserialize-references 2021-11-22 14:51:21 +13:00
Rob Bygrave d5fe7a9ebe Whitespace format only - OrmQueryPropertiesParser 2021-11-22 10:23:27 +13:00
Rob BygraveandGitHub 9f52856343 Merge pull request #2439 from FOCONIS/path-properties-query-with-all-props
Path properties query with all props
2021-11-22 09:15:08 +13:00
Rob BygraveandGitHub 0b529603c4 Merge pull request #2438 from FOCONIS/type-get-all-for-repeated-annotations
FIX: typeGetAll did not work with repeated annotations on one class
2021-11-22 09:01:06 +13:00
Noemi Szemenyei 60d0a3da39 findMap() with beanCache should use idPoperty if mapKey = null 2021-11-19 11:53:37 +01:00
Noemi Szemenyei 1c224444c0 Assume InfoInherit infoType when it has no children 2021-11-16 13:44:53 +01:00
Jonas PöhlerandNoemi Szemenyei d3e07defa0 FIX: Json deserialize references 2021-11-16 11:57:30 +01:00
Noemi Szemenyei 1b5d379ed3 Fix for Query with PathProperties (*,x(y)) 2021-11-16 11:45:18 +01:00
Noemi Szemenyei b90393a691 Unittest for select Query with (*,x(y)) 2021-11-16 11:39:14 +01:00
Jonas PöhlerandNoemi Szemenyei 2d26740286 FIX: typeGetAll did not work with repeated annotations on one class 2021-11-16 11:24:22 +01:00
Rob Bygrave 5807874c9e [maven-release-plugin] prepare for next development iteration 2021-11-04 11:19:32 +13:00
Rob Bygrave ea7b4e8162 [maven-release-plugin] prepare release ebean-parent-12.13.0 2021-11-04 11:19:25 +13:00
Rob Bygrave 43742fdc0b Bump version to 12.13.0-SNAPSHOT 2021-11-04 11:16:50 +13:00
Rob Bygrave 8ef71bd451 Bump version to 12.13.0-SNAPSHOT 2021-11-04 11:02:45 +13:00
Rob Bygrave 0f60e2240c Bump version to 12.13.0-SNAPSHOT 2021-11-04 10:57:48 +13:00
Rob Bygrave 2cbb161ed5 Follow up to #2437 - Rename internal "dead/alive" to "replaced" 2021-11-04 10:40:04 +13:00
Rob BygraveandGitHub a47caec85b Merge pull request #2437 from FOCONIS/fix-persistence-context
FIX: Subsequent findEach / findList does not work reliable [Fixes regression in 12.3.3]
2021-11-04 09:59:31 +13:00
Roland Praml fd1b5f58bc FIX: Subsequent findEach / findList does not work reliable (Regression of #2411) 2021-11-03 11:34:04 +01:00
Michal Wysocki 39a4035f3b Extra assertions for DBArray in asDTO and sqlUpdate 2021-11-02 13:25:42 +01:00
Rob Bygrave 0bb7d79015 Tidy build.yml 2021-10-28 22:40:10 +13:00
Rob BygraveandGitHub 9907cffe6e Update README.md 2021-10-28 22:38:48 +13:00
Rob Bygrave 704a138ff0 Tidy build.yml and TestExtraScalarTypes 2021-10-28 22:34:55 +13:00
Rob Bygrave f3cab4ee10 Merge branch 'master' of github.com:ebean-orm/ebean 2021-10-28 22:33:48 +13:00
Rob Bygrave d507452d63 Fix test TestExtraScalarTypes for github workflows build 2021-10-28 22:33:28 +13:00
Rob BygraveandGitHub 893aa6cb1a Update build.yml 2021-10-28 22:26:13 +13:00
Rob BygraveandGitHub e92fd2ef06 Add github workflows build.yml 2021-10-28 22:19:24 +13:00
Rob BygraveandGitHub bdad8b258a Merge pull request #2427 from FOCONIS/bug-reload-fails-on-partial-beans
FIX: When a bean is modified in persistence context and searched again, it will loose the change
2021-10-22 16:17:31 +13:00
Rob Bygrave a6cdf8d6dc Turn off nexus.staging.autoReleaseAfterClose 2021-10-22 10:52:16 +13:00
Rob Bygrave e232c724c0 maven.deploy.skip test modules and fix agent versions 2021-10-22 10:49:57 +13:00
Roland Praml d55023dbc7 FIX: When a bean is modified in persistence context and searched again, it will loose the change 2021-10-21 16:50:53 +02:00
Rob Bygrave fa4e013692 [maven-release-plugin] prepare for next development iteration 2021-10-21 21:36:29 +13:00
Rob Bygrave 08502d7315 [maven-release-plugin] prepare release ebean-parent-12.12.3 2021-10-21 21:36:21 +13:00
Rob Bygrave 6f4bc0ac2c Prepare release, comment out extra test modules 2021-10-21 21:33:16 +13:00
Rob Bygrave 5585866e82 Prepare release, comment out extra test modules 2021-10-21 14:07:27 +13:00
Rob Bygrave f21f6d9592 Prepare release, comment out extra test modules 2021-10-21 13:54:39 +13:00
Rob Bygrave 03e0519951 Refactor tidy internals for DefaultServer, rename descriptorManager 2021-10-21 13:41:58 +13:00
Rob Bygrave bc23d5829c Refactor tidy internals for DefaultPersister, BeanDescriptorManager etc 2021-10-21 13:30:32 +13:00
Rob Bygrave 64108aac40 #2424 Preserve using PersistenceException when transaction register(Callback) called with no active transaction 2021-10-21 12:12:02 +13:00
Rob Bygrave fcda419abb #2424 Preserve using PersistenceException when transaction register(Callback) called with no active transaction 2021-10-21 12:06:45 +13:00
Rob Bygrave 4d34c9e868 #2424 Change error for transaction register(Callback) when no active transaction from PersistenceException to NullPointerException
Ah ok, so in being more strict on null for currentTransaction() that shows up the code that registers transaction callbacks as checking for null and throwing PersistenceException. This is inconsistent with LOTS of other methods that use currentTransaction() and would result in NPE.

The concept here is that PersistenceException for this case isn't better than NPE and NPE is actually more consistence wrt using currentTransaction().
2021-10-21 12:02:42 +13:00
Rob Bygrave 5178b76431 Update internals migrate from deprecated methods baseTable() 2021-10-20 20:07:54 +13:00
Rob Bygrave 8fb02662e6 #2423 Add @Nullable on single bean publish and restore by id 2021-10-20 20:06:59 +13:00
Rob Bygrave 1aac63771d #2423 Tidy up DefaultServer internals getting descriptor 2021-10-20 19:58:11 +13:00
Rob Bygrave 3a138c3462 Tidy internals only - improve DefaultServer parameter names 2021-10-20 16:07:43 +13:00
Rob Bygrave 30088f4de7 #2423 Tidy up DefaultServer internals with Objects.requireNonNull() 2021-10-20 15:53:50 +13:00
Rob BygraveandGitHub cc272bb950 Merge pull request #2423 from ebean-orm/feature/nonNullApi
Use @NonNullApi to explicitly reflect non-null return types and params by default
2021-10-20 15:47:44 +13:00
Rob Bygrave b3ee982b64 Use @NonNullApi to explicitly reflect non-null return types and params by default 2021-10-20 15:45:20 +13:00
Rob Bygrave 92a13ad265 Remove pom releaseBackup files that should not be there 2021-10-20 09:52:06 +13:00
Rob Bygrave a445557ec3 #2422 - Remove extraneous jsr 305 @Nonnull 2021-10-19 17:59:25 +13:00
Rob Bygrave c7bb027c7d #2422 - Remove extraneous jsr 305 @Nonnull 2021-10-19 17:33:23 +13:00
Rob Bygrave 709eb369c9 #2419 - Add explicit @Nullable on findOne() methods 2021-10-19 12:12:11 +13:00
Rob Bygrave 5a4924b6cb #2421 - Change database.diff() to return empty map rather than null with null bean argument 2021-10-19 11:58:29 +13:00
Rob Bygrave a61c73c62a #2418 #2420 BeanState.loadErrors() returns empty map
Change Database.beanState() to throw IllegalArgumentException when bean isn't an entity bean
2021-10-19 11:52:36 +13:00
Rob Bygrave 7862648b83 #2419 - Add explicit @Nullable on findOne() methods 2021-10-19 11:50:22 +13:00
Rob Bygrave fa252a1fe4 Javadoc for #2303 - bump to pgjdbc 42.3.0 2021-10-19 11:23:26 +13:00
Rob Bygrave add7a8c4ba Javadoc for #2303 - bump to pgjdbc 42.2.25
Noting that this version of pgjdbc has not been released yet. Guessing that this is the next release number.
2021-10-14 14:49:15 +13:00
Rob Bygrave 834c04bd33 Update Postgres test dependency only (#2303) 2021-10-13 09:45:00 +13:00
Rob Bygrave 9bda4ab5c7 #2303 - Add javadoc for notes on Postgres with "allQuotedIdentifiers = true" 2021-10-13 09:37:40 +13:00
Rob Bygrave d1ca7a30dc Merge branch 'FOCONIS-tidy-remove-readjson-resetContext' 2021-10-12 15:11:35 +13:00
Rob Bygrave cb67dd0f29 Merge branch 'tidy-remove-readjson-resetContext' of https://github.com/FOCONIS/ebean into FOCONIS-tidy-remove-readjson-resetContext 2021-10-12 15:11:23 +13:00
Rob Bygrave e173f6e9a9 Tidy only DefaultPersistenceContext after merge of #2411 2021-10-12 15:10:36 +13:00
Rob BygraveandGitHub 349cd01921 Merge pull request #2411 from ebean-orm/feature/weak-reference-persistence-context
Weak reference based persistence context for streaming queries
2021-10-12 14:39:47 +13:00
Rob BygraveandGitHub 8fa7fa6af3 Merge pull request #2413 from FOCONIS/feature/weak-reference-persistence-context
Change DefaultPersistenceContect to use beginIterate / endIterate
2021-10-12 14:34:05 +13:00
Rob Bygrave caf18565a0 [maven-release-plugin] prepare for next development iteration 2021-10-12 12:46:15 +13:00
Rob Bygrave c89d39ec2d [maven-release-plugin] prepare release ebean-parent-12.12.2 2021-10-12 12:46:08 +13:00
Rob Bygrave 556557276c Bump ebean-agent version 2021-10-12 12:38:08 +13:00
Roland Praml 2f277938e5 Remove LoadContext.resetPersistenceContext 2021-10-11 17:48:09 +02:00
Roland Praml 5322ab3e7e Remove: ReadJson.resetContext as it is not used 2021-10-11 17:22:33 +02:00
Roland Praml 100832ddd9 Changed test to test pc.beginIterate / endIterate 2021-10-11 17:16:34 +02:00
Roland Praml 3f5009aa91 Use WeakReferences when in iterate query mode 2021-10-11 16:25:21 +02:00
Roland Praml 8dbd290119 Remove: ReadJson.resetContext as it is not used 2021-10-11 13:40:03 +02:00
Rob Bygrave ea3fb833a4 Weak reference based PersistenceContext for streaming queries 2021-10-11 22:48:18 +13:00
Rob Bygrave 0273e1c2c8 Modify test TestUpdate to ensure basic test data is loaded first 2021-10-11 12:13:02 +13:00
Rob Bygrave 8440a13b0f Refactor rename internal method DefaultPersistenceContext.classContext() 2021-10-11 11:36:38 +13:00
Rob Bygrave c5e940733c #2408 Followup refactor BindParamsParser extract methods 2021-10-11 11:21:28 +13:00
Rob BygraveandGitHub ac73031bec Merge pull request #2408 from FOCONIS/pr/bugfix/reuse_update_collection_parameters
Fix reuse of io.ebean.Update when using setParameter with Collection
2021-10-11 11:01:23 +13:00
Rob Bygrave a65ff8a650 Tidy test only - TestOneToManyCorrectGrouping 2021-10-08 12:55:50 +13:00
Rob Bygrave f904fea104 Tidy, remove unnecessary --add-opens test clause for eban-querybean testing 2021-10-08 12:55:22 +13:00
Rob Bygrave 2549eace09 #2406 - Memory leak in Query.findEach 2021-10-08 11:20:54 +13:00
Jonas Pöhler a592717c77 Merge remote-tracking branch 'ebean/master' into pr/bugfix/reuse_update_collection_parameters 2021-10-06 11:57:50 +02:00
Jonas Pöhler db6f93e383 FIX: Reuse of io.ebean.Update with collection parameters did not work correctly 2021-10-06 11:57:09 +02:00
Rob Bygrave 0a0d67585c [maven-release-plugin] prepare for next development iteration 2021-10-05 10:50:00 +13:00
Rob Bygrave db2f8cd811 [maven-release-plugin] prepare release ebean-parent-12.12.1 2021-10-05 10:49:53 +13:00
Rob Bygrave b6e524f879 Disable test modules for release 2021-10-05 10:47:23 +13:00
Rob Bygrave 40492f487c #2404 - Initializing @OneToMany with mutableListOf() in Kotlin results in ClassCastException 2021-10-05 10:17:44 +13:00
Rob Bygrave 2cee03bc4b #172 Bump ebean-agent via maven plugin
The associated ebean-agent has the fix for the kotlin specific #172 issue.
2021-10-04 22:57:24 +13:00
Rob BygraveandGitHub e2c6125501 Merge pull request #2402 from ebean-orm/feature/ebean-agent-min-version
Modify EbeanVersion to check for minimum ebean-agent version
2021-09-30 10:42:33 +13:00
Jonas Pöhler 3fe521c53a Merge remote-tracking branch 'ebean/master' into pr/enh/stored_procedures_mysql_drop_column 2021-09-29 16:13:49 +02:00
Rob Bygrave b53221fc0e Modify EbeanVersion to check for minimum ebean-agent version 2021-09-29 12:20:27 +13:00
Rob Bygrave b23551ce43 #2401 - Fix EbeanVersion for use in module-path (reads local ebean-api pom.properties) 2021-09-29 11:14:26 +13:00
Rob Bygrave 3971ccea1a Merge branch 'master' of github.com:ebean-orm/ebean 2021-09-29 11:11:55 +13:00
Rob BygraveandGitHub 35b1f835c5 Merge pull request #2400 from focbenz/patch-1
Update README.md typo fix Maven central
2021-09-29 09:47:28 +13:00
Michael BenzandGitHub ef5e3a796d Update README.md typo fix Maven central
typo fix Maven central
2021-09-28 20:02:12 +02:00
Jonas Pöhler 091b5fbf26 Optionally allow use of stored procedures for MySql to drop columns in db migration 2021-09-27 17:08:22 +02:00
Rob Bygrave d3dbde4e79 Add a dummy placeholder so that we can sync to maven central
The sync needs javadoc and sources so adding a dummy class. Note that I think we only just got this due to the multi-version jar but not sure.
2021-09-24 21:42:23 +12:00
Rob Bygrave 033c579984 #2398 - Fix compiler warning for annotation processing query bean generators 2021-09-24 17:51:36 +12:00
Rob Bygrave 1a34a56351 [maven-release-plugin] prepare for next development iteration 2021-09-24 10:12:14 +12:00
Rob Bygrave edfdbd56b1 [maven-release-plugin] prepare release ebean-parent-12.12.0 2021-09-24 10:12:07 +12:00
Rob Bygrave 8f94072afd Log error when ebean-ddl-generator not in classpath but ddlRun is true 2021-09-23 22:32:01 +12:00
Rob Bygrave d028b200fa Log error when ebean-ddl-generator not in classpath but ddlRun is true 2021-09-23 22:28:01 +12:00
Rob Bygrave 9af006b15b Update tests only for Oracle 2021-09-23 18:49:28 +12:00
Rob Bygrave 35a6ff7f02 #2392 - Oracle specific singleAttribute distinct query - not include the column twice with order by clause 2021-09-23 18:48:40 +12:00
Rob Bygrave cebac8040f #2391 - MySql specific NPE because the return value of "java.sql.ResultSetMetaData.getTableName(int)" is null 2021-09-23 17:20:59 +12:00
Rob Bygrave e8524c5b1a Fix tests only - fix tests for SqlServer 2021-09-23 17:07:35 +12:00
Rob Bygrave 3244314424 #2390 - Tidy generated SQL removing excess whitespace after id = ? predicate 2021-09-23 16:42:45 +12:00
Rob Bygrave 0a4c26965c No effective change - tidy whitespace in CQueryBuilder 2021-09-23 16:36:20 +12:00
Rob Bygrave 6238243c91 No effective change - tidy whitespace in CQueryBuilderRawSql 2021-09-23 16:35:35 +12:00
Rob Bygrave c1d7e77d85 No effective change - tidy whitespace in DtoMeta etc 2021-09-23 16:31:29 +12:00
Rob Bygrave 5b07309f51 #2389 - redis.clients.jedis.exceptions.JedisDataException: ERR wrong number of arguments for 'mget' command 2021-09-23 15:41:33 +12:00
Rob Bygrave 8ee67410f9 #2387 - Additionally support setIdIn(Collection<?> ids)
Add overloaded method taking Collection of id values.
2021-09-23 15:32:40 +12:00
Rob Bygrave dec114028f #2388 - Bump dependencies ebean-migration, classpath-scanner, avaje-config 2021-09-23 15:01:43 +12:00
Rob Bygrave 477e7eeeda #2387 - Hit the L2 bean cache via property IN expression (when property is the id property) 2021-09-23 00:23:23 +12:00
Rob Bygrave c9c61d9f97 #2386 - Fix test with logging change 2021-09-23 00:13:53 +12:00
Rob Bygrave d0909ad140 #2385 - Redis L2 cache regression - MPUT not working 2021-09-22 23:13:39 +12:00
Rob BygraveandGitHub 13c94ac78d Merge pull request #2386 from ebean-orm/feature/refactor-simplify-loggers
Refactor internals, reduce the number of loggers used and simplify
2021-09-22 22:33:49 +12:00
Rob Bygrave f467ca2e10 Refactor internals, reduce the number of loggers used and simplify 2021-09-22 22:29:41 +12:00
Rob BygraveandGitHub d5c24d327e Merge pull request #2384 from ebean-orm/feature/2039
#2039 Map LocalDateTime when generating DB migrations for Postgres to timestamp DB type
2021-09-22 16:53:17 +12:00
Rob Bygrave 23cd45b5d1 #2039 LocalDateTime ignore timestamp->localdatetime as a type change
Historically LocalDateTime mapped to logical timestamp and we need to treat that to be not a change in type. Migrations then will not generate a AlterColumn migration when we start using the new logical type localdatetime.
2021-09-22 16:51:47 +12:00
Rob Bygrave a14f7a1766 #2039 Map LocalDateTime when generating DB migrations for Postgres to timestamp DB type 2021-09-22 16:23:10 +12:00
Rob BygraveandGitHub c86a8c2d32 Merge pull request #2332 from ChenZhangg/Modify_MAVEN_1
Improve MAVEN build Performance
2021-09-22 14:15:13 +12:00
Rob Bygrave e85a471fcf #2380 Related test pom only changes
Note that we can't run both test-java16 and test-kotlin together as kotlin isn't yet working on JDK 16
2021-09-22 14:11:46 +12:00
Rob BygraveandGitHub 57689db291 Merge pull request #2380 from cit-consulting/isToManyDirty_cce
WIP: Try to fix ClassCastException in isToManyDirty() check
2021-09-22 14:00:19 +12:00
Rob Bygrave fec87b5281 Test against Postgres JDBC driver excluding the checker-qual dependency 2021-09-21 21:16:43 +12:00
Rob Bygrave 21bd83b417 Fix TestQueryJoinOnFormula with Postgres specific sql 2021-09-21 21:16:06 +12:00
Vladimir Konkov fde5350c43 Kotlin-based test 2021-09-21 11:49:36 +03:00
Rob Bygrave 769f6b72ae Bump to 12.12.0-SNAPSHOT 2021-09-21 15:04:08 +12:00
Rob Bygrave 97e9b3c473 #2383 - Refactor rename Pairs methods for consistency (that are expected to be used only internally) 2021-09-21 15:01:01 +12:00
Rob BygraveandGitHub 3550bf61c4 Refactor rename TransactionManager methods (#2382) 2021-09-21 14:54:26 +12:00
Rob BygraveandGitHub 0bf8c9eb64 Add module-info support via multi-version jar (#2381) 2021-09-21 14:37:51 +12:00
Vladimir Konkov 01e7ddcffd Try to fix ClassCastException in isToManyDirty() check 2021-09-20 20:02:58 +03:00
Rob Bygrave b450227b13 [maven-release-plugin] prepare for next development iteration 2021-09-20 12:41:40 +12:00
Rob Bygrave d7554cefc7 [maven-release-plugin] prepare release ebean-parent-12.11.5 2021-09-20 12:41:33 +12:00
rbygrave a7a056f041 #2379 - Refactor tidy internals only - method names and tidy for internal BatchPstmt and related 2021-09-20 12:35:00 +12:00
Rob BygraveandGitHub ad0befe90a Merge pull request #2308 from FOCONIS/bugfix/fix-gen-key-sequence-test
fixing test entity GenKeySequence
2021-09-20 11:59:15 +12:00
Rob BygraveandGitHub 59763777f3 Merge pull request #2378 from ebean-orm/FOCONIS-save-cascade-order
#2377 - Wrong order in batch save - Fix to transaction depth
2021-09-20 11:57:43 +12:00
rbygrave 1bf9cfde50 #2377 - Revert back the changes to BatchControl as no longer needed
With the fix to the depth we no longer need these changes to BatchControl
2021-09-20 11:53:31 +12:00
rbygrave f51f2269fb #2377 - Wrong order in batch save, fix transaction depth
The guts of this fix is in DefaultPersister.saveAssocOne() with the change to use the new transaction.depthDecrement() method. For our failing test cases this changes the depth from -1, 0 to be 0, 1.

We can see the impact of this change in the batch ordering via the logging of:
 io.ebean.SUM - txn[1001] BatchControl flush ...
2021-09-17 17:58:20 +12:00
rbygrave b38a21f8c4 Merge branch 'save-cascade-order' of https://github.com/FOCONIS/ebean into FOCONIS-save-cascade-order 2021-09-17 14:00:35 +12:00
Roland Praml bf62efd220 Add failing testcases for wrong order in batch save and possible fix for one of them 2021-09-16 16:52:20 +02:00
Rob Bygrave fc54ade8f6 #2363 - Bump ebean-migration to 12.11.2 2021-09-16 23:06:15 +12:00
Rob Bygrave aa5ba76707 #2376 - Whoops, revert logback-test.xml change 2021-09-16 23:01:43 +12:00
Rob Bygrave 3865fc8ffd #2376 - When Lazy load of soft deleted bean - javax.persistence.EntityNotFoundException: Bean not found during lazy load or refresh. id[*] type[class *] 2021-09-16 23:01:04 +12:00
Rob Bygrave b262c2e19d #2373 - Tidy up, migrate from deprecated methods 2021-09-16 11:58:45 +12:00
Rob BygraveandGitHub cf95372f32 Merge pull request #2373 from FOCONIS/pr/enh/post_process_find_controller
Allow post-processing in BeanFindController
2021-09-16 11:26:34 +12:00
Rob BygraveandGitHub 41bbfb0c9c Merge pull request #2372 from FOCONIS/pr/bugfix/optimistic_lock_undo_generated_properties
Undo generated properties on OptimisticLockException
2021-09-16 11:17:55 +12:00
Rob Bygrave 8129376b2a Merge branch 'FOCONIS-pr/enh/formula_in_where_and_order_by' 2021-09-16 11:12:39 +12:00
Jonas Pöhler d016f479e2 Merge remote-tracking branch 'ebean/master' into pr/enh/post_process_find_controller 2021-09-15 16:36:22 +02:00
Jonas Pöhler aea50b4805 Fix assert methods and import 2021-09-15 15:30:07 +02:00
Jonas Pöhler 864ae2ad9b Fix star imports 2021-09-15 13:55:24 +02:00
Jonas Pöhler 861fc813a7 Merge remote-tracking branch 'ebean/master' into pr/enh/formula_in_where_and_order_by 2021-09-15 13:54:10 +02:00
Rob Bygrave f3b66c555a #2368 - ebean-migration not loading properties properly from ebean as it's name isn't set 2021-09-15 22:35:10 +12:00
Rob Bygrave 04ab161421 #2367 - Modify ebean-ddl-generator to not have a dependency on ImportedId
Effectively remove the import io.ebeaninternal.server.deploy.id.ImportedId; dependency
2021-09-15 19:14:38 +12:00
Rob Bygrave 7226bb0ea3 #2367 - Modify ebean-ddl-generator to not have a dependency on MultiValueBind
Effectively remove the import io.ebeaninternal.server.persist.platform.MultiValueBind; dependency
2021-09-15 17:04:01 +12:00
Rob Bygrave 55bfd56574 #2367 - Modify ebean-test to use its own logger adapter (not reuse the one from ebean-core) 2021-09-15 16:56:12 +12:00
rbygrave 853a6a5c1d #2363 - Bump to dependencies that have module-info via mult-version jars etc 2021-09-15 11:28:02 +12:00
rbygrave 0206921eae #2366 - Rename methods with deprecation for QueryPlanCapture and Pairs 2021-09-15 11:22:25 +12:00
Rob BygraveandGitHub f3dbf216d2 Merge pull request #2365 from FOCONIS/pr/bugfix/cache_exists_queries
Allow caching of exists-queries
2021-09-15 08:59:56 +12:00
Jonas Pöhler 38139850de Merge remote-tracking branch 'ebean/master' into pr/enh/post_process_find_controller 2021-09-14 15:37:43 +02:00
Jonas Pöhler 37b3ea9e5a Merge remote-tracking branch 'ebean/master' into pr/bugfix/optimistic_lock_undo_generated_properties 2021-09-14 15:37:18 +02:00
Jonas Pöhler 4064be731f Re-add test and fix post-merge compile errors 2021-09-14 15:36:03 +02:00
Jonas Pöhler beec6b4b13 Merge remote-tracking branch 'ebean/master' into pr/enh/formula_in_where_and_order_by
# Conflicts:
#	ebean-core/src/test/java/org/tests/query/joins/TestQueryJoinOnFormula.java
2021-09-14 15:27:08 +02:00
Jonas Pöhler 6db44a05fe Merge remote-tracking branch 'ebean/master' into pr/bugfix/cache_exists_queries 2021-09-14 13:55:29 +02:00
Thomas Fellner 45e235cb64 Merge remote-tracking branch 'origin/master' into bugfix/fix-gen-key-sequence-test 2021-09-14 11:29:00 +02:00
Rob Bygrave 512ba24041 #2364 - Move tests only in ebean-ddl-generator 2021-09-14 19:10:23 +12:00
Rob Bygrave 1fbfcd393f #2363 - Bump to dependencies that have module-info via mult-version jars etc
Bump ebean-ddl-generator and avaje-config
2021-09-14 19:00:55 +12:00
Jonas Pöhler 5805c3e995 Re-add test 2021-09-13 17:12:32 +02:00
Jonas Pöhler c89255ec72 Merge remote-tracking branch 'ebean/master' into pr/bugfix/cache_exists_queries
# Conflicts:
#	ebean-core/src/test/java/org/tests/cache/TestQueryCache.java
2021-09-13 17:06:05 +02:00
Jonas Pöhler a582db9101 Re-add test and fix compile error 2021-09-13 17:04:22 +02:00
Jonas Pöhler 12fe54da24 Merge remote-tracking branch 'ebean/master' into pr/bugfix/optimistic_lock_undo_generated_properties
# Conflicts:
#	ebean-core/src/test/java/org/tests/basic/TestIUDVanilla.java
2021-09-13 16:47:06 +02:00
Jonas Pöhler a4eeda6449 Revert changes 2021-09-13 13:34:14 +02:00
Jonas Pöhler 1fecbbb618 Changes post-merge 2021-09-13 13:33:20 +02:00
Jonas Pöhler c363023c80 Merge remote-tracking branch 'ebean/master' into pr/enh/post_process_find_controller 2021-09-13 13:25:28 +02:00
Jonas Pöhler 0cfae9a13b Smaller changes pre-merge 2021-09-13 13:15:14 +02:00
Rob Bygrave 88f75bc62f #2363 - Bump to dependencies that have module-info via mult-version jars etc 2021-09-10 22:07:10 +12:00
Rob Bygrave fece3bb0df #2363 - Bump to dependencies that have module-info via mult-version jars etc 2021-09-10 22:00:18 +12:00
Rob Bygrave 268a39ae15 #2363 - Bump to dependencies that have module-info via mult-version jars etc 2021-09-10 21:59:52 +12:00
Rob Bygrave 9324d1cebe Delete the pom.xml.releaseBackup files that somehow got added 2021-09-10 21:47:27 +12:00
Rob Bygrave 2733608a72 [maven-release-plugin] prepare for next development iteration 2021-09-09 21:57:50 +12:00
Rob Bygrave e29e032693 [maven-release-plugin] prepare release ebean-parent-12.11.4 2021-09-09 21:57:43 +12:00
Rob Bygrave 9fc2ec044d #2362 - ENH: Add lock(bean) method as convenience for DB pessimistic locking 2021-09-09 18:18:16 +12:00
Rob Bygrave b739326fca #2361 - Update test-java16 tests - use record style accessors with entity beans 2021-09-09 12:13:34 +12:00
Rob Bygrave 88fd4f5569 #2361 - Update test-java16 test dependencies 2021-09-09 12:04:11 +12:00
Rob Bygrave 4cca3bfa98 #2361 - Tidy test dependencies bump tiles-maven-plugin 2021-09-09 11:44:27 +12:00
Rob Bygrave 8f8d031d91 #2361 - Tidy tests dependencies in ebean-core 2021-09-09 11:39:17 +12:00
Rob Bygrave 7a327cb644 #2361 - Tidy tests only, organise imports 2021-09-09 11:29:05 +12:00
Rob Bygrave 1696caadd4 #2361 - Tidy tests only, move to LoggedSql (ebean-test) 2021-09-09 11:25:04 +12:00
Rob BygraveandGitHub e5dceda4b9 Merge pull request #2361 from ebean-orm/feature/move-tests-to-ebean-test
Refactor move tests from ebean-core to ebean-test
2021-09-09 10:59:42 +12:00
rbygrave eab56d323b Refactor move tests from ebean-core to ebean-test 2021-09-08 22:49:23 +12:00
rbygrave 0b00a14fd3 Refactor tidy tests - remove unused test Main and test MainMemoryLeak 2021-09-08 21:48:53 +12:00
rbygrave c1d57c6b10 Refactor tidy tests 2021-09-08 21:47:52 +12:00
rbygrave 1049435f86 Tidy up ddl-generator BaseTestCase 2021-09-08 17:31:14 +12:00
rbygrave cee879d2f3 #2359 - Rename internal methods - BeanDescriptorManager 2021-09-08 15:34:23 +12:00
rbygrave 93ff2ef2e4 #2359 - Rename internal methods - SpiEbeanServer 2021-09-08 15:25:18 +12:00
rbygrave d389ac680f #2359 - Rename internal methods - BeanDescriptor 2021-09-08 15:17:17 +12:00
rbygrave d582e63c25 #2359 - Rename internal methods - STreeProperty 2021-09-08 14:41:12 +12:00
rbygrave cb9295658c #2359 - Rename internal methods - ElPropertyValue 2021-09-08 14:32:49 +12:00
rbygrave dbc1ab7a57 #2359 - Rename methods and tidy in cache API 2021-09-08 14:25:10 +12:00
rbygrave bb9532f42e #2359 - Rename Transaction.getConnection() method to connection() with deprecation 2021-09-08 14:17:30 +12:00
rbygrave 632f04c76b #2359 - Rename plugin api methods with deprecation - Property 2021-09-08 14:04:31 +12:00
rbygrave bc02eeac57 #2359 - Rename plugin api methods with deprecation - BeanType 2021-09-08 13:13:29 +12:00
rbygrave d6dc147497 #2359 - Rename plugin api methods with deprecation - BeanDocType 2021-09-08 10:59:20 +12:00
rbygrave a15e1ae0a7 #2359 - Rename plugin api methods with deprecation - QueryPlanMetric 2021-09-08 10:53:32 +12:00
rbygrave 8b98335e2e #2359 - Rename plugin api methods with deprecation - BeanDocType 2021-09-08 10:42:51 +12:00
rbygrave 01e07dd2be #2358 - Rename BeanState methods with deprecation 2021-09-08 10:30:18 +12:00
rbygrave 3ac8d6e1d3 #2357 - Modify ddl-generator CurrentModel away from deprecated methods 2021-09-07 21:45:23 +12:00
rbygrave 66143280fa #2357 - Update tests to move away from deprecated methods 2021-09-07 21:44:07 +12:00
rbygrave e95442d8ec #2357 - Update tests to use reference() 2021-09-07 18:13:03 +12:00
rbygrave aafde53b81 #2357 - Update tests to use beanState() 2021-09-07 18:11:51 +12:00
rbygrave 0887480865 #2357 - Update tests to use Database from EbeanServer 2021-09-07 18:10:36 +12:00
rbygrave 4ff8df9538 Tidy tests for ServerConfig -> DatabaseConfig 2021-09-07 17:33:06 +12:00
rbygrave ddb63c1488 Update tests for MariaDB 2021-09-07 16:30:39 +12:00
rbygrave aab2dff49c MySQL Ignore tests that use Hash/Source JSON dirty detection
MySQL JSON type will not preserve ordering of keys. No way to return a consistent JSON result with this type hence Hash/Source do not work
2021-09-07 16:04:07 +12:00
rbygrave d017b2ef39 MySQL Ignore tests that use Hash/Source JSON dirty detection
MySQL JSON type will not preserve ordering of keys. No way to return a consistent JSON result with this type hence Hash/Source do not work
2021-09-07 15:08:28 +12:00
rbygrave 70a967a3a7 Junit5 bump - ebean-core 2021-09-07 13:23:27 +12:00
rbygrave 796edae614 Junit5 bump - tidy ebean-test 2021-09-06 21:37:14 +12:00
rbygrave 50bb7086ac Junit5 bump - tidy ebean-test 2021-09-06 21:01:50 +12:00
rbygrave af8cf9c6c7 Junit5 bump - querybean-generator 2021-09-06 20:57:48 +12:00
rbygrave 6227b081cf Junit5 bump - ebean-test 2021-09-06 20:55:09 +12:00
rbygrave 42645f7236 Junit5 bump - ebean-redis 2021-09-06 20:51:58 +12:00
rbygrave eae8bbac82 Junit5 bump - ebean-querybean 2021-09-06 18:05:11 +12:00
rbygrave 43451c5342 Junit5 bump - ebean-postgis 2021-09-06 17:59:01 +12:00
rbygrave a6f27ca19f Junit5 bump - ebean-externalmapping-xml 2021-09-06 17:53:17 +12:00
rbygrave a7462e86c8 Junit5 bump - ebean-ddl-generator, autotune and api 2021-09-06 17:49:23 +12:00
rbygrave 0ddcfec70d Junit5 bump - ebean-ddl-generator, autotune and api 2021-09-06 17:49:06 +12:00
rbygrave bf70470b9a Junit5 bump - remove parent junit dependency 2021-09-06 16:55:11 +12:00
rbygrave 23c5bd65cf [maven-release-plugin] prepare for next development iteration 2021-09-05 10:54:24 +12:00
rbygrave 30aa05a243 [maven-release-plugin] prepare release ebean-parent-12.11.3 2021-09-05 10:54:17 +12:00
rbygrave 4ce70e401d No functional change - Simplify BeanDescriptor.isIdLoaded() 2021-09-04 22:24:59 +12:00
rbygrave a2f49a544c #2355 - Rename methods in SpiServer with deprecation 2021-09-04 22:01:16 +12:00
rbygrave 4d4065c54b #2355 - Rename methods in SpiServer with deprecation 2021-09-04 21:55:23 +12:00
rbygrave d072dd52cf #2355 - Rename methods in SpiServer with deprecation 2021-09-03 20:17:12 +12:00
rbygrave 25b9b37ac0 #2354 - Refactor internals - refactor rename methods in BeanRequest etc 2021-09-03 19:53:36 +12:00
rbygrave 5ea5b55882 #2353 Refactor rename internal methods for BeanRequest 2021-09-03 19:04:48 +12:00
rbygrave b69c00b01e #2353 - Rename BeanPersistRequest methods with deprecation 2021-09-03 18:01:27 +12:00
rbygrave aa53742a07 #2352 - Rename ServerCache methods with deprecation 2021-09-03 17:24:33 +12:00
rbygrave 7c2a77081b #2351 - Rename Database.getReference() to reference() with deprecation 2021-09-03 10:50:29 +12:00
rbygrave 57c0bceb63 #2351 - Rename Database.getReference() to reference() with deprecation 2021-09-03 10:47:56 +12:00
rbygrave 8cb43788dc #2350 - Rename Database.getBeanState() to beanState() with deprecation 2021-09-03 09:55:48 +12:00
rbygrave 921ee9f8a1 #2345 - Rename Database.getExpressionFactory() to expressionFactory with deprecation 2021-09-03 09:46:04 +12:00
rbygrave 058e16d1a8 #2349 - Rename Database.getBeanId() to beanId() with deprecation 2021-09-03 09:32:47 +12:00
rbygrave a5f9beabdf #2349 - Rename Database.getBeanId() to beanId() with deprecation 2021-09-03 09:31:16 +12:00
Rob Bygrave 0ed6ccf499 #2348 - Rename Database.getServerCacheManager() to cacheManager() with deprecation 2021-09-02 23:14:33 +12:00
Rob Bygrave fe67abce83 #2347 - Rename Database.getPlatform() to platform() with deprecation 2021-09-02 23:04:57 +12:00
Rob Bygrave 7fba9adc43 #2346 - Rename Database.getMetaInfoManager() to metaInfo() with deprecation 2021-09-02 22:58:09 +12:00
Rob Bygrave 4557bdfa6f #2345 - Rename Database.getExpressionFactory() to expressionFactory with deprecation 2021-09-02 22:55:47 +12:00
Rob Bygrave 7a7dbae313 #2342 - Rename Database.getName() to Database.name() with deprecation 2021-09-02 22:52:34 +12:00
Rob Bygrave 12c5e9ea5d #2344 - Rename Database.getDataSource() to dataSource() with deprecation 2021-09-02 22:48:09 +12:00
Rob Bygrave 239a444d4c #2343 - Rename Database.getAutoTune() to autoTune() with deprecation 2021-09-02 22:44:31 +12:00
Rob Bygrave f770b66f42 #2342 - Rename Database.getName() to Database.name() with deprecation 2021-09-02 22:41:51 +12:00
Rob Bygrave 6311d0bf4e No effective change - javadoc for ServerCache 2021-09-02 22:36:02 +12:00
Rob Bygrave 491d6a5461 #2341 - Refactor internal api LoadBeanBuffer LoadBeanRequest etc 2021-09-02 22:09:34 +12:00
Rob Bygrave b142319da0 Refactor tidy methods in LoadBeanRequest, LoadManyRequest, LoadRequest and DefaultBeanLoader 2021-09-02 21:50:43 +12:00
Rob Bygrave ac21fcb5cf Simplify load description in LoadBeanRequest and LoadManyRequest 2021-09-02 19:28:24 +12:00
Rob Bygrave 455914fb52 Use cast built into BeanDescriptor.beanId() rather than cast + getId() 2021-09-02 19:25:02 +12:00
Rob Bygrave 2419c6ab34 #2335 ReadOnly propagation test requiring cache clear 2021-09-02 19:23:40 +12:00
Rob BygraveandGitHub 8a0403ef6b Merge pull request #2340 from ebean-orm/feature/2335
#2335 -  L2 cache be triggered by in ?
2021-09-02 19:08:36 +12:00
rbygrave e0afeea6c4 #2335 - Modify test - Put back readOnly assert (#2340) 2021-09-02 19:03:54 +12:00
Rob BygraveandGitHub dd8b4f6416 Merge pull request #2338 from FOCONIS/delete-id-request-getbeantype
NEW: DeleteIdRequest can return beanType
2021-09-02 17:46:11 +12:00
rbygrave 97482c3372 No effective change - tidy DefaultCallableSql 2021-09-02 17:45:30 +12:00
rbygrave d2e36fc1d2 No effective change - tidy DefaultSqlUpdate raw types 2021-09-02 17:34:45 +12:00
rbygrave 99acd6d64f Tidy test only - static imports for QCustomerByteArrayTest 2021-09-02 17:28:04 +12:00
rbygrave 6fe6b8ba64 #2335 - L2 cache be triggered by in ? 2021-09-02 17:10:56 +12:00
Rob BygraveandGitHub c2b947d2e6 Merge pull request #2337 from Ryszard-Trojnacki/master
Query bean PByteArray type for byte[]
2021-09-02 15:05:20 +12:00
Rob BygraveandGitHub 7d6b25ff59 Merge pull request #2339 from FOCONIS/master12
No effective code change: Add missing @Override annotation
2021-09-02 15:02:03 +12:00
rbygrave d9cef737e3 #2335 Initial test work 2021-09-02 11:57:59 +12:00
rob 2f18e97a44 Allow format() for types UUID to handle string input 2021-09-02 11:52:26 +12:00
rob bf3c1629f7 Allow format() for types Integer and Long to handle string input 2021-09-02 11:44:51 +12:00
rob 1062adede4 No effective change - change setUseCache(false) to setBeanCacheMode(CacheMode.OFF) 2021-09-02 10:26:14 +12:00
rob 47c9a434bb Test tidy - remove @Cache from Order model 2021-09-02 10:15:33 +12:00
Roland Praml b2bfca7ec6 no effective code change: Add missing @Override annotation and removed duplicate methods in interfaces 2021-09-01 09:58:27 +02:00
Roland Praml 5d84f10110 NEW DeleteIdRequest can return beantype. Also provide alternative for deprecated 'getEbeanServer' 2021-09-01 09:44:31 +02:00
Ryszard Trojnacki 847ce5db88 Added PByteArray query bean type for byte[] column type. 2021-08-31 11:34:35 +02:00
Ryszard TrojnackiandGitHub afdfbd6173 Merge branch 'ebean-orm:master' into master 2021-08-31 09:46:26 +02:00
rbygrave c0007d3c1a [maven-release-plugin] prepare for next development iteration 2021-08-31 17:21:59 +12:00
rbygrave aa27aedca9 [maven-release-plugin] prepare release ebean-parent-12.11.2 2021-08-31 17:21:52 +12:00
rbygrave 172c1d10a1 Tidy test only - tidy TestDbArray_asSet 2021-08-31 14:28:54 +12:00
rbygrave da6f7d671b #2336 - @DbArray List or Set of UUID or enum returned as String (not converted) when DB does not support ARRAY 2021-08-31 14:26:52 +12:00
Thomas Fellner 7a13670594 Merge remote-tracking branch 'origin/master' into bugfix/fix-gen-key-sequence-test 2021-08-30 15:17:22 +02:00
rbygrave 6e10d641b2 Merge branch 'master' of github.com:ebean-orm/ebean 2021-08-30 22:43:06 +12:00
rbygrave c5dca69482 Tests only - update tests for sql server 2021-08-30 22:42:12 +12:00
rob 371a50176e Tidy tests only - ClusterTest and TestAggregateFormula 2021-08-30 22:39:11 +12:00
Roland PramlandJonas Pöhler 35bff7c3e7 FIX: Cache exist query results 2021-08-27 15:27:54 +02:00
Roland PramlandJonas Pöhler 83f8435000 FIX: Cache exist query results 2021-08-27 13:56:51 +02:00
Chen Zhang a1b4b1d8ca Improve MAVEN build Performance 2021-08-27 09:24:13 +08:00
Jonas Pöhler fad3e634d5 ADD: Formula properties can be used in orderBy and where clause 2021-08-26 17:15:38 +02:00
Jonas Pöhler 62712c976f ADD: BeanFindController supports postProcessing of retrieved entities 2021-08-26 14:37:51 +02:00
Rob BygraveandGitHub 56fed3ad87 Merge pull request #2331 from FOCONIS/pr/bugfix/npe_mutableNext_call
Fix for NPE in mutableNext in EBI
2021-08-25 10:38:32 +12:00
Rob BygraveandGitHub 9a65731be9 Merge pull request #2330 from FOCONIS/pr/enh/sort_order_in_bean_state
Make getSortOrder accessible in BeanState API
2021-08-25 10:36:29 +12:00
Rob BygraveandGitHub 34b011f683 Merge pull request #2329 from FOCONIS/pr/bugfix/oder_column_cache
@OrderdColum did not work properly with cached beans
2021-08-25 10:29:45 +12:00
Jonas Pöhler 69c721b66e ADD: getSortOrder accessible in BeanState API 2021-08-24 14:48:22 +02:00
Jonas Pöhler f2a578cd76 FIX: OrderdColums did not work properly with cache 2021-08-24 14:28:21 +02:00
rbygrave 1e34d65675 Tests only - update ddl review for Postgres 2021-08-24 15:59:58 +12:00
rbygrave 60db0b0999 #2328 - Postgres JSONB dirty checking - trim json 2021-08-24 15:58:29 +12:00
rbygrave 3bfb6dbc20 #2327 - Follow up and fix test TestQueryFilterMany 2021-08-24 15:04:52 +12:00
rbygrave d4d9bb204d #2327 - findSingleAttribute() on a ToMany path includes the id column
Follow up refactor SqlTreeBuilder
2021-08-24 15:04:23 +12:00
rbygrave bedb841fa9 #2327 - findSingleAttribute() on a ToMany path includes the id column
Follow up test changes
2021-08-24 14:52:54 +12:00
rbygrave c4c4663144 #2327 - findSingleAttribute() on a ToMany path includes the id column 2021-08-24 14:31:30 +12:00
rbygrave b392db866c Update tests for multi-platform testing 2021-08-22 17:48:19 +12:00
rbygrave 3556f9a42b Rename test helper StartPostgres (start docker postgres) 2021-08-22 16:39:44 +12:00
rbygrave 0345ca9f18 Update ddl review only - for #2326 2021-08-22 16:38:50 +12:00
rbygrave eacc4b907d Update ddl review only - for #2326 2021-08-22 15:55:45 +12:00
rbygrave 09cb5da3d3 #2326 - [ddl generator] Primary key constraint not generated for @IdClass 2021-08-22 15:55:08 +12:00
rbygrave b22791c15b Update ddl review for h2 2021-08-22 15:29:27 +12:00
rbygrave df3eda411a #2318 - Refactor internals - trim whitespace in deploy package 2021-08-22 13:59:08 +12:00
Jonas Pöhler 5b10c053de FIX: NPE when accessing mutableNext in EBI 2021-08-20 15:13:42 +02:00
rbygrave bf2d75e55e #2318 - Refactor internals - trim whitespace in deploy package 2021-08-20 17:51:01 +12:00
rbygrave 6f7efe6922 #2318 - Refactor internals - trim whitespace in deploy package 2021-08-20 17:39:11 +12:00
rbygrave 90e321ddbd #2318 - Refactor internals - trim whitespace in deploy package 2021-08-20 16:58:37 +12:00
Rob BygraveandGitHub 9649d71082 Merge pull request #2325 from FOCONIS/pr/bugfix/ordere_list_modify_listen_mode
Modification of a OneToMany-Relation with @OrderColumn was not detected
2021-08-20 15:29:22 +12:00
rbygrave 932337d83d Bump ebean-agent to 12.11.2 relating to fix for #2325 2021-08-20 13:09:59 +12:00
Jonas Pöhler 7e4bde8d34 FIX: Modification of a OneToMany-Relation with @OrderColumn was not detected 2021-08-19 17:11:31 +02:00
rbygrave 01e8b5f471 #2323 - Fallback to database query if redis connection fails 2021-08-18 20:41:09 +12:00
rbygrave 68a6da22be Fix imports on test TestQueryExists 2021-08-18 09:41:36 +12:00
rbygrave 986f3b5bca Merge branch 'master' of github.com:ebean-orm/ebean 2021-08-18 09:32:30 +12:00
rbygrave 4b1bb9d1ee #2324 - Bump ebean-datasource to 7.2 2021-08-18 09:11:24 +12:00
rbygrave ec340c0abe #2320 - Tidy only changes 2021-08-18 09:10:27 +12:00
rbygrave b062ec050c #2320 - Tidy only changes 2021-08-18 09:05:28 +12:00
rbygrave 965f4c6227 #2320 - Tidy only changes 2021-08-18 09:05:18 +12:00
Rob BygraveandGitHub bdc4022211 Merge pull request #2322 from FOCONIS/pr/bugfix/subquery_without_where
Fix for subqueries without where condition
2021-08-18 08:53:34 +12:00
rbygrave 7edfe3607d #2320 - When I use Redis for L2 cache, can I set the TTL of the cache key? 2021-08-18 08:43:06 +12:00
Jonas Pöhler e1731b87ec Merge remote-tracking branch 'ebean/master' into pr/bugfix/subquery_without_where 2021-08-17 16:07:02 +02:00
rbygrave ebadc92f63 #2319 - redis - ReentrantLock to replace synchronized(this) 2021-08-17 22:07:31 +12:00
rbygrave ea56ec7435 #2319 - redis - final classes 2021-08-17 22:06:48 +12:00
rbygrave 3b990fb6e1 #2319 - redis - remove unused PrefixKey 2021-08-17 22:03:33 +12:00
rbygrave 96b4fbea4b #2319 - redis - tidy whitespace 2021-08-17 22:02:57 +12:00
rbygrave 9161e17476 #2318 - Refactor internals - final classes in querybean package 2021-08-17 21:39:57 +12:00
rbygrave 190a2c47e9 #2318 - Refactor internals - final classes in cache package 2021-08-17 21:24:56 +12:00
rbygrave d096706685 #2318 - Refactor internals - final classes in internal api package 2021-08-17 21:03:53 +12:00
rbygrave 7521cb530e #2318 - Refactor internals - final classes in type packages 2021-08-17 20:48:15 +12:00
rbygrave dde9b507ce #2318 - Refactor internals - final classes in type packages 2021-08-17 20:09:27 +12:00
rbygrave 183416a640 #2318 - Delete unused ScalarTypeLongToTimestamp 2021-08-17 20:09:02 +12:00
rbygrave 826e8518ea #2318 - Refactor internals - final classes in type packages 2021-08-17 19:46:08 +12:00
rbygrave 55587b12aa #2318 - Refactor internals - final classes in el packages 2021-08-17 19:15:35 +12:00
rbygrave 285a94e5fe #2318 - Refactor internals - final classes in dto packages 2021-08-17 19:06:54 +12:00
rbygrave 16a05528b7 #2318 - Refactor internals - final classes in deploy packages etc 2021-08-17 19:00:55 +12:00
rbygrave b4f4ef3c1b #2318 - Refactor internals - final classes in server packages 2021-08-17 18:24:28 +12:00
rbygrave cd407ee467 #2318 - Refactor internals - final classes in changelog packages 2021-08-16 23:32:26 +12:00
rbygrave 9ee63144e5 #2318 - Refactor internals - final classes in core packages 2021-08-16 23:32:05 +12:00
rbygrave 0413d89a9e #2318 - Refactor internals - final classes in expression packages 2021-08-16 23:19:02 +12:00
rbygrave f33e54d8ba #2318 - Refactor internals - final classes in id and generated property packages 2021-08-16 22:53:38 +12:00
Rob BygraveandGitHub a2b19d46e1 Merge pull request #2316 from FOCONIS/pr/bugfix/json-null-formatValue
Fix: setting json values to null was throwing a NPE when persisting
2021-08-16 22:31:47 +12:00
rbygrave 4163b4dc25 #2317 - Plus test changes due to tidy whitespace on sql generation 2021-08-16 22:23:58 +12:00
rbygrave 12220d4322 #2317 - Incorrect SQL generated for @IdClass with fetch() on ToMany path 2021-08-16 22:21:49 +12:00
rbygrave 14262d4c25 #2317 - Incorrect SQL generated for @IdClass with fetch() on ToMany path 2021-08-16 22:20:21 +12:00
Jonas Pöhler (JPo) f3ec4a78c9 FIX: setting json values to null was throwing a NPE when persisting 2021-08-16 12:02:47 +02:00
rbygrave f7a0ae8b4a [maven-release-plugin] prepare for next development iteration 2021-08-16 09:23:18 +12:00
rbygrave 3c6d17c9a5 [maven-release-plugin] prepare release ebean-parent-12.11.1 2021-08-16 09:23:11 +12:00
rbygrave 885ba0fdd2 Set autoReleaseAfterClose true 2021-08-16 09:18:31 +12:00
rbygrave f3b0e34b67 #2315 - Refactor internals - make more classes final in transaction packages 2021-08-16 09:16:31 +12:00
rbygrave 4109fab0d8 #2313 - Refactor internals - make more classes final in query packages 2021-08-15 15:22:02 +12:00
rbygrave 0688061f5c Speed up TestUuidGenerator 2021-08-15 15:17:19 +12:00
rbygrave 82c12b1565 #2312 - Refactor internals - make more classes final in persist packages 2021-08-15 14:50:43 +12:00
rbygrave ebc0fabbdb #2311 - Fix BindPadding for empty list 2021-08-15 14:15:03 +12:00
rbygrave 587b2e3075 #2310 Tidy to only cast once 2021-08-15 14:09:44 +12:00
Rob BygraveandGitHub ec82dd3da9 Merge pull request #2310 from FOCONIS/nutation-on-cache
FIX: mutation info is not restored on cache hit
2021-08-15 13:50:19 +12:00
rbygrave 3e190b34f5 Merge branch 'master' of github.com:ebean-orm/ebean 2021-08-15 13:48:43 +12:00
rbygrave e059ad9172 Merge branch 'FOCONIS-mutationdetection-source-special-json-types' 2021-08-15 13:48:27 +12:00
rbygrave 1297324fa9 Fix where using JDK 10 Reader.transferTo() method plus add final to methods and classes 2021-08-15 13:47:46 +12:00
rbygrave e2b7434d98 Merge branch 'mutationdetection-source-special-json-types' of https://github.com/FOCONIS/ebean into FOCONIS-mutationdetection-source-special-json-types 2021-08-15 12:06:12 +12:00
rbygrave ada8df5755 Improve startup logging messages 2021-08-15 12:05:30 +12:00
Roland Praml 843b90cbba FIX: mutation info is not restored on cache hit 2021-08-13 11:52:31 +02:00
Roland Praml 6b263919d5 handle also JsonNode 2021-08-13 11:19:24 +02:00
Roland Praml 965c1e803f FIX: mutationDetection = SOURCE works also for special json types 2021-08-13 10:47:14 +02:00
Thomas Fellner 9aa2fc824a second entity with SequenceGenerator added and test written 2021-08-13 08:36:25 +02:00
Rob BygraveandGitHub a13bc481b8 Merge pull request #2306 from FOCONIS/pr/enh/softreference_in_cache
Use SoftReferences in Cache
2021-08-13 09:35:38 +12:00
rbygrave fc7379aabc Tidy internals - server.persist.dml package for whitespace and typos 2021-08-13 09:18:31 +12:00
Thomas Fellner 531024b8b4 Fix test TestGeneratedKeys 2021-08-12 15:47:21 +02:00
rbygrave a17683c549 #2307 - Tidy ShutdownManager DatabaseFactory only 2021-08-12 16:32:12 +12:00
rbygrave eeacad0fb9 #2307 - ENH: Add DatabaseFactory.disableShutdownHook() ... [ alias for ShutdownManager.deregisterShutdownHook() ] 2021-08-12 14:36:14 +12:00
rbygrave c51140b59a Add DefaultServer.toString() and tidy DbOffline remove unnecessary log message 2021-08-12 13:01:07 +12:00
Jonas Pöhler f1817a0dbb Merge remote-tracking branch 'ebean/master' into pr/enh/softreference_in_cache 2021-08-11 15:26:42 +02:00
Jonas Pöhler 5b05510bb9 Merge remote-tracking branch 'ebean/master' into pr/enh/softreference_in_cache 2021-08-11 14:08:55 +02:00
rbygrave b676476cd2 Add SpiQuery.Type.defaultSelect() for ATTRIBUTE and sub-query type queries 2021-08-11 20:51:46 +12:00
rbygrave 709f8ed05f Merge branch 'master' of github.com:ebean-orm/ebean 2021-08-11 20:21:26 +12:00
rbygrave 31282416d8 Merge branch 'FOCONIS-subquery-with-fetch-path' 2021-08-11 20:16:33 +12:00
Rob BygraveandGitHub 385c84ae6f Merge pull request #2302 from FOCONIS/feature/switch-db2-driver
Switch DB2 driver to the publicly available JCC driver
2021-08-11 19:43:09 +12:00
Roland Praml 2d24020202 Added / enhanced test case 2021-08-11 09:32:21 +02:00
Roland Praml 1a2aba3f56 Distinguish between exists and in subquery 2021-08-11 08:54:40 +02:00
Thomas Fellner f50f0192d1 Switch DB2 driver to the publicly available JCC driver 2021-08-11 08:47:49 +02:00
Roland Praml 12b8b4b955 Merge remote-tracking branch 'upstream/master' into subquery-with-fetch-path 2021-08-11 07:42:11 +02:00
rbygrave c267366578 Refactor tidy internals - aList -> expr in for loops etc. No functional change. 2021-08-11 15:32:54 +12:00
Rob BygraveandGitHub 18e49cc1ce Merge pull request #2300 from FOCONIS/exists-with-dynamic
Enables select + exists for dynamic formula properties
2021-08-11 14:01:46 +12:00
Rob BygraveandGitHub 1ce4b1a994 Merge pull request #2299 from FOCONIS/push-pops-in-wrong-order
PushJson/PopJson did not work correctly, if null beans were involved
2021-08-11 13:48:00 +12:00
Rob BygraveandGitHub f3c87e488a Merge pull request #2301 from FOCONIS/bugfix/update-ddl-generator-version
Updating ebean-ddl-generator version in ebean-core
2021-08-11 13:46:19 +12:00
Rob BygraveandGitHub f24c698cd5 Merge pull request #2298 from ebean-orm/FOCONIS-md5-for-querybindhash
Foconis md5 for querybindhash
2021-08-11 13:29:44 +12:00
rbygrave 144a3b54bb Refactor rename method queryBindHash() to queryBindKey() 2021-08-11 13:25:04 +12:00
rbygrave ec7c7048db Refactor rename BindHash to BindValuesKey 2021-08-11 13:19:44 +12:00
rbygrave fd2e542c0b Change BindHash from interface to implementation, Delete unused server persist BindValues 2021-08-11 12:43:58 +12:00
rbygrave 11e8e3696f BindParams does not need encryptionKey in equals/hashCode 2021-08-11 12:24:36 +12:00
Thomas Fellner d08f7af1e0 update ebean-ddl-generator version in ebean-core 2021-08-10 18:31:02 +02:00
Roland Praml 60dfaab22c Enables select + exists for dynamic formula properties 2021-08-10 15:29:10 +02:00
Roland Praml 75fa7cb7fd PushJson/PopJson did not work correctly, if null beans were involved 2021-08-10 13:24:13 +02:00
rbygrave e47b1737a8 Add HashCodeBindHashTest 2021-08-10 22:28:31 +12:00
rbygrave e1ad210bb0 Tidy JunctionExpression 2021-08-10 22:18:33 +12:00
rbygrave ac3edbedf4 Remove MdBindHash, tidy DefaultOrmQuery 2021-08-10 22:07:48 +12:00
rbygrave 2dc48cf08d ArrayContainsExpression equals() to use enhanced for loop 2021-08-10 22:00:46 +12:00
rbygrave ede1ad0a4c Fix BindParams equals() and hashCode() 2021-08-10 21:58:41 +12:00
rbygrave 3e8f76cd6d Update HashCodeBindHash to use values for equals() 2021-08-10 21:49:31 +12:00
rbygrave cd6df2be39 Merge branch 'md5-for-querybindhash' of https://github.com/FOCONIS/ebean into FOCONIS-md5-for-querybindhash 2021-08-10 21:18:43 +12:00
Rob BygraveandGitHub 7091e972fc Merge pull request #2297 from FOCONIS/fix-mutable-next-changelog
FIX: Changelog-oldValue did not work for Json mutable properties
2021-08-10 21:10:15 +12:00
Roland Praml c8ae3c5ef6 FIX: Changelog-oldValue did not work for Json mutable properties 2021-08-10 09:30:25 +02:00
Rob BygraveandGitHub 54e8c4df8a Merge pull request #2296 from FOCONIS/fix-test-for-java-8
Fix the test to run with java 8
2021-08-10 17:04:14 +12:00
Roland Praml e18c190905 Fix the test to run with java 8 2021-08-09 09:46:49 +02:00
Roland Praml 181dc73d39 Use MD5 for QueryBindHash 2021-08-09 09:19:53 +02:00
rbygrave 7ed2de9178 Update github issue template 2021-08-09 16:57:43 +12:00
rbygrave 8c101fd0a4 #2268 - Feature request/question: Query execution time for debugging 2021-08-09 16:48:59 +12:00
rbygrave 43213ead05 #2291 - ENH: Explicit option for fast-failing or not fast-failing (skipDataSourceCheck config option) 2021-08-09 15:10:59 +12:00
Rob BygraveandGitHub 0ef5c65c94 Merge pull request #2294 from ebean-orm/feature/metric-hash-2
#2293 - Metric hash back to MD5 of sql + name + loc (minus location file and line source) ~= Revert of #2288
2021-08-09 14:49:17 +12:00
rbygrave c610f95b2d #2293 - Metric hash back to MD5 of sql + name + loc (minus location file and line source) ~= Revert of #2288 2021-08-09 14:05:10 +12:00
rbygrave c4484c758e [maven-release-plugin] prepare for next development iteration 2021-08-06 14:56:15 +12:00
Jonas Pöhler 4cebb367de FIX: subquery could not not have a where clause 2021-07-29 17:09:24 +02:00
Jonas Pöhler 60ef87b269 Merge remote-tracking branch 'ebean/master' into pr/enh/softreference_in_cache 2021-07-16 15:29:33 +02:00
Roland Praml 7e265f7bde FIX: SubQuery with fetch-path does not work correctly 2021-07-13 09:09:30 +02:00
Jonas Pöhler (JPo) bd7499a505 Use SoftReference in Cache, so it can be gc'ed if the jvm runs out of memory
Signed-off-by: Jonas Pöhler (JPo) <jonas.poehler@foconis.de>
2021-03-29 13:23:56 +02:00
Ryszard TrojnackiandGitHub 40a4546ac6 Merge pull request #4 from ebean-orm/master
Update to head
2020-11-28 13:16:05 +01:00
3282 changed files with 53399 additions and 33550 deletions
-6
View File
@@ -1,9 +1,3 @@
GITHUB ISSUES ARE STRICTLY CONTROLLED FOR THIS PROJECT.
Refer to http://ebean-orm.github.io/support for the policies controlling the use of github issues.
Please post issues to the Ebean group https://groups.google.com/forum/#!forum/ebean first.
## Expected behavior
## Actual behavior
+40
View File
@@ -0,0 +1,40 @@
name: Build
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
java_version: [8]
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: Maven version
run: mvn --version
# - name: Maven single test
# run: mvn --batch-mode clean verify -Dtest="io.ebeaninternal.server.core.DefaultServer_getReferenceTest" -DfailIfNoTests=false
- name: Build with Maven
run: mvn clean package
+38
View File
@@ -0,0 +1,38 @@
name: DB2 LUW
on:
workflow_dispatch:
schedule:
- cron: '10 8 * * 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: db2
run: mvn clean test -Dprops.file=testconfig/ebean-db2.properties
+41
View File
@@ -0,0 +1,41 @@
name: H2Database
on:
workflow_dispatch:
schedule:
- cron: '10 1 * * *'
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: 'zulu'
- name: Maven cache
uses: actions/cache@v2
env:
cache-name: maven-cache
with:
path:
~/.m2
key: build-${{ env.cache-name }}
- name: Maven version
run: mvn --version
- name: H2Database
run: mvn clean package
+39
View File
@@ -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
+39
View File
@@ -0,0 +1,39 @@
name: ebean EA
on:
workflow_dispatch:
schedule:
- cron: '39 6 * * 1,3,5'
jobs:
build:
runs-on: ${{ matrix.os }}
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
java_version: [17,18,19,loom,valhalla,metropolis,panama]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: Set up Java
uses: oracle-actions/setup-java@v1
with:
website: jdk.java.net
release: ${{ matrix.java_version }}
- name: Maven cache
uses: actions/cache@v2
env:
cache-name: maven-cache
with:
path:
~/.m2
key: build-${{ env.cache-name }}
- name: Build with Maven
run: mvn package
+38
View File
@@ -0,0 +1,38 @@
name: MariaDB
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
+51
View File
@@ -0,0 +1,51 @@
name: Multi-database platform
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: h2database
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: mariadb
run: mvn clean test -Dprops.file=testconfig/ebean-mariadb.properties
- name: yugabyte
run: mvn clean test -Dprops.file=testconfig/ebean-yugabyte.properties
- name: sqlserver
run: mvn clean test -Dprops.file=testconfig/ebean-sqlserver17.properties
# - name: sqlserver19
# run: mvn clean test -Dprops.file=testconfig/ebean-sqlserver19.properties
# - name: db2
# run: mvn clean test -Dprops.file=testconfig/ebean-db2.properties
# - name: oracle
# run: mvn clean test -Dprops.file=testconfig/ebean-oracle.properties
+39
View File
@@ -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
+38
View File
@@ -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
+38
View File
@@ -0,0 +1,38 @@
name: Oracle18
on:
workflow_dispatch:
schedule:
- cron: '10 6 * * 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: 'zulu'
- name: Maven cache
uses: actions/cache@v2
env:
cache-name: maven-cache
with:
path:
~/.m2
key: build-${{ env.cache-name }}
- name: oracle
run: mvn clean test -Dprops.file=testconfig/ebean-oracle.properties
+38
View File
@@ -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
+35
View File
@@ -0,0 +1,35 @@
name: SqlServer 2019
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
+38
View File
@@ -0,0 +1,38 @@
name: SqlServer
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 2017
run: mvn clean test -Dprops.file=testconfig/ebean-sqlserver17.properties
+38
View File
@@ -0,0 +1,38 @@
name: Yugabyte
on:
workflow_dispatch:
schedule:
- cron: '10 3 * * *'
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: yugabyte
run: mvn clean test -Dprops.file=testconfig/ebean-yugabyte.properties
+1 -1
View File
@@ -34,7 +34,7 @@ env:
install: true
script:
- mvn clean test
- mvn -T 1C clean test
after_failure:
- ./.travis/print_surefire_reports
+201
View File
@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2012 Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-15
View File
@@ -1,15 +0,0 @@
EbeanORM
Copyright 2012 Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+25 -9
View File
@@ -1,5 +1,24 @@
[![Build Status](https://travis-ci.org/ebean-orm/ebean.svg?branch=master)](https://travis-ci.org/ebean-orm/ebean)
[![Build](https://github.com/ebean-orm/ebean/actions/workflows/build.yml/badge.svg)](https://github.com/ebean-orm/ebean/actions/workflows/build.yml)
[![Maven Central : ebean](https://maven-badges.herokuapp.com/maven-central/io.ebean/ebean/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.ebean/ebean)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/ebean-orm/ebean/blob/master/LICENSE)
[![Multi-JDK Build](https://github.com/ebean-orm/ebean/actions/workflows/multi-jdk-build.yml/badge.svg)](https://github.com/ebean-orm/ebean/actions/workflows/multi-jdk-build.yml)
[![JDK 18-ea](https://github.com/ebean-orm/ebean/actions/workflows/jdk-18-ea.yml/badge.svg)](https://github.com/ebean-orm/ebean/actions/workflows/jdk-18-ea.yml)
[![H2Database](https://github.com/ebean-orm/ebean/actions/workflows/h2database.yml/badge.svg)](https://github.com/ebean-orm/ebean/actions/workflows/h2database.yml)
[![Postgres](https://github.com/ebean-orm/ebean/actions/workflows/postgres.yml/badge.svg)](https://github.com/ebean-orm/ebean/actions/workflows/postgres.yml)
[![MySql](https://github.com/ebean-orm/ebean/actions/workflows/mysql.yml/badge.svg)](https://github.com/ebean-orm/ebean/actions/workflows/mysql.yml)
[![MariaDB](https://github.com/ebean-orm/ebean/actions/workflows/mariadb.yml/badge.svg)](https://github.com/ebean-orm/ebean/actions/workflows/mariadb.yml)
[![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>
@@ -29,18 +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 cental 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")
## Other versions
* [![Maven Central : ebean-agent](https://maven-badges.herokuapp.com/maven-central/io.ebean/ebean-agent/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.ebean/ebean-agent) - ebean-agent
* [![Maven Central : ebean-maven-plugin](https://maven-badges.herokuapp.com/maven-central/io.ebean/ebean-maven-plugin/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.ebean/ebean-maven-plugin) - ebean-maven-plugin
+21 -15
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>12.11.0</version>
<version>12.16.3-SNAPSHOT</version>
</parent>
<name>ebean api</name>
@@ -27,7 +27,7 @@
<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-config</artifactId>
<version>1.3</version>
<version>1.7</version>
</dependency>
<!--
@@ -36,27 +36,26 @@
-->
<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-jsr305</artifactId>
<artifactId>avaje-lang</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>persistence-api</artifactId>
<version>2.2.4</version>
<version>2.2.5</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-annotation</artifactId>
<version>7.2</version>
<version>7.7</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-types</artifactId>
<version>2.1</version>
<version>2.2</version>
</dependency>
<dependency>
@@ -86,7 +85,7 @@
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.199</version>
<version>${h2database.version}</version>
<optional>true</optional>
</dependency>
@@ -104,21 +103,28 @@
<optional>true</optional>
</dependency>
<dependency>
<groupId>io.avaje</groupId>
<artifactId>junit</artifactId>
<version>1.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.5</version>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.24</version>
<extensions>true</extensions>
<configuration>
<archive>
<manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
</archive>
<tiles>
<tile>io.avaje.tile:moditech-module:1.0</tile>
</tiles>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -1,5 +1,7 @@
package io.ebean;
import io.avaje.lang.NonNullApi;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
import java.util.concurrent.ScheduledExecutorService;
@@ -18,6 +20,7 @@ import java.util.concurrent.TimeUnit;
* This also propagates MDC context from the current thread to the
* background task if defined.
*/
@NonNullApi
public interface BackgroundExecutor {
/**
@@ -1,7 +1,7 @@
package io.ebean;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import io.avaje.lang.NonNullApi;
import io.avaje.lang.Nullable;
import java.util.List;
import java.util.Optional;
@@ -27,10 +27,10 @@ import java.util.Optional;
* @param <I> The ID type
* @param <T> The Bean type
*/
@NonNullApi
public abstract class BeanFinder<I,T> {
protected final Database server;
protected final Class<T> type;
/**
@@ -79,11 +79,10 @@ public abstract class BeanFinder<I,T> {
/**
* Creates an entity reference for this ID.
* <p>
* Equivalent to {@link Database#getReference(Class, Object)}
* Equivalent to {@link Database#reference(Class, Object)}
*/
@Nonnull
public T ref(I id) {
return db().getReference(type, id);
return db().reference(type, id);
}
/**
@@ -97,7 +96,6 @@ public abstract class BeanFinder<I,T> {
/**
* Find an entity by ID returning an Optional.
*/
@Nullable
public Optional<T> findByIdOrEmpty(I id) {
return db().find(type).setId(id).findOneOrEmpty();
}
@@ -112,7 +110,6 @@ public abstract class BeanFinder<I,T> {
/**
* Retrieves all entities of the given type.
*/
@Nonnull
public List<T> findAll() {
return query().findList();
}
@@ -1,5 +1,6 @@
package io.ebean;
import io.avaje.lang.NonNullApi;
import io.ebean.bean.EntityBean;
import java.util.Collection;
@@ -31,6 +32,7 @@ import java.util.Collection;
* @param <I> The ID type
* @param <T> The Bean type
*/
@NonNullApi
public abstract class BeanRepository<I, T> extends BeanFinder<I, T> {
/**
+51 -10
View File
@@ -1,6 +1,5 @@
package io.ebean;
import javax.annotation.Nullable;
import java.util.Map;
import java.util.Set;
@@ -57,7 +56,7 @@ public interface BeanState {
*
* // set loaded state on the email property to false so that
* // the email property is not included in a stateless update
* DB.getBeanState(user).setPropertyLoaded("email", false);
* DB.beanState(user).setPropertyLoaded("email", false);
*
* user.update();
*
@@ -72,25 +71,47 @@ public interface BeanState {
* bean.
* <p>
* Accessing another property will cause lazy loading to occur.
* </p>
*/
Set<String> getLoadedProps();
Set<String> loadedProps();
/**
* Deprecated migrate to loadedProps().
*/
@Deprecated
default Set<String> getLoadedProps() {
return loadedProps();
}
/**
* Return the set of changed properties.
*/
Set<String> getChangedProps();
Set<String> changedProps();
/**
* Deprecated migrate to changedProps().
*/
@Deprecated
default Set<String> getChangedProps() {
return changedProps();
}
/**
* Return a map of the updated properties and their new and old values.
*/
Map<String, ValuePair> getDirtyValues();
Map<String, ValuePair> dirtyValues();
/**
* Deprecated migrate to dirtyValues().
*/
@Deprecated
default Map<String, ValuePair> getDirtyValues() {
return dirtyValues();
}
/**
* Return true if the bean is readOnly.
* <p>
* If a setter is called on a readOnly bean it will throw an exception.
* </p>
*/
boolean isReadOnly();
@@ -114,8 +135,28 @@ public interface BeanState {
void resetForInsert();
/**
* Returns a map with load erros.
* Returns a map with load errors.
*/
@Nullable
Map<String, Exception> getLoadErrors();
Map<String, Exception> loadErrors();
/**
* Deprecated migrate to loadErrors().
*/
@Deprecated
default Map<String, Exception> getLoadErrors() {
return loadErrors();
}
/**
* Return the sort order value for an order column.
*/
int sortOrder();
/**
* Deprecated migrate to sortOrder().
*/
@Deprecated
default int getSortOrder() {
return sortOrder();
}
}
+75 -91
View File
@@ -1,13 +1,13 @@
package io.ebean;
import io.avaje.lang.NonNullApi;
import io.avaje.lang.Nullable;
import io.ebean.annotation.TxIsolation;
import io.ebean.cache.ServerCacheManager;
import io.ebean.plugin.Property;
import io.ebean.text.csv.CsvReader;
import io.ebean.text.json.JsonContext;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.persistence.OptimisticLockException;
import javax.persistence.PersistenceException;
import java.util.Collection;
@@ -60,6 +60,7 @@ import java.util.concurrent.Callable;
*
* }</pre>
*/
@NonNullApi
public final class DB {
private static final DbContext context = DbContext.getInstance();
@@ -126,8 +127,16 @@ public final class DB {
* an expression that uses OR like Expression e = Expr.or(..., ...);
* </p>
*/
public static ExpressionFactory expressionFactory() {
return getDefault().expressionFactory();
}
/**
* Deprecated migrate to expressionFactory().
*/
@Deprecated
public static ExpressionFactory getExpressionFactory() {
return getDefault().getExpressionFactory();
return expressionFactory();
}
/**
@@ -515,15 +524,13 @@ public final class DB {
* @param bean The entity bean to check uniqueness on
* @return a set of Properties if constraint validation was detected or empty list.
*/
@Nonnull
public static Set<Property> checkUniqueness(Object bean) {
return getDefault().checkUniqueness(bean);
}
/**
* Same as {@link #checkUniqueness(Object)}. but with given transaction.
* Same as {@link #checkUniqueness(Object)} but with given transaction.
*/
@Nonnull
public static Set<Property> checkUniqueness(Object bean, Transaction transaction) {
return getDefault().checkUniqueness(bean, transaction);
}
@@ -650,8 +657,16 @@ public final class DB {
* @param beanType the type of entity bean
* @param id the id value
*/
public static <T> T reference(Class<T> beanType, Object id) {
return getDefault().reference(beanType, id);
}
/**
* Deprecated migrate to beanId().
*/
@Deprecated
public static <T> T getReference(Class<T> beanType, Object id) {
return getDefault().getReference(beanType, id);
return reference(beanType, id);
}
/**
@@ -660,14 +675,12 @@ public final class DB {
* <ul>
* <li>asc - ascending order (which is the default)</li>
* <li>desc - Descending order</li>
* <li>nullsHigh - Treat null values as high/large values (which is the
* default)</li>
* <li>nullsHigh - Treat null values as high/large values (which is the default)</li>
* <li>nullsLow- Treat null values as low/very small values</li>
* </ul>
* <p>
* If you leave off any keywords the defaults are ascending order and treating
* nulls as high values.
* </p>
* <p>
* Note that the sorting uses a Comparator and Collections.sort(); and does
* not invoke a DB query.
@@ -837,7 +850,6 @@ public final class DB {
* }</pre>
*/
public static <T> Update<T> createUpdate(Class<T> beanType, String ormUpdate) {
return getDefault().createUpdate(beanType, ormUpdate);
}
@@ -845,7 +857,6 @@ public final class DB {
* Create a CsvReader for a given beanType.
*/
public static <T> CsvReader<T> createCsvReader(Class<T> beanType) {
return getDefault().createCsvReader(beanType);
}
@@ -883,7 +894,6 @@ public final class DB {
* @return A ORM Query for this beanType
*/
public static <T> Query<T> createQuery(Class<T> beanType) {
return getDefault().createQuery(beanType);
}
@@ -921,7 +931,6 @@ public final class DB {
* @return The query with expressions defined as per the parsed query statement
*/
public static <T> Query<T> createQuery(Class<T> beanType, String eql) {
return getDefault().createQuery(beanType, eql);
}
@@ -937,7 +946,6 @@ public final class DB {
* @return A ORM Query object for this beanType
*/
public static <T> Query<T> find(Class<T> beanType) {
return getDefault().find(beanType);
}
@@ -1016,77 +1024,6 @@ public final class DB {
return getDefault().filter(beanType);
}
// /**
// * Execute a Sql Update Delete or Insert statement. This returns the number of
// * rows that where updated, deleted or inserted. If is executed in batch then
// * this returns -1. You can get the actual rowCount after commit() from
// * updateSql.getRowCount().
// * <p>
// * If you wish to execute a Sql Select natively then you should use the
// * FindByNativeSql object.
// * </p>
// * <p>
// * Note that the table modification information is automatically deduced and
// * you do not need to call the DB.externalModification() method when you
// * use this method.
// * </p>
// * <p>
// * Example:
// * </p>
// * <pre>{@code
// *
// * // example that uses 'named' parameters
// * String s = "UPDATE f_topic set post_count = :count where id = :id"
// *
// * SqlUpdate update = DB.createSqlUpdate(s);
// *
// * update.setParameter("id", 1);
// * update.setParameter("count", 50);
// *
// * int modifiedCount = DB.execute(update);
// *
// * String msg = "There where " + modifiedCount + "rows updated";
// *
// * }</pre>
// *
// * @param sqlUpdate the update sql potentially with bind values
// * @return the number of rows updated or deleted. -1 if executed in batch.
// * @see SqlUpdate
// * @see CallableSql
// * @see DB#execute(CallableSql)
// */
// public static int execute(SqlUpdate sqlUpdate) {
// return defaultDatabase().execute(sqlUpdate);
// }
//
// /**
// * For making calls to stored procedures.
// * <p>
// * Example:
// * </p>
// * <pre>{@code
// *
// * String sql = "{call sp_order_modify(?,?,?)}";
// *
// * CallableSql cs = DB.createCallableSql(sql);
// * cs.setParameter(1, 27);
// * cs.setParameter(2, "SHIPPED");
// * cs.registerOut(3, Types.INTEGER);
// *
// * DB.execute(cs);
// *
// * // read the out parameter
// * Integer returnValue = (Integer) cs.getObject(3);
// *
// * }</pre>
// *
// * @see CallableSql
// * @see Ebean#execute(SqlUpdate)
// */
// public static int execute(CallableSql callableSql) {
// return defaultDatabase().execute(callableSql);
// }
/**
* Execute a TxRunnable in a Transaction with an explicit scope.
* <p>
@@ -1231,30 +1168,77 @@ public final class DB {
* This will return null if the bean is not an enhanced entity bean.
* </p>
*/
public static BeanState beanState(Object bean) {
return getDefault().beanState(bean);
}
/**
* Deprecated migrate to beanState().
*/
@Deprecated
public static BeanState getBeanState(Object bean) {
return getDefault().getBeanState(bean);
return beanState(bean);
}
/**
* Return the value of the Id property for a given bean.
*/
public static Object beanId(Object bean) {
return getDefault().beanId(bean);
}
/**
* Deprecated migrate to beanId().
*/
@Deprecated
public static Object getBeanId(Object bean) {
return getDefault().getBeanId(bean);
return beanId(bean);
}
/**
* Load and lock the bean using {@code select for update}.
* <p>
* This should be executed inside a transaction.
* <p>
* The bean needs to have an ID property set and can be a reference bean (only has ID)
* or partially or fully populated bean. This will load all the properties of the bean
* from the database using {@code select for update}.
*
* @param bean The entity bean that we wish to obtain a database lock on.
*/
public static void lock(Object bean) {
getDefault().lock(bean);
}
/**
* Deprecated migrate to cacheManager().
*/
@Deprecated
public static ServerCacheManager getServerCacheManager() {
return getDefault().cacheManager();
}
/**
* Return the manager of the level 2 cache ("L2" cache).
*/
public static ServerCacheManager getServerCacheManager() {
return getDefault().getServerCacheManager();
public static ServerCacheManager cacheManager() {
return getDefault().cacheManager();
}
/**
* Return the BackgroundExecutor service for asynchronous processing of
* queries.
*/
public static BackgroundExecutor backgroundExecutor() {
return getDefault().backgroundExecutor();
}
/**
* Deprecated migrate to backgroundExecutor().
*/
@Deprecated
public static BackgroundExecutor getBackgroundExecutor() {
return getDefault().getBackgroundExecutor();
return backgroundExecutor();
}
/**
+151 -22
View File
@@ -1,5 +1,7 @@
package io.ebean;
import io.avaje.lang.NonNullApi;
import io.avaje.lang.Nullable;
import io.ebean.annotation.Platform;
import io.ebean.annotation.TxIsolation;
import io.ebean.cache.ServerCacheManager;
@@ -10,8 +12,6 @@ import io.ebean.plugin.SpiServer;
import io.ebean.text.csv.CsvReader;
import io.ebean.text.json.JsonContext;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.persistence.OptimisticLockException;
import javax.persistence.PersistenceException;
import javax.sql.DataSource;
@@ -92,6 +92,7 @@ import java.util.concurrent.Callable;
* @see DatabaseFactory
* @see DatabaseConfig
*/
@NonNullApi
public interface Database {
/**
@@ -120,34 +121,82 @@ public interface Database {
/**
* Return AutoTune which is used to control the AutoTune service at runtime.
*/
AutoTune getAutoTune();
AutoTune autoTune();
/**
* Deprecated migrate to autoTune().
*/
@Deprecated
default AutoTune getAutoTune() {
return autoTune();
}
/**
* Return the associated DataSource for this Database instance.
*/
DataSource getDataSource();
DataSource dataSource();
/**
* Deprecated migrate to dataSource().
*/
@Deprecated
default DataSource getDataSource() {
return dataSource();
}
/**
* Return the associated read only DataSource for this Database instance (can be null).
*/
DataSource getReadOnlyDataSource();
DataSource readOnlyDataSource();
/**
* Deprecated migrate to readOnlyDataSource().
*/
@Deprecated
default DataSource getReadOnlyDataSource() {
return readOnlyDataSource();
}
/**
* Return the name. This is used with {@link DB#byName(String)} to get a
* Database that was registered with the DB singleton.
*/
String getName();
String name();
/**
* Deprecated migrate to name().
*/
@Deprecated
default String getName() {
return name();
}
/**
* Return the ExpressionFactory for this database.
*/
ExpressionFactory getExpressionFactory();
ExpressionFactory expressionFactory();
/**
* Deprecated migrate to expressionFactory().
*/
@Deprecated
default ExpressionFactory getExpressionFactory() {
return expressionFactory();
}
/**
* Return the MetaInfoManager which is used to get meta data from the Database
* such as query execution statistics.
*/
MetaInfoManager getMetaInfoManager();
MetaInfoManager metaInfo();
/**
* Deprecated migrate to metaInfo().
*/
@Deprecated
default MetaInfoManager getMetaInfoManager() {
return metaInfo();
}
/**
* Return the platform used for this database instance.
@@ -166,12 +215,28 @@ public interface Database {
*
* @return platform for this database instance
*/
Platform getPlatform();
Platform platform();
/**
* Deprecated migrate to platform().
*/
@Deprecated
default Platform getPlatform() {
return platform();
}
/**
* Return the extended API intended for use by plugins.
*/
SpiServer getPluginApi();
SpiServer pluginApi();
/**
* Deprecated migrate to pluginApi().
*/
@Deprecated
default SpiServer getPluginApi() {
return pluginApi();
}
/**
* Return the BeanState for a given entity bean.
@@ -179,12 +244,28 @@ public interface Database {
* This will return null if the bean is not an enhanced entity bean.
* </p>
*/
BeanState getBeanState(Object bean);
BeanState beanState(Object bean);
/**
* Deprecated migrate to beanState().
*/
@Deprecated
default BeanState getBeanState(Object bean) {
return beanState(bean);
}
/**
* Return the value of the Id property for a given bean.
*/
Object getBeanId(Object bean);
Object beanId(Object bean);
/**
* Deprecated migrate to beanId().
*/
@Deprecated
default Object getBeanId(Object bean) {
return beanId(bean);
}
/**
* Set the Id value onto the bean converting the type of the id value if necessary.
@@ -196,7 +277,15 @@ public interface Database {
* @param bean The entity bean to set the id value on.
* @param id The id value to set.
*/
Object setBeanId(Object bean, Object id);
Object beanId(Object bean, Object id);
/**
* Deprecated migrate to beanId().
*/
@Deprecated
default Object setBeanId(Object bean, Object id) {
return beanId(bean, id);
}
/**
* Return a map of the differences between two objects of the same type.
@@ -211,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>
*/
@@ -487,8 +576,8 @@ public interface Database {
<T> DtoQuery<T> createNamedDtoQuery(Class<T> dtoType, String namedQuery);
/**
* Look to execute a native sql query that does not returns beans but instead
* returns SqlRow or direct access to ResultSet (see {@link SqlQuery#findList(RowMapper)}.
* Look to execute a native sql query that does not return beans but instead
* returns SqlRow or direct access to ResultSet.
*
* <p>
* Refer to {@link DtoQuery} for native sql queries returning DTO beans.
@@ -861,8 +950,15 @@ public interface Database {
* @param beanType the type of entity bean
* @param id the id value
*/
@Nonnull
<T> T getReference(Class<T> beanType, Object id);
<T> T reference(Class<T> beanType, Object id);
/**
* Deprecated migrate to reference().
*/
@Deprecated
default <T> T getReference(Class<T> beanType, Object id) {
return reference(beanType, id);
}
/**
* Return the extended API for Database.
@@ -1140,6 +1236,7 @@ public interface Database {
* @param id the bean id value
* @param transaction the transaction to use (can be null)
*/
@Nullable
<T> T find(Class<T> beanType, Object id, Transaction transaction);
/**
@@ -1198,13 +1295,11 @@ public interface Database {
* @param bean The entity bean to check uniqueness on
* @return a set of Properties if constraint validation was detected or empty list.
*/
@Nonnull
Set<Property> checkUniqueness(Object bean);
/**
* Same as {@link #checkUniqueness(Object)}. but with given transaction.
*/
@Nonnull
Set<Property> checkUniqueness(Object bean, Transaction transaction);
/**
@@ -1431,13 +1526,29 @@ public interface Database {
/**
* Return the manager of the server cache ("L2" cache).
*/
ServerCacheManager getServerCacheManager();
ServerCacheManager cacheManager();
/**
* Deprecated migrate to cacheManager().
*/
@Deprecated
default ServerCacheManager getServerCacheManager() {
return cacheManager();
}
/**
* Return the BackgroundExecutor service for asynchronous processing of
* queries.
*/
BackgroundExecutor getBackgroundExecutor();
BackgroundExecutor backgroundExecutor();
/**
* Deprecated migrate to backgroundExecutor().
*/
@Deprecated
default BackgroundExecutor getBackgroundExecutor() {
return backgroundExecutor();
}
/**
* Return the JsonContext for reading/writing JSON.
@@ -1502,6 +1613,7 @@ public interface Database {
* @param id the id of the entity bean
* @param transaction the transaction the publish process should use (can be null)
*/
@Nullable
<T> T publish(Class<T> beanType, Object id, Transaction transaction);
/**
@@ -1515,6 +1627,7 @@ public interface Database {
* @param beanType the type of the entity bean
* @param id the id of the entity bean
*/
@Nullable
<T> T publish(Class<T> beanType, Object id);
/**
@@ -1553,6 +1666,7 @@ public interface Database {
* @param id the id of the entity bean to restore
* @param transaction the transaction the restore process should use (can be null)
*/
@Nullable
<T> T draftRestore(Class<T> beanType, Object id, Transaction transaction);
/**
@@ -1566,6 +1680,7 @@ public interface Database {
* @param beanType the type of the entity bean
* @param id the id of the entity bean to restore
*/
@Nullable
<T> T draftRestore(Class<T> beanType, Object id);
/**
@@ -1602,6 +1717,20 @@ public interface Database {
*/
<T> Set<String> validateQuery(Query<T> query);
/**
* Load and lock the bean using {@code select for update}.
* <p>
* This should be executed inside a transaction and results in the bean being loaded or
* refreshed from the database and a database row lock held via {@code select for update}.
* <p>
* The bean needs to have an ID property set and can be a reference bean (only has ID)
* or partially or fully populated bean. This will load all the properties of the bean
* from the database using {@code select for update} obtaining a database row lock (using WAIT).
*
* @param bean The entity bean that we wish to obtain a database lock on.
*/
void lock(Object bean);
/**
* Truncate all the given tables.
*/
@@ -16,18 +16,15 @@ import java.util.concurrent.locks.ReentrantLock;
* <p>
* This uses either DatabaseConfig or properties in the application.properties file to
* configure and create a Database instance.
* </p>
* <p>
* The Database instance can either be registered with the DB singleton or
* not. The DB singleton effectively holds a map of Database by a name.
* If the Database is registered with the DB singleton you can retrieve it
* later via {@link DB#byName(String)}.
* </p>
* <p>
* One Database can be nominated as the 'default/primary' Database. Many
* methods on the DB singleton such as {@link DB#find(Class)} are just a
* convenient way of using the 'default/primary' Database.
* </p>
*/
public class DatabaseFactory {
@@ -48,7 +45,7 @@ public class DatabaseFactory {
public static void initialiseContainer(ContainerConfig containerConfig) {
lock.lock();
try {
getContainer(containerConfig);
container(containerConfig);
} finally {
lock.unlock();
}
@@ -60,7 +57,7 @@ public class DatabaseFactory {
public static Database create(String name) {
lock.lock();
try {
return getContainer(null).createServer(name);
return container(null).createServer(name);
} finally {
lock.unlock();
}
@@ -68,6 +65,16 @@ public class DatabaseFactory {
/**
* Create using the DatabaseConfig object to configure the database.
*
* <pre>{@code
*
* DatabaseConfig config = new DatabaseConfig();
* config.setName("db");
* config.loadProperties();
*
* Database database = DatabaseFactory.create(config);
*
* }</pre>
*/
public static Database create(DatabaseConfig config) {
lock.lock();
@@ -115,7 +122,6 @@ public class DatabaseFactory {
* Shutdown gracefully all Database instances cleaning up any resources as required.
* <p>
* This is typically invoked via JVM shutdown hook and not explicitly called.
* </p>
*/
public static void shutdown() {
lock.lock();
@@ -127,15 +133,15 @@ public class DatabaseFactory {
}
private static Database createInternal(DatabaseConfig config) {
return getContainer(config.getContainerConfig()).createServer(config);
return container(config.getContainerConfig()).createServer(config);
}
/**
* Get the EbeanContainer initialising it if necessary.
* Return the SpiContainer initialising it if necessary.
*
* @param containerConfig the configuration controlling clustering communication
*/
private static SpiContainer getContainer(ContainerConfig containerConfig) {
private static SpiContainer container(ContainerConfig containerConfig) {
// thread safe in that all calling methods hold lock
if (container != null) {
return container;
@@ -15,8 +15,7 @@ import java.util.concurrent.locks.ReentrantLock;
*/
final class DbContext {
private static final Logger logger = LoggerFactory.getLogger(DbContext.class);
private static final Logger log = LoggerFactory.getLogger("io.ebean");
static {
EbeanVersion.getVersion();
}
@@ -39,7 +38,6 @@ final class DbContext {
if (!DbPrimary.isSkip()) {
// look to see if there is a default server defined
String defaultName = DbPrimary.getDefaultServerName();
logger.debug("defaultName:{}", defaultName);
if (defaultName != null && !defaultName.trim().isEmpty()) {
defaultDatabase = getWithCreate(defaultName.trim());
}
@@ -54,7 +52,7 @@ final class DbContext {
throw new DataSourceConfigurationException(msg, e);
} catch (Throwable e) {
logger.error("Error trying to create the default Database", e);
log.error("Error trying to create the default Database", e);
throw new RuntimeException(e);
}
}
@@ -115,7 +113,7 @@ final class DbContext {
* Register a server so we can get it by its name.
*/
void register(Database server, boolean isDefault) {
registerWithName(server.getName(), server, isDefault);
registerWithName(server.name(), server, isDefault);
}
private void registerWithName(String name, Database server, boolean isDefault) {
@@ -1,9 +1,10 @@
package io.ebean;
import io.avaje.lang.NonNullApi;
import io.avaje.lang.Nullable;
import io.ebean.docstore.DocQueryContext;
import io.ebean.docstore.RawDoc;
import javax.annotation.Nullable;
import java.io.IOException;
import java.util.List;
import java.util.Map;
@@ -13,6 +14,7 @@ import java.util.function.Predicate;
/**
* Document storage operations.
*/
@NonNullApi
public interface DocumentStore {
/**
+12 -6
View File
@@ -1,7 +1,9 @@
package io.ebean;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import io.avaje.lang.NonNullApi;
import io.avaje.lang.Nullable;
import java.util.Collection;
import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;
@@ -38,12 +40,12 @@ import java.util.stream.Stream;
*
* }</pre>
*/
@NonNullApi
public interface DtoQuery<T> extends CancelableQuery {
/**
* Execute the query returning a list.
*/
@Nonnull
List<T> findList();
/**
@@ -53,7 +55,6 @@ public interface DtoQuery<T> extends CancelableQuery {
* resultSet and potentially connection and MUST be closed. We should use
* QueryIterator in a <em>try with resource block</em>.
*/
@Nonnull
QueryIterator<T> findIterate();
/**
@@ -63,7 +64,6 @@ public interface DtoQuery<T> extends CancelableQuery {
* resultSet and potentially connection and MUST be closed. We should use
* the Stream in a <em>try with resource block</em>.
*/
@Nonnull
Stream<T> findStream();
/**
@@ -105,7 +105,6 @@ public interface DtoQuery<T> extends CancelableQuery {
/**
* Execute the query returning an optional bean.
*/
@Nonnull
Optional<T> findOneOrEmpty();
/**
@@ -130,6 +129,13 @@ public interface DtoQuery<T> extends CancelableQuery {
*/
DtoQuery<T> setParameter(String name, Object value);
/**
* Bind the named multi-value array parameter which we would use with Postgres ANY.
* <p>
* For Postgres this binds an ARRAY rather than expands into multiple bind values.
*/
DtoQuery<T> setArrayParameter(String name, Collection<?> values);
/**
* Bind the parameter by its index position (1 based like JDBC).
*/
+6 -9
View File
@@ -1,13 +1,12 @@
package io.ebean;
import io.avaje.lang.Nullable;
import io.ebean.annotation.TxIsolation;
import io.ebean.cache.ServerCacheManager;
import io.ebean.plugin.Property;
import io.ebean.text.csv.CsvReader;
import io.ebean.text.json.JsonContext;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.persistence.OptimisticLockException;
import javax.persistence.PersistenceException;
import java.util.Collection;
@@ -103,7 +102,7 @@ public final class Ebean {
* </p>
*/
public static ExpressionFactory getExpressionFactory() {
return getDefault().getExpressionFactory();
return getDefault().expressionFactory();
}
/**
@@ -506,7 +505,6 @@ public final class Ebean {
* @param bean The entity bean to check uniqueness on
* @return a set of Properties if constraint validation was detected or empty list.
*/
@Nonnull
public static Set<Property> checkUniqueness(Object bean) {
return getDefault().checkUniqueness(bean);
}
@@ -514,7 +512,6 @@ public final class Ebean {
/**
* Same as {@link #checkUniqueness(Object)}. but with given transaction.
*/
@Nonnull
public static Set<Property> checkUniqueness(Object bean, Transaction transaction) {
return getDefault().checkUniqueness(bean, transaction);
}
@@ -642,7 +639,7 @@ public final class Ebean {
* @param id the id value
*/
public static <T> T getReference(Class<T> beanType, Object id) {
return getDefault().getReference(beanType, id);
return getDefault().reference(beanType, id);
}
/**
@@ -1201,14 +1198,14 @@ public final class Ebean {
* </p>
*/
public static BeanState getBeanState(Object bean) {
return getDefault().getBeanState(bean);
return getDefault().beanState(bean);
}
/**
* Return the manager of the server cache ("L2" cache).
*/
public static ServerCacheManager getServerCacheManager() {
return getDefault().getServerCacheManager();
return getDefault().cacheManager();
}
/**
@@ -1216,7 +1213,7 @@ public final class Ebean {
* queries.
*/
public static BackgroundExecutor getBackgroundExecutor() {
return getDefault().getBackgroundExecutor();
return getDefault().backgroundExecutor();
}
/**
@@ -14,26 +14,75 @@ import java.util.Properties;
*/
public class EbeanVersion {
private static final Logger logger = LoggerFactory.getLogger(EbeanVersion.class);
private static final Logger log = LoggerFactory.getLogger("io.ebean");
/**
* Maintain the minimum ebean-agent version manually based on required ebean-agent bug fixes.
*/
private static final int MIN_AGENT_MAJOR_VERSION = 12;
private static final int MIN_AGENT_MINOR_VERSION = 12;
private static String version = "unknown";
static {
readVersion();
checkAgentVersion();
}
private static void readVersion() {
try {
Properties prop = new Properties();
try (InputStream in = DB.class.getResourceAsStream("/META-INF/maven/io.ebean/ebean/pom.properties")) {
try (InputStream in = ClassLoader.getSystemResourceAsStream("META-INF/maven/io.ebean/ebean-api/pom.properties")) {
if (in != null) {
prop.load(in);
in.close();
version = prop.getProperty("version");
version = readVersion(in);
}
}
logger.info("ebean version: {}", version);
log.info("ebean version: {}", version);
} catch (IOException e) {
logger.warn("Could not determine ebean version: {}", e.getMessage());
log.warn("Could not determine ebean version: {}", e.getMessage());
}
}
private static void checkAgentVersion() {
try {
try (InputStream in = ClassLoader.getSystemResourceAsStream("META-INF/maven/io.ebean/ebean-agent/pom.properties")) {
// often we only have ebean-agent during development (with build time enhancement), null is expected
if (in != null) {
String agentVersion = readVersion(in);
if (agentVersion != null) {
if (checkMinAgentVersion(agentVersion)) {
log.error("Expected minimum ebean-agent version {}.{}.0 but we have {}, please update the ebean-agent", MIN_AGENT_MAJOR_VERSION, MIN_AGENT_MINOR_VERSION, agentVersion);
}
}
}
}
} catch (IOException e) {
log.warn("Could not check minimum ebean-agent version {}.{}.0 required due to - {}", MIN_AGENT_MAJOR_VERSION, MIN_AGENT_MINOR_VERSION, e.getMessage());
}
}
/**
* Return true if ebean-agent is NOT at our minimum version.
*/
static boolean checkMinAgentVersion(String agentVersion) {
String[] versionSegments = agentVersion.split("\\.");
if (versionSegments.length != 3) {
return true;
} else {
int major = Integer.parseInt(versionSegments[0]);
int minor = Integer.parseInt(versionSegments[1]);
if (major < MIN_AGENT_MAJOR_VERSION) {
return true;
} else {
return major == MIN_AGENT_MAJOR_VERSION && minor < MIN_AGENT_MINOR_VERSION;
}
}
}
private static String readVersion(InputStream in) throws IOException {
Properties prop = new Properties();
prop.load(in);
in.close();
return prop.getProperty("version");
}
private EbeanVersion() {
// hide
}
@@ -1,6 +1,5 @@
package io.ebean;
import javax.annotation.Nonnull;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Future;
@@ -25,13 +24,11 @@ public class EmptyPagedList<T> implements PagedList<T> {
// do nothing
}
@Nonnull
@Override
public Future<Integer> getFutureCount() {
return null;
}
@Nonnull
@Override
public List<T> getList() {
return Collections.emptyList();
+40 -45
View File
@@ -16,7 +16,7 @@ import java.util.Map;
* This provides a convenient way to create expressions for the default
* database.
* <p>
* See also {@link DB#getExpressionFactory()}
* See also {@link DB#expressionFactory()}
* </p>
* <p>
* Creates standard common expressions for using in a Query Where or Having
@@ -34,14 +34,14 @@ public class Expr {
* Equal To - property equal to the given value.
*/
public static Expression eq(String propertyName, Object value) {
return DB.getExpressionFactory().eq(propertyName, value);
return DB.expressionFactory().eq(propertyName, value);
}
/**
* Not Equal To - property not equal to the given value.
*/
public static Expression ne(String propertyName, Object value) {
return DB.getExpressionFactory().ne(propertyName, value);
return DB.expressionFactory().ne(propertyName, value);
}
/**
@@ -49,7 +49,7 @@ public class Expr {
* using a lower() function to make it case insensitive).
*/
public static Expression ieq(String propertyName, String value) {
return DB.getExpressionFactory().ieq(propertyName, value);
return DB.expressionFactory().ieq(propertyName, value);
}
/**
@@ -59,28 +59,28 @@ public class Expr {
* </p>
*/
public static Expression inRange(String propertyName, Object value1, Object value2) {
return DB.getExpressionFactory().inRange(propertyName, value1, value2);
return DB.expressionFactory().inRange(propertyName, value1, value2);
}
/**
* Between - property between the two given values.
*/
public static Expression between(String propertyName, Object value1, Object value2) {
return DB.getExpressionFactory().between(propertyName, value1, value2);
return DB.expressionFactory().between(propertyName, value1, value2);
}
/**
* Between - value between two given properties.
*/
public static Expression between(String lowProperty, String highProperty, Object value) {
return DB.getExpressionFactory().betweenProperties(lowProperty, highProperty, value);
return DB.expressionFactory().betweenProperties(lowProperty, highProperty, value);
}
/**
* Greater Than - property greater than the given value.
*/
public static Expression gt(String propertyName, Object value) {
return DB.getExpressionFactory().gt(propertyName, value);
return DB.expressionFactory().gt(propertyName, value);
}
/**
@@ -88,42 +88,42 @@ public class Expr {
* value.
*/
public static Expression ge(String propertyName, Object value) {
return DB.getExpressionFactory().ge(propertyName, value);
return DB.expressionFactory().ge(propertyName, value);
}
/**
* Less Than - property less than the given value.
*/
public static Expression lt(String propertyName, Object value) {
return DB.getExpressionFactory().lt(propertyName, value);
return DB.expressionFactory().lt(propertyName, value);
}
/**
* Less Than or Equal to - property less than or equal to the given value.
*/
public static Expression le(String propertyName, Object value) {
return DB.getExpressionFactory().le(propertyName, value);
return DB.expressionFactory().le(propertyName, value);
}
/**
* Is Null - property is null.
*/
public static Expression isNull(String propertyName) {
return DB.getExpressionFactory().isNull(propertyName);
return DB.expressionFactory().isNull(propertyName);
}
/**
* Is Not Null - property is not null.
*/
public static Expression isNotNull(String propertyName) {
return DB.getExpressionFactory().isNotNull(propertyName);
return DB.expressionFactory().isNotNull(propertyName);
}
/**
* Case insensitive {@link #exampleLike(Object)}
*/
public static ExampleExpression iexampleLike(Object example) {
return DB.getExpressionFactory().iexampleLike(example);
return DB.expressionFactory().iexampleLike(example);
}
/**
@@ -131,14 +131,14 @@ public class Expr {
* LikeType.RAW (you need to add you own wildcards % and _).
*/
public static ExampleExpression exampleLike(Object example) {
return DB.getExpressionFactory().exampleLike(example);
return DB.expressionFactory().exampleLike(example);
}
/**
* Create the query by Example expression specifying more options.
*/
public static ExampleExpression exampleLike(Object example, boolean caseInsensitive, LikeType likeType) {
return DB.getExpressionFactory().exampleLike(example, caseInsensitive, likeType);
return DB.expressionFactory().exampleLike(example, caseInsensitive, likeType);
}
/**
@@ -146,7 +146,7 @@ public class Expr {
* characters % (percentage) and _ (underscore).
*/
public static Expression like(String propertyName, String value) {
return DB.getExpressionFactory().like(propertyName, value);
return DB.expressionFactory().like(propertyName, value);
}
/**
@@ -155,14 +155,14 @@ public class Expr {
* a lower() function to make the expression case insensitive.
*/
public static Expression ilike(String propertyName, String value) {
return DB.getExpressionFactory().ilike(propertyName, value);
return DB.expressionFactory().ilike(propertyName, value);
}
/**
* Starts With - property like value%.
*/
public static Expression startsWith(String propertyName, String value) {
return DB.getExpressionFactory().startsWith(propertyName, value);
return DB.expressionFactory().startsWith(propertyName, value);
}
/**
@@ -170,14 +170,14 @@ public class Expr {
* lower() function to make the expression case insensitive.
*/
public static Expression istartsWith(String propertyName, String value) {
return DB.getExpressionFactory().istartsWith(propertyName, value);
return DB.expressionFactory().istartsWith(propertyName, value);
}
/**
* Ends With - property like %value.
*/
public static Expression endsWith(String propertyName, String value) {
return DB.getExpressionFactory().endsWith(propertyName, value);
return DB.expressionFactory().endsWith(propertyName, value);
}
/**
@@ -185,14 +185,14 @@ public class Expr {
* function to make the expression case insensitive.
*/
public static Expression iendsWith(String propertyName, String value) {
return DB.getExpressionFactory().iendsWith(propertyName, value);
return DB.expressionFactory().iendsWith(propertyName, value);
}
/**
* Contains - property like %value%.
*/
public static Expression contains(String propertyName, String value) {
return DB.getExpressionFactory().contains(propertyName, value);
return DB.expressionFactory().contains(propertyName, value);
}
/**
@@ -200,42 +200,42 @@ public class Expr {
* function to make the expression case insensitive.
*/
public static Expression icontains(String propertyName, String value) {
return DB.getExpressionFactory().icontains(propertyName, value);
return DB.expressionFactory().icontains(propertyName, value);
}
/**
* For collection properties that are empty (have not existing elements).
*/
public static Expression isEmpty(String propertyName) {
return DB.getExpressionFactory().isEmpty(propertyName);
return DB.expressionFactory().isEmpty(propertyName);
}
/**
* For collection properties that are not empty (have existing elements).
*/
public static Expression isNotEmpty(String propertyName) {
return DB.getExpressionFactory().isNotEmpty(propertyName);
return DB.expressionFactory().isNotEmpty(propertyName);
}
/**
* In - property has a value in the array of values.
*/
public static Expression in(String propertyName, Object[] values) {
return DB.getExpressionFactory().in(propertyName, values);
return DB.expressionFactory().in(propertyName, values);
}
/**
* In - using a subQuery.
*/
public static Expression in(String propertyName, Query<?> subQuery) {
return DB.getExpressionFactory().in(propertyName, subQuery);
return DB.expressionFactory().in(propertyName, subQuery);
}
/**
* In - property has a value in the collection of values.
*/
public static Expression in(String propertyName, Collection<?> values) {
return DB.getExpressionFactory().in(propertyName, values);
return DB.expressionFactory().in(propertyName, values);
}
/**
@@ -272,14 +272,14 @@ public class Expr {
* }</pre>
*/
public static Expression inOrEmpty(String propertyName, Collection<?> values) {
return DB.getExpressionFactory().inOrEmpty(propertyName, values);
return DB.expressionFactory().inOrEmpty(propertyName, values);
}
/**
* Id Equal to - ID property is equal to the value.
*/
public static Expression idEq(Object value) {
return DB.getExpressionFactory().idEq(value);
return DB.expressionFactory().idEq(value);
}
/**
@@ -292,7 +292,7 @@ public class Expr {
* @param propertyMap a map keyed by property names.
*/
public static Expression allEq(Map<String, Object> propertyMap) {
return DB.getExpressionFactory().allEq(propertyMap);
return DB.expressionFactory().allEq(propertyMap);
}
/**
@@ -303,7 +303,7 @@ public class Expr {
* </p>
*/
public static Expression raw(String raw, Object value) {
return DB.getExpressionFactory().raw(raw, value);
return DB.expressionFactory().raw(raw, value);
}
/**
@@ -314,53 +314,48 @@ public class Expr {
* </p>
*/
public static Expression raw(String raw, Object[] values) {
return DB.getExpressionFactory().raw(raw, values);
return DB.expressionFactory().raw(raw, values);
}
/**
* Add raw expression with no parameters.
*/
public static Expression raw(String raw) {
return DB.getExpressionFactory().raw(raw);
return DB.expressionFactory().raw(raw);
}
/**
* And - join two expressions with a logical and.
*/
public static Expression and(Expression expOne, Expression expTwo) {
return DB.getExpressionFactory().and(expOne, expTwo);
return DB.expressionFactory().and(expOne, expTwo);
}
/**
* Or - join two expressions with a logical or.
*/
public static Expression or(Expression expOne, Expression expTwo) {
return DB.getExpressionFactory().or(expOne, expTwo);
return DB.expressionFactory().or(expOne, expTwo);
}
/**
* Negate the expression (prefix it with NOT).
*/
public static Expression not(Expression exp) {
return DB.getExpressionFactory().not(exp);
return DB.expressionFactory().not(exp);
}
/**
* Return a list of expressions that will be joined by AND's.
*/
public static <T> Junction<T> conjunction(Query<T> query) {
return DB.getExpressionFactory().conjunction(query);
return DB.expressionFactory().conjunction(query);
}
/**
* Return a list of expressions that will be joined by OR's.
*/
public static <T> Junction<T> disjunction(Query<T> query) {
return DB.getExpressionFactory().disjunction(query);
return DB.expressionFactory().disjunction(query);
}
}
@@ -1,21 +1,13 @@
package io.ebean;
import io.ebean.search.Match;
import io.ebean.search.MultiMatch;
import io.ebean.search.TextCommonTerms;
import io.ebean.search.TextQueryString;
import io.ebean.search.TextSimple;
import io.avaje.lang.NonNullApi;
import io.avaje.lang.Nullable;
import io.ebean.search.*;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.persistence.NonUniqueResultException;
import java.sql.Connection;
import java.sql.Timestamp;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.*;
import java.util.function.Consumer;
import java.util.function.Predicate;
@@ -39,6 +31,7 @@ import java.util.function.Predicate;
*
* @see Query#where()
*/
@NonNullApi
public interface ExpressionList<T> {
/**
@@ -327,7 +320,6 @@ public interface ExpressionList<T> {
*
* @see Query#findList()
*/
@Nonnull
List<T> findList();
/**
@@ -335,7 +327,6 @@ public interface ExpressionList<T> {
*
* @see Query#findIds()
*/
@Nonnull
<A> List<A> findIds();
/**
@@ -351,7 +342,6 @@ public interface ExpressionList<T> {
*
* @see Query#findSet()
*/
@Nonnull
Set<T> findSet();
/**
@@ -359,7 +349,6 @@ public interface ExpressionList<T> {
*
* @see Query#findMap()
*/
@Nonnull
<K> Map<K, T> findMap();
/**
@@ -392,7 +381,6 @@ public interface ExpressionList<T> {
*
* @return the list of values for the selected property
*/
@Nonnull
<A> List<A> findSingleAttributeList();
/**
@@ -429,7 +417,6 @@ public interface ExpressionList<T> {
/**
* Execute the query returning an optional bean.
*/
@Nonnull
Optional<T> findOneOrEmpty();
/**
@@ -442,7 +429,6 @@ public interface ExpressionList<T> {
*
* @return a Future object for the row count query
*/
@Nonnull
FutureRowCount<T> findFutureCount();
/**
@@ -455,7 +441,6 @@ public interface ExpressionList<T> {
*
* @return a Future object for the list of Id's
*/
@Nonnull
FutureIds<T> findFutureIds();
/**
@@ -468,7 +453,6 @@ public interface ExpressionList<T> {
*
* @return a Future object for the list result of the query
*/
@Nonnull
FutureList<T> findFutureList();
/**
@@ -499,7 +483,6 @@ public interface ExpressionList<T> {
* @return The PagedList
* @see Query#findPagedList()
*/
@Nonnull
PagedList<T> findPagedList();
/**
@@ -509,7 +492,6 @@ public interface ExpressionList<T> {
* It will execute the query against the history returning the versions of the bean.
* </p>
*/
@Nonnull
List<Version<T>> findVersions();
/**
@@ -519,13 +501,11 @@ public interface ExpressionList<T> {
* It will execute the query against the history returning the versions of the bean.
* </p>
*/
@Nonnull
List<Version<T>> findVersionsBetween(Timestamp start, Timestamp end);
/**
* Add some filter predicate expressions to the many property.
*/
@Nonnull
ExpressionList<T> filterMany(String manyProperty);
/**
@@ -1,7 +1,7 @@
package io.ebean;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import io.avaje.lang.Nullable;
import javax.persistence.NonUniqueResultException;
import java.time.Clock;
import java.util.List;
@@ -82,7 +82,6 @@ public interface ExtendedServer {
*
* @see Query#findIds()
*/
@Nonnull
<A, T> List<A> findIds(Query<T> query, Transaction transaction);
/**
@@ -100,7 +99,6 @@ public interface ExtendedServer {
* @see Query#findEach(Consumer)
* @see Query#findEachWhile(Predicate)
*/
@Nonnull
<T> QueryIterator<T> findIterate(Query<T> query, Transaction transaction);
/**
@@ -112,7 +110,6 @@ public interface ExtendedServer {
* Note that the stream needs to be closed so use with try with resources.
* </p>
*/
@Nonnull
<T> Stream<T> findStream(Query<T> query, Transaction transaction);
/**
@@ -125,7 +122,6 @@ public interface ExtendedServer {
* <p>
* Note that the stream needs to be closed so use with try with resources.
*/
@Nonnull
@Deprecated
<T> Stream<T> findLargeStream(Query<T> query, Transaction transaction);
@@ -210,7 +206,6 @@ public interface ExtendedServer {
* It will execute the query against the history returning the versions of the bean.
* </p>
*/
@Nonnull
<T> List<Version<T>> findVersions(Query<T> query, Transaction transaction);
/**
@@ -235,7 +230,6 @@ public interface ExtendedServer {
* @return the list of fetched beans.
* @see Query#findList()
*/
@Nonnull
<T> List<T> findList(Query<T> query, Transaction transaction);
/**
@@ -251,7 +245,6 @@ public interface ExtendedServer {
* @return a Future object for the row count query
* @see Query#findFutureCount()
*/
@Nonnull
<T> FutureRowCount<T> findFutureCount(Query<T> query, Transaction transaction);
/**
@@ -267,7 +260,6 @@ public interface ExtendedServer {
* @return a Future object for the list of Id's
* @see Query#findFutureIds()
*/
@Nonnull
<T> FutureIds<T> findFutureIds(Query<T> query, Transaction transaction);
/**
@@ -284,7 +276,6 @@ public interface ExtendedServer {
* @return a Future object for the list result of the query
* @see Query#findFutureList()
*/
@Nonnull
<T> FutureList<T> findFutureList(Query<T> query, Transaction transaction);
/**
@@ -316,7 +307,6 @@ public interface ExtendedServer {
* @return The PagedList
* @see Query#findPagedList()
*/
@Nonnull
<T> PagedList<T> findPagedList(Query<T> query, Transaction transaction);
/**
@@ -341,7 +331,6 @@ public interface ExtendedServer {
* @return the set of fetched beans.
* @see Query#findSet()
*/
@Nonnull
<T> Set<T> findSet(Query<T> query, Transaction transaction);
/**
@@ -358,7 +347,6 @@ public interface ExtendedServer {
* @return the map of fetched beans.
* @see Query#findMap()
*/
@Nonnull
<K, T> Map<K, T> findMap(Query<T> query, Transaction transaction);
/**
@@ -391,7 +379,6 @@ public interface ExtendedServer {
* @return the list of values for the selected property
* @see Query#findSingleAttributeList()
*/
@Nonnull
<A, T> List<A> findSingleAttributeList(Query<T> query, Transaction transaction);
/**
@@ -419,7 +406,6 @@ public interface ExtendedServer {
/**
* Similar to findOne() but returns an Optional (rather than nullable).
*/
@Nonnull
<T> Optional<T> findOneOrEmpty(Query<T> query, Transaction transaction);
/**
@@ -463,7 +449,6 @@ public interface ExtendedServer {
* @return the list of fetched MapBean.
* @see SqlQuery#findList()
*/
@Nonnull
List<SqlRow> findList(SqlQuery query, Transaction transaction);
/**
@@ -1,9 +1,8 @@
package io.ebean;
import io.avaje.lang.NonNullApi;
import io.ebean.service.SpiFetchGroupQuery;
import javax.annotation.Nonnull;
/**
* Defines what part of the object graph to load (select and fetch clauses).
* <p>
@@ -62,6 +61,7 @@ import javax.annotation.Nonnull;
*
* @param <T> The bean type the Fetch group can be applied to
*/
@NonNullApi
public interface FetchGroup<T> {
/**
@@ -83,7 +83,6 @@ public interface FetchGroup<T> {
*
* @return The FetchGroup with the given select clause
*/
@Nonnull
static <T> FetchGroup<T> of(Class<T> cls, String select) {
return XServiceProvider.fetchGroupOf(cls, select);
}
@@ -108,7 +107,6 @@ public interface FetchGroup<T> {
*
* @return The FetchGroupBuilder with the given select clause which we will add fetch clauses to
*/
@Nonnull
static <T> FetchGroupBuilder<T> of(Class<T> cls) {
return XServiceProvider.fetchGroupOf(cls);
}
@@ -1,6 +1,6 @@
package io.ebean;
import javax.annotation.Nonnull;
import io.avaje.lang.NonNullApi;
/**
* Builds a FetchGroup by adding fetch clauses.
@@ -23,85 +23,73 @@ import javax.annotation.Nonnull;
*
* }</pre>
*/
@NonNullApi
public interface FetchGroupBuilder<T> {
/**
* Specify specific properties to select (top level properties).
*/
@Nonnull
FetchGroupBuilder<T> select(String select);
/**
* Fetch all the properties at the given path.
*/
@Nonnull
FetchGroupBuilder<T> fetch(String path);
/**
* Fetch the path with the nested fetch group.
*/
@Nonnull
FetchGroupBuilder<T> fetch(String path, FetchGroup<?> nestedGroup);
/**
* Fetch the path using a query join with the nested fetch group.
*/
@Nonnull
FetchGroupBuilder<T> fetchQuery(String path, FetchGroup<?> nestedGroup);
/**
* Fetch the path lazily with the nested fetch group.
*/
@Nonnull
FetchGroupBuilder<T> fetchLazy(String path, FetchGroup<?> nestedGroup);
/**
* Fetch the path including specified properties.
*/
@Nonnull
FetchGroupBuilder<T> fetch(String path, String properties);
/**
* Fetch the path including all its properties using a query join.
*/
@Nonnull
FetchGroupBuilder<T> fetchQuery(String path);
/**
* Fetch the path including all its properties using L2 cache.
* Cache misses fallback to fetchQuery().
*/
@Nonnull
FetchGroupBuilder<T> fetchCache(String path);
/**
* Fetch the path including specified properties using a query join.
*/
@Nonnull
FetchGroupBuilder<T> fetchQuery(String path, String properties);
/**
* Fetch the path including specified properties using L2 cache.
* Cache misses fallback to fetchQuery().
*/
@Nonnull
FetchGroupBuilder<T> fetchCache(String path, String properties);
/**
* Fetch the path including all its properties lazily.
*/
@Nonnull
FetchGroupBuilder<T> fetchLazy(String path);
/**
* Fetch the path including specified properties lazily.
*/
@Nonnull
FetchGroupBuilder<T> fetchLazy(String path, String properties);
/**
* Build and return the FetchGroup.
*/
@Nonnull
FetchGroup<T> build();
}
@@ -1,5 +1,7 @@
package io.ebean;
import io.avaje.lang.NonNullApi;
import java.util.List;
import java.util.Set;
@@ -77,6 +79,7 @@ import java.util.Set;
*
* @param <T> the entity bean type
*/
@NonNullApi
public interface Filter<T> {
/**
+5 -6
View File
@@ -1,7 +1,7 @@
package io.ebean;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import io.avaje.lang.NonNullApi;
import io.avaje.lang.Nullable;
import java.util.List;
/**
@@ -55,6 +55,7 @@ import java.util.List;
* }</pre>
*
*/
@NonNullApi
public class Finder<I, T> {
/**
@@ -137,11 +138,10 @@ public class Finder<I, T> {
/**
* Creates an entity reference for this ID.
* <p>
* Equivalent to {@link Database#getReference(Class, Object)}
* Equivalent to {@link Database#reference(Class, Object)}
*/
@Nonnull
public T ref(I id) {
return db().getReference(type, id);
return db().reference(type, id);
}
/**
@@ -166,7 +166,6 @@ public class Finder<I, T> {
/**
* Retrieves all entities of the given type.
*/
@Nonnull
public List<T> all() {
return query().findList();
}
@@ -113,9 +113,9 @@ public interface Junction<T> extends Expression, ExpressionList<T> {
*/
SHOULD("should", "", true);
private String prefix;
private String literal;
private boolean text;
private final String prefix;
private final String literal;
private final boolean text;
Type(String literal, String prefix, boolean text) {
this.literal = literal;
@@ -1,6 +1,5 @@
package io.ebean;
import javax.annotation.Nonnull;
import java.util.List;
import java.util.concurrent.Future;
@@ -116,13 +115,11 @@ public interface PagedList<T> {
*
* }</pre>
*/
@Nonnull
Future<Integer> getFutureCount();
/**
* Return the list of entities for this page.
*/
@Nonnull
List<T> getList();
/**
+27 -14
View File
@@ -3,6 +3,7 @@ package io.ebean;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
/**
* Holds a list of value object pairs.
@@ -62,15 +63,14 @@ import java.util.List;
* </p>
* <pre>{@code sql
*
* create index ix_name on table_name ((sku || '-' || code));
* create index ix_name on table_name (sku || '-' || code);
*
* }</pre>
*/
public class Pairs {
public final class Pairs {
private final String property0;
private final String property1;
private final List<Entry> entries = new ArrayList<>();
/**
@@ -111,54 +111,70 @@ public class Pairs {
/**
* Return the first property name.
*/
public String getProperty0() {
public String property0() {
return property0;
}
/**
* Return the second property name.
*/
public String getProperty1() {
public String property1() {
return property1;
}
/**
* Return all the value pairs.
*/
public List<Entry> getEntries() {
public List<Entry> entries() {
return Collections.unmodifiableList(entries);
}
/**
* Return the separator character used with DB varchar concatenation to combine the 2 values.
*/
public String getConcatSeparator() {
public String concatSeparator() {
return concatSeparator;
}
/**
* Set the separator character used with DB varchar concatenation to combine the 2 values.
*/
public Pairs setConcatSeparator(String concatSeparator) {
public Pairs concatSeparator(String concatSeparator) {
this.concatSeparator = concatSeparator;
return this;
}
/**
* Deprecated migrate to concatSeparator()
*/
@Deprecated
public Pairs setConcatSeparator(String concatSeparator) {
return concatSeparator(concatSeparator);
}
/**
* Return a suffix used with DB varchar concatenation to combine the 2 values.
*/
public String getConcatSuffix() {
public String concatSuffix() {
return concatSuffix;
}
/**
* Add a suffix used with DB varchar concatenation to combine the 2 values.
*/
public Pairs setConcatSuffix(String concatSuffix) {
public Pairs concatSuffix(String concatSuffix) {
this.concatSuffix = concatSuffix;
return this;
}
/**
* Deprecated migrate to concatSuffix()
*/
@Deprecated
public Pairs setConcatSuffix(String concatSuffix) {
return concatSuffix(concatSuffix);
}
@Override
public String toString() {
return "p0:" + property0 + " p1:" + property1 + " entries:" + entries;
@@ -208,16 +224,13 @@ public class Pairs {
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Entry that = (Entry) o;
return a.equals(that.a) && b.equals(that.b);
}
@Override
public int hashCode() {
int result = a.hashCode();
result = 92821 * result + b.hashCode();
return result;
return Objects.hash(a, b);
}
}
}
@@ -45,14 +45,6 @@ public interface ProfileLocation {
*/
String label();
/**
* Return a hash of the location that intentionally excludes the line number.
* <p>
* The hash is expected to be stable regardless of line number in the source file
* so that is identifies the class and method location over a long time.
*/
long hash();
/**
* Return the full location.
*/
+3 -17
View File
@@ -1,7 +1,7 @@
package io.ebean;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import io.avaje.lang.NonNullApi;
import io.avaje.lang.Nullable;
import javax.persistence.NonUniqueResultException;
import java.sql.Connection;
import java.sql.Timestamp;
@@ -177,6 +177,7 @@ import java.util.stream.Stream;
*
* @param <T> the type of Entity bean this query will fetch.
*/
@NonNullApi
public interface Query<T> extends CancelableQuery {
/**
@@ -689,7 +690,6 @@ public interface Query<T> extends CancelableQuery {
* This query will execute against the Database that was used to create it.
* </p>
*/
@Nonnull
<A> List<A> findIds();
/**
@@ -727,7 +727,6 @@ public interface Query<T> extends CancelableQuery {
*
* }</pre>
*/
@Nonnull
QueryIterator<T> findIterate();
/**
@@ -749,7 +748,6 @@ public interface Query<T> extends CancelableQuery {
*
* }</pre>
*/
@Nonnull
Stream<T> findStream();
/**
@@ -772,7 +770,6 @@ public interface Query<T> extends CancelableQuery {
*
* }</pre>
*/
@Nonnull
@Deprecated
Stream<T> findLargeStream();
@@ -882,7 +879,6 @@ public interface Query<T> extends CancelableQuery {
*
* }</pre>
*/
@Nonnull
List<T> findList();
/**
@@ -898,7 +894,6 @@ public interface Query<T> extends CancelableQuery {
*
* }</pre>
*/
@Nonnull
Set<T> findSet();
/**
@@ -918,7 +913,6 @@ public interface Query<T> extends CancelableQuery {
*
* }</pre>
*/
@Nonnull
<K> Map<K, T> findMap();
/**
@@ -951,7 +945,6 @@ public interface Query<T> extends CancelableQuery {
*
* @return the list of values for the selected property
*/
@Nonnull
<A> List<A> findSingleAttributeList();
/**
@@ -1049,7 +1042,6 @@ public interface Query<T> extends CancelableQuery {
/**
* Execute the query returning an optional bean.
*/
@Nonnull
Optional<T> findOneOrEmpty();
/**
@@ -1064,7 +1056,6 @@ public interface Query<T> extends CancelableQuery {
* It will execute the query against the history returning the versions of the bean.
* </p>
*/
@Nonnull
List<Version<T>> findVersions();
/**
@@ -1074,7 +1065,6 @@ public interface Query<T> extends CancelableQuery {
* It will execute the query against the history returning the versions of the bean.
* </p>
*/
@Nonnull
List<Version<T>> findVersionsBetween(Timestamp start, Timestamp end);
/**
@@ -1132,7 +1122,6 @@ public interface Query<T> extends CancelableQuery {
*
* @return a Future object for the row count query
*/
@Nonnull
FutureRowCount<T> findFutureCount();
/**
@@ -1145,7 +1134,6 @@ public interface Query<T> extends CancelableQuery {
*
* @return a Future object for the list of Id's
*/
@Nonnull
FutureIds<T> findFutureIds();
/**
@@ -1157,7 +1145,6 @@ public interface Query<T> extends CancelableQuery {
*
* @return a Future object for the list result of the query
*/
@Nonnull
FutureList<T> findFutureList();
/**
@@ -1187,7 +1174,6 @@ public interface Query<T> extends CancelableQuery {
*
* @return The PagedList
*/
@Nonnull
PagedList<T> findPagedList();
/**
@@ -1,6 +1,7 @@
package io.ebean;
import java.net.URL;
import java.nio.file.Path;
import java.util.Map;
/**
@@ -23,10 +24,10 @@ public interface ScriptRunner {
/**
* Run a script given the resource path (that should start with "/").
*/
void run(String path);
void run(String resourcePath);
/**
* Run a script given the resource path (that should start with "/") and place holders.
* Run a script given the resource path (that should start with "/") and place-holders.
*
* <pre>{@code
*
@@ -38,7 +39,7 @@ public interface ScriptRunner {
*
* }</pre>
*/
void run(String path, Map<String, String> placeholderMap);
void run(String resourcePath, Map<String, String> placeholderMap);
/**
* Run a DDL or SQL script given the resource.
@@ -46,10 +47,20 @@ public interface ScriptRunner {
void run(URL resource);
/**
* Run a DDL or SQL script given the resource and place holders.
* Run a DDL or SQL script given the resource and place-holders.
*/
void run(URL resource, Map<String, String> placeholderMap);
/**
* Run a DDL or SQL script given the file.
*/
void run(Path file);
/**
* Run a DDL or SQL script given the file and place-holders.
*/
void run(Path file, Map<String, String> placeholderMap);
/**
* Run the raw provided DDL or SQL script.
*
+14 -4
View File
@@ -1,7 +1,7 @@
package io.ebean;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import io.avaje.lang.NonNullApi;
import io.avaje.lang.Nullable;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
@@ -37,12 +37,12 @@ import java.util.function.Predicate;
*
* }</pre>
*/
@NonNullApi
public interface SqlQuery extends Serializable, CancelableQuery {
/**
* Execute the query returning a list.
*/
@Nonnull
List<SqlRow> findList();
/**
@@ -119,7 +119,6 @@ public interface SqlQuery extends Serializable, CancelableQuery {
/**
* Execute the query returning an optional row.
*/
@Nonnull
Optional<SqlRow> findOneOrEmpty();
/**
@@ -247,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>
@@ -354,6 +363,7 @@ public interface SqlQuery extends Serializable, CancelableQuery {
/**
* Return the single value.
*/
@Nullable
T findOne();
/**
@@ -1,5 +1,7 @@
package io.ebean;
import java.util.Collection;
/**
* A SqlUpdate for executing insert update or delete statements.
* <p>
@@ -324,6 +326,13 @@ public interface SqlUpdate {
*/
SqlUpdate setParameter(String name, Object param);
/**
* Bind the named multi-value array parameter which we would use with Postgres ANY.
* <p>
* For Postgres this binds an ARRAY rather than expands into multiple bind values.
*/
SqlUpdate setArrayParameter(String name, Collection<?> values);
/**
* Set a named parameter that has a null value. Exactly the same as
* {@link #setNullParameter(String, int)}.
@@ -538,7 +538,15 @@ public interface Transaction extends AutoCloseable {
* Examples of when a developer may wish to use the connection directly are:
* Savepoints, advanced CLOB BLOB use and advanced stored procedure calls.
*/
Connection getConnection();
Connection connection();
/**
* Deprecated migrate to connection().
*/
@Deprecated
default Connection getConnection() {
return connection();
}
/**
* Add table modification information to the TransactionEvent.
@@ -98,4 +98,14 @@ public class Version<T> {
public Map<String, ValuePair> getDiff() {
return diff;
}
@Override
public String toString() {
return "Version{" +
"bean=" + bean +
", start=" + start +
", end=" + end +
", diff=" + diff +
'}';
}
}
@@ -11,7 +11,7 @@ public interface BeanCollectionLoader {
/**
* Return the name of the associated Database.
*/
String getName();
String name();
/**
* Invoke the lazy loading for this bean collection.
@@ -9,11 +9,7 @@ import javax.persistence.PersistenceException;
import java.io.Serializable;
import java.math.BigDecimal;
import java.net.URL;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import java.util.*;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
@@ -364,7 +360,7 @@ public final class EntityBeanIntercept implements Serializable {
* Return true if the entity should be updated.
*/
public boolean isUpdate() {
return forceUpdate || state == STATE_LOADED;
return forceUpdate || state == STATE_LOADED || state == STATE_REFERENCE;
}
/**
@@ -395,6 +391,15 @@ public final class EntityBeanIntercept implements Serializable {
this.owner._ebean_setEmbeddedLoaded();
this.lazyLoadProperty = -1;
this.origValues = null;
// after save, transfer the mutable next values back to mutable info
if (mutableNext != null) {
for (int i = 0; i < mutableNext.length; i++) {
MutableValueNext next = mutableNext[i];
if (next != null) {
mutableInfo(i, next.info());
}
}
}
this.mutableNext = null;
for (int i = 0; i < flags.length; i++) {
flags[i] &= ~(FLAG_CHANGED_PROP | FLAG_ORIG_VALUE_SET);
@@ -824,7 +829,7 @@ public final class EntityBeanIntercept implements Serializable {
/**
* Load the bean when it is a reference.
*/
protected void loadBean(int loadProperty) {
void loadBean(int loadProperty) {
lock.lock();
try {
if (beanLoader == null) {
@@ -834,7 +839,7 @@ public final class EntityBeanIntercept implements Serializable {
}
// For stand alone reference bean or after deserialisation lazy load
// using the ebeanServer. Synchronise only on the bean.
loadBeanInternal(loadProperty, database.getPluginApi().beanLoader());
loadBeanInternal(loadProperty, database.pluginApi().beanLoader());
return;
}
} finally {
@@ -881,7 +886,7 @@ public final class EntityBeanIntercept implements Serializable {
* Helper method to check if two objects are equal.
*/
@SuppressWarnings({"unchecked", "rawtypes"})
protected static boolean notEqual(Object obj1, Object obj2) {
static boolean notEqual(Object obj1, Object obj2) {
if (obj1 == null) {
return (obj2 != null);
}
@@ -1155,7 +1160,7 @@ public final class EntityBeanIntercept implements Serializable {
*/
public Map<String, Exception> getLoadErrors() {
if (loadErrors == null) {
return null;
return Collections.emptyMap();
}
Map<String, Exception> ret = null;
int len = getPropertyLength();
@@ -1224,8 +1229,7 @@ public final class EntityBeanIntercept implements Serializable {
return null;
}
final MutableValueNext next = mutableNext[propertyIndex];
mutableInfo(propertyIndex, next.info());
return next.content();
return next != null ? next.content() : null;
}
}
@@ -60,21 +60,15 @@ public interface PersistenceContext {
int size(Class<?> rootType);
/**
* Return a copy of the Persistence context to use for large query iteration.
* Signalizes the PersistenceContext, the begin for large query iteration.
*/
PersistenceContext forIterate();
void beginIterate();
/**
* Return a new Persistence context during iteration of large query result.
* Signalizes the PersistenceContext, the end for large query iteration.
*/
PersistenceContext forIterateReset();
/**
* Return true if the persistence context has grown and hit the 'reset limit'
* during large query iteration.
*/
boolean resetLimit();
void endIterate();
/**
* Wrapper on a bean to also indicate if a bean has been deleted.
* <p>
@@ -20,7 +20,7 @@ public abstract class SingleBeanLoader implements BeanLoader {
@Override
public String getName() {
return database.getName();
return database.name();
}
@Override
@@ -39,7 +39,7 @@ public abstract class SingleBeanLoader implements BeanLoader {
@Override
public void loadBean(EntityBeanIntercept ebi) {
database.getPluginApi().loadBeanL2(ebi);
database.pluginApi().loadBeanL2(ebi);
}
}
@@ -53,7 +53,7 @@ public abstract class SingleBeanLoader implements BeanLoader {
@Override
public void loadBean(EntityBeanIntercept ebi) {
database.getPluginApi().loadBeanRef(ebi);
database.pluginApi().loadBeanRef(ebi);
}
}
@@ -67,7 +67,7 @@ public abstract class SingleBeanLoader implements BeanLoader {
@Override
public void loadBean(EntityBeanIntercept ebi) {
database.getPluginApi().loadBean(ebi);
database.pluginApi().loadBean(ebi);
}
}
}
@@ -13,9 +13,7 @@ import java.util.Set;
public class QueryCacheEntry {
private final Object value;
private final Set<String> dependentTables;
private final long timestamp;
/**
+19 -3
View File
@@ -10,17 +10,17 @@ import java.util.Set;
* Represents part of the "L2" server side cache.
* <p>
* This is used to cache beans or query results (bean collections).
* </p>
* <p>
* There are 2 ServerCache's for each bean type. One is used as the 'bean cache'
* which holds beans of a given type. The other is the 'query cache' holding
* query results for a given type.
* </p>
*/
public interface ServerCache {
/**
* Get values for many keys.
*/
default Map<Object, Object> getAll(Set<Object> keys) {
Map<Object, Object> map = new LinkedHashMap<>();
for (Object key : keys) {
Object value = get(key);
@@ -73,6 +73,14 @@ public interface ServerCache {
/**
* Return the hit ratio the cache is currently getting.
*/
default int hitRatio() {
return getHitRatio();
}
/**
* Deprecated migrate to hitRatio().
*/
@Deprecated
int getHitRatio();
/**
@@ -80,6 +88,14 @@ public interface ServerCache {
*
* @param reset if true the statistics are reset.
*/
default ServerCacheStatistics statistics(boolean reset) {
return getStatistics(reset);
}
/**
* Deprecated migrate to statistics().
*/
@Deprecated
ServerCacheStatistics getStatistics(boolean reset);
/**
@@ -21,7 +21,15 @@ public interface ServerCacheManager {
* rather than background processing.
* </p>
*/
boolean isLocalL2Caching();
boolean localL2Caching();
/**
* Deprecated migrate to localL2Caching().
*/
@Deprecated
default boolean isLocalL2Caching() {
return localL2Caching();
}
/**
* Return all the cache regions.
@@ -36,37 +44,78 @@ public interface ServerCacheManager {
*
* @param regions A region name or comma delimited list of region names.
*/
void setEnabledRegions(String regions);
void enabledRegions(String regions);
/**
* Deprecated migrate to enabledRegions().
*/
@Deprecated
default void setEnabledRegions(String regions) {
enabledRegions(regions);
}
/**
* Enable or disable all the cache regions.
*/
void setAllRegionsEnabled(boolean enabled);
void allRegionsEnabled(boolean enabled);
/**
* Return the cache region by name. Typically to enable or disable the region.
* Deprecated migrate to allRegionsEnabled().
*/
ServerCacheRegion getRegion(String name);
@Deprecated
default void setAllRegionsEnabled(boolean enabled) {
allRegionsEnabled(enabled);
}
/**
* Return the cache region by name. Typically, to enable or disable the region.
*/
ServerCacheRegion region(String name);
@Deprecated
default ServerCacheRegion getRegion(String name) {
return region(name);
}
/**
* Return the cache for mapping natural keys to id values.
*/
ServerCache getNaturalKeyCache(Class<?> beanType);
ServerCache naturalKeyCache(Class<?> beanType);
@Deprecated
default ServerCache getNaturalKeyCache(Class<?> beanType) {
return naturalKeyCache(beanType);
}
/**
* Return the cache for beans of a particular type.
*/
ServerCache getBeanCache(Class<?> beanType);
ServerCache beanCache(Class<?> beanType);
@Deprecated
default ServerCache getBeanCache(Class<?> beanType) {
return beanCache(beanType);
}
/**
* Return the cache for associated many properties of a bean type.
*/
ServerCache getCollectionIdsCache(Class<?> beanType, String propertyName);
ServerCache collectionIdsCache(Class<?> beanType, String propertyName);
@Deprecated
default ServerCache getCollectionIdsCache(Class<?> beanType, String propertyName) {
return collectionIdsCache(beanType, propertyName);
}
/**
* Return the cache for query results of a particular type of bean.
*/
ServerCache getQueryCache(Class<?> beanType);
ServerCache queryCache(Class<?> beanType);
@Deprecated
default ServerCache getQueryCache(Class<?> beanType) {
return queryCache(beanType);
}
/**
* This clears both the bean and query cache for a given type.
@@ -18,7 +18,6 @@ public class ServerCacheOptions {
* Construct with no set options.
*/
public ServerCacheOptions() {
}
/**
@@ -73,7 +72,6 @@ public class ServerCacheOptions {
* Return a copy of this object.
*/
public ServerCacheOptions copy() {
ServerCacheOptions copy = new ServerCacheOptions();
copy.maxSize = maxSize;
copy.maxIdleSecs = maxIdleSecs;
@@ -8,7 +8,15 @@ public interface ServerCacheRegion {
/**
* Return the region name.
*/
String getName();
String name();
/**
* Deprecated migrate to name().
*/
@Deprecated
default String getName() {
return name();
}
/**
* Return true if the cache region is enabled.
@@ -63,7 +63,7 @@ abstract class AbstractBeanCollection<E> implements BeanCollection<E> {
*/
AbstractBeanCollection(BeanCollectionLoader loader, EntityBean ownerBean, String propertyName) {
this.loader = loader;
this.ebeanServerName = loader.getName();
this.ebeanServerName = loader.name();
this.ownerBean = ownerBean;
this.propertyName = propertyName;
this.readOnly = ownerBean != null && ownerBean._ebean_getIntercept().isReadOnly();
@@ -111,7 +111,7 @@ abstract class AbstractBeanCollection<E> implements BeanCollection<E> {
public void setLoader(BeanCollectionLoader loader) {
this.registeredWithLoadContext = true;
this.loader = loader;
this.ebeanServerName = loader.getName();
this.ebeanServerName = loader.name();
}
@Override
@@ -117,7 +117,7 @@ public final class BeanSet<E> extends AbstractBeanCollection<E> implements Set<E
try {
if (set == null) {
if (!disableLazyLoad && modifyListening) {
lazyLoadCollection(true);
lazyLoadCollection(false);
} else {
set = new LinkedHashSet<>();
}
@@ -134,7 +134,7 @@ public final class BeanSet<E> extends AbstractBeanCollection<E> implements Set<E
if (disableLazyLoad) {
set = new LinkedHashSet<>();
} else {
lazyLoadCollection(true);
lazyLoadCollection(false);
}
}
} finally {
@@ -0,0 +1,42 @@
package io.ebean.config;
import java.util.concurrent.Callable;
/**
* BackgroundExecutorWrapper that can be used to wrap tasks that are sent to background (i.e. another thread).
* It should copy all necessary thread-local variables. See {@link MdcBackgroundExecutorWrapper} for implementation details.
*
* @author Roland Praml, FOCONIS AG
*/
public interface BackgroundExecutorWrapper {
/**
* Wrap the task with MDC context if defined.
*/
<T> Callable<T> wrap(Callable<T> task);
/**
* Wrap the task with MDC context if defined.
*/
Runnable wrap(Runnable task);
/**
* Combines two wrappers by nesting them.
*/
default BackgroundExecutorWrapper with(BackgroundExecutorWrapper inner) {
return new BackgroundExecutorWrapper() {
@Override
public Runnable wrap(Runnable task) {
return BackgroundExecutorWrapper.this.wrap(inner.wrap(task));
}
@Override
public <T> Callable<T> wrap(Callable<T> task) {
return BackgroundExecutorWrapper.this.wrap(inner.wrap(task));
}
};
}
}
@@ -1,10 +1,5 @@
package io.ebean.config;
import java.io.IOException;
import java.net.URL;
import java.util.Enumeration;
/**
* Helper to find classes taking into account the context class loader.
*/
@@ -77,22 +72,14 @@ public class ClassLoadConfig {
* Return a new instance of the class using the default constructor.
*/
public Object newInstance(String className) {
try {
Class<?> cls = forName(className);
return cls.newInstance();
return cls.getDeclaredConstructor().newInstance();
} catch (Exception e) {
throw new IllegalArgumentException("Error constructing " + className, e);
}
}
/**
* Return the resources for the given name.
*/
public Enumeration<URL> getResources(String name) throws IOException {
return context.getResources(name);
}
/**
* Return true if the given class is present.
*/
@@ -129,9 +116,7 @@ public class ClassLoadConfig {
* Optional - if set only use this classLoader (no fallback).
*/
protected final ClassLoader preferredLoader;
protected final ClassLoader contextLoader;
protected final ClassLoader callerLoader;
ClassLoaderContext(ClassLoader preferredLoader) {
@@ -145,15 +130,7 @@ public class ClassLoadConfig {
return (loader != null) ? loader : callerLoader;
}
Enumeration<URL> getResources(String name) throws IOException {
if (preferredLoader != null) {
return preferredLoader.getResources(name);
}
return contextLoader().getResources(name);
}
Class<?> forName(String name) throws ClassNotFoundException {
if (preferredLoader != null) {
// only use the explicitly set classLoader
return classForName(name, preferredLoader);
@@ -2,11 +2,7 @@ package io.ebean.config;
import com.fasterxml.jackson.core.JsonFactory;
import io.avaje.config.Config;
import io.ebean.DatabaseFactory;
import io.ebean.EbeanVersion;
import io.ebean.PersistenceContextScope;
import io.ebean.Query;
import io.ebean.Transaction;
import io.ebean.*;
import io.ebean.annotation.*;
import io.ebean.cache.ServerCachePlugin;
import io.ebean.config.dbplatform.DatabasePlatform;
@@ -14,14 +10,7 @@ import io.ebean.config.dbplatform.DbEncrypt;
import io.ebean.config.dbplatform.DbType;
import io.ebean.config.dbplatform.IdType;
import io.ebean.datasource.DataSourceConfig;
import io.ebean.event.BeanFindController;
import io.ebean.event.BeanPersistController;
import io.ebean.event.BeanPersistListener;
import io.ebean.event.BeanPostConstructListener;
import io.ebean.event.BeanPostLoad;
import io.ebean.event.BeanQueryAdapter;
import io.ebean.event.BulkTableEventListener;
import io.ebean.event.ServerConfigStartup;
import io.ebean.event.*;
import io.ebean.event.changelog.ChangeLogListener;
import io.ebean.event.changelog.ChangeLogPrepare;
import io.ebean.event.changelog.ChangeLogRegister;
@@ -34,14 +23,7 @@ import javax.sql.DataSource;
import java.time.Clock;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.ServiceLoader;
import java.util.*;
/**
* The configuration used for creating a Database.
@@ -82,7 +64,6 @@ import java.util.ServiceLoader;
*/
public class DatabaseConfig {
/**
* The Database name.
*/
@@ -319,6 +300,8 @@ public class DatabaseConfig {
*/
private ExternalTransactionManager externalTransactionManager;
private boolean skipDataSourceCheck;
/**
* The data source (if programmatically provided).
*/
@@ -388,6 +371,33 @@ public class DatabaseConfig {
*/
private String uuidStateFile;
/**
* The node id (=mac address) for Version 1 UUIDs. There are several options:
* <ul>
* <li><code>null</code> (default) The generator tries to get the hardwarwe MAC
* address. If this fails, it will fall back to 'generate' mode.</li>
* <li><code>"generate"</code> Hardware detection is skipped. It generates a
* random identifier and tries to persist this to the state file. This nodeId
* will be reused on next start. If persisting to the state file will fail also,
* it will fall back to 'random' mode.<br>
* This mode is good, if the MAC address is not reliable, e.g. if you run
* multiple ebean instances on the same machine.</li>
* <li><code>"random"</code> In this mode, a random node id is generated on each
* start. No stateFile is used. it will generate a new nodeId on each
* application start.<br>
* This mode is good, if you have no write access to save the state file.</li>
* <li><code>"xx-xx-xx-xx-xx-xx"</code> When an explicit nodeId is specified,
* this one is used.</li>
* </ul>
* Note: It is possible that multiple servers are sharing the same state file as
* long as they are in the <b>same</b> JVM/ClassLoader scope. In this case it is
* recommended to use the same uuidNodeId configuration.
*
* If you have multiple servers in different JVMs, do <b>not</b> share the state
* files!
*/
private String uuidNodeId;
/**
* The clock used for setting the timestamps (e.g. @UpdatedTimestamp) on objects.
*/
@@ -400,8 +410,8 @@ public class DatabaseConfig {
private List<BeanPostConstructListener> postConstructListeners = new ArrayList<>();
private List<BeanPersistListener> persistListeners = new ArrayList<>();
private List<BeanQueryAdapter> queryAdapters = new ArrayList<>();
private List<BulkTableEventListener> bulkTableEventListeners = new ArrayList<>();
private List<ServerConfigStartup> configStartupListeners = new ArrayList<>();
private final List<BulkTableEventListener> bulkTableEventListeners = new ArrayList<>();
private final List<ServerConfigStartup> configStartupListeners = new ArrayList<>();
/**
* By default inserts are included in the change log.
@@ -409,48 +419,33 @@ public class DatabaseConfig {
private boolean changeLogIncludeInserts = true;
private ChangeLogPrepare changeLogPrepare;
private ChangeLogListener changeLogListener;
private ChangeLogRegister changeLogRegister;
private boolean changeLogAsync = true;
private ReadAuditLogger readAuditLogger;
private ReadAuditPrepare readAuditPrepare;
private EncryptKeyManager encryptKeyManager;
private EncryptDeployManager encryptDeployManager;
private Encryptor encryptor;
private boolean dbOffline;
private DbEncrypt dbEncrypt;
private boolean dbOffline;
private ServerCachePlugin serverCachePlugin;
/**
* The default PersistenceContextScope used if one is not explicitly set on a query.
*/
private PersistenceContextScope persistenceContextScope = PersistenceContextScope.TRANSACTION;
private JsonFactory jsonFactory;
private boolean localTimeWithNanos;
private boolean durationWithNanos;
private int maxCallStack = 5;
private boolean transactionRollbackOnChecked = true;
// configuration for the background executor service (thread pool)
private int backgroundExecutorSchedulePoolSize = 1;
private int backgroundExecutorShutdownSecs = 30;
private BackgroundExecutorWrapper backgroundExecutorWrapper = new MdcBackgroundExecutorWrapper();
// defaults for the L2 bean caching
@@ -1469,6 +1464,20 @@ public class DatabaseConfig {
this.backgroundExecutorShutdownSecs = backgroundExecutorShutdownSecs;
}
/**
* Return the background executor wrapper.
*/
public BackgroundExecutorWrapper getBackgroundExecutorWrapper() {
return backgroundExecutorWrapper;
}
/**
* Sets the background executor wrapper. The wrapper is used when a task is sent to background and should copy the thread-locals.
*/
public void setBackgroundExecutorWrapper(BackgroundExecutorWrapper backgroundExecutorWrapper) {
this.backgroundExecutorWrapper = backgroundExecutorWrapper;
}
/**
* Return the L2 cache default max size.
*/
@@ -1580,6 +1589,9 @@ public class DatabaseConfig {
/**
* Set to true if all DB column and table names should use quoted identifiers.
* <p>
* For Postgres pgjdbc version 42.3.0 should be used with datasource property
* <em>quoteReturningIdentifiers</em> set to <em>false</em> (refer #2303).
*/
public void setAllQuotedIdentifiers(boolean allQuotedIdentifiers) {
platformConfig.setAllQuotedIdentifiers(allQuotedIdentifiers);
@@ -1651,6 +1663,20 @@ public class DatabaseConfig {
this.autoTuneConfig = autoTuneConfig;
}
/**
* Return true if the startup DataSource check should be skipped.
*/
public boolean skipDataSourceCheck() {
return skipDataSourceCheck;
}
/**
* Set to true to skip the startup DataSource check.
*/
public void setSkipDataSourceCheck(boolean skipDataSourceCheck) {
this.skipDataSourceCheck = skipDataSourceCheck;
}
/**
* Return the DataSource.
*/
@@ -2035,6 +2061,20 @@ public class DatabaseConfig {
public void setUuidStateFile(String uuidStateFile) {
this.uuidStateFile = uuidStateFile;
}
/**
* Returns the V1-UUID-NodeId
*/
public String getUuidNodeId() {
return uuidNodeId;
}
/**
* Sets the V1-UUID-NodeId.
*/
public void setUuidNodeId(String uuidNodeId) {
this.uuidNodeId = uuidNodeId;
}
/**
* Return true if LocalTime should be persisted with nanos precision.
@@ -2725,21 +2765,7 @@ public class DatabaseConfig {
this.classLoadConfig = classLoadConfig;
}
/**
* Return the service loader using the classLoader defined in ClassLoadConfig.
*/
public <T> ServiceLoader<T> serviceLoad(Class<T> spiService) {
return ServiceLoader.load(spiService, classLoadConfig.getClassLoader());
}
/**
* Return the first service using the service loader (or null).
*/
public <T> T service(Class<T> spiService) {
ServiceLoader<T> load = serviceLoad(spiService);
Iterator<T> serviceInstances = load.iterator();
return serviceInstances.hasNext() ? serviceInstances.next() : null;
}
/**
* Load settings from application.properties, application.yaml and other sources.
@@ -2778,7 +2804,7 @@ public class DatabaseConfig {
*/
private List<AutoConfigure> autoConfiguration() {
List<AutoConfigure> list = new ArrayList<>();
for (AutoConfigure autoConfigure : serviceLoad(AutoConfigure.class)) {
for (AutoConfigure autoConfigure : ServiceLoader.load(AutoConfigure.class)) {
autoConfigure.preConfigure(this);
list.add(autoConfigure);
}
@@ -2873,6 +2899,7 @@ public class DatabaseConfig {
backgroundExecutorSchedulePoolSize = p.getInt("backgroundExecutorSchedulePoolSize", backgroundExecutorSchedulePoolSize);
backgroundExecutorShutdownSecs = p.getInt("backgroundExecutorShutdownSecs", backgroundExecutorShutdownSecs);
backgroundExecutorWrapper = p.createInstance(BackgroundExecutorWrapper.class, "backgroundExecutorWrapper", backgroundExecutorWrapper);
disableClasspathSearch = p.getBoolean("disableClasspathSearch", disableClasspathSearch);
currentUserProvider = p.createInstance(CurrentUserProvider.class, "currentUserProvider", currentUserProvider);
databasePlatform = p.createInstance(DatabasePlatform.class, "databasePlatform", databasePlatform);
@@ -2918,6 +2945,7 @@ public class DatabaseConfig {
uuidVersion = p.getEnum(UuidVersion.class, "uuidVersion", uuidVersion);
uuidStateFile = p.get("uuidStateFile", uuidStateFile);
uuidNodeId = p.get("uuidNodeId", uuidNodeId);
localTimeWithNanos = p.getBoolean("localTimeWithNanos", localTimeWithNanos);
jodaLocalTimeMode = p.get("jodaLocalTimeMode", jodaLocalTimeMode);
@@ -2932,6 +2960,7 @@ public class DatabaseConfig {
jsonDate = p.getEnum(JsonConfig.Date.class, "jsonDate", jsonDate);
jsonMutationDetection = p.getEnum(MutationDetection.class, "jsonMutationDetection", jsonMutationDetection);
skipDataSourceCheck = p.getBoolean("skipDataSourceCheck", skipDataSourceCheck);
runMigration = p.getBoolean("migration.run", runMigration);
ddlGenerate = p.getBoolean("ddl.generate", ddlGenerate);
ddlRun = p.getBoolean("ddl.run", ddlRun);
@@ -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;
}
@@ -0,0 +1,52 @@
package io.ebean.config;
import org.slf4j.MDC;
import java.util.Map;
import java.util.concurrent.Callable;
/**
* Propagates MDC context for tasks executed in the background.
*/
public final class MdcBackgroundExecutorWrapper implements BackgroundExecutorWrapper {
/**
* Wrap the task with MDC context if defined.
*/
@Override
public <T> Callable<T> wrap(Callable<T> task) {
final Map<String, String> map = MDC.getCopyOfContextMap();
if (map == null) {
return task;
} else {
return () -> {
MDC.setContextMap(map);
try {
return task.call();
} finally {
MDC.clear();
}
};
}
}
/**
* Wrap the task with MDC context if defined.
*/
@Override
public Runnable wrap(Runnable task) {
final Map<String, String> map = MDC.getCopyOfContextMap();
if (map == null) {
return task;
} else {
return () -> {
MDC.setContextMap(map);
try {
task.run();
} finally {
MDC.clear();
}
};
}
}
}
@@ -66,6 +66,8 @@ public class PlatformConfig {
private boolean caseSensitiveCollation = true;
private boolean useMigrationStoredProcedures = false;
/**
* Modify the default mapping of standard types such as default precision for DECIMAL etc.
*/
@@ -90,6 +92,7 @@ public class PlatformConfig {
this.geometrySRID = platformConfig.geometrySRID;
this.dbUuid = platformConfig.dbUuid;
this.caseSensitiveCollation = platformConfig.caseSensitiveCollation;
this.useMigrationStoredProcedures = platformConfig.useMigrationStoredProcedures;
this.allQuotedIdentifiers = platformConfig.allQuotedIdentifiers;
this.databaseInetAddressVarchar = platformConfig.databaseInetAddressVarchar;
this.customDbTypeMappings = platformConfig.customDbTypeMappings;
@@ -117,6 +120,9 @@ public class PlatformConfig {
/**
* Set to true if all DB column and table names should use quoted identifiers.
* <p>
* For Postgres pgjdbc version 42.3.0 should be used with datasource property
* <em>quoteReturningIdentifiers</em> set to <em>false</em> (refer #2303).
*/
public void setAllQuotedIdentifiers(boolean allQuotedIdentifiers) {
this.allQuotedIdentifiers = allQuotedIdentifiers;
@@ -139,6 +145,20 @@ public class PlatformConfig {
this.caseSensitiveCollation = caseSensitiveCollation;
}
/**
* Return true if force use of helper stored procedures for migrations.
*/
public boolean isUseMigrationStoredProcedures() {
return useMigrationStoredProcedures;
}
/**
* Set true to force use of helper stored procedures for migrations.
*/
public void setUseMigrationStoredProcedures(boolean useMigrationStoredProcedures) {
this.useMigrationStoredProcedures = useMigrationStoredProcedures;
}
/**
* Return true if Postgres FOR UPDATE should use the NO KEY option.
*/
@@ -314,6 +334,7 @@ public class PlatformConfig {
databaseBooleanFalse = p.get("databaseBooleanFalse", databaseBooleanFalse);
databaseInetAddressVarchar = p.getBoolean("databaseInetAddressVarchar", databaseInetAddressVarchar);
caseSensitiveCollation = p.getBoolean("caseSensitiveCollation", caseSensitiveCollation);
useMigrationStoredProcedures = p.getBoolean("useMigrationStoredProcedures", useMigrationStoredProcedures);
DbUuid dbUuid = p.getEnum(DbUuid.class, "dbuuid", null);
if (dbUuid != null) {
@@ -375,7 +396,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);
@@ -21,6 +21,14 @@ public class QueryPlanCapture {
/**
* Return the database the plans were captured for.
*/
public Database database() {
return database;
}
/**
* Deprecated migrate to database().
*/
@Deprecated
public Database getDatabase() {
return database;
}
@@ -28,6 +36,14 @@ public class QueryPlanCapture {
/**
* Return the captured query plans.
*/
public List<MetaQueryPlan> plans() {
return plans;
}
/**
* Deprecated migrate to plans().
*/
@Deprecated
public List<MetaQueryPlan> getPlans() {
return plans;
}
@@ -7,13 +7,10 @@ public class BasicSqlAnsiLimiter implements BasicSqlLimiter {
@Override
public String limit(String dbSql, int firstRow, int maxRows) {
StringBuilder sb = new StringBuilder(50 + dbSql.length());
sb.append(dbSql);
if (firstRow > 0) {
sb.append(" ").append("offset");
sb.append(" ").append(firstRow).append(" rows");
sb.append(" offset ").append(firstRow).append(" rows");
}
if (maxRows > 0) {
sb.append(" fetch next ").append(maxRows).append(" rows only");
@@ -15,6 +15,7 @@ import javax.persistence.PersistenceException;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
@@ -25,7 +26,7 @@ import java.sql.Types;
*/
public class DatabasePlatform {
private static final Logger logger = LoggerFactory.getLogger(DatabasePlatform.class);
private static final Logger log = LoggerFactory.getLogger("io.ebean");
/**
* Behavior used when ending a query only transaction (at read committed isolation level).
@@ -53,6 +54,17 @@ public class DatabasePlatform {
protected boolean supportsSavepointId = true;
protected boolean useMigrationStoredProcedures = false;
/**
* Can we use native java time API objects in
* {@link ResultSet#getObject(int, Class)} and
* {@link PreparedStatement#setObject(int, Object)}.
*
* Not all drivers (DB2 e.g.) will support this.
*/
protected boolean supportsNativeJavaTime = true;
/**
* The behaviour used when ending a read only transaction at read committed isolation level.
*/
@@ -153,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).
@@ -202,6 +214,8 @@ public class DatabasePlatform {
*/
protected PersistBatch persistBatchOnCascade = PersistBatch.ALL;
protected int maxInBinding;
/**
* The maximum length of table names - used specifically when derived
* default table names for intersection tables.
@@ -237,6 +251,7 @@ public class DatabasePlatform {
public void configure(PlatformConfig config) {
this.sequenceBatchSize = config.getDatabaseSequenceBatchSize();
this.caseSensitiveCollation = config.isCaseSensitiveCollation();
this.useMigrationStoredProcedures = config.isUseMigrationStoredProcedures();
configureIdType(config.getIdType());
configure(config, config.isAllQuotedIdentifiers());
}
@@ -343,6 +358,13 @@ public class DatabasePlatform {
return supportsSavepointId;
}
/**
* Return true if migrations should use stored procedures.
*/
public boolean isUseMigrationStoredProcedures() {
return useMigrationStoredProcedures;
}
/**
* Return true if the platform supports LIMIT with sql update.
*/
@@ -350,6 +372,13 @@ public class DatabasePlatform {
return inlineSqlUpdateLimit;
}
/**
* Return the maximum number of bind values this database platform allows or zero for no limit.
*/
public int getMaxInBinding() {
return maxInBinding;
}
/**
* Return the maximum table name length.
* <p>
@@ -573,11 +602,8 @@ public class DatabasePlatform {
this.supportsResultSetConcurrencyModeUpdatable = supportsResultSetConcurrencyModeUpdatable;
}
/**
* Normally not needed - overridden in CockroachPlatform.
*/
public boolean isDdlAutoCommit() {
return false;
public void setUseMigrationStoredProcedures(final boolean useMigrationStoredProcedures) {
this.useMigrationStoredProcedures = useMigrationStoredProcedures;
}
/**
@@ -636,11 +662,11 @@ 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 {
logger.error("Missing backquote on [" + dbName + "]");
log.error("Missing backquote on [" + dbName + "]");
}
} else if (allQuotedIdentifiers) {
return openQuote + dbName + closeQuote;
@@ -649,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.
*/
@@ -694,7 +729,7 @@ public class DatabasePlatform {
protected String withForUpdate(String sql, Query.LockWait lockWait, Query.LockType lockType) {
// silently assume the database does not support the "for update" clause.
logger.info("it seems your database does not support the 'for update' clause");
log.info("it seems your database does not support the 'for update' clause");
return sql;
}
@@ -728,7 +763,7 @@ public class DatabasePlatform {
if (!schemaExists(dbSchema, connection)) {
Statement query = connection.createStatement();
try {
logger.info("create schema:{}", dbSchema);
log.debug("create schema:{}", dbSchema);
query.executeUpdate("create schema " + dbSchema);
} finally {
JdbcClose.close(query);
@@ -758,7 +793,6 @@ public class DatabasePlatform {
* Return true if the table exists.
*/
public boolean tableExists(Connection connection, String catalog, String schema, String table) throws SQLException {
DatabaseMetaData metaData = connection.getMetaData();
ResultSet tables = metaData.getTables(catalog, schema, table, null);
try {
@@ -814,4 +848,8 @@ public class DatabasePlatform {
protected void escapeLikeCharacter(char ch, StringBuilder sb) {
sb.append(likeEscapeChar).append(ch);
}
public boolean supportsNativeJavaTime() {
return supportsNativeJavaTime;
}
}
@@ -70,7 +70,6 @@ public class DbPlatformTypeMapping {
* Load the standard types. These can be overridden by DB specific platform.
*/
private void loadDefaults(boolean logicalTypes) {
put(DbType.BOOLEAN, BOOLEAN_LOGICAL);
put(DbType.BIT);
put(DbType.INTEGER);
@@ -88,7 +87,6 @@ public class DbPlatformTypeMapping {
put(DbType.LONGVARCHAR);
// most commonly real maps to db float
put(DbType.REAL, new DbPlatformType("float"));
put(DbType.POINT, POINT);
put(DbType.POLYGON, POLYGON);
put(DbType.LINESTRING, LINESTRING);
@@ -103,7 +101,7 @@ public class DbPlatformTypeMapping {
put(DbType.VARBINARY, new DbPlatformType("varbinary"));
put(DbType.BINARY, new DbPlatformType("binary"));
put(DbType.CHAR, new DbPlatformType("char"));
put(DbType.LOCALDATETIME, new DbPlatformType("localdatetime", false));
put(DbType.HSTORE, new DbPlatformType("hstore", false));
put(DbType.JSON, new DbPlatformType("json", false));
put(DbType.JSONB, new DbPlatformType("jsonb", false));
@@ -120,7 +118,7 @@ public class DbPlatformTypeMapping {
put(DbType.VARBINARY, new DbPlatformType("varbinary", 255));
put(DbType.BINARY, new DbPlatformType("binary", 255));
put(DbType.CHAR, new DbPlatformType("char", 1));
put(DbType.LOCALDATETIME, DbType.TIMESTAMP.createPlatformType());
put(DbType.JSON, JSON_CLOB_PLACEHOLDER); // Postgres maps this to JSON
put(DbType.JSONB, JSON_CLOB_PLACEHOLDER); // Postgres maps this to JSONB
put(DbType.JSONCLOB, JSON_CLOB_PLACEHOLDER);
@@ -137,7 +135,6 @@ public class DbPlatformTypeMapping {
* Lookup the platform specific DbType given the standard sql type name.
*/
public DbPlatformType lookup(String name, boolean withScale) {
DbType type = lookup.byName(name);
if (type == null) {
throw new IllegalArgumentException("Unknown type [" + name + "] - not standard sql type");
@@ -160,7 +157,6 @@ public class DbPlatformTypeMapping {
}
private DbPlatformType getJsonType(DbType type, boolean withScale) {
DbPlatformType dbType = get(type);
if (dbType == JSON_CLOB_PLACEHOLDER) {
// if we have scale that implies this maps to varchar
@@ -34,6 +34,7 @@ public enum DbType {
ARRAY(Types.ARRAY),
LOCALDATETIME(ExtraDbTypes.LOCALDATETIME),
UUID(ExtraDbTypes.UUID),
INET(ExtraDbTypes.INET),
CIDR(ExtraDbTypes.CIDR),
@@ -5,11 +5,6 @@ package io.ebean.config.dbplatform;
*/
public interface ExtraDbTypes {
/**
* DB native UUID type (H2 and Postgres).
*/
int UUID = 5010;
/**
* Type to map Map content to Postgres HSTORE.
*/
@@ -40,6 +35,12 @@ public interface ExtraDbTypes {
*/
int JSONBlob = 5005;
int LOCALDATETIME = 5009;
/**
* DB native UUID type (H2 and Postgres).
*/
int UUID = 5010;
int INET = 5020;
int CIDR = 5021;
@@ -24,23 +24,14 @@ import java.util.concurrent.locks.ReentrantLock;
*/
public abstract class SequenceIdGenerator implements PlatformIdGenerator {
protected static final Logger logger = LoggerFactory.getLogger("io.ebean.SEQ");
protected static final Logger log = LoggerFactory.getLogger("io.ebean.SEQ");
private final ReentrantLock lock = new ReentrantLock();
/**
* The actual sequence name.
*/
protected final String seqName;
protected final DataSource dataSource;
protected final BackgroundExecutor backgroundExecutor;
protected final NavigableSet<Long> idList = new TreeSet<>();
protected final int allocationSize;
protected AtomicBoolean currentlyBackgroundLoading = new AtomicBoolean(false);
/**
@@ -129,7 +120,7 @@ public abstract class SequenceIdGenerator implements PlatformIdGenerator {
protected void loadInBackground(final int requestSize) {
if (currentlyBackgroundLoading.get()) {
// skip as already background loading
logger.debug("... skip background sequence load (another load in progress)");
log.debug("... skip background sequence load (another load in progress)");
return;
}
currentlyBackgroundLoading.set(true);
@@ -161,8 +152,8 @@ public abstract class SequenceIdGenerator implements PlatformIdGenerator {
resultSet = statement.executeQuery();
List<Long> newIds = readIds(resultSet, requestSize);
if (logger.isTraceEnabled()) {
logger.trace("seq:{} loaded:{} sql:{}", seqName, newIds.size(), sql);
if (log.isTraceEnabled()) {
log.trace("seq:{} loaded:{} sql:{}", seqName, newIds.size(), sql);
}
if (newIds.isEmpty()) {
throw new PersistenceException("Always expecting more than 1 row from " + sql);
@@ -173,7 +164,7 @@ public abstract class SequenceIdGenerator implements PlatformIdGenerator {
} catch (SQLException e) {
if (e.getMessage().contains("Database is already closed")) {
String msg = "Error getting SEQ when DB shutting down " + e.getMessage();
logger.error(msg);
log.error(msg);
System.out.println(msg);
return Collections.emptyList();
} else {
@@ -2,8 +2,6 @@ package io.ebean.config.dbplatform;
import io.ebean.Transaction;
import io.ebean.util.JdbcClose;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.persistence.PersistenceException;
import javax.sql.DataSource;
@@ -20,12 +18,8 @@ import java.sql.SQLException;
*/
public class SimpleSequenceIdGenerator implements PlatformIdGenerator {
private static final Logger logger = LoggerFactory.getLogger(SimpleSequenceIdGenerator.class);
private final String sql;
private final DataSource dataSource;
private final String seqName;
/**
@@ -61,7 +55,7 @@ public class SimpleSequenceIdGenerator implements PlatformIdGenerator {
PreparedStatement pstmt = null;
ResultSet rset = null;
try {
c = useTxnConnection ? t.getConnection() : dataSource.getConnection();
c = useTxnConnection ? t.connection() : dataSource.getConnection();
pstmt = c.prepareStatement(sql);
rset = pstmt.executeQuery();
if (rset.next()) {
@@ -31,14 +31,39 @@ public class SqlCodeTranslator implements SqlExceptionTranslator {
this.map = Collections.emptyMap();
}
@Override
public PersistenceException translate(String message, SQLException e) {
private DataErrorType getErrorType(SQLException e) {
DataErrorType errorType = map.get(e.getSQLState());
if (errorType == null) {
// fall back to error code
errorType = map.get(String.valueOf(e.getErrorCode()));
}
return errorType;
}
@Override
public PersistenceException translate(String message, SQLException e) {
DataErrorType errorType = getErrorType(e);
// for DB2 we must inspect the sql exception chain to determine which
// persistence error occurred in a batch execution. We also concatenate
// the error messages to improve error analysis.
SQLException chain = e.getNextException();
if (chain != null) {
StringBuilder sb = new StringBuilder(message);
int i = 1;
while (chain != null && i < 100000) { // prevents from endless loop
sb.append("\n\t#").append(i++).append(": ").append(chain.getMessage());
if (errorType == null) {
errorType = getErrorType(chain);
if (errorType != null) {
sb.append(" (causing error)"); // mark the line, where we found a matching error code
}
}
chain = chain.getNextException();
}
message = sb.toString();
}
if (errorType != null) {
switch (errorType) {
case AcquireLock:
@@ -18,6 +18,8 @@ public class ClickHousePlatform extends DatabasePlatform {
//this.exceptionTranslator =
this.nativeUuidType = true;
this.dbDefaultValue.setNow("now()");
this.dbDefaultValue.setFalse("0");
this.dbDefaultValue.setTrue("1");
this.dbIdentity.setIdType(IdType.IDENTITY);
this.dbIdentity.setSupportsGetGeneratedKeys(false);
@@ -26,7 +28,6 @@ public class ClickHousePlatform extends DatabasePlatform {
this.booleanDbType = Types.INTEGER;
dbTypeMap.put(DbType.BOOLEAN, new DbPlatformType("UInt8"));
// using unsigned as default types ...
dbTypeMap.put(DbType.TINYINT, new DbPlatformType("UInt8", false));
dbTypeMap.put(DbType.SMALLINT, new DbPlatformType("UInt16", false));
@@ -34,15 +35,13 @@ public class ClickHousePlatform extends DatabasePlatform {
dbTypeMap.put(DbType.BIGINT, new DbPlatformType("UInt64", false));
dbTypeMap.put(DbType.DECIMAL, new DbPlatformType("Decimal", 16, 3));
dbTypeMap.put(DbType.DOUBLE, new DbPlatformType("Float64", false));
dbTypeMap.put(DbType.DATE, new DbPlatformType("Date", false));
dbTypeMap.put(DbType.TIMESTAMP, new DbPlatformType("DateTime", false));
dbTypeMap.put(DbType.LOCALDATETIME, new DbPlatformType("DateTime", false));
dbTypeMap.put(DbType.VARCHAR, new DbPlatformType("String", false));
dbTypeMap.put(DbType.LONGVARCHAR, new DbPlatformType("String", false));
dbTypeMap.put(DbType.CLOB, new DbPlatformType("String", false));
dbTypeMap.put(DbType.JSONVARCHAR, new DbPlatformType("String", false));
dbTypeMap.put(DbType.UUID, new DbPlatformType("UUID", false));
dbTypeMap.put(DbType.INET, new DbPlatformType("String", false));
dbTypeMap.put(DbType.CIDR, new DbPlatformType("String", false));
@@ -11,18 +11,7 @@ public class CockroachPlatform extends PostgresPlatform {
public CockroachPlatform() {
super();
this.platform = Platform.COCKROACH;
// no like escape clause supported
this.likeSpecialCharacters = new char[]{'%', '_'};
this.likeClauseRaw = "like ?";
this.likeClauseEscaped = "like ?";
}
/**
* Needs a commit after create index such that alter table add foreign key ... succeeds.
*/
@Override
public boolean isDdlAutoCommit() {
return true;
this.historySupport = null; // not yet implemented in DDL
}
}
@@ -1,7 +1,6 @@
package io.ebean.config.dbplatform.db2;
import io.ebean.BackgroundExecutor;
import io.ebean.annotation.PersistBatch;
import io.ebean.annotation.Platform;
import io.ebean.config.dbplatform.DatabasePlatform;
import io.ebean.config.dbplatform.DbPlatformType;
@@ -15,19 +14,19 @@ import java.sql.Types;
/**
* DB2 specific platform.
*/
public class DB2Platform extends DatabasePlatform {
public abstract class BaseDB2Platform extends DatabasePlatform {
public DB2Platform() {
public BaseDB2Platform() {
super();
this.platform = Platform.DB2;
this.maxTableNameLength = 18;
this.maxConstraintNameLength = 18;
this.supportsNativeJavaTime = false;
this.truncateTable = "truncate table %s reuse storage ignore delete triggers immediate";
this.likeClauseRaw = "like ?";
this.sqlLimiter = new Db2SqlLimiter();
this.dbIdentity.setSupportsGetGeneratedKeys(true);
this.dbIdentity.setSupportsSequence(true);
this.idInExpandedForm = true; // Db2 does not support (a,b) in ((?,?),(?,?))
this.exceptionTranslator =
new SqlErrorCodes()
.addAcquireLock("40001","57033") // key -911/-913
@@ -37,13 +36,13 @@ public class DB2Platform extends DatabasePlatform {
.addDataIntegrity("23502","23503","23504","23511","23512","23511","42917","23515")
.build();
historySupport = new DB2HistorySupport();
booleanDbType = Types.BOOLEAN;
dbTypeMap.put(DbType.TINYINT, new DbPlatformType("smallint", false));
dbTypeMap.put(DbType.INTEGER, new DbPlatformType("integer", false));
dbTypeMap.put(DbType.BIGINT, new DbPlatformType("bigint", false));
dbTypeMap.put(DbType.REAL, new DbPlatformType("real"));
dbTypeMap.put(DbType.DECIMAL, new DbPlatformType("decimal", 16, 3));
persistBatchOnCascade = PersistBatch.NONE;
}
/**
@@ -0,0 +1,39 @@
package io.ebean.config.dbplatform.db2;
import io.ebean.annotation.Platform;
import io.ebean.config.dbplatform.DbPlatformType;
import io.ebean.config.dbplatform.DbType;
import io.ebean.config.dbplatform.SqlErrorCodes;
import java.sql.Types;
/**
* DB2 specific platform for i Series.
*
* @author Cédric Sougné
*/
public class DB2ForIPlatform extends BaseDB2Platform {
public DB2ForIPlatform() {
super();
this.platform = Platform.DB2FORI;
// Note: IBM i from 7.1 allow up to to 128
// TODO: Check if we need to introduce older platform (DB2ForI_6 ? but older
// documentation is not anymore published on ibm.com),
this.maxTableNameLength = 128;
this.maxConstraintNameLength = 128;
this.dbIdentity.setSupportsIdentity(true);
this.exceptionTranslator = new SqlErrorCodes().addAcquireLock("57033") // key -913
.addDuplicateKey("23505") // -803
// .addDataIntegrity("-407","-530","-531","-532","-543","-544","-545","-603","-667")
// we need SQLState, not code:
// https://www.ibm.com/support/knowledgecenter/en/SSEPEK_10.0.0/codes/src/tpc/db2z_n.html
.addDataIntegrity("23502", "23503", "23504", "23507", "23511", "23512", "23513", "42917", "23515")
.build();
booleanDbType = Types.SMALLINT;
dbTypeMap.put(DbType.BOOLEAN, new DbPlatformType("smallint default 0"));
}
}
@@ -0,0 +1,30 @@
package io.ebean.config.dbplatform.db2;
import io.ebean.config.dbplatform.DbStandardHistorySupport;
/**
* DB2 based history support.
*/
public class DB2HistorySupport extends DbStandardHistorySupport {
@Override
public String getAsOfViewSuffix(String asOfViewSuffix) {
return " for system_time as of ?";
}
@Override
public String getVersionsBetweenSuffix(String asOfViewSuffix) {
return " for system_time between ? and ?";
}
@Override
public String getSysPeriodLower(String tableAlias, String sysPeriod) {
return tableAlias + "." + sysPeriod + "_start";
}
@Override
public String getSysPeriodUpper(String tableAlias, String sysPeriod) {
return tableAlias + "." + sysPeriod + "_end";
}
}
@@ -0,0 +1,22 @@
package io.ebean.config.dbplatform.db2;
import io.ebean.annotation.PersistBatch;
import io.ebean.annotation.Platform;
/**
* DB2 specific platform for older DB2 versions. This platform is here for
* compatibility reasons. It uses a length limit of 18 chars for table and
* constraint names. Newer DB2 versions will support up to 128. It is strongly
* recommended to migrate to db2luw/DB2ForI or db2zos platform.
*/
public class DB2LegacyPlatform extends BaseDB2Platform {
public DB2LegacyPlatform() {
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.persistBatchOnCascade = PersistBatch.NONE;
}
}
@@ -0,0 +1,17 @@
package io.ebean.config.dbplatform.db2;
import io.ebean.annotation.Platform;
/**
* DB2 platform for Linux/Unix/Windows.
* @author Roland Praml, FOCONIS AG
*
*/
public class DB2LuwPlatform extends BaseDB2Platform {
public DB2LuwPlatform() {
super();
this.platform = Platform.DB2LUW;
this.maxTableNameLength = 128;
this.maxConstraintNameLength = 128;
}
}
@@ -19,7 +19,7 @@ public class DB2SequenceIdGenerator extends SequenceBatchIdGenerator {
public DB2SequenceIdGenerator(BackgroundExecutor be, DataSource ds, String seqName, int batchSize) {
super(be, ds, seqName, batchSize);
this.baseSql = "values nextval for " + seqName;
this.unionBaseSql = " union " + baseSql;
this.unionBaseSql = ", nextval for " + seqName;
}
@Override
@@ -0,0 +1,18 @@
package io.ebean.config.dbplatform.db2;
import io.ebean.annotation.Platform;
/**
* DB2 platform for z/OS.
* Note: This platform is currently not tested!
* @author Roland Praml, FOCONIS AG
*
*/
public class DB2ZosPlatform extends BaseDB2Platform {
public DB2ZosPlatform() {
super();
this.platform = Platform.DB2ZOS;
this.maxTableNameLength = 128;
this.maxConstraintNameLength = 128;
}
}
@@ -15,10 +15,13 @@ public class Db2SqlLimiter implements SqlLimiter {
sb.append("distinct ");
}
sb.append(request.getDbSql());
int firstRow = request.getFirstRow();
if (firstRow > 0) {
sb.append(" offset ").append(firstRow).append(" rows");
}
int maxRows = request.getMaxRows();
if (maxRows > 0) {
sb.append(" ").append(NEW_LINE).append("FETCH FIRST ").append(maxRows).append(" ROWS ONLY");
sb.append(" fetch next ").append(maxRows).append(" rows only");
}
String sql = request.getDbPlatform().completeSql(sb.toString(), request.getOrmQuery());
@@ -5,6 +5,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.sql.*;
import java.time.LocalDateTime;
import java.util.Arrays;
/**
@@ -12,7 +13,7 @@ import java.util.Arrays;
*/
public class H2HistoryTrigger implements Trigger {
private static final Logger logger = LoggerFactory.getLogger(H2HistoryTrigger.class);
private static final Logger log = LoggerFactory.getLogger(H2HistoryTrigger.class);
/**
* Hardcoding the column and history table suffix for now. Not sure how to get that
@@ -69,21 +70,21 @@ public class H2HistoryTrigger implements Trigger {
insertSql.append(");");
this.insertHistorySql = insertSql.toString();
logger.debug("History table insert sql: {}", insertHistorySql);
log.debug("History table insert sql: {}", insertHistorySql);
}
@Override
public void fire(Connection connection, Object[] oldRow, Object[] newRow) throws SQLException {
if (oldRow != null) {
// a delete or update event
Timestamp now = new Timestamp(System.currentTimeMillis());
LocalDateTime now = LocalDateTime.now();
oldRow[effectEndPosition] = now;
if (newRow != null) {
// update event. Set the effective start timestamp to now.
newRow[effectStartPosition] = now;
}
if (logger.isDebugEnabled()) {
logger.debug("History insert: {}", Arrays.toString(oldRow));
if (log.isTraceEnabled()) {
log.trace("History insert: {}", Arrays.toString(oldRow));
}
insertIntoHistory(connection, oldRow);
}
@@ -39,6 +39,7 @@ public class H2Platform extends DatabasePlatform {
this.dbIdentity.setSupportsIdentity(true);
dbTypeMap.put(DbType.UUID, new DbPlatformType("uuid", false));
dbTypeMap.put(DbType.INTEGER, new DbPlatformType("integer", false));
}
/**
@@ -18,13 +18,12 @@ public class H2SequenceIdGenerator extends SequenceBatchIdGenerator {
*/
public H2SequenceIdGenerator(BackgroundExecutor be, DataSource ds, String seqName, int batchSize) {
super(be, ds, seqName, batchSize);
this.baseSql = "select " + seqName + ".nextval";
this.baseSql = "select nextval('" + seqName + "')";
this.unionBaseSql = " union " + baseSql;
}
@Override
public String getSql(int batchSize) {
StringBuilder sb = new StringBuilder();
sb.append(baseSql);
for (int i = 1; i < batchSize; i++) {
@@ -92,4 +92,8 @@ public class HanaPlatform extends DatabasePlatform {
}
}
@Override
public boolean isUseMigrationStoredProcedures() {
return true;
}
}
@@ -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;
}
}
@@ -51,6 +51,7 @@ public abstract class BaseMySqlPlatform extends DatabasePlatform {
dbTypeMap.put(DbType.BIT, new DbPlatformType("tinyint(1)"));
dbTypeMap.put(DbType.BOOLEAN, new DbPlatformType("tinyint(1)"));
dbTypeMap.put(DbType.TIMESTAMP, new DbPlatformType("datetime(6)"));
dbTypeMap.put(DbType.LOCALDATETIME, new DbPlatformType("datetime(6)"));
dbTypeMap.put(DbType.CLOB, new MySqlClob());
dbTypeMap.put(DbType.BLOB, new MySqlBlob());
dbTypeMap.put(DbType.BINARY, new DbPlatformType("binary", 255));
@@ -10,5 +10,6 @@ public class MySql55Platform extends BaseMySqlPlatform {
super();
this.platform = Platform.MYSQL55;
dbTypeMap.put(DbType.TIMESTAMP, new DbPlatformType("datetime"));
dbTypeMap.put(DbType.LOCALDATETIME, new DbPlatformType("datetime"));
}
}
@@ -11,6 +11,7 @@ public class Oracle11Platform extends OraclePlatform {
public Oracle11Platform() {
super();
this.platform = Platform.ORACLE11;
this.columnAliasPrefix = "c";
this.sqlLimiter = new OracleRownumSqlLimiter();
this.basicSqlLimiter = new OracleRownumBasicLimiter();
dbIdentity.setIdType(IdType.SEQUENCE);
@@ -0,0 +1,13 @@
package io.ebean.config.dbplatform.oracle;
/**
* Oracle 12 platform using column alias.
*/
public class Oracle12Platform extends OraclePlatform {
public Oracle12Platform() {
super();
//this.platform = Platform.ORACLE12;
this.columnAliasPrefix = "c";
}
}
@@ -22,8 +22,8 @@ public class OraclePlatform extends DatabasePlatform {
public OraclePlatform() {
super();
this.platform = Platform.ORACLE;
this.columnAliasPrefix = "c";
this.supportsDeleteTableAlias = true;
this.maxInBinding = 1000;
this.maxTableNameLength = 30;
this.maxConstraintNameLength = 30;
this.dbEncrypt = new OracleDbEncrypt();
@@ -35,11 +35,9 @@ public class OraclePlatform extends DatabasePlatform {
dbIdentity.setSupportsSequence(true);
dbIdentity.setSupportsIdentity(true);
dbIdentity.setSupportsGetGeneratedKeys(true);
this.dbDefaultValue.setFalse("0");
this.dbDefaultValue.setTrue("1");
this.dbDefaultValue.setNow("current_timestamp");
this.treatEmptyStringsAsNull = true;
this.likeClauseRaw = "like ?";
@@ -56,7 +54,6 @@ public class OraclePlatform extends DatabasePlatform {
booleanDbType = Types.INTEGER;
dbTypeMap.put(DbType.BOOLEAN, new DbPlatformType("number(1)"));
dbTypeMap.put(DbType.INTEGER, new DbPlatformType("number", 10));
dbTypeMap.put(DbType.BIGINT, new DbPlatformType("number", 19));
dbTypeMap.put(DbType.REAL, new DbPlatformType("number", 19, 4));
@@ -65,12 +62,10 @@ public class OraclePlatform extends DatabasePlatform {
dbTypeMap.put(DbType.TINYINT, new DbPlatformType("number", 3));
dbTypeMap.put(DbType.DECIMAL, new DbPlatformType("number", 16, 3));
dbTypeMap.put(DbType.VARCHAR, new DbPlatformType("varchar2", 255));
dbTypeMap.put(DbType.LONGVARBINARY, new DbPlatformType("blob"));
dbTypeMap.put(DbType.LONGVARCHAR, new DbPlatformType("clob"));
dbTypeMap.put(DbType.VARBINARY, new DbPlatformType("raw", 255));
dbTypeMap.put(DbType.BINARY, new DbPlatformType("raw", 255));
dbTypeMap.put(DbType.TIME, new DbPlatformType("timestamp"));
}
@@ -69,22 +69,19 @@ public class PostgresPlatform extends DatabasePlatform {
DbPlatformType dbTypeText = new DbPlatformType("text", false);
DbPlatformType dbBytea = new DbPlatformType("bytea", false);
dbTypeMap.put(DbType.UUID, new DbPlatformType("uuid", false));
dbTypeMap.put(DbType.INET, new DbPlatformType("inet", false));
dbTypeMap.put(DbType.CIDR, new DbPlatformType("cidr", false));
dbTypeMap.put(DbType.HSTORE, new DbPlatformType("hstore", false));
dbTypeMap.put(DbType.JSON, new DbPlatformType("json", false));
dbTypeMap.put(DbType.JSONB, new DbPlatformType("jsonb", false));
dbTypeMap.put(DbType.INTEGER, new DbPlatformType("integer", false));
dbTypeMap.put(DbType.DOUBLE, new DbPlatformType("float"));
dbTypeMap.put(DbType.TINYINT, new DbPlatformType("smallint"));
dbTypeMap.put(DbType.TIMESTAMP, new DbPlatformType("timestamptz"));
dbTypeMap.put(DbType.LOCALDATETIME, new DbPlatformType("timestamp"));
dbTypeMap.put(DbType.BINARY, dbBytea);
dbTypeMap.put(DbType.VARBINARY, dbBytea);
dbTypeMap.put(DbType.BLOB, dbBytea);
dbTypeMap.put(DbType.CLOB, dbTypeText);
dbTypeMap.put(DbType.LONGVARBINARY, dbBytea);
@@ -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"));

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