Compare commits

..
Author SHA1 Message Date
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
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
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
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
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
Thomas Fellner 7a13670594 Merge remote-tracking branch 'origin/master' into bugfix/fix-gen-key-sequence-test 2021-08-30 15:17:22 +02: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
Thomas Fellner 9aa2fc824a second entity with SequenceGenerator added and test written 2021-08-13 08:36:25 +02:00
Thomas Fellner 531024b8b4 Fix test TestGeneratedKeys 2021-08-12 15:47:21 +02:00
2242 changed files with 19215 additions and 16743 deletions
+36
View File
@@ -0,0 +1,36 @@
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: Build with Maven
run: mvn package
+39
View File
@@ -0,0 +1,39 @@
name: JDK 18-ea
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: [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
+35
View File
@@ -0,0 +1,35 @@
name: MariaDB 10.6
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: mariadb 10.6
run: mvn clean test -Dprops.file=testconfig/ebean-mariadb.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
+45
View File
@@ -0,0 +1,45 @@
name: Multi-database platform test
on: [workflow_dispatch]
jobs:
build:
runs-on: ${{ matrix.os }}
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
java_version: [11]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java_version }}
distribution: 'adopt'
- name: Maven cache
uses: actions/cache@v2
env:
cache-name: maven-cache
with:
path:
~/.m2
key: build-${{ env.cache-name }}
- name: h2
run: mvn clean test
- name: postgres
run: mvn clean test -Dprops.file=testconfig/ebean-postgres.properties
- name: mysql
run: mvn clean test -Dprops.file=testconfig/ebean-mysql.properties
- name: sqlserver 2019
run: mvn clean test -Dprops.file=testconfig/ebean-sqlserver19.properties
- name: sqlserver 2017
run: mvn clean test -Dprops.file=testconfig/ebean-sqlserver17.properties
- name: mariadb
run: mvn clean test -Dprops.file=testconfig/ebean-mariadb.properties
+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: Postgres
on:
workflow_dispatch:
schedule:
- cron: '10 6 * * *'
jobs:
build:
runs-on: ${{ matrix.os }}
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
java_version: [11]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java_version }}
distribution: 'adopt'
- name: Maven cache
uses: actions/cache@v2
env:
cache-name: maven-cache
with:
path:
~/.m2
key: build-${{ env.cache-name }}
- name: postgres
run: mvn clean test -Dprops.file=testconfig/ebean-postgres.properties
@@ -0,0 +1,37 @@
name: SqlServer 2017 latest
on: [workflow_dispatch]
jobs:
build:
runs-on: ${{ matrix.os }}
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
java_version: [11]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java_version }}
distribution: 'adopt'
- name: Maven cache
uses: actions/cache@v2
env:
cache-name: maven-cache
with:
path:
~/.m2
key: build-${{ env.cache-name }}
# - name: sqlserver 2019 latest
# run: mvn clean test -Dprops.file=testconfig/ebean-sqlserver.properties
- name: sqlserver 2017 latest
run: mvn clean test -Dprops.file=testconfig/ebean-sqlserver17.properties
@@ -0,0 +1,35 @@
name: SqlServer 2019 latest
on: [workflow_dispatch]
jobs:
build:
runs-on: ${{ matrix.os }}
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
java_version: [11]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java_version }}
distribution: 'adopt'
- name: Maven cache
uses: actions/cache@v2
env:
cache-name: maven-cache
with:
path:
~/.m2
key: build-${{ env.cache-name }}
- name: sqlserver 2019 latest
run: mvn clean test -Dprops.file=testconfig/ebean-sqlserver19.properties
+1 -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
+10 -2
View File
@@ -1,5 +1,13 @@
[![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)
[![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-10.6.yml/badge.svg)](https://github.com/ebean-orm/ebean/actions/workflows/mariadb-10.6.yml)
[![SqlServer](https://github.com/ebean-orm/ebean/actions/workflows/sqlserver-2017-latest.yml/badge.svg)](https://github.com/ebean-orm/ebean/actions/workflows/sqlserver-2017-latest.yml)
# Sponsors
<table>
@@ -36,7 +44,7 @@ Post questions or issues to the Ebean google group - https://groups.google.com/f
Goto [https://ebean.io/docs/](https://ebean.io/docs/)
## Maven cental links:
## Maven central links:
[Maven central - ebean](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22io.ebean%22%20AND%20a%3A%22ebean%22 "maven central ebean")
[Maven central - all related projects](http://search.maven.org/#search%7Cga%7C1%7Cebean "maven central all related projects")
+20 -14
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>12.11.3</version>
<version>12.13.2</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.5</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.3</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-types</artifactId>
<version>2.1</version>
<version>2.2</version>
</dependency>
<dependency>
@@ -104,21 +103,28 @@
<optional>true</optional>
</dependency>
<dependency>
<groupId>io.avaje</groupId>
<artifactId>junit</artifactId>
<version>1.0</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>
+130
View File
@@ -0,0 +1,130 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>12.13.2-SNAPSHOT</version>
</parent>
<name>ebean api</name>
<description>ebean api</description>
<artifactId>ebean-api</artifactId>
<dependencies>
<!--
Projects are expected to explicit depend on version
of slf4j that they want to use
-->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.30</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-config</artifactId>
<version>1.5</version>
</dependency>
<!--
Class retention Nonnull and Nullable annotations
to assist with IDE auto-completion with Ebean API
-->
<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-lang</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>persistence-api</artifactId>
<version>2.2.5</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-annotation</artifactId>
<version>7.3</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-types</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-datasource-api</artifactId>
<version>${ebean-datasource.version}</version>
</dependency>
<!-- Jackson core used internally by Ebean -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
<optional>true</optional>
</dependency>
<!-- provided scope for JsonNode support -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
<optional>true</optional>
</dependency>
<!-- Provided scope so that the H2HistoryTrigger can live in Ebean core
and not require a separate module for it -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.199</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>io.avaje</groupId>
<artifactId>junit</artifactId>
<version>1.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.24</version>
<extensions>true</extensions>
<configuration>
<tiles>
<tile>io.avaje.tile:moditech-module:1.0</tile>
</tiles>
</configuration>
</plugin>
</plugins>
</build>
</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;
/**
@@ -81,7 +81,6 @@ public abstract class BeanFinder<I,T> {
* <p>
* Equivalent to {@link Database#reference(Class, Object)}
*/
@Nonnull
public T ref(I 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> {
/**
+47 -11
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,13 +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 getSortOrder();
int sortOrder();
/**
* Deprecated migrate to sortOrder().
*/
@Deprecated
default int getSortOrder() {
return sortOrder();
}
}
+28 -82
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();
@@ -523,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);
}
@@ -851,7 +850,6 @@ public final class DB {
* }</pre>
*/
public static <T> Update<T> createUpdate(Class<T> beanType, String ormUpdate) {
return getDefault().createUpdate(beanType, ormUpdate);
}
@@ -859,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);
}
@@ -897,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);
}
@@ -935,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);
}
@@ -951,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);
}
@@ -1030,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>
@@ -1272,10 +1195,33 @@ public final class DB {
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() {
public static ServerCacheManager cacheManager() {
return getDefault().cacheManager();
}
+24 -7
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 {
/**
@@ -575,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.
@@ -949,7 +950,6 @@ public interface Database {
* @param beanType the type of entity bean
* @param id the id value
*/
@Nonnull
<T> T reference(Class<T> beanType, Object id);
/**
@@ -1236,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);
/**
@@ -1294,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);
/**
@@ -1614,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);
/**
@@ -1627,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);
/**
@@ -1665,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);
/**
@@ -1678,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);
/**
@@ -1714,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.
*/
@@ -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);
}
}
@@ -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).
*/
+1 -4
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;
@@ -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);
}
@@ -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();
@@ -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> {
/**
+3 -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.util.List;
/**
@@ -55,6 +55,7 @@ import java.util.List;
* }</pre>
*
*/
@NonNullApi
public class Finder<I, T> {
/**
@@ -139,7 +140,6 @@ public class Finder<I, T> {
* <p>
* Equivalent to {@link Database#reference(Class, Object)}
*/
@Nonnull
public T ref(I 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);
}
}
}
+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,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();
/**
@@ -354,6 +353,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.
@@ -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;
@@ -1164,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();
@@ -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>
@@ -13,9 +13,7 @@ import java.util.Set;
public class QueryCacheEntry {
private final Object value;
private final Set<String> dependentTables;
private final long timestamp;
/**
@@ -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.
@@ -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.
*/
@@ -402,8 +383,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.
@@ -411,42 +392,26 @@ 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)
@@ -1582,6 +1547,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);
@@ -2741,21 +2709,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.
@@ -2794,7 +2748,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);
}
@@ -117,6 +117,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;
@@ -375,7 +378,7 @@ public class PlatformConfig {
BINARY(false, true, false),
/**
* Store using DB BINARY(16).
* Store using DB BINARY(16) with optimized packing.
*/
BINARY_OPTIMIZED(false, true, true);
@@ -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;
}
@@ -25,7 +25,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).
@@ -640,7 +640,7 @@ public class DatabasePlatform {
if (dbName.charAt(dbName.length() - 1) == BACK_TICK) {
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;
@@ -694,7 +694,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 +728,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 +758,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 {
@@ -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()) {
@@ -26,7 +26,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 +33,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));
@@ -20,6 +20,8 @@ public class DB2Platform extends DatabasePlatform {
public DB2Platform() {
super();
this.platform = Platform.DB2;
// Note: DB2 (at least LUW supports length up to 128)
// TOOD: Check if we need to introduce a new platform (DB2_LUW_11 ?)
this.maxTableNameLength = 18;
this.maxConstraintNameLength = 18;
this.truncateTable = "truncate table %s reuse storage ignore delete triggers immediate";
@@ -12,7 +12,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,7 +69,7 @@ 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
@@ -82,8 +82,8 @@ public class H2HistoryTrigger implements Trigger {
// 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);
}
@@ -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"));
}
}
@@ -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"));
@@ -21,6 +21,8 @@ public class SqlServer16Platform extends SqlServerBasePlatform {
dbTypeMap.put(DbType.VARCHAR, new DbPlatformType("varchar", 255));
dbTypeMap.put(DbType.LONGVARCHAR, new DbPlatformType("text"));
dbTypeMap.put(DbType.CLOB, new DbPlatformType("text"));
dbTypeMap.put(DbType.JSON, new DbPlatformType("text"));
dbTypeMap.put(DbType.JSONB, new DbPlatformType("text"));
}
}
@@ -57,7 +57,6 @@ abstract class SqlServerBasePlatform extends DatabasePlatform {
this.dbDefaultValue.setTrue("1");
this.dbDefaultValue.setNow("SYSUTCDATETIME()");
dbTypeMap.put(DbType.BOOLEAN, new DbPlatformType("bit"));
dbTypeMap.put(DbType.INTEGER, new DbPlatformType("integer", false));
dbTypeMap.put(DbType.BIGINT, new DbPlatformType("numeric", 19));
dbTypeMap.put(DbType.REAL, new DbPlatformType("float(16)"));
@@ -67,16 +66,14 @@ abstract class SqlServerBasePlatform extends DatabasePlatform {
dbTypeMap.put(DbType.DATE, new DbPlatformType("date"));
dbTypeMap.put(DbType.TIME, new DbPlatformType("time"));
dbTypeMap.put(DbType.TIMESTAMP, new DbPlatformType("datetime2"));
dbTypeMap.put(DbType.LOCALDATETIME, new DbPlatformType("datetime2"));
// UTF8 aware types - overwritten in SqlServer16 platform
dbTypeMap.put(DbType.CHAR, new DbPlatformType("nchar", 1));
dbTypeMap.put(DbType.VARCHAR, new DbPlatformType("nvarchar", 255));
dbTypeMap.put(DbType.LONGVARCHAR, new DbPlatformType("nvarchar", Integer.MAX_VALUE));
dbTypeMap.put(DbType.CLOB, new DbPlatformType("nvarchar", Integer.MAX_VALUE));
dbTypeMap.put(DbType.JSON, new DbPlatformType("nvarchar", Integer.MAX_VALUE));
dbTypeMap.put(DbType.JSONB, new DbPlatformType("nvarchar", Integer.MAX_VALUE));
dbTypeMap.put(DbType.BLOB, new DbPlatformType("image"));
dbTypeMap.put(DbType.LONGVARBINARY, new DbPlatformType("image"));
}
@@ -50,4 +50,17 @@ public interface BeanFindController {
*/
<T> BeanCollection<T> findMany(BeanQueryRequest<T> request);
/**
* Allows post-processing of the find result.
*/
default <T> BeanCollection<T> postProcessMany(BeanQueryRequest<T> request, BeanCollection<T> result) {
return result;
}
/**
* Allows post-processing of the find result.
*/
default <T> T postProcess(BeanQueryRequest<T> request, T result) {
return result;
};
}
@@ -43,6 +43,12 @@ public interface BeanPersistRequest<T> {
return transaction();
}
/**
* Return true if this request is due to cascading persist.
* False implies this is a "top level" request.
*/
boolean isCascade();
/**
* For an update or delete of a partially populated bean this is the set of
* loaded properties and otherwise returns null.
@@ -20,18 +20,13 @@ import java.util.concurrent.locks.ReentrantLock;
*/
public final class ShutdownManager {
private static final Logger logger = LoggerFactory.getLogger(ShutdownManager.class);
private static final Logger log = LoggerFactory.getLogger("io.ebean");
private static final ReentrantLock lock = new ReentrantLock();
private static final List<Database> databases = new ArrayList<>();
private static final ShutdownHook shutdownHook = new ShutdownHook();
private static boolean stopping;
private static SpiContainer container;
static {
// Register the Shutdown hook
registerShutdownHook();
@@ -125,8 +120,8 @@ public final class ShutdownManager {
// Already run shutdown...
return;
}
if (logger.isDebugEnabled()) {
logger.debug("Shutting down");
if (log.isDebugEnabled()) {
log.debug("Ebean shutting down");
}
stopping = true;
deregisterShutdownHook();
@@ -138,7 +133,7 @@ public final class ShutdownManager {
Runnable r = (Runnable) ClassUtil.newInstance(shutdownRunner);
r.run();
} catch (Exception e) {
logger.error("Error running custom shutdown runnable", e);
log.error("Error running custom shutdown runnable", e);
}
}
@@ -152,7 +147,7 @@ public final class ShutdownManager {
try {
server.shutdown();
} catch (Exception ex) {
logger.error("Error executing shutdown runnable", ex);
log.error("Error executing shutdown runnable", ex);
ex.printStackTrace();
}
}
@@ -170,10 +165,10 @@ public final class ShutdownManager {
while (drivers.hasMoreElements()) {
Driver driver = drivers.nextElement();
try {
logger.info("De-registering jdbc driver: " + driver);
log.info("De-registering jdbc driver: " + driver);
DriverManager.deregisterDriver(driver);
} catch (SQLException e) {
logger.error("Error de-registering driver " + driver, e);
log.error("Error de-registering driver " + driver, e);
}
}
}
@@ -10,7 +10,15 @@ public interface QueryPlanMetric {
/**
* Return the underlying timed metric.
*/
TimedMetric getMetric();
TimedMetric metric();
/**
* Deprecated migrate to metric().
*/
@Deprecated
default TimedMetric getMetric() {
return metric();
}
/**
* Visit the underlying metric.
@@ -16,11 +16,27 @@ public interface BeanDocType<T> {
/**
* Return the doc store index type for this bean type.
*/
default String indexType() {
return getIndexType();
}
/**
* Deprecated migrate to indexType().
*/
@Deprecated
String getIndexType();
/**
* Return the doc store index name for this bean type.
*/
default String indexName() {
return getIndexName();
}
/**
* Deprecated migrate to indexName().
*/
@Deprecated
String getIndexName();
/**
@@ -32,12 +48,28 @@ public interface BeanDocType<T> {
/**
* Return the FetchPath for the embedded document.
*/
default FetchPath embedded(String path) {
return getEmbedded(path);
}
/**
* Deprecated migrate to embedded().
*/
@Deprecated
FetchPath getEmbedded(String path);
/**
* For embedded 'many' properties we need a FetchPath relative to the root which is used to
* build and replace the embedded list.
*/
default FetchPath embeddedManyRoot(String path) {
return getEmbeddedManyRoot(path);
}
/**
* Deprecated migrate to embeddedManyRoot().
*/
@Deprecated
FetchPath getEmbeddedManyRoot(String path);
/**
@@ -8,7 +8,6 @@ import io.ebean.event.BeanPersistController;
import io.ebean.event.BeanPersistListener;
import io.ebean.event.BeanQueryAdapter;
import javax.annotation.Nonnull;
import java.util.Collection;
import java.util.List;
import java.util.function.Consumer;
@@ -21,51 +20,111 @@ public interface BeanType<T> {
/**
* Return the short name of the bean type.
*/
@Nonnull
String getName();
String name();
/**
* Deprecated migrate to name().
*/
@Deprecated
default String getName() {
return name();
}
/**
* Return the full name of the bean type.
*/
@Nonnull
String getFullName();
String fullName();
/**
* Deprecated migrate to fullName().
*/
@Deprecated
default String getFullName() {
return fullName();
}
/**
* Return the class type this BeanDescriptor describes.
*/
@Nonnull
Class<T> getBeanType();
Class<T> type();
/**
* Deprecated migrate to type().
*/
@Deprecated
default Class<T> getBeanType() {
return type();
}
/**
* Return the type bean for an OneToMany or ManyToOne or ManyToMany property.
*/
BeanType<?> getBeanTypeAtPath(String propertyName);
BeanType<?> beanTypeAtPath(String propertyName);
/**
* Deprecated migrate to beanTypeAtPath().
*/
@Deprecated
default BeanType<?> getBeanTypeAtPath(String propertyName) {
return beanTypeAtPath(propertyName);
}
/**
* Return all the properties for this bean type.
*/
@Nonnull
Collection<? extends Property> allProperties();
/**
* Return the Id property.
*/
Property getIdProperty();
Property idProperty();
/**
* Deprecated migrate to idProperty().
*/
@Deprecated
default Property getIdProperty() {
return idProperty();
}
/**
* Return the when modified property if there is one defined.
*/
Property getWhenModifiedProperty();
Property whenModifiedProperty();
/**
* Deprecated migrate to idProperty().
*/
@Deprecated
default Property getWhenModifiedProperty() {
return whenModifiedProperty();
}
/**
* Return the when created property if there is one defined.
*/
Property getWhenCreatedProperty();
Property whenCreatedProperty();
/**
* Deprecated migrate to idProperty().
*/
@Deprecated
default Property getWhenCreatedProperty() {
return whenCreatedProperty();
}
/**
* Return the Property to read values from a bean.
*/
Property getProperty(String propertyName);
Property property(String propertyName);
/**
* Deprecated migrate to property().
*/
@Deprecated
default Property getProperty(String propertyName) {
return property(propertyName);
}
/**
* Return the ExpressionPath for a given property path.
@@ -73,7 +132,15 @@ public interface BeanType<T> {
* This can return a property or nested property path.
* </p>
*/
ExpressionPath getExpressionPath(String path);
ExpressionPath expressionPath(String path);
/**
* Deprecated migrate to expressionPath().
*/
@Deprecated
default ExpressionPath getExpressionPath(String path) {
return expressionPath(path);
}
/**
* Return true if the property is a valid known property or path for the given bean type.
@@ -108,7 +175,15 @@ public interface BeanType<T> {
/**
* Return the base table this bean type maps to.
*/
String getBaseTable();
String baseTable();
/**
* Deprecated migrate to baseTable().
*/
@Deprecated
default String getBaseTable() {
return baseTable();
}
/**
* Create a new instance of the bean.
@@ -118,10 +193,18 @@ public interface BeanType<T> {
/**
* Return the bean id. This is the same as getBeanId() but without the generic type.
*/
Object beanId(Object bean);
Object id(Object bean);
/**
* Deprecated migrate to beanId()
* Deprecated migrate to id()
*/
@Deprecated
default Object beanId(Object bean) {
return id(bean);
}
/**
* Deprecated migrate to id()
*/
@Deprecated
Object getBeanId(T bean);
@@ -129,32 +212,80 @@ public interface BeanType<T> {
/**
* Set the id value to the bean.
*/
void setBeanId(T bean, Object idValue);
void setId(T bean, Object idValue);
/**
* Deprecated migrate to setId()
*/
@Deprecated
default void setBeanId(T bean, Object idValue) {
setId(bean, idValue);
}
/**
* Return the bean persist controller.
*/
BeanPersistController getPersistController();
BeanPersistController persistController();
/**
* Deprecated migrate to persistController()
*/
@Deprecated
default BeanPersistController getPersistController() {
return persistController();
}
/**
* Return the bean persist listener.
*/
BeanPersistListener getPersistListener();
BeanPersistListener persistListener();
/**
* Deprecated migrate to persistListener()
*/
@Deprecated
default BeanPersistListener getPersistListener() {
return persistListener();
}
/**
* Return the beanFinder. Usually null unless overriding the finder.
*/
BeanFindController getFindController();
BeanFindController findController();
/**
* Deprecated migrate to findController()
*/
@Deprecated
default BeanFindController getFindController() {
return findController();
}
/**
* Return the BeanQueryAdapter or null if none is defined.
*/
BeanQueryAdapter getQueryAdapter();
BeanQueryAdapter queryAdapter();
/**
* Deprecated migrate to queryAdapter()
*/
@Deprecated
default BeanQueryAdapter getQueryAdapter() {
return queryAdapter();
}
/**
* Return the identity generation type.
*/
IdType getIdType();
IdType idType();
/**
* Deprecated migrate to idType()
*/
@Deprecated
default IdType getIdType() {
return idType();
}
/**
* Return true if this bean type has doc store backing.
@@ -168,12 +299,28 @@ public interface BeanType<T> {
* for the document store.
* </p>
*/
DocMapping getDocMapping();
DocMapping docMapping();
/**
* Deprecated migrate to docMapping()
*/
@Deprecated
default DocMapping getDocMapping() {
return docMapping();
}
/**
* Return the doc store queueId for this bean type.
*/
String getDocStoreQueueId();
String docStoreQueueId();
/**
* Deprecated migrate to docStoreQueueId()
*/
@Deprecated
default String getDocStoreQueueId() {
return docStoreQueueId();
}
/**
* Return the doc store support for this bean type.\
@@ -204,12 +351,28 @@ public interface BeanType<T> {
/**
* Returns all direct children of this beantype
*/
List<BeanType<?>> getInheritanceChildren();
List<BeanType<?>> inheritanceChildren();
/**
* Returns the parent in inheritance hiearchy
* Deprecated migrate to inheritanceChildren()
*/
BeanType<?> getInheritanceParent();
@Deprecated
default List<BeanType<?>> getInheritanceChildren() {
return inheritanceChildren();
}
/**
* Returns the parent in inheritance hierarchy
*/
BeanType<?> inheritanceParent();
/**
* Deprecated migrate to inheritanceParent()
*/
@Deprecated
default BeanType<?> getInheritanceParent() {
return inheritanceParent();
}
/**
* Visit all children recursively
@@ -219,7 +382,15 @@ public interface BeanType<T> {
/**
* Return the discriminator column.
*/
String getDiscColumn();
String discColumn();
/**
* Deprecated migrate to discColumn()
*/
@Deprecated
default String getDiscColumn() {
return discColumn();
}
/**
* Create a bean given the discriminator value.
@@ -37,7 +37,15 @@ public interface ExpressionPath {
/**
* Return the default StringParser for the scalar property.
*/
StringParser getStringParser();
StringParser stringParser();
/**
* Deprecated migrate to stringParser().
*/
@Deprecated
default StringParser getStringParser() {
return stringParser();
}
/**
* For DateTime capable scalar types convert the long systemTimeMillis into
@@ -54,7 +62,15 @@ public interface ExpressionPath {
/**
* Return the underlying JDBC type or 0 if this is not a scalar type.
*/
int getJdbcType();
int jdbcType();
/**
* Deprecated migrate to jdbcType().
*/
@Deprecated
default int getJdbcType() {
return jdbcType();
}
/**
* Return true if this is an ManyToOne or OneToOne associated bean property.
@@ -67,20 +83,52 @@ public interface ExpressionPath {
* Typically used to produce id = ? expression strings.
* </p>
*/
String getAssocIdExpression(String propName, String bindOperator);
String assocIdExpression(String propName, String bindOperator);
/**
* Deprecated migrate to assocIdExpression().
*/
@Deprecated
default String getAssocIdExpression(String propName, String bindOperator) {
return assocIdExpression(propName, bindOperator);
}
/**
* Return the Id values for the given bean value.
*/
Object[] getAssocIdValues(EntityBean bean);
Object[] assocIdValues(EntityBean bean);
/**
* Deprecated migrate to assocIdValues().
*/
@Deprecated
default Object[] getAssocIdValues(EntityBean bean) {
return assocIdValues(bean);
}
/**
* Return the underlying bean property.
*/
Property getProperty();
Property property();
/**
* Deprecated migrate to property().
*/
@Deprecated
default Property getProperty() {
return property();
}
/**
* The ElPrefix plus name.
*/
String getElName();
String elName();
/**
* Deprecated migrate to elName().
*/
@Deprecated
default String getElName() {
return elName();
}
}
@@ -1,7 +1,5 @@
package io.ebean.plugin;
import javax.annotation.Nonnull;
/**
* Property of a entity bean that can be read.
*/
@@ -10,19 +8,41 @@ public interface Property {
/**
* Return the name of the property.
*/
@Nonnull
String getName();
String name();
/**
* Deprecated migrate to name().
*/
@Deprecated
default String getName() {
return name();
}
/**
* Return the type of the property.
*/
@Nonnull
Class<?> getPropertyType();
Class<?> type();
/**
* Deprecated migrate to type().
*/
@Deprecated
default Class<?> getPropertyType() {
return type();
}
/**
* Return the value of the property on the given bean.
*/
Object getVal(Object bean);
Object value(Object bean);
/**
* Deprecated migrate to value().
*/
@Deprecated
default Object getVal(Object bean) {
return value(bean);
}
/**
* Return true if this is a OneToMany or ManyToMany property.
@@ -20,7 +20,7 @@ import org.slf4j.LoggerFactory;
*/
public class DefaultCsvCallback<T> implements CsvCallback<T> {
private static final Logger logger = LoggerFactory.getLogger(DefaultCsvCallback.class);
private static final Logger log = LoggerFactory.getLogger(DefaultCsvCallback.class);
/**
* The transaction to use (if not using CsvCallback).
@@ -124,13 +124,11 @@ public class DefaultCsvCallback<T> implements CsvCallback<T> {
*/
@Override
public void processBean(int row, String[] line, T bean) {
// assumes single bean or Cascade.PERSIST will save any
// related beans (e.g. customer -> customer.billingAddress
server.save(bean, transaction);
if (logInfoFrequency > 0 && (row % logInfoFrequency == 0)) {
logger.info("processed " + row + " rows");
log.debug("processed {} rows", row);
}
}
@@ -139,11 +137,9 @@ public class DefaultCsvCallback<T> implements CsvCallback<T> {
*/
@Override
public void end(int row) {
commitTransactionIfCreated();
exeTime = System.currentTimeMillis() - startTime;
logger.info("Csv finished, rows[" + row + "] exeMillis[" + exeTime + "]");
log.info("Csv finished, rows[{}] exeMillis[{}]", row, exeTime);
}
/**
@@ -159,23 +155,20 @@ public class DefaultCsvCallback<T> implements CsvCallback<T> {
* and batch size.
*/
protected void initTransactionIfRequired() {
transaction = server.currentTransaction();
if (transaction == null || !transaction.isActive()) {
transaction = server.beginTransaction();
createdTransaction = true;
if (persistBatchSize > 1) {
logger.info("Creating transaction, batchSize[" + persistBatchSize + "]");
log.debug("Creating transaction, batchSize[{}]", persistBatchSize);
transaction.setBatchMode(true);
transaction.setBatchSize(persistBatchSize);
transaction.setGetGeneratedKeys(false);
} else {
// explicitly turn off JDBC batching in case
// is has been turned on globally
transaction.setBatchMode(false);
logger.info("Creating transaction with no JDBC batching");
log.debug("Creating transaction with no JDBC batching");
}
}
}
@@ -187,7 +180,7 @@ public class DefaultCsvCallback<T> implements CsvCallback<T> {
protected void commitTransactionIfCreated() {
if (createdTransaction) {
transaction.commit();
logger.info("Committed transaction");
log.debug("Committed transaction");
}
}
@@ -198,7 +191,7 @@ public class DefaultCsvCallback<T> implements CsvCallback<T> {
protected void rollbackTransactionIfCreated(Throwable e) {
if (createdTransaction) {
transaction.rollback(e);
logger.info("Rolled back transaction");
log.debug("Rolled back transaction");
}
}
@@ -20,7 +20,7 @@ public interface JsonBeanReader<T> {
/**
* Create a new reader taking the context from the existing one but using a new JsonParser.
*/
JsonBeanReader<T> forJson(JsonParser moreJson, boolean resetContext);
JsonBeanReader<T> forJson(JsonParser moreJson);
/**
* Add a bean explicitly to the persistence context.
@@ -2,6 +2,7 @@ package io.ebean.util;
import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;
@@ -57,10 +58,8 @@ public class AnnotationUtil {
private static <A extends Annotation> void typeGetAllCollect(Class<?> clazz, Class<A> annotationType, Set<A> result) {
while (clazz != null && clazz != Object.class) {
final A val = clazz.getAnnotation(annotationType);
if (val != null) {
result.add(val);
}
final A[] annotations = clazz.getAnnotationsByType(annotationType);
Collections.addAll(result, annotations);
clazz = clazz.getSuperclass();
}
}
@@ -13,7 +13,7 @@ import java.sql.Statement;
*/
public class JdbcClose {
private static final Logger logger = LoggerFactory.getLogger(JdbcClose.class);
private static final Logger log = LoggerFactory.getLogger("io.ebean");
/**
* Close the resultSet logging if an error occurs.
@@ -24,7 +24,7 @@ public class JdbcClose {
statement.close();
}
} catch (SQLException e) {
logger.warn("Error closing statement", e);
log.warn("Error closing statement", e);
}
}
@@ -37,7 +37,7 @@ public class JdbcClose {
resultSet.close();
}
} catch (SQLException e) {
logger.warn("Error closing resultSet", e);
log.warn("Error closing resultSet", e);
}
}
@@ -50,7 +50,7 @@ public class JdbcClose {
connection.close();
}
} catch (SQLException e) {
logger.warn("Error closing connection", e);
log.warn("Error closing connection", e);
}
}
@@ -63,7 +63,7 @@ public class JdbcClose {
connection.rollback();
}
} catch (SQLException e) {
logger.warn("Error on connection rollback", e);
log.warn("Error on connection rollback", e);
}
}
@@ -76,7 +76,7 @@ public class JdbcClose {
stmt.cancel();
}
} catch (SQLException e) {
logger.warn("Error on cancelling statement", e);
log.warn("Error on cancelling statement", e);
}
}
}
+58
View File
@@ -0,0 +1,58 @@
module io.ebean.api {
uses io.ebean.config.AutoConfigure;
uses io.ebean.datasource.DataSourceAlertFactory;
uses io.ebean.metric.MetricFactory;
uses io.ebean.service.SpiContainerFactory;
uses io.ebean.service.SpiRawSqlService;
uses io.ebean.service.SpiProfileLocationFactory;
uses io.ebean.service.SpiFetchGroupService;
requires transitive java.sql;
requires transitive io.avaje.config;
requires transitive persistence.api;
requires transitive io.ebean.annotation;
requires transitive io.ebean.datasource.api;
requires transitive org.slf4j;
requires static io.ebean.types;
requires static io.avaje.jsr305x;
requires static com.fasterxml.jackson.core;
requires static javax.servlet.api;
requires static com.h2database;
exports io.ebean;
exports io.ebean.bean;
exports io.ebean.cache;
exports io.ebean.meta;
exports io.ebean.config;
exports io.ebean.config.dbplatform;
exports io.ebean.config.dbplatform.clickhouse;
exports io.ebean.config.dbplatform.h2;
exports io.ebean.config.dbplatform.db2;
exports io.ebean.config.dbplatform.cockroach;
exports io.ebean.config.dbplatform.hana;
exports io.ebean.config.dbplatform.hsqldb;
exports io.ebean.config.dbplatform.mariadb;
exports io.ebean.config.dbplatform.mysql;
exports io.ebean.config.dbplatform.nuodb;
exports io.ebean.config.dbplatform.oracle;
exports io.ebean.config.dbplatform.postgres;
exports io.ebean.config.dbplatform.sqlanywhere;
exports io.ebean.config.dbplatform.sqlite;
exports io.ebean.config.dbplatform.sqlserver;
exports io.ebean.event;
exports io.ebean.event.readaudit;
exports io.ebean.event.changelog;
exports io.ebean.common;
exports io.ebean.docstore;
exports io.ebean.plugin;
exports io.ebean.metric;
exports io.ebean.search;
exports io.ebean.service;
exports io.ebean.text;
exports io.ebean.text.json;
exports io.ebean.text.csv;
exports io.ebean.util;
}
@@ -1,2 +0,0 @@
Manifest-Version: 1.0
Automatic-Module-Name: io.ebean.api
@@ -0,0 +1,31 @@
package io.ebean;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
class EbeanVersionTest {
@Test
void checkMinAgentVersion_ok() {
assertFalse(EbeanVersion.checkMinAgentVersion("12.12.0"));
assertFalse(EbeanVersion.checkMinAgentVersion("12.12.99"));
assertFalse(EbeanVersion.checkMinAgentVersion("13.1.0"));
}
@Test
void checkMinAgentVersion_agentTooOld() {
assertTrue(EbeanVersion.checkMinAgentVersion("11.13.0"));
assertTrue(EbeanVersion.checkMinAgentVersion("12.11.0"));
assertTrue(EbeanVersion.checkMinAgentVersion("12.11.99"));
}
@Test
void checkMinAgentVersion_unexpectedAgentVersion() {
assertTrue(EbeanVersion.checkMinAgentVersion("13.13"));
assertTrue(EbeanVersion.checkMinAgentVersion("13"));
assertTrue(EbeanVersion.checkMinAgentVersion(""));
}
}
@@ -1,6 +1,6 @@
package io.ebean.config.dbplatform;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import java.sql.Types;
import java.time.LocalDate;
@@ -0,0 +1,28 @@
package io.ebean.util;
import static org.assertj.core.api.Assertions.assertThat;
import java.io.File;
import java.util.Set;
import org.junit.jupiter.api.Test;
import io.ebean.annotation.Formula;
public class TestAnnotationUtil {
@Formula(select = "x")
@Formula(select = "y")
private static class TestObject {
}
@Test
public void testRepeatableAnnotation() {
Set<Formula> list = AnnotationUtil.typeGetAll(TestObject.class, Formula.class);
assertThat(list).hasSize(2);
}
}
+8 -19
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>12.11.3</version>
<version>12.13.2</version>
</parent>
<!-- <parent>-->
<!-- <groupId>org.avaje</groupId>-->
@@ -14,7 +14,7 @@
<scm>
<developerConnection>scm:git:git@github.com:ebean-orm/ebean.git</developerConnection>
<tag>ebean-parent-12.11.3</tag>
<tag>ebean-parent-12.13.2</tag>
</scm>
<name>ebean autotune</name>
@@ -26,7 +26,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>12.11.3</version>
<version>12.13.2</version>
<scope>provided</scope>
</dependency>
@@ -46,9 +46,9 @@
</dependency>
<dependency>
<groupId>org.avaje.composite</groupId>
<groupId>io.avaje</groupId>
<artifactId>junit</artifactId>
<version>1.1</version>
<version>1.0</version>
<scope>test</scope>
</dependency>
@@ -59,27 +59,16 @@
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.19</version>
<version>2.24</version>
<extensions>true</extensions>
<configuration>
<tiles>
<!-- other tiles ... -->
<tile>io.ebean.tile:enhancement:12.6.0</tile>
<tile>io.ebean.tile:enhancement:12.11.3</tile>
<tile>io.avaje.tile:moditech-module:1.0</tile>
</tiles>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.5</version>
<configuration>
<archive>
<manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
+74
View File
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>12.13.2-SNAPSHOT</version>
</parent>
<!-- <parent>-->
<!-- <groupId>org.avaje</groupId>-->
<!-- <artifactId>java8-oss</artifactId>-->
<!-- <version>2.2</version>-->
<!-- </parent>-->
<scm>
<developerConnection>scm:git:git@github.com:ebean-orm/ebean.git</developerConnection>
<tag>HEAD</tag>
</scm>
<name>ebean autotune</name>
<description>ebean automatic query tuning module</description>
<artifactId>ebean-autotune</artifactId>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>12.13.2-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<!-- needed for java 11+ -->
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-datasource</artifactId>
<version>${ebean-datasource.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.avaje</groupId>
<artifactId>junit</artifactId>
<version>1.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.24</version>
<extensions>true</extensions>
<configuration>
<tiles>
<tile>io.ebean.tile:enhancement:12.11.3</tile>
<tile>io.avaje.tile:moditech-module:1.0</tile>
</tiles>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -111,7 +111,7 @@ public class ProfileManager implements ProfilingListener {
public AutoTuneCollection profilingCollection(boolean reset) {
AutoTuneCollection req = new AutoTuneCollection();
for (ProfileOrigin origin : profileMap.values()) {
BeanDescriptor<?> desc = server.getBeanDescriptorById(origin.getOrigin().getBeanType());
BeanDescriptor<?> desc = server.descriptorById(origin.getOrigin().getBeanType());
if (desc != null) {
origin.profilingCollection(desc, req, reset);
}
@@ -43,14 +43,14 @@ public class ProfileOriginNodeUsage {
try {
BeanDescriptor<?> desc = rootDesc;
if (path != null) {
ElPropertyValue elGetValue = rootDesc.getElGetValue(path);
ElPropertyValue elGetValue = rootDesc.elGetValue(path);
if (elGetValue == null) {
logger.warn("AutoTune: Can't find join for path[" + path + "] for " + rootDesc.getName());
logger.warn("AutoTune: Can't find join for path[" + path + "] for " + rootDesc.name());
return;
} else {
BeanProperty beanProperty = elGetValue.getBeanProperty();
BeanProperty beanProperty = elGetValue.beanProperty();
if (beanProperty instanceof BeanPropertyAssoc<?>) {
desc = ((BeanPropertyAssoc<?>) beanProperty).getTargetDescriptor();
desc = ((BeanPropertyAssoc<?>) beanProperty).targetDescriptor();
}
}
}
@@ -61,7 +61,7 @@ public class ProfileOriginNodeUsage {
for (String propName : aggregateUsed) {
BeanProperty beanProp = desc.findPropertyFromPath(propName);
if (beanProp == null) {
logger.warn("AutoTune: Can't find property[" + propName + "] for " + desc.getName());
logger.warn("AutoTune: Can't find property[" + propName + "] for " + desc.name());
} else {
if (beanProp.isId()) {
@@ -76,24 +76,24 @@ public class ProfileOriginNodeUsage {
// (which is the default for Lob's so typical).
} else {
addedToPath = true;
pathProps.addToPath(path, beanProp.getName());
pathProps.addToPath(path, beanProp.name());
}
}
}
}
if ((modified || addVersionProperty) && desc != null) {
BeanProperty versionProp = desc.getVersionProperty();
BeanProperty versionProp = desc.versionProperty();
if (versionProp != null) {
addedToPath = true;
pathProps.addToPath(path, versionProp.getName());
pathProps.addToPath(path, versionProp.name());
}
}
if (toOneIdProperty != null && !addedToPath) {
// add ToOne property to parent path
ElPropertyValue assocOne = rootDesc.getElGetValue(path);
pathProps.addToPath(SplitName.parent(path), assocOne.getName());
ElPropertyValue assocOne = rootDesc.elGetValue(path);
pathProps.addToPath(SplitName.parent(path), assocOne.name());
}
} finally {
lock.unlock();
@@ -0,0 +1,15 @@
import io.ebeaninternal.server.autotune.AutoTuneServiceProvider;
import io.ebeaninternal.server.autotune.service.AutoTuneServiceFactory;
/**
* Provider of AutoTuneServiceProvider
*/
module io.ebean.autotune {
provides AutoTuneServiceProvider with AutoTuneServiceFactory;
requires io.ebean.api;
requires io.ebean.core;
requires java.xml;
requires java.xml.bind;
}
@@ -1,2 +0,0 @@
Manifest-Version: 1.0
Automatic-Module-Name: io.ebean.autotune
@@ -1,7 +1,7 @@
package io.ebeaninternal.server.autotune.service;
import io.ebeaninternal.server.autotune.model.Autotune;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import java.io.File;
import java.io.InputStream;
@@ -5,7 +5,7 @@ import io.ebean.bean.ObjectGraphNode;
import io.ebean.bean.ObjectGraphOrigin;
import io.ebeaninternal.server.deploy.BeanDescriptor;
import io.ebeaninternal.server.querydefn.OrmQueryDetail;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.tests.autofetch.BaseTestCase;
import org.tests.model.basic.Order;
@@ -11,6 +11,6 @@ public class BaseTestCase {
}
protected <T> BeanDescriptor<T> getBeanDescriptor(Class<T> cls) {
return spiEbeanServer().getBeanDescriptor(cls);
return spiEbeanServer().descriptor(cls);
}
}
+15 -15
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>12.11.3</version>
<version>12.13.2</version>
</parent>
<name>ebean bom</name>
@@ -71,88 +71,88 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean</artifactId>
<version>12.11.3</version>
<version>12.13.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>12.11.3</version>
<version>12.13.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>12.11.3</version>
<version>12.13.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core-type</artifactId>
<version>12.11.3</version>
<version>12.13.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-ddl-generator</artifactId>
<version>12.11.3</version>
<version>12.13.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-externalmapping-api</artifactId>
<version>12.11.3</version>
<version>12.13.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-externalmapping-xml</artifactId>
<version>12.11.3</version>
<version>12.13.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-autotune</artifactId>
<version>12.11.3</version>
<version>12.13.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>12.11.3</version>
<version>12.13.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>querybean-generator</artifactId>
<version>12.11.3</version>
<version>12.13.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>kotlin-querybean-generator</artifactId>
<version>12.11.3</version>
<version>12.13.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>12.11.3</version>
<version>12.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-postgis</artifactId>
<version>12.11.3</version>
<version>12.13.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-redis</artifactId>
<version>12.11.3</version>
<version>12.13.2</version>
</dependency>
</dependencies>
+162
View File
@@ -0,0 +1,162 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>12.13.2-SNAPSHOT</version>
</parent>
<name>ebean bom</name>
<description>ebean bill of materials pom</description>
<artifactId>ebean-bom</artifactId>
<packaging>pom</packaging>
<dependencyManagement>
<dependencies>
<!-- dependencies external to this ebean.git build -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-ddl-runner</artifactId>
<version>${ebean-ddl-runner.version}</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-migration-auto</artifactId>
<version>${ebean-migration-auto.version}</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-migration</artifactId>
<version>${ebean-migration.version}</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-datasource-api</artifactId>
<version>${ebean-datasource.version}</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-datasource</artifactId>
<version>${ebean-datasource.version}</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-agent</artifactId>
<version>${ebean-agent.version}</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-maven-plugin</artifactId>
<version>${ebean-maven-plugin.version}</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test-docker</artifactId>
<version>${ebean-test-docker.version}</version>
</dependency>
<!-- modules -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean</artifactId>
<version>12.13.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>12.13.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>12.13.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core-type</artifactId>
<version>12.13.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-ddl-generator</artifactId>
<version>12.13.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-externalmapping-api</artifactId>
<version>12.13.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-externalmapping-xml</artifactId>
<version>12.13.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-autotune</artifactId>
<version>12.13.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>12.13.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>querybean-generator</artifactId>
<version>12.13.2-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>kotlin-querybean-generator</artifactId>
<version>12.13.2-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>12.13.2-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-postgis</artifactId>
<version>12.13.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-redis</artifactId>
<version>12.13.2-SNAPSHOT</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
+17 -2
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>12.11.3</version>
<version>12.13.2</version>
</parent>
<artifactId>ebean-core-type</artifactId>
@@ -16,7 +16,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>12.11.3</version>
<version>12.13.2</version>
</dependency>
<dependency>
@@ -28,4 +28,19 @@
</dependencies>
<build>
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.24</version>
<extensions>true</extensions>
<configuration>
<tiles>
<tile>io.avaje.tile:moditech-module:1.0</tile>
</tiles>
</configuration>
</plugin>
</plugins>
</build>
</project>
+46
View File
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>12.13.2-SNAPSHOT</version>
</parent>
<artifactId>ebean-core-type</artifactId>
<name>ebean core type</name>
<description>ebean scalar types api</description>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>12.13.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.24</version>
<extensions>true</extensions>
<configuration>
<tiles>
<tile>io.avaje.tile:moditech-module:1.0</tile>
</tiles>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -0,0 +1,10 @@
module io.ebean.core.type {
exports io.ebean.core.type;
requires transitive java.sql;
requires transitive io.ebean.api;
requires static com.fasterxml.jackson.core;
}
+33 -161
View File
@@ -3,7 +3,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>12.11.3</version>
<version>12.13.2</version>
</parent>
<artifactId>ebean-core</artifactId>
@@ -15,35 +15,21 @@
<scm>
<developerConnection>scm:git:git@github.com:ebean-orm/ebean.git</developerConnection>
<tag>ebean-parent-12.11.3</tag>
<tag>ebean-parent-12.13.2</tag>
</scm>
<profiles>
<profile>
<id>db2</id>
<dependencies>
<!-- https://mvnrepository.com/artifact/com.ibm.db2/jcc -->
<dependency>
<groupId>com.ibm.db2</groupId>
<artifactId>jcc</artifactId>
<version>11.5.5.0</version>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-ddl-runner</artifactId>
<version>1.0</version>
<version>1.2</version>
</dependency>
<dependency>
<groupId>io.avaje</groupId>
<artifactId>classpath-scanner</artifactId>
<version>6.0</version>
<version>6.2</version>
</dependency>
<dependency>
@@ -52,45 +38,22 @@
<version>1.1</version>
</dependency>
<!-- keep testing in core using ebean-ddl-generator & ebean-migration -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-migration</artifactId>
<version>12.4.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-ddl-generator</artifactId>
<version>12.11.0</version>
<scope>test</scope>
</dependency>
<!-- test scope for supporting ebean-ddl-generator -->
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>12.11.3</version>
<version>12.13.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core-type</artifactId>
<version>12.11.3</version>
<version>12.13.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-externalmapping-api</artifactId>
<version>12.11.3</version>
<version>12.13.2</version>
</dependency>
<dependency>
@@ -105,8 +68,8 @@
-->
<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-jsr305</artifactId>
<version>1.0</version>
<artifactId>avaje-jsr305-x</artifactId>
<version>1.1</version>
<scope>provided</scope>
</dependency>
@@ -121,8 +84,8 @@
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
<artifactId>javax.transaction-api</artifactId>
<version>1.3</version>
<optional>true</optional>
</dependency>
@@ -130,7 +93,7 @@
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.1.0.Final</version>
<version>2.0.1.Final</version>
<optional>true</optional>
</dependency>
<dependency>
@@ -147,12 +110,12 @@
<optional>true</optional>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
<optional>true</optional>
</dependency>
<!-- <dependency>-->
<!-- <groupId>javax.annotation</groupId>-->
<!-- <artifactId>javax.annotation-api</artifactId>-->
<!-- <version>1.3.2</version>-->
<!-- <optional>true</optional>-->
<!-- </dependency>-->
<!-- Jackson core used internally by Ebean -->
<dependency>
@@ -173,7 +136,7 @@
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.20</version>
<version>42.2.24</version>
<optional>true</optional>
</dependency>
@@ -186,107 +149,15 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.nuodb.jdbc</groupId>
<artifactId>nuodb-jdbc</artifactId>
<version>20.2.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<artifactId>ojdbc10</artifactId>
<version>19.3.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test-docker</artifactId>
<version>4.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.15.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>2.3.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>7.2.2.jre8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.17</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.6.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sap.cloud.db.jdbc</groupId>
<artifactId>ngdbc</artifactId>
<version>2.3.48</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.avaje.composite</groupId>
<artifactId>junit</artifactId>
<version>1.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.avaje</groupId>
<artifactId>mod-uuid</artifactId>
<version>1.1</version>
<artifactId>junit</artifactId>
<version>1.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
@@ -336,17 +207,6 @@
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.5</version>
<configuration>
<archive>
<manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
@@ -368,6 +228,18 @@
</executions>
</plugin>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.24</version>
<extensions>true</extensions>
<configuration>
<tiles>
<tile>io.avaje.tile:moditech-module:1.0</tile>
</tiles>
</configuration>
</plugin>
</plugins>
</build>
+247
View File
@@ -0,0 +1,247 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>12.13.2-SNAPSHOT</version>
</parent>
<artifactId>ebean-core</artifactId>
<packaging>jar</packaging>
<name>ebean core</name>
<description>ebean core module</description>
<url>https://ebean.io/</url>
<scm>
<developerConnection>scm:git:git@github.com:ebean-orm/ebean.git</developerConnection>
<tag>HEAD</tag>
</scm>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-ddl-runner</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>io.avaje</groupId>
<artifactId>classpath-scanner</artifactId>
<version>6.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-migration-auto</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>12.13.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core-type</artifactId>
<version>12.13.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-externalmapping-api</artifactId>
<version>12.13.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>4.8-1</version>
</dependency>
<!--
Class retention Nonnull and Nullable annotations
to assist with IDE auto-completion with Ebean API
-->
<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-jsr305-x</artifactId>
<version>1.1</version>
<scope>provided</scope>
</dependency>
<!-- Provided scope so that the H2HistoryTrigger can live in Ebean core
and not require a separate module for it -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.199</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>javax.transaction-api</artifactId>
<version>1.3</version>
<optional>true</optional>
</dependency>
<!-- validation annotations Size etc -->
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>3.0.0</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.9.7</version>
<optional>true</optional>
</dependency>
<!-- <dependency>-->
<!-- <groupId>javax.annotation</groupId>-->
<!-- <artifactId>javax.annotation-api</artifactId>-->
<!-- <version>1.3.2</version>-->
<!-- <optional>true</optional>-->
<!-- </dependency>-->
<!-- Jackson core used internally by Ebean -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
<optional>true</optional>
</dependency>
<!-- Provided scope for Postgres JSON/JSONB support -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.24</version>
<optional>true</optional>
</dependency>
<!-- Test scope -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-datasource</artifactId>
<version>${ebean-datasource.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.avaje</groupId>
<artifactId>junit</artifactId>
<version>1.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>io.ebean</groupId>
<artifactId>ebean-maven-plugin</artifactId>
<version>${ebean-maven-plugin.version}</version>
<executions>
<execution>
<id>test</id>
<phase>process-test-classes</phase>
<configuration>
<transformArgs>debug=0</transformArgs>
</configuration>
<goals>
<goal>testEnhance</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M4</version>
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
<trimStackTrace>false</trimStackTrace>
<failIfNoTests>false</failIfNoTests>
<includes>
<include>**/Test*.java</include>
<include>**/*Test.java</include>
<include>**/*Tests.java</include>
</includes>
<systemProperties>
<property>
<!-- transfer datasource.default parameter -->
<name>datasource.default</name>
<value>${datasource.default}</value>
</property>
<property>
<!-- transfer dbClockDelta parameter -->
<name>dbClockDelta</name>
<value>${dbClockDelta}</value>
</property>
</systemProperties>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<doctitle>Ebean 12</doctitle>
<overview>src/main/java/io/ebean/overview.html</overview>
<excludePackageNames>io.ebeaninternal.*:io.ebeanservice:io.ebean.common:io.ebean.bean:io.ebean.service:io.ebean.metric:io.ebean.util:io.ebean.config.properties:io.ebean.config.dbplatform</excludePackageNames>
<linksource>true</linksource>
<overview>src/main/java/com/avaje/ebean/overview.html</overview>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.24</version>
<extensions>true</extensions>
<configuration>
<tiles>
<tile>io.avaje.tile:moditech-module:1.0</tile>
</tiles>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -223,6 +223,15 @@ public final class BindParams implements Serializable {
return p;
}
/**
* Set a named In parameter that is multi-valued.
*/
public Param setArrayParameter(String name, Collection<?> value) {
Param p = getParam(name);
p.setInValue(new MultiValueWrapper(value));
return p;
}
/**
* Set an encryption key as a bind value.
* <p>
@@ -285,12 +294,17 @@ public final class BindParams implements Serializable {
*/
public boolean isSameBindHash() {
if (bindHash == null) {
bindHash = calcQueryPlanHash();
return false;
}
String oldPlan = bindHash;
String newHash = calcQueryPlanHash();
return bindHash.equals(newHash);
}
/**
* Updates the hash.
*/
public void updateHash() {
bindHash = calcQueryPlanHash();
return bindHash.equals(oldPlan);
}
/**
@@ -1,6 +1,6 @@
package io.ebeaninternal.api;
import io.ebeaninternal.server.expression.IdInExpression;
import io.ebeaninternal.server.expression.IdInCommon;
import java.util.ArrayList;
import java.util.Collection;
@@ -13,10 +13,10 @@ import java.util.Set;
*/
public final class CacheIdLookupMany<T> implements CacheIdLookup<T> {
private final IdInExpression idInExpression;
private final IdInCommon idInExpression;
private int remaining;
public CacheIdLookupMany(IdInExpression idInExpression) {
public CacheIdLookupMany(IdInCommon idInExpression) {
this.idInExpression = idInExpression;
}
@@ -34,15 +34,12 @@ public final class CacheIdLookupMany<T> implements CacheIdLookup<T> {
*/
@Override
public List<T> removeHits(BeanCacheResult<T> cacheResult) {
Set<Object> hitIds = new HashSet<>();
List<T> beans = new ArrayList<>(hitIds.size());
for (BeanCacheResult.Entry<T> hit : cacheResult.hits()) {
hitIds.add(hit.getKey());
beans.add(hit.getBean());
}
this.remaining = idInExpression.removeIds(hitIds);
return beans;
}
@@ -0,0 +1,13 @@
package io.ebeaninternal.api;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Common loggers used in ebean-core.
*/
public final class CoreLog {
public static final Logger log = LoggerFactory.getLogger("io.ebean.core");
public static final Logger internal = LoggerFactory.getLogger("io.ebean.internal");
}
@@ -48,7 +48,7 @@ public final class LoadBeanRequest extends LoadRequest {
@Override
public Class<?> beanType() {
return loadBuffer.descriptor().getBeanType();
return loadBuffer.descriptor().type();
}
public String description() {
@@ -108,7 +108,7 @@ public final class LoadBeanRequest extends LoadRequest {
BeanDescriptor<?> desc = loadBuffer.descriptor();
// collect Ids and maybe load bean cache
for (Object bean : list) {
loadedIds.add(desc.beanId(bean));
loadedIds.add(desc.id(bean));
}
if (loadCache) {
desc.cacheBeanPutAll(list);
@@ -36,14 +36,6 @@ public interface LoadContext {
*/
PersistenceContext getPersistenceContext();
/**
* Set the persistence context used by this query and future lazy loading.
* <p>
* Used by query iterator when processing large result sets.
* </p>
*/
void resetPersistenceContext(PersistenceContext persistenceContext);
/**
* Register a Bean for lazy loading.
*/

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