Compare commits

...
189 Commits
Author SHA1 Message Date
Rob Bygrave 60a84b7a38 Version 13.15.2 2023-03-22 23:33:48 +13:00
Rob Bygrave fa3e9e6fc6 Bump ebean-agent to 13.15.2 2023-03-22 23:30:28 +13:00
Rob BygraveandGitHub 8ca44edf9c Merge pull request #3006 from ebean-orm/fix/3005-rawSql-select
Fix for #3005 - Regression, Invalid SQL with RawSql in 13.15.0 due o #2996
2023-03-22 23:25:33 +13:00
Rob Bygrave fcefd94086 Fix for #3005 - Regression, Invalid SQL with RawSql in 13.15.0 due to #2996 2023-03-22 23:18:18 +13:00
Rob Bygrave 70e5d57b7e Bump to next snapshot version 2023-03-21 23:32:21 +13:00
Rob Bygrave cc3b9c9508 Version 13.15.1 2023-03-21 21:17:08 +13:00
Rob Bygrave be49be38d0 Bump ebean-agent to 13.15.1 2023-03-21 20:45:59 +13:00
Rob BygraveandGitHub dca13db945 Merge pull request #3002 from ebean-orm/feature/improveLogging-markedAsDeleted
Improve the logging around MarkedAsDeleted
2023-03-21 20:43:12 +13:00
Rob Bygrave bd318a5d85 Improve the logging around MarkedAsDeleted 2023-03-21 20:30:39 +13:00
Rob BygraveandGitHub 4c2be2986a Merge pull request #3000 from FOCONIS/bugfix-fix-json-import
FIX: DB.json().toBean(target) can update existing lists (#85)
2023-03-18 10:22:18 +13:00
3d7bebd244 FIX: DB.json().toBean(target) can update existing lists (#85)
* FIX: DB.json().toBean(target) can update existing lists

* remove sys.print, typo

---------

Co-authored-by: Roland Praml <roland.praml@foconis.de>
Co-authored-by: Juri Skrobko <juri.skrobko@foconis.de>
2023-03-17 11:04:53 +01:00
Rob Bygrave e23bbf5f94 Revert test sqlserver docker image to 2017-CU28-ubuntu-16.04 2023-03-17 19:18:53 +13:00
Rob Bygrave 27b0c33a4b Adjustments for SqlServer using BIGINT 2023-03-17 18:51:33 +13:00
Rob Bygrave 53ef159d06 Bump Postgres docker image to 15 2023-03-17 18:50:52 +13:00
Rob Bygrave a7d778d98b Merge branch 'master' of github.com:ebean-orm/ebean 2023-03-17 18:14:17 +13:00
Rob Bygrave 19580ff83d Bump SqlServer docker image to 2022-RTM-CU2-ubuntu-20.04 2023-03-17 18:14:02 +13:00
Rob BygraveandGitHub a79a44c513 Merge pull request #2999 from ebean-orm/feature/2998-sqlserver-bigint
#2998 - SQLServer, map java long to BIGINT for bitwise expressions
2023-03-17 18:04:32 +13:00
Rob Bygrave 184b82e1b2 Fix test TestRawSqlQuerySelect for SqlServer
The order by not supported here by SqlServer
2023-03-17 18:03:37 +13:00
Rob Bygrave 04e935acd0 #2998 - SQLServer, map java long to BIGINT for bitwise expressions 2023-03-17 17:54:25 +13:00
Rob Bygrave 142ffe925c Fix test TestRawSqlQuerySelect to support multiple databases 2023-03-16 09:06:09 +13:00
Rob Bygrave 395505ec0d Bump to 13.15.1-SNAPSHOT 2023-03-14 16:57:17 +13:00
Rob Bygrave c21a76fa5b Version 13.15.0 2023-03-14 12:54:53 +13:00
Rob Bygrave a2690fdccd #2995 - Change DatabaseConfig.getClasses() to return a Set
The thinking is that it is safer to make this API change
rather than to return a shallow copy which you won't be
able to detect.
2023-03-14 11:56:01 +13:00
Rob BygraveandGitHub 4039c20462 Merge pull request #2996 from ebean-orm/buchtajz-query_select_bugs
Add support for specifying select clause with RawSql
2023-03-14 11:48:40 +13:00
Rob BygraveandGitHub 6d43028fba Merge pull request #2995 from ebean-orm/feature/config-isLoadModuleInfo
Change such that querybean generated class registration can be used with explicit class registration
2023-03-14 11:48:09 +13:00
Rob Bygrave efcee7e739 Improve test asserts for lazy loading element collection 2023-03-10 21:33:58 +13:00
Rob Bygrave 523fe6ae54 #2946 - Support specify select clause for RawSql 2023-03-10 20:31:54 +13:00
Rob Bygrave 8ec031bfde Merge branch 'query_select_bugs' of github.com:buchtajz/ebean into buchtajz-query_select_bugs 2023-03-10 19:38:26 +13:00
Rob Bygrave cd938fd659 Bump github actions versions on all build.yml 2023-03-10 14:17:38 +13:00
Rob Bygrave 837e296451 Bump github actions versions on build.yml 2023-03-10 14:14:31 +13:00
Rob Bygrave 52b0bd7b7d Bump kotlin version to 1.8.10 2023-03-10 13:57:14 +13:00
Rob Bygrave a8cad4f3d9 Change such that querybean generated class registration can be used will explicit class registration
In DatabaseConfig.isAutoLoadModuleInfo() it only used the querybean generated class registration is classes.isEmpty(). Changing this so that it only uses the loadModuleInfo flag.

This means, unless loadModuleInfo is set to false the classes that register with ebean will be a combination of both the explicitly registered ones plus the classes from the querybean generated EbeanEntityRegister.

In addition, this changes the classes from List to Set.
2023-03-10 11:01:46 +13:00
Rob Bygrave e4cb81cbba Bump to 13.14.2-SNAPSHOT 2023-03-10 00:26:34 +13:00
Rob Bygrave 08cd0aa4b7 Fix the jakarta <-> javax scripts with space after sed -i 2023-03-10 00:22:13 +13:00
Rob Bygrave b565a5843e Version 13.14.1 2023-03-09 21:38:47 +13:00
Rob Bygrave 79c96c9ec1 Improve error message in InterceptReadWrite when lazy loading and no default server registered 2023-03-09 17:14:36 +13:00
Rob BygraveandGitHub b703b683d8 Merge pull request #2994 from ebean-orm/feature/ErrorNoAttributeConverter
Throw IllegalStateException when @Convert on property but there is no…
2023-03-09 16:28:20 +13:00
Rob Bygrave 456eb3aca9 Throw IllegalStateException when @Convert on property but there is no AttributeConverter registered for that type 2023-03-09 16:27:41 +13:00
Rob BygraveandGitHub 54c35300d4 Merge pull request #2992 from ebean-orm/feature/iae-batch-lazy-load
Fix for IndexOutOfBoundsException: The size must be at least 1
2023-03-09 09:59:12 +13:00
Rob Bygrave dfc5963e35 Fix for IndexOutOfBoundsException: The size must be at least 1
Stack trace observed:

java.lang.IndexOutOfBoundsException: The size must be at least 1
    at io.ebeaninternal.server.deploy.id.IdBinderSimple.getIdInValueExpr(IdBinderSimple.java:135)
    at io.ebeaninternal.server.deploy.BeanDescriptor.parentIdInExpr(BeanDescriptor.java:1634)
    at io.ebeaninternal.server.deploy.BeanPropertyAssocManySqlHelp.addWhereParentIdIn(BeanPropertyAssocManySqlHelp.java:121)
    at io.ebeaninternal.server.deploy.BeanPropertyAssocMany.addWhereParentIdIn(BeanPropertyAssocMany.java:342)
    at io.ebeaninternal.api.LoadManyRequest.createQuery(LoadManyRequest.java:90)
    at io.ebeaninternal.server.core.DefaultBeanLoader.loadMany(DefaultBeanLoader.java:39)
    at io.ebeaninternal.server.core.DefaultServer.loadMany(DefaultServer.java:475)
    at io.ebeaninternal.server.loadcontext.DLoadManyContext$LoadBuffer.loadMany(DLoadManyContext.java:215)
    at io.ebean.common.AbstractBeanCollection.lazyLoadCollection(AbstractBeanCollection.java:90)
    at io.ebean.common.BeanList.init(BeanList.java:141)
    at io.ebean.common.BeanList.iterator(BeanList.java:327)
2023-03-09 09:57:41 +13:00
Rob Bygrave 36777d5a3d No effective change - static import for log level 2023-03-09 09:41:20 +13:00
Rob BygraveandGitHub 12b028fc43 Merge pull request #2991 from ebean-orm/feature/bom-add-spring-txn
Add ebean-spring-txn to ebean-bom
2023-03-07 20:33:07 +13:00
Rob Bygrave 72b2f30f2d Add ebean-spring-txn to ebean-bom 2023-03-07 20:23:34 +13:00
Rob Bygrave 1de74ac366 Change ebean-spring-txn to be a submodule and use junit5 2023-03-07 01:13:06 +13:00
Rob Bygrave 07cb243db3 Merge remote-tracking branch 'ebean-spring-txn/master' 2023-03-07 01:00:07 +13:00
Rob Bygrave 9a02618b67 Move into ebean-spring-txn subdirectory 2023-03-07 00:56:28 +13:00
Rob Bygrave 801cb6fa73 Bump to 13.14.0 2023-03-07 00:36:46 +13:00
Rob Bygrave 1c8a416de0 Use ebean-core as provided dependency
- ebean-core as provided dependency
- ebean-h2 as test dependency
2023-03-07 00:21:19 +13:00
Rob BygraveandGitHub c30a8c79a2 Merge pull request #2990 from ebean-orm/feature/move-kotlin-tests
Move tests from kotlin-querbean-generator to the test-kotlin module
2023-03-03 23:38:36 +13:00
Rob Bygrave 35cb4356c5 Move tests from kotlin-querbean-generator to the test-kotlin module 2023-03-03 23:34:51 +13:00
Rob Bygrave a73c985315 Bump to next snapshot version 2023-03-01 12:50:53 +13:00
Rob Bygrave b5fbfbf1b6 Version 13.14.0 2023-03-01 00:08:52 +13:00
Rob BygraveandGitHub 4471607b2d Merge pull request #2989 from ebean-orm/fix/queryBeans-inheritance-parentOnlyHasDiscriminatorValue
[QueryBeans] Generate the query beans as final classes
2023-02-28 23:16:14 +13:00
Rob Bygrave e4c4b0b43d [QueryBeans] Generate the query beans as final classes 2023-02-28 23:15:42 +13:00
Rob BygraveandGitHub d7ffc4bbb5 Merge pull request #2988 from ebean-orm/fix/queryBeans-inheritance-parentOnlyHasDiscriminatorValue
[QueryBeans] Fix for missing inherited properties when parent only has @DiscriminatorValue
2023-02-28 23:06:03 +13:00
Rob Bygrave 0bb2f104a4 [QueryBeans] Fix for missing inherited properties when parent only has @DiscriminatorValue
A parent in the Inheritance hierarchy has @DiscriminatorValue but not the @Inheritance annotation. The bug means the inherited properties are not included on the generated query bean.

The fix is to the querybean-generator to pick up inherited properties for this case.
2023-02-28 23:02:19 +13:00
Rob BygraveandGitHub ac3ca8113d Merge pull request #2987 from ebean-orm/feature/querybeans-refactor-assoc
[QueryBeans] Refactor splitting TQAssocBean into TQAssoc & TQAssocBean
2023-02-28 21:56:35 +13:00
Rob Bygrave 4ec46e3008 [QueryBeans] Refactor splitting TQAssocBean into TQAssoc & TQAssocBean
- Requires ebean-agent to be up-to-date (13.13.2 or greater)
- Split TQAssocBean into 2, one for embeddable beans and the other for the reset
- The eq(), in() etc expressions go to TQAssoc
- Add fetch() methods to TQAssocBean
- No longer generate the fetch() methods as we now have them on TQAssocBean
2023-02-27 17:46:11 +13:00
Rob Bygrave e9ab0f34f3 Next snapshot version 2023-02-27 16:57:38 +13:00
buchtajzandGitHub 8c47ba89d1 Merge branch 'ebean-orm:master' into query_select_bugs 2023-02-21 00:04:39 +01:00
rob a9575048b4 Change to support Ebean 13.13.0
FYI: Also put the provided slf4j-api back to 1.7.x to see the logs when running tests
2023-02-17 21:02:46 +13:00
rob 82fd6dc65f Add badges to README 2023-02-14 23:24:09 +13:00
rob 5b4ff2627c Bump provided spring dependency to latest in 5.3 to avoid security pings on the older dependency 2023-02-14 22:36:27 +13:00
rob 2aa92d63fd Bump test dependency Jackson 2023-02-14 22:32:04 +13:00
rob 658b5b7e06 Bump version to 13.10.0 2023-02-14 22:29:45 +13:00
rob 4e3cd83e36 #33 - Update internals from using deprecated TransactionSynchronizationAdapter to TransactionSynchronization 2023-02-14 22:29:02 +13:00
Michal Buchtík 1af3d0bcf3 remove unnecessary replace 2023-02-10 12:27:10 +01:00
Michal Buchtík 01a0cee3c2 patch RawSql query builder, fix tests 2023-02-10 12:17:40 +01:00
Michal Buchtík f26feec3d9 Merge remote-tracking branch 'origin/master' into query_select_bugs 2023-02-10 09:33:28 +01:00
Michal Buchtík 6055a33dc8 fix changes 2023-01-27 12:11:01 +01:00
Michal Buchtík 230d18e48f failing test for rawSql select .asDto query 2023-01-27 11:39:37 +01:00
Rob Bygrave e00e490e73 Update use example in README 2022-09-07 14:09:49 +12:00
Rob Bygrave dd95081e63 Update use example in README 2022-09-07 14:03:37 +12:00
Rob Bygrave 03bd31677a Bump to 13.9.1 2022-09-07 13:35:26 +12:00
Rob Bygrave 4619c56b09 #31 - Explicitly add Apache 2 License text (it got missed when ebean changed from LGPL to Apache2) 2022-09-07 13:34:23 +12:00
Rob Bygrave c3dc57f0fb Bump the spring dependency versions used in testing 2022-09-07 13:21:04 +12:00
Rob BygraveandGitHub 50ba20289b Merge pull request #30 from ebean-orm/feature/final-txn-manager
Make SpringJdbcTransactionManager final, SpringJdbcTransaction not public
2022-09-07 12:51:48 +12:00
Rob Bygrave 6b73072982 Make SpringJdbcTransactionManager final, SpringJdbcTransaction not public 2022-09-07 12:48:45 +12:00
Rob Bygrave 6e340bd149 Bump parent and version 2022-09-05 19:40:21 +12:00
Rob BygraveandGitHub 65f551650f Merge pull request #29 from ebean-orm/feature/bump-flush
Use System.Logger and transaction.flush()
2022-09-05 19:38:30 +12:00
Rob Bygrave 3be3741db6 Change to use System.Logger + transaction.flush() 2022-09-05 19:35:52 +12:00
Rob Bygrave 610afd3717 Update tests 2022-09-05 19:33:40 +12:00
Rob Bygrave 4084822d2c Bump to 13.0.0 and Java 11 2022-03-31 14:38:41 +13:00
Rob Bygrave a2c82263ee Bump to 12.12.0 2021-09-24 11:29:50 +12:00
rbygrave 30f3d542b3 Bump to 12.11.4 2021-09-09 13:10:13 +12:00
rbygrave 56cb2c69aa Bump to 12.11.1 2021-08-16 19:49:02 +12:00
rbygrave bd1dd43cbf Bump to 12.11.0 2021-08-16 19:43:28 +12:00
rob bygrave 5caae29df9 [maven-release-plugin] prepare for next development iteration 2020-12-23 20:46:33 +13:00
rob bygrave 9713b607b5 [maven-release-plugin] prepare release ebean-spring-txn-12.6.4 2020-12-23 20:46:10 +13:00
rob bygrave 0e46558cae Bump ebean to 12.6.4 for #22 2020-12-23 20:45:33 +13:00
Rob BygraveandGitHub 2386f1034b Merge pull request #24 from spinachomes/master
add fail situation for transaction Propagation.REQUIRES_NEW
2020-12-21 16:30:02 +13:00
李清波 ddf9f5c508 add fail situation for transaction Propagation.REQUIRES_NEW 2020-12-21 11:23:00 +08:00
rob bygrave 559867294f Add test for transaction Propagation.REQUIRES_NEW 2020-12-21 14:47:23 +13:00
rob bygrave bf0c8d8dab Add test for transaction Propagation.REQUIRES_NEW 2020-12-21 14:45:13 +13:00
rob bygrave 7077e92cb0 [maven-release-plugin] prepare for next development iteration 2020-12-18 15:29:36 +13:00
rob bygrave 035c5570c3 [maven-release-plugin] prepare release ebean-spring-txn-12.6.3 2020-12-18 15:29:25 +13:00
rob bygrave 0be0fd1e05 Bump to 12.6.3-SNAPSHOT 2020-12-18 15:28:31 +13:00
rob bygrave bdfd380687 #23 - Use updated PostCommit to send ChangeLog changes. Use PreCommit to flush last ChangeLog changes at PreCommit 2020-12-18 14:55:57 +13:00
rob bygrave d1a4c73cd6 [maven-release-plugin] prepare for next development iteration 2020-12-18 10:01:04 +13:00
rob bygrave 7133c81fc5 [maven-release-plugin] prepare release ebean-spring-txn-12.4.2 2020-12-18 10:00:52 +13:00
rob bygrave c6b4de39e8 Merge branch 'master' of github.com:ebean-orm/ebean-spring-txn 2020-12-18 09:58:30 +13:00
rob bygrave 94f367af70 #22 - Spring @Transactional with batch mode not invoking ebean batch flush 2020-12-18 09:58:16 +13:00
Rob BygraveandGitHub dc6c393300 Merge pull request #21 from ebean-orm/dependabot/maven/junit-junit-4.13.1
Bump junit from 4.12 to 4.13.1
2020-10-13 22:55:00 +13:00
dependabot[bot]andGitHub 239f3a0a54 Bump junit from 4.12 to 4.13.1
Bumps [junit](https://github.com/junit-team/junit4) from 4.12 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.12.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.12...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-13 07:51:29 +00:00
rob bygrave d3e78ab54e [maven-release-plugin] prepare for next development iteration 2020-09-18 01:15:35 +12:00
rob bygrave c6483535bd [maven-release-plugin] prepare release ebean-spring-txn-12.4.1 2020-09-18 01:15:24 +12:00
rob bygrave 95bb2a5d56 Bump to 12.4.1 2020-09-18 01:14:52 +12:00
rob bygrave 23649ed840 [maven-release-plugin] prepare for next development iteration 2020-03-13 17:12:25 +13:00
rob bygrave 3ee4034a76 [maven-release-plugin] prepare release ebean-spring-txn-12.2.1 2020-03-13 17:12:15 +13:00
rob bygrave 21d377546e Bump to 12.2.1 2020-03-13 17:10:21 +13:00
rob bygrave 8c9dccc6a3 [maven-release-plugin] prepare for next development iteration 2019-10-14 14:53:28 +13:00
rob bygrave 6fdf681993 [maven-release-plugin] prepare release ebean-spring-txn-12.1.1 2019-10-14 14:53:19 +13:00
rob bygrave 7e8f413578 No effective change - sync to Ebean 12.1.1 2019-10-14 14:52:46 +13:00
rob bygrave 6705e5a962 Bump Ebean provided dependency to 11.42.1 2019-08-08 22:14:44 +12:00
Rob Bygrave d9126a936d [maven-release-plugin] prepare for next development iteration 2018-03-12 21:45:57 +13:00
Rob Bygrave 4ee024b1ce [maven-release-plugin] prepare release ebean-spring-txn-11.10.4 2018-03-12 21:45:45 +13:00
Rob Bygrave 19491d5ae6 #19 - java.lang.IllegalStateException: Transaction is Inactive ... when using Ebean transactions with Ebean's Spring transaction manager 2018-03-12 21:45:14 +13:00
Rob Bygrave db816594c5 No effective change - tidy tests 2018-02-23 10:50:51 +13:00
Rob Bygrave fa73b7791f [maven-release-plugin] prepare for next development iteration 2018-02-09 23:49:03 +13:00
Rob Bygrave c61da5b0e5 [maven-release-plugin] prepare release ebean-spring-txn-11.10.3 2018-02-09 23:48:50 +13:00
Rob Bygrave 49d724ad65 Bump pom version to align with Ebean version 2018-02-09 23:48:01 +13:00
Rob Bygrave 3ee2410a79 #18 - SpringJdbcTransactionManager inifinite recursion (Ebean #1254)
Update pom ebean version
2018-02-09 23:46:38 +13:00
Rob Bygrave c2ddc70565 #18 - SpringJdbcTransactionManager inifinite recursion (Ebean #1254) 2018-02-09 23:05:27 +13:00
Rob Bygrave 2f66e07c25 Add test for https://github.com/ebean-orm/ebean/issues/1254 2018-02-09 22:20:57 +13:00
Rob Bygrave 0807569ee2 Update readme 2018-02-03 00:14:00 +13:00
Rob Bygrave 206dec1bf8 [maven-release-plugin] prepare for next development iteration 2018-02-03 00:05:12 +13:00
Rob Bygrave 0e852f5bb5 [maven-release-plugin] prepare release ebean-spring-txn-11.10.1 2018-02-03 00:04:59 +13:00
Rob Bygrave a272fb4e02 #17 - Refactor to use the better internals in Ebean 11.10.1 2018-02-03 00:04:22 +13:00
Rob Bygrave cbdc6e09aa [maven-release-plugin] prepare for next development iteration 2018-01-30 23:53:23 +13:00
Rob Bygrave 211087f636 [maven-release-plugin] prepare release ebean-spring-txn-11.5.1 2018-01-30 23:53:10 +13:00
Rob Bygrave dca824b431 #16 - Bump to support Ebean 11.5.1+ 2018-01-30 23:52:40 +13:00
Rob Bygrave 6bcc8eb0f2 Update Readme 2016-12-21 21:11:00 +13:00
Rob Bygrave 844df4d5c9 Update scm due to rename to ebean-spring-txn 2016-12-21 21:04:47 +13:00
Rob Bygrave 6360d5fe1c [maven-release-plugin] prepare for next development iteration 2016-12-21 20:59:11 +13:00
Rob Bygrave e57a074b68 [maven-release-plugin] prepare release ebean-spring-txn-10.1.1 2016-12-21 20:59:00 +13:00
Rob Bygrave 052632239e pom - update name 2016-12-21 20:58:28 +13:00
Rob Bygrave 16aa4caceb #15 - Rename artifact to ebean-spring-txn ... (as this is specific and only for integration with spring transactions) 2016-12-21 20:57:28 +13:00
Rob Bygrave 83d84f6079 #14 - Remove agent loading feature for spring boot as it has been moved to ebean-spring-agent 2016-12-21 20:53:33 +13:00
Rob Bygrave 23c278d878 pom dependencies - ebean and slf4j-api as provided (versions expected to be controlled externally) 2016-12-21 20:44:47 +13:00
Rob Bygrave 7074b0de71 No effective change - use enhanced for 2016-12-19 16:40:00 +13:00
Rob BygraveandGitHub 2a9b025e88 Merge pull request #12 from ksperling/agent-autoconfig
Agent autoconfig and misc changes
2016-12-19 13:07:30 +13:00
Karsten Sperling 16b3a0b1c1 Rename from springtxn to spring since boot support is included as well (and Environment configuration support to come) 2016-12-16 23:38:36 +13:00
Karsten Sperling e0c4f73600 POM tidying 2016-12-16 23:38:36 +13:00
Karsten Sperling 6eb1947a6e Add EbeanAgentAutoConfiguration for Spring Boot 2016-12-16 23:38:36 +13:00
Rob Bygrave 2f793c29dc #11 - Repackage to io.ebean.springtxn ... remove factory bean support (move it to src/test as example) 2016-12-13 21:50:11 +13:00
Rob Bygrave 326fc221bf pom - modify scm to use ssh 2016-11-17 12:29:02 +13:00
Rob Bygrave d49018363c [maven-release-plugin] prepare for next development iteration 2016-11-17 12:19:27 +13:00
Rob Bygrave 2a2a0ad1f4 [maven-release-plugin] prepare release ebean-spring-7.2.1 2016-11-17 12:19:12 +13:00
Rob Bygrave 463b03ef7c bump pom to 7.2.1-SNAPSHOT 2016-11-17 12:18:01 +13:00
Rob BygraveandGitHub 80d39775ba Merge pull request #10 from ksperling/logging-tidyup
Use slf4j for logging and tidy up dependencies.
2016-11-17 12:14:08 +13:00
Karsten Sperling 92cdd25ca9 Use slf4j for logging and tidy up dependencies. 2016-11-17 09:37:41 +13:00
Rob BygraveandGitHub 53680ba53b Merge pull request #8 from ksperling/spring-tx-flush
Propagate 'flush' calls from Spring TX synchronization to the ebean
2016-11-14 15:23:26 +13:00
Karsten Sperling aa85c5fa3b Propagate 'flush' calls from Spring TX synchronization to the ebean transaction. 2016-11-14 13:30:03 +13:00
Robin Bygrave a1ce6f8a81 [maven-release-plugin] prepare for next development iteration 2016-08-03 17:46:37 +12:00
Robin Bygrave 7480904792 [maven-release-plugin] prepare release ebean-spring-7.1.2 2016-08-03 17:46:18 +12:00
Robin Bygrave b12cfafc21 Change groupId to ... org.avaje.ebean, and artifactId to ... ebean-spring 2016-08-03 17:45:51 +12:00
Robin Bygrave f07727651e [maven-release-plugin] prepare for next development iteration 2016-05-18 08:33:54 +12:00
Robin Bygrave 6090eaa167 [maven-release-plugin] prepare release avaje-ebeanorm-spring-7.1.1 2016-05-18 08:33:34 +12:00
Robin Bygrave 40eada4e80 #6 - Modify POM dependencies, change to provided scope for Ebean and Spring context 2016-05-18 08:33:04 +12:00
Robin Bygrave 2d375b3596 [maven-release-plugin] prepare for next development iteration 2015-11-04 08:34:33 +13:00
Robin Bygrave d864e2c723 [maven-release-plugin] prepare release avaje-ebeanorm-spring-6.1.1 2015-11-04 08:34:08 +13:00
Robin Bygrave e50c372562 Bump pom to 6.1.1-SNAPSHOT 2015-11-04 08:33:37 +13:00
Robin Bygrave e2cb033119 #5 - Error creating bean with name 'serverConfig' defined in class path resource [init-database.xml]: Cannot create inner bean 'com.avaje.ebean.config.AutofetchConfig#2e385cce' of type [com.avaje.ebean.config.AutofetchConfig] while setting bean property 'autofetchConfig' 2015-11-04 08:33:16 +13:00
Robin Bygrave 9620c57f19 [maven-release-plugin] prepare for next development iteration 2015-07-30 05:03:49 +12:00
Robin Bygrave 07cc0fcbb6 [maven-release-plugin] prepare release avaje-ebeanorm-spring-4.5.3 2015-07-30 05:03:28 +12:00
Robin Bygrave 6d1beb5c03 Add javadoc-plugin to pom 2015-07-30 05:03:05 +12:00
Robin Bygrave 1667107422 Update spring xsd to spring-beans-4.1.xsd 2015-07-30 04:57:03 +12:00
Robin Bygrave de5cf1df2c No effective change - format 2015-07-30 04:54:25 +12:00
Robin Bygrave a83114ced2 Update tests and dependencies 2015-07-30 04:53:25 +12:00
Rob Bygrave d6983422bf Merge pull request #3 from abguorui0928/master
Create AgentLoaderSupport.java
2015-05-14 22:45:43 +12:00
guor 6d4b3ad84e Create AgentLoaderSupport.java
add support for setup enhancement in spring
2015-05-11 21:01:58 +08:00
Eddie Mc Greal a3df7919b5 Updated to correct ebeanorm dependency range 2015-01-20 09:54:21 +01:00
Rob Bygrave 6f1aa39cc9 Merge pull request #2 from nedge/master
Update Version to 4.1.9 and edited MANIFEST for OSGi
2014-10-15 19:56:11 +13:00
Eddie Mc Greal f18c24c1d1 Update Version to 4.1.9 and edited MANIFEST for OSGi 2014-10-14 08:11:32 +02:00
Rob Bygrave 068401c29c [maven-release-plugin] prepare for next development iteration 2014-04-02 22:15:51 +13:00
Rob Bygrave 6fbbd8b107 [maven-release-plugin] prepare release avaje-ebeanorm-spring-3.3.1 2014-04-02 22:15:25 +13:00
Rob Bygrave 6379bd9e5d Set pom to 3.3.1-SNAPSHOT, ready for release 2014-04-02 22:12:31 +13:00
Rob Bygrave 94d58dfa7c Merge pull request #1 from nedge/develop
Changed to correct version and removed old logging config stuff
2014-04-02 22:08:21 +13:00
Eddie Mc Greal 035fb80959 Changed to correct version and removed old logging config stuff 2014-03-06 22:17:55 +01:00
Robin Bygrave 3b97f77083 [maven-release-plugin] prepare for next development iteration 2013-04-29 21:27:36 +12:00
Robin Bygrave a7d47202e6 [maven-release-plugin] prepare release avaje-ebeanorm-spring-3.2.1 2013-04-29 21:27:19 +12:00
Robin Bygrave 199a9d3118 Opps, fixed scm location 2013-04-29 21:26:37 +12:00
Robin Bygrave 5df3ac4b04 Change package of test beans etc for enhancement 2013-04-29 21:13:37 +12:00
Robin Bygrave 782f77b688 [maven-release-plugin] prepare for next development iteration 2012-09-15 01:32:05 +12:00
Robin Bygrave 1d570a233e [maven-release-plugin] prepare release avaje-ebeanorm-spring-3.1.1 2012-09-15 01:31:49 +12:00
Robin Bygrave 4a6b58bd9b Remove commons logging from dependency 2012-09-15 01:30:21 +12:00
rbygrave d64073bef0 Change license to Apache2, clean up dependencies 2012-09-15 01:15:37 +12:00
rbygrave 6d8a9236f8 initial add of EbeanORM spring from v2.8.1 2012-09-14 01:06:56 +12:00
Rob Bygrave 1665b4f2fa Initial commit 2012-09-13 05:59:29 -07:00
167 changed files with 2470 additions and 808 deletions
+3 -3
View File
@@ -17,14 +17,14 @@ jobs:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java_version }}
distribution: 'zulu'
- name: Maven cache
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: maven-cache
with:
+3 -3
View File
@@ -20,14 +20,14 @@ jobs:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java_version }}
distribution: 'adopt'
- name: Maven cache
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: maven-cache
with:
+3 -3
View File
@@ -20,14 +20,14 @@ jobs:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java_version }}
distribution: 'zulu'
- name: Maven cache
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: maven-cache
with:
+2 -2
View File
@@ -20,14 +20,14 @@ jobs:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Java
uses: oracle-actions/setup-java@v1
with:
website: jdk.java.net
release: ${{ matrix.java_version }}
- name: Maven cache
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: maven-cache
with:
+3 -3
View File
@@ -20,14 +20,14 @@ jobs:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java_version }}
distribution: 'adopt'
- name: Maven cache
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: maven-cache
with:
+3 -3
View File
@@ -17,14 +17,14 @@ jobs:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java_version }}
distribution: 'adopt'
- name: Maven cache
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: maven-cache
with:
+3 -3
View File
@@ -20,14 +20,14 @@ jobs:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java_version }}
distribution: 'zulu'
- name: Maven cache
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: maven-cache
with:
+3 -3
View File
@@ -20,14 +20,14 @@ jobs:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java_version }}
distribution: 'adopt'
- name: Maven cache
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: maven-cache
with:
+3 -3
View File
@@ -20,14 +20,14 @@ jobs:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java_version }}
distribution: 'zulu'
- name: Maven cache
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: maven-cache
with:
+3 -3
View File
@@ -20,14 +20,14 @@ jobs:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java_version }}
distribution: 'adopt'
- name: Maven cache
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: maven-cache
with:
+3 -3
View File
@@ -17,14 +17,14 @@ jobs:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java_version }}
distribution: 'adopt'
- name: Maven cache
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: maven-cache
with:
+3 -3
View File
@@ -20,14 +20,14 @@ jobs:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java_version }}
distribution: 'adopt'
- name: Maven cache
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: maven-cache
with:
+3 -3
View File
@@ -20,14 +20,14 @@ jobs:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java_version }}
distribution: 'adopt'
- name: Maven cache
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: maven-cache
with:
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.13.2</version>
<version>13.15.2</version>
</parent>
<name>ebean-clickhouse</name>
@@ -16,13 +16,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
@@ -35,13 +35,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-clickhouse</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.13.2</version>
<version>13.15.2</version>
</parent>
<name>ebean-cockroach</name>
@@ -16,13 +16,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
@@ -35,13 +35,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.13.2</version>
<version>13.15.2</version>
</parent>
<name>ebean-db2</name>
@@ -16,13 +16,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
@@ -35,13 +35,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-db2</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.13.2</version>
<version>13.15.2</version>
</parent>
<name>ebean-h2</name>
@@ -16,13 +16,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
@@ -35,13 +35,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-h2</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.13.2</version>
<version>13.15.2</version>
</parent>
<name>ebean-hana</name>
@@ -16,13 +16,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
@@ -35,13 +35,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-hana</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.13.2</version>
<version>13.15.2</version>
</parent>
<name>ebean-mariadb</name>
@@ -16,13 +16,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
@@ -35,13 +35,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-mariadb</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.13.2</version>
<version>13.15.2</version>
</parent>
<name>ebean-mysql</name>
@@ -16,13 +16,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
@@ -35,13 +35,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-mysql</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.13.2</version>
<version>13.15.2</version>
</parent>
<name>ebean-nuodb</name>
@@ -16,13 +16,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
@@ -35,13 +35,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-nuodb</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.13.2</version>
<version>13.15.2</version>
</parent>
<name>ebean-oracle</name>
@@ -16,13 +16,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
@@ -35,13 +35,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-oracle</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.13.2</version>
<version>13.15.2</version>
</parent>
<name>ebean-postgres</name>
@@ -16,13 +16,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
@@ -35,13 +35,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.13.2</version>
<version>13.15.2</version>
</parent>
<name>ebean-sqlite</name>
@@ -16,13 +16,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
@@ -35,13 +35,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-sqlite</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.13.2</version>
<version>13.15.2</version>
</parent>
<name>ebean-sqlserver</name>
@@ -16,13 +16,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
@@ -35,13 +35,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-sqlserver</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
</dependencies>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.13.2</version>
<version>13.15.2</version>
</parent>
<name>ebean-yugabyte</name>
@@ -16,13 +16,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
@@ -35,13 +35,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
</dependencies>
+8 -8
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>composites</artifactId>
<groupId>io.ebean</groupId>
<version>13.13.2</version>
<version>13.15.2</version>
</parent>
<name>ebean (all platforms)</name>
@@ -16,31 +16,31 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-joda-time</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-jackson-jsonnode</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-jackson-mapper</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
@@ -53,13 +53,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-all</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
</dependencies>
+1 -1
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.13.2</version>
<version>13.15.2</version>
</parent>
<artifactId>composites</artifactId>
+1 -1
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.13.2</version>
<version>13.15.2</version>
</parent>
<name>ebean api</name>
@@ -24,6 +24,11 @@ public class InterceptReadOnly implements EntityBeanIntercept {
this.owner = (EntityBean) ownerBean;
}
@Override
public String toString() {
return "InterceptReadOnly{" + owner + '}';
}
@Override
public EntityBean getOwner() {
return owner;
@@ -113,6 +113,25 @@ public final class InterceptReadWrite implements EntityBeanIntercept {
this.flags = null;
}
@Override
public String toString() {
return "InterceptReadWrite{state=" + state +
(dirty ? " dirty;" : "") +
(forceUpdate ? " forceUpdate;" : "") +
(readOnly ? " readOnly;" : "") +
(disableLazyLoad ? " disableLazyLoad;" : "") +
(lazyLoadFailure ? " lazyLoadFailure;" : "") +
(fullyLoadedBean ? " fullyLoadedBean;" : "") +
(loadedFromCache ? " loadedFromCache;" : "") +
", pc=" + System.identityHashCode(persistenceContext) +
", flags=" + Arrays.toString(flags) +
(lazyLoadProperty > -1 ? (", lazyLoadProperty=" + lazyLoadProperty) : "") +
", loader=" + beanLoader +
(ownerId != null ? (", ownerId=" + ownerId) : "") +
", owner=" + owner +
'}';
}
@Override
public EntityBean getOwner() {
return owner;
@@ -690,7 +709,7 @@ public final class InterceptReadWrite implements EntityBeanIntercept {
if (beanLoader == null) {
final Database database = DB.byName(ebeanServerName);
if (database == null) {
throw new PersistenceException("Database [" + ebeanServerName + "] was not found?");
throw new PersistenceException(ebeanServerName == null ? "No registered default server" : "Database [" + ebeanServerName + "] is not registered");
}
// For stand alone reference bean or after deserialisation lazy load
// using the ebeanServer. Synchronise only on the bean.
@@ -718,7 +737,7 @@ public final class InterceptReadWrite implements EntityBeanIntercept {
}
if (lazyLoadFailure) {
// failed when batch lazy loaded by another bean in the batch
throw new EntityNotFoundException("(Lazy) loading failed on type:" + owner.getClass().getName() + " id:" + ownerId + " - Bean has been deleted");
throw new EntityNotFoundException("(Lazy) loading failed on type:" + owner.getClass().getName() + " id:" + ownerId + " - Bean has been deleted. BeanLoader: " + beanLoader);
}
if (lazyLoadProperty == -1) {
lazyLoadProperty = loadProperty;
@@ -123,10 +123,10 @@ public class DatabaseConfig {
private boolean loadModuleInfo = true;
/**
* List of interesting classes such as entities, embedded, ScalarTypes,
* Listeners, Finders, Controllers etc.
* Interesting classes such as entities, embedded, ScalarTypes,
* Listeners, Finders, Controllers, AttributeConverters etc.
*/
private List<Class<?>> classes = new ArrayList<>();
private Set<Class<?>> classes = new HashSet<>();
/**
* The packages that are searched for interesting classes. Only used when
@@ -2320,8 +2320,7 @@ public class DatabaseConfig {
}
/**
* Programmatically add classes (typically entities) that this server should
* use.
* Programmatically add classes (typically entities) that this server should use.
* <p>
* The class can be an Entity, Embedded type, ScalarType, BeanPersistListener,
* BeanFinder or BeanPersistController.
@@ -2331,8 +2330,7 @@ public class DatabaseConfig {
* <p>
* Alternatively the classes can be added via {@link #setClasses(List)}.
*
* @param cls the entity type (or other type) that should be registered by this
* database.
* @param cls the entity type (or other type) that should be registered by this database.
*/
public void addClass(Class<?> cls) {
classes.add(cls);
@@ -2341,7 +2339,7 @@ public class DatabaseConfig {
/**
* Register all the classes (typically entity classes).
*/
public void addAll(List<Class<?>> classList) {
public void addAll(Collection<Class<?>> classList) {
if (classList != null && !classList.isEmpty()) {
classes.addAll(classList);
}
@@ -2383,15 +2381,26 @@ public class DatabaseConfig {
* <p>
* Alternatively the classes can contain added via {@link #addClass(Class)}.
*/
public void setClasses(List<Class<?>> classes) {
this.classes = classes;
public void setClasses(Collection<Class<?>> classes) {
this.classes = new HashSet<>(classes);
}
/**
* Return the classes registered for this database. Typically this includes
* Return the classes registered for this database. Typically, this includes
* entities and perhaps listeners.
*/
public List<Class<?>> getClasses() {
public Set<Class<?>> classes() {
return classes;
}
/**
* Deprecated - migrate to classes().
* <p>
* Sorry if returning Set rather than List breaks code but it feels safer to
* do that than a subtle change to return a shallow copy which you will not detect.
*/
@Deprecated
public Set<Class<?>> getClasses() {
return classes;
}
@@ -2760,8 +2769,6 @@ public class DatabaseConfig {
this.classLoadConfig = classLoadConfig;
}
/**
* Load settings from application.properties, application.yaml and other sources.
* <p>
@@ -2906,7 +2913,7 @@ public class DatabaseConfig {
serverCachePlugin = p.createInstance(ServerCachePlugin.class, "serverCachePlugin", serverCachePlugin);
String packagesProp = p.get("search.packages", p.get("packages", null));
packages = getSearchList(packagesProp, packages);
packages = searchList(packagesProp, packages);
skipCacheAfterWrite = p.getBoolean("skipCacheAfterWrite", skipCacheAfterWrite);
updateAllPropertiesInBatch = p.getBoolean("updateAllPropertiesInBatch", updateAllPropertiesInBatch);
@@ -2982,10 +2989,10 @@ public class DatabaseConfig {
tenantCatalogProvider = p.createInstance(TenantCatalogProvider.class, "tenant.catalogProvider", tenantCatalogProvider);
tenantSchemaProvider = p.createInstance(TenantSchemaProvider.class, "tenant.schemaProvider", tenantSchemaProvider);
tenantPartitionColumn = p.get("tenant.partitionColumn", tenantPartitionColumn);
classes = getClasses(p);
classes = readClasses(p);
String mappingsProp = p.get("mappingLocations", null);
mappingLocations = getSearchList(mappingsProp, mappingLocations);
mappingLocations = searchList(mappingsProp, mappingLocations);
}
private NamingConvention createNamingConvention(PropertiesWrapper properties, NamingConvention namingConvention) {
@@ -2999,13 +3006,13 @@ public class DatabaseConfig {
* @param properties the properties
* @return the classes
*/
private List<Class<?>> getClasses(PropertiesWrapper properties) {
private Set<Class<?>> readClasses(PropertiesWrapper properties) {
String classNames = properties.get("classes", null);
if (classNames == null) {
return classes;
}
List<Class<?>> classList = new ArrayList<>();
Set<Class<?>> classList = new HashSet<>();
String[] split = StringHelper.splitNames(classNames);
for (String cn : split) {
if (!"class".equalsIgnoreCase(cn)) {
@@ -3020,7 +3027,7 @@ public class DatabaseConfig {
return classList;
}
private List<String> getSearchList(String searchNames, List<String> defaultValue) {
private List<String> searchList(String searchNames, List<String> defaultValue) {
if (searchNames != null) {
String[] entries = StringHelper.splitNames(searchNames);
List<String> hitList = new ArrayList<>(entries.length);
@@ -3399,8 +3406,16 @@ public class DatabaseConfig {
* When false we either register entity classes via application code or use classpath
* scanning to find and register entity classes.
*/
public boolean isLoadModuleInfo() {
return loadModuleInfo;
}
/**
* Deprecated - migrate to isLoadModuleInfo().
*/
@Deprecated
public boolean isAutoLoadModuleInfo() {
return loadModuleInfo && classes.isEmpty();
return loadModuleInfo;
}
/**
@@ -3,10 +3,6 @@ package io.ebean.config;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.ebean.annotation.MutationDetection;
import io.ebean.annotation.PersistBatch;
import io.ebean.config.DatabaseConfig;
import io.ebean.config.JsonConfig;
import io.ebean.config.MatchingNamingConvention;
import io.ebean.config.PlatformConfig;
import io.ebean.config.dbplatform.IdType;
import io.ebean.datasource.DataSourceConfig;
import org.junit.jupiter.api.Assertions;
@@ -93,6 +89,7 @@ class DatabaseConfigTest {
assertTrue(config.isDbOffline());
assertTrue(config.isAutoReadOnlyDataSource());
assertTrue(config.isAutoLoadModuleInfo());
assertTrue(config.isLoadModuleInfo());
assertTrue(config.skipDataSourceCheck());
assertTrue(config.isIdGeneratorAutomatic());
@@ -165,6 +162,7 @@ class DatabaseConfigTest {
assertEquals(MutationDetection.HASH, config.getJsonMutationDetection());
assertTrue(config.getPlatformConfig().isCaseSensitiveCollation());
assertTrue(config.isAutoLoadModuleInfo());
assertTrue(config.isLoadModuleInfo());
assertFalse(config.isQueryPlanEnable());
assertEquals(Long.MAX_VALUE, config.getQueryPlanThresholdMicros());
@@ -175,6 +173,7 @@ class DatabaseConfigTest {
config.setLoadModuleInfo(false);
assertFalse(config.isAutoLoadModuleInfo());
assertFalse(config.isLoadModuleInfo());
config.setAutoPersistUpdates(true);
assertTrue(config.isAutoPersistUpdates());
config.setSkipDataSourceCheck(true);
+3 -3
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.13.2</version>
<version>13.15.2</version>
</parent>
<!-- <parent>-->
<!-- <groupId>org.avaje</groupId>-->
@@ -26,7 +26,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>provided</scope>
</dependency>
@@ -69,7 +69,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-h2</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>test</scope>
</dependency>
+35 -29
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.13.2</version>
<version>13.15.2</version>
</parent>
<name>ebean bom</name>
@@ -89,106 +89,112 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core-type</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-joda-time</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-jackson-jsonnode</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-jackson-mapper</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-ddl-generator</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-externalmapping-api</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-externalmapping-xml</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-autotune</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>querybean-generator</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>kotlin-querybean-generator</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-postgis</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-redis</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-spring-txn</artifactId>
<version>13.15.2</version>
</dependency>
<!-- platforms -->
@@ -196,67 +202,67 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-clickhouse</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-db2</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-h2</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-hana</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-mariadb</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-mysql</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-nuodb</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-oracle</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-postgres</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-sqlite</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-sqlserver</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
</dependencies>
+2 -2
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.13.2</version>
<version>13.15.2</version>
</parent>
<artifactId>ebean-core-type</artifactId>
@@ -16,7 +16,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
+7 -7
View File
@@ -3,7 +3,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.13.2</version>
<version>13.15.2</version>
</parent>
<artifactId>ebean-core</artifactId>
@@ -22,7 +22,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
@@ -46,13 +46,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core-type</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-externalmapping-api</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
@@ -143,21 +143,21 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-h2</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-sqlserver</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>test</scope>
</dependency>
@@ -62,9 +62,9 @@ public final class LoadBeanRequest extends LoadRequest {
/**
* Return the list of Id values for the beans in the lazy load buffer.
*/
public List<Object> getIdList() {
List<Object> idList = new ArrayList<>();
BeanDescriptor<?> desc = loadBuffer.descriptor();
public List<Object> ids() {
final List<Object> idList = new ArrayList<>(batch.size());
final BeanDescriptor<?> desc = loadBuffer.descriptor();
for (EntityBeanIntercept ebi : batch) {
idList.add(desc.getId(ebi.getOwner()));
}
@@ -111,6 +111,7 @@ public final class LoadBeanRequest extends LoadRequest {
desc.cacheBeanPutAll(list);
}
if (lazyLoadProperty != null) {
List<EntityBeanIntercept> missed = new ArrayList<>();
Set<Object> missedIds = new HashSet<>();
for (EntityBeanIntercept ebi : batch) {
// check if the underlying row in DB was deleted. Mark the bean as 'failed' if
@@ -120,23 +121,26 @@ public final class LoadBeanRequest extends LoadRequest {
// assume this is logically deleted (hence not found)
desc.markAsDeleted(ebi.getOwner());
missedIds.add(id);
missed.add(ebi);
}
}
return new Result(loadedIds, missedIds);
return new Result(loadedIds, missedIds, missed);
}
return EMPTY_RESULT;
}
static final Result EMPTY_RESULT = new Result(Collections.emptySet(),Collections.emptySet());
static final Result EMPTY_RESULT = new Result(Collections.emptySet(),Collections.emptySet(), Collections.emptyList());
public static class Result {
private final Set<Object> loadedIds;
private final Set<Object> missedIds;
private final List<EntityBeanIntercept> missed;
Result(Set<Object> loadedIds, Set<Object> missedIds) {
Result(Set<Object> loadedIds, Set<Object> missedIds, List<EntityBeanIntercept> missed) {
this.loadedIds = loadedIds;
this.missedIds = missedIds;
this.missed = missed;
}
public boolean markedDeleted() {
@@ -150,5 +154,9 @@ public final class LoadBeanRequest extends LoadRequest {
public Set<Object> loadedIds() {
return loadedIds;
}
public List<EntityBeanIntercept> missed() {
return missed;
}
}
}
@@ -12,6 +12,7 @@ import java.util.ArrayList;
import java.util.List;
import static java.lang.System.Logger.Level.DEBUG;
import static java.lang.System.Logger.Level.INFO;
/**
* Request for loading Associated Many Beans.
@@ -22,26 +23,29 @@ public final class LoadManyRequest extends LoadRequest {
private final LoadManyBuffer loadContext;
private final boolean onlyIds;
private final boolean loadCache;
private final BeanCollection<?> originCollection;
private boolean originIncluded;
/**
* Construct for lazy loading.
*/
public LoadManyRequest(LoadManyBuffer loadContext, boolean onlyIds, boolean loadCache) {
this(loadContext, null, true, onlyIds, loadCache);
public LoadManyRequest(LoadManyBuffer loadContext, boolean onlyIds, boolean loadCache, BeanCollection<?> originCollection) {
super(null, true);
this.loadContext = loadContext;
this.onlyIds = onlyIds;
this.loadCache = loadCache;
this.originCollection = originCollection;
}
/**
* Construct for secondary query.
*/
public LoadManyRequest(LoadManyBuffer loadContext, OrmQueryRequest<?> parentRequest) {
this(loadContext, parentRequest, false, false, false);
}
private LoadManyRequest(LoadManyBuffer loadContext, OrmQueryRequest<?> parentRequest, boolean lazy, boolean onlyIds, boolean loadCache) {
super(parentRequest, lazy);
super(parentRequest, false);
this.loadContext = loadContext;
this.onlyIds = onlyIds;
this.loadCache = loadCache;
this.onlyIds = false;
this.loadCache = false;
this.originCollection = null;
}
@Override
@@ -59,10 +63,18 @@ public final class LoadManyRequest extends LoadRequest {
for (int i = 0; i < loadContext.size(); i++) {
BeanCollection<?> bc = loadContext.get(i);
if (bc != null) {
if (lazy && !originIncluded && bc == originCollection) {
originIncluded = true;
}
idList.add(many.parentId(bc.getOwnerBean()));
bc.setLoader(server); // don't use the load buffer again
}
}
if (originCollection != null && !originIncluded) {
CoreLog.log.log(INFO, "Batch lazy loading including origin collection - size:{0}", idList.size());
idList.add(many.parentId(originCollection.getOwnerBean()));
originCollection.setLoader(server); // don't use the load buffer again
}
if (many.targetDescriptor().isPadInExpression()) {
BindPadding.padIds(idList);
}
@@ -34,5 +34,5 @@ public interface SpiJsonReader {
Object readValueUsingObjectMapper(Class<?> propertyType) throws IOException;
boolean intercept();
boolean update();
}
@@ -18,7 +18,8 @@ import java.text.MessageFormat;
import java.util.List;
import java.util.Set;
import static java.lang.System.Logger.Level.*;
import static java.lang.System.Logger.Level.DEBUG;
import static java.lang.System.Logger.Level.ERROR;
/**
* Helper to handle lazy loading and refreshing of beans.
@@ -125,23 +126,26 @@ final class DefaultBeanLoader {
* Load a batch of beans for +query or +lazy loading.
*/
void loadBean(LoadBeanRequest loadRequest) {
Set<EntityBeanIntercept> batch = loadRequest.batch();
final Set<EntityBeanIntercept> batch = loadRequest.batch();
if (batch.isEmpty()) {
throw new RuntimeException("Nothing in batch?");
}
List<Object> idList = loadRequest.getIdList();
if (idList.isEmpty()) {
// everything was loaded from cache
final List<Object> ids = loadRequest.ids();
if (ids.isEmpty()) {
// this should never happen given the batch is not empty
CoreLog.internal.log(ERROR, "No Ids when loading Batch buffer");
return;
}
SpiQuery<?> query = server.createQuery(loadRequest.beanType());
loadRequest.configureQuery(query, idList);
final SpiQuery<?> query = server.createQuery(loadRequest.beanType());
loadRequest.configureQuery(query, ids);
final List<?> list = executeQuery(loadRequest, query);
final LoadBeanRequest.Result result = loadRequest.postLoad(list);
if (result.markedDeleted() && CoreLog.markedAsDeleted.isLoggable(DEBUG)) {
String msg = MessageFormat.format("Loaded bean marked as deleted for {0} missedIds:{1} loadedIds:{2} sql:{3} list:{4}", loadRequest.beanType(), result.missedIds(), result.loadedIds(), query.getGeneratedSql(), list);
CoreLog.markedAsDeleted.log(DEBUG, "Loaded bean batch {0}", batch);
String msg = MessageFormat.format("Loaded bean marked as deleted for {0} ids:{1} missedIds:{2} loadedIds:{3} sql:{4} loadedList:{5} missed:{6}",
loadRequest.beanType(), ids, result.missedIds(), result.loadedIds(), query.getGeneratedSql(), list, result.missed());
CoreLog.markedAsDeleted.log(DEBUG, msg, new RuntimeException("LoadBeanRequest markedAsDeleted"));
}
}
@@ -17,8 +17,8 @@ import javax.persistence.PersistenceException;
import java.net.URL;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;
import java.util.ServiceLoader;
import java.util.Set;
import java.util.concurrent.locks.ReentrantLock;
import static java.lang.System.Logger.Level.*;
@@ -121,7 +121,7 @@ public final class DefaultContainer implements SpiContainer {
configProvider.apply(config);
}
}
if (config.isAutoLoadModuleInfo()) {
if (config.isLoadModuleInfo()) {
// auto register entity classes
boolean found = false;
for (EntityClassRegister loader : ServiceLoader.load(EntityClassRegister.class)) {
@@ -177,10 +177,10 @@ public final class DefaultContainer implements SpiContainer {
* Get the class based entities, scalarTypes, Listeners etc.
*/
private BootupClasses bootupClasses1(DatabaseConfig config) {
List<Class<?>> entityClasses = config.getClasses();
if (config.isDisableClasspathSearch() || (entityClasses != null && !entityClasses.isEmpty())) {
Set<Class<?>> classes = config.classes();
if (config.isDisableClasspathSearch() || (classes != null && !classes.isEmpty())) {
// use classes we explicitly added via configuration
return new BootupClasses(entityClasses);
return new BootupClasses(classes);
}
return BootupClassPathSearch.search(config);
}
@@ -962,13 +962,15 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
if (transaction == null) {
transaction = currentServerTransaction();
}
query.setDefaultRawSqlIfRequired();
if (query.isAutoTunable() && !autoTuneService.tuneQuery(query)) {
// use deployment FetchType.LAZY/EAGER annotations
// to define the 'default' select clause
query.setDefaultSelectClause();
if (!query.isRawSql()) {
query.setDefaultRawSqlIfRequired();
if (query.isAutoTunable() && !autoTuneService.tuneQuery(query)) {
// use deployment FetchType.LAZY/EAGER annotations
// to define the 'default' select clause
query.setDefaultSelectClause();
}
query.selectAllForLazyLoadProperty();
}
query.selectAllForLazyLoadProperty();
ProfileLocation profileLocation = query.getProfileLocation();
if (profileLocation != null) {
profileLocation.obtain();
@@ -22,6 +22,7 @@ import java.lang.annotation.Annotation;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.function.Predicate;
import static java.lang.System.Logger.Level.DEBUG;
@@ -79,9 +80,9 @@ public class BootupClasses implements Predicate<Class<?>> {
public BootupClasses() {
}
public BootupClasses(List<Class<?>> list) {
if (list != null) {
for (Class<?> cls : list) {
public BootupClasses(Set<Class<?>> classes) {
if (classes != null) {
for (Class<?> cls : classes) {
test(cls);
}
}
@@ -133,7 +133,12 @@ final class BeanDescriptorJsonHelp<T> {
String key = parser.getCurrentName();
BeanProperty p = desc.beanProperty(key);
if (p != null) {
p.jsonRead(readJson, bean);
if (p.isVersion() && readJson.update() ) {
// skip version prop during update
p.jsonRead(readJson);
} else {
p.jsonRead(readJson, bean);
}
} else {
// read an unmapped property
if (unmappedProperties == null) {
@@ -20,9 +20,9 @@ import io.ebeaninternal.api.SpiExpressionRequest;
import io.ebeaninternal.api.SpiQuery;
import io.ebeaninternal.api.json.SpiJsonReader;
import io.ebeaninternal.api.json.SpiJsonWriter;
import io.ebeaninternal.server.bind.DataBind;
import io.ebeaninternal.server.core.EncryptAlias;
import io.ebeaninternal.server.core.InternString;
import io.ebeaninternal.server.bind.DataBind;
import io.ebeaninternal.server.deploy.generatedproperty.GeneratedProperty;
import io.ebeaninternal.server.deploy.generatedproperty.GeneratedWhenCreated;
import io.ebeaninternal.server.deploy.generatedproperty.GeneratedWhenModified;
@@ -1408,15 +1408,20 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
}
public void jsonRead(SpiJsonReader ctx, EntityBean bean) throws IOException {
Object objValue = jsonRead(ctx);
if (jsonDeserialize) {
if (ctx.update()) {
setValueIntercept(bean, objValue);
} else {
setValue(bean, objValue);
}
}
}
public Object jsonRead(SpiJsonReader ctx) throws IOException {
JsonToken event = ctx.nextToken();
if (JsonToken.VALUE_NULL == event) {
if (jsonDeserialize) {
if (ctx.intercept()) {
setValueIntercept(bean, null);
} else {
setValue(bean, null);
}
}
return null;
} else {
// expect to read non-null json value
Object objValue;
@@ -1433,13 +1438,7 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
CoreLog.log.log(ERROR, msg, e);
}
}
if (jsonDeserialize) {
if (ctx.intercept()) {
setValueIntercept(bean, objValue);
} else {
setValue(bean, objValue);
}
}
return objValue;
}
}
@@ -2,6 +2,8 @@ package io.ebeaninternal.server.deploy;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import io.ebean.SqlUpdate;
import io.ebean.Transaction;
import io.ebean.bean.BeanCollection;
@@ -27,6 +29,7 @@ import java.io.StringWriter;
import java.util.*;
import static java.lang.System.Logger.Level.ERROR;
import static java.lang.System.Logger.Level.WARNING;
/**
* Property mapped to a List Set or Map.
@@ -937,7 +940,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
if (elementDescriptor != null) {
elementDescriptor.jsonWriteMapEntry(ctx, entry);
} else {
targetDescriptor.jsonWrite(ctx, (EntityBean)entry.getValue());
targetDescriptor.jsonWrite(ctx, (EntityBean) entry.getValue());
}
}
@@ -1003,7 +1006,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
if (JsonToken.VALUE_NULL == event) {
return null;
}
return jsonReadCollection(ctx, null);
return jsonReadCollection(ctx, null, null);
}
/**
@@ -1016,15 +1019,16 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
/**
* Read the collection (JSON Array) containing entity beans.
*/
public Object jsonReadCollection(SpiJsonReader readJson, EntityBean parentBean) throws IOException {
public Object jsonReadCollection(SpiJsonReader readJson, EntityBean parentBean, Object targets) throws IOException {
if (elementDescriptor != null && elementDescriptor.isJsonReadCollection()) {
return elementDescriptor.jsonReadCollection(readJson, parentBean);
}
BeanCollection<?> collection = createEmpty(parentBean);
BeanCollectionAdd add = beanCollectionAdd(collection);
Map<Object, T> existingBeans = extractBeans(targets);
do {
// CHECKME: Update existing list entry here?
EntityBean detailBean = (EntityBean) targetDescriptor.jsonRead(readJson, name, null);
EntityBean detailBean = getDetailBean(readJson, existingBeans);
if (detailBean == null) {
// read the entire array
break;
@@ -1039,6 +1043,63 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
return collection;
}
/**
* Find bean in the target collection and reuse it for JSON update.
*/
private EntityBean getDetailBean(SpiJsonReader readJson, Map<Object, T> targets) throws IOException {
BeanProperty idProperty = targetDescriptor.idProperty();
if (targets == null || idProperty == null) {
return (EntityBean) targetDescriptor.jsonRead(readJson, name, null);
} else {
JsonToken token = readJson.parser().nextToken();
if (JsonToken.VALUE_NULL == token || JsonToken.END_ARRAY == token) {
return null;
}
// extract the id. We have to buffer the JSON;
ObjectNode node = readJson.mapper().readTree(readJson.parser());
SpiJsonReader jsonReader = readJson.forJson(node.traverse());
JsonNode idNode = node.get(idProperty.name());
Object id = idNode == null ? null : idProperty.jsonRead(readJson.forJson(idNode.traverse()));
return (EntityBean) targetDescriptor.jsonRead(jsonReader, name, targets.get(id));
}
}
/**
* Extract beans, that are currently in the target collection. (targets can be a List/Set/Map)
*/
private Map<Object, T> extractBeans(Object targets) {
Collection<T> beans;
if (targets == null) {
return null;
} else if (targets instanceof Map) {
if (((Map<?, T>) targets).isEmpty()) {
return null;
}
beans = ((Map<?, T>) targets).values();
} else if (targets instanceof Collection) {
if (((Collection<?>) targets).isEmpty()) {
return null;
}
beans = (Collection<T>) targets;
} else {
CoreLog.log.log(WARNING, "Found non collection value " + targets.getClass().getSimpleName());
return null;
}
BeanProperty idProp = targetDescriptor.idProperty();
Map<Object, T> ret = new HashMap<>();
for (T bean : beans) {
if (bean instanceof EntityBean) {
Object id = idProp.getValue((EntityBean) bean);
if (id != null) {
ret.put(id, bean);
}
}
}
return ret.isEmpty() ? null : ret;
}
/**
* Bind all the property values to the SqlUpdate.
*/
@@ -50,10 +50,10 @@ class BeanPropertyAssocManyJsonHelp {
if (JsonToken.START_ARRAY != event && JsonToken.START_OBJECT != event) {
throw new JsonParseException(parser, "Unexpected token " + event + " - expecting start array or object");
}
if (readJson.intercept()) {
many.setValueIntercept(parentBean, many.jsonReadCollection(readJson, parentBean));
if (readJson.update()) {
many.setValueIntercept(parentBean, many.jsonReadCollection(readJson, parentBean, many.value(parentBean)));
} else {
many.setValue(parentBean, many.jsonReadCollection(readJson, parentBean));
many.setValue(parentBean, many.jsonReadCollection(readJson, parentBean, null));
}
}
@@ -787,9 +787,10 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
@Override
public void jsonRead(SpiJsonReader readJson, EntityBean bean) throws IOException {
if (jsonDeserialize && targetDescriptor != null) {
T target = (T) value(bean);
// CHECKME: may we skip reading the object from the json stream?
T target = readJson.update() ? (T) value(bean) : null;
T assocBean = targetDescriptor.jsonRead(readJson, name, target);
if (readJson.intercept()) {
if (readJson.update()) {
setValueIntercept(bean, assocBean);
} else {
setValue(bean, assocBean);
@@ -797,6 +798,11 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
}
}
@Override
public Object jsonRead(SpiJsonReader readJson) throws IOException {
return targetDescriptor.jsonRead(readJson, name, null);
}
public boolean isReference(Object detailBean) {
EntityBean eb = (EntityBean) detailBean;
return targetDescriptor.isReference(eb._ebean_getIntercept());
@@ -19,7 +19,7 @@ public final class BeanPropertySimpleCollection<T> extends BeanPropertyAssocMany
}
@Override
public Object jsonReadCollection(SpiJsonReader readJson, EntityBean parentBean) throws IOException {
public Object jsonReadCollection(SpiJsonReader readJson, EntityBean parentBean, Object collectionValue) throws IOException {
return elementDescriptor.jsonReadCollection(readJson, parentBean);
}
}
@@ -9,8 +9,7 @@ import io.ebeaninternal.server.deploy.ManyType;
import io.ebeaninternal.server.deploy.meta.*;
import io.ebeaninternal.server.type.TypeManager;
import javax.persistence.PersistenceException;
import javax.persistence.Transient;
import javax.persistence.*;
import java.lang.reflect.*;
import static java.lang.System.Logger.Level.*;
@@ -105,20 +104,18 @@ public final class DeployCreateProperties {
}
}
@SuppressWarnings({"unchecked"})
private DeployBeanProperty createManyType(DeployBeanDescriptor<?> desc, Class<?> targetType, ManyType manyType) {
try {
ScalarType<?> scalarType = typeManager.type(targetType);
if (scalarType != null) {
return new DeployBeanPropertySimpleCollection(desc, targetType, manyType);
return new DeployBeanPropertySimpleCollection<>(desc, targetType, manyType);
}
} catch (NullPointerException e) {
CoreLog.internal.log(DEBUG, "expected non-scalar type {0}", e.getMessage());
}
return new DeployBeanPropertyAssocMany(desc, targetType, manyType);
return new DeployBeanPropertyAssocMany<>(desc, targetType, manyType);
}
@SuppressWarnings({"unchecked"})
private DeployBeanProperty createProp(DeployBeanDescriptor<?> desc, Field field) {
Class<?> propertyType = field.getType();
if (isSpecialScalarType(field)) {
@@ -149,9 +146,11 @@ public final class DeployCreateProperties {
// return with no ScalarType (still support JSON features)
return new DeployBeanProperty(desc, propertyType, null, null);
}
if (AnnotationUtil.has(field, Convert.class)) {
throw new IllegalStateException("No AttributeConverter registered for type " + propertyType + " at " + desc.getFullName() + "." + field.getName());
}
try {
return new DeployBeanPropertyAssocOne(desc, propertyType);
return new DeployBeanPropertyAssocOne<>(desc, propertyType);
} catch (Exception e) {
CoreLog.log.log(ERROR, "Error with " + desc + " field:" + field.getName(), e);
return null;
@@ -32,13 +32,13 @@ public final class ReadJson implements SpiJsonReader {
private final Object objectMapper;
private final PersistenceContext persistenceContext;
private final LoadContext loadContext;
private final boolean intercept;
private final boolean update;
private final boolean enableLazyLoading;
/**
* Construct with parser and readOptions.
*/
public ReadJson(BeanDescriptor<?> desc, JsonParser parser, JsonReadOptions readOptions, Object objectMapper, boolean intercept) {
public ReadJson(BeanDescriptor<?> desc, JsonParser parser, JsonReadOptions readOptions, Object objectMapper, boolean update) {
this.rootDesc = desc;
this.parser = parser;
this.objectMapper = objectMapper;
@@ -48,7 +48,7 @@ public final class ReadJson implements SpiJsonReader {
// only create visitorMap, pathStack if needed ...
this.visitorMap = (readOptions == null) ? null : readOptions.getVisitorMap();
this.pathStack = (visitorMap == null && loadContext == null) ? null : new PathStack();
this.intercept = intercept;
this.update = update;
}
/**
@@ -62,7 +62,7 @@ public final class ReadJson implements SpiJsonReader {
this.objectMapper = source.objectMapper;
this.persistenceContext = source.persistenceContext;
this.loadContext = source.loadContext;
this.intercept = source.intercept;
this.update = source.update;
this.enableLazyLoading = source.enableLazyLoading;
}
@@ -213,10 +213,10 @@ public final class ReadJson implements SpiJsonReader {
}
/**
* Do we have to set values via intercept or not.
* Do we update an existing bean? This meeans we have to set values via intercept and handle collections.
*/
@Override
public boolean intercept() {
return intercept;
public boolean update() {
return update;
}
}
@@ -125,6 +125,11 @@ final class DLoadBeanContext extends DLoadBaseContext implements LoadBeanContext
this.batch = new HashSet<>(Math.max((int) (batchSize/.75f) + 1, 16));
}
@Override
public String toString() {
return "LoadBuffer@" + hashCode();
}
@Override
public Lock lock() {
bufferLock.lock();
@@ -186,6 +191,9 @@ final class DLoadBeanContext extends DLoadBaseContext implements LoadBeanContext
@Override
public void loadBean(EntityBeanIntercept ebi) {
assert bufferLock.isHeldByCurrentThread();
assert bufferLock.isLocked();
// A lock is effectively held by EntityBeanIntercept.loadBean()
if (context.desc.lazyLoadMany(ebi, context)) {
// lazy load property was a Many
@@ -212,7 +212,7 @@ final class DLoadManyContext extends DLoadBaseContext implements LoadManyContext
}
}
context.parent.getEbeanServer().loadMany(new LoadManyRequest(this, onlyIds, useCache));
context.parent.getEbeanServer().loadMany(new LoadManyRequest(this, onlyIds, useCache, bc));
// clear the buffer as all entries have been loaded
clear();
} finally {
@@ -20,6 +20,7 @@ import java.util.Map;
import java.util.Set;
import static io.ebeaninternal.server.persist.DmlUtil.isNullOrZero;
import static java.lang.System.Logger.Level.WARNING;
/**
* Saves the details for a OneToMany or ManyToMany relationship (entity beans).
@@ -309,11 +310,11 @@ final class SaveManyBeans extends SaveManyBase {
EntityBean otherBean = (EntityBean) other;
// the object from the 'other' side of the ManyToMany
if (deletions != null && deletions.remove(otherBean)) {
String m = "Inserting and Deleting same object? " + otherBean;
String msg = "Inserting and Deleting same object? " + otherBean;
if (transaction.isLogSummary()) {
transaction.logSummary(m);
transaction.logSummary(msg);
}
CoreLog.log.log(System.Logger.Level.WARNING, m);
CoreLog.log.log(WARNING, msg);
} else {
if (!many.hasImportedId(otherBean)) {
throw new PersistenceException("ManyToMany bean does not have an Id value? " + otherBean);
@@ -8,6 +8,7 @@ import io.ebeaninternal.api.SpiQuery;
import io.ebeaninternal.server.core.OrmQueryRequest;
import io.ebeaninternal.server.deploy.BeanDescriptor;
import io.ebeaninternal.server.querydefn.OrmQueryLimitRequest;
import io.ebeaninternal.server.querydefn.OrmQueryProperties;
import io.ebeaninternal.server.rawsql.SpiRawSql;
import io.ebeaninternal.server.util.BindParamsParser;
@@ -56,7 +57,19 @@ final class CQueryBuilderRawSql {
private String buildMainQuery(String orderBy, OrmQueryRequest<?> request, CQueryPredicates predicates, SpiRawSql.Sql sql) {
StringBuilder sb = new StringBuilder();
sb.append(sql.getPreFrom());
OrmQueryProperties ormQueryProperties = request.query().getDetail().getChunk(null, false);
if (ormQueryProperties.hasSelectClause()) {
boolean first = true;
for (String selectProperty : ormQueryProperties.getIncluded()) {
if (!first) {
sb.append(", ");
}
sb.append(selectProperty);
first = false;
}
} else {
sb.append(sql.getPreFrom());
}
sb.append(" ");
String s = sql.getPreWhere();
@@ -591,10 +591,17 @@ public class DefaultOrmQuery<T> extends AbstractQuery implements SpiQuery<T> {
*/
@Override
public final void setSelectId() {
// clear select and fetch joins
detail.clear();
select(beanDescriptor.idSelect());
singleAttribute = true;
if (rawSql != null) {
String column = rawSql.mapToColumn(beanDescriptor.idSelect());
if (column != null) {
select(column);
}
} else {
// clear select and fetch joins
detail.clear();
select(beanDescriptor.idSelect());
singleAttribute = true;
}
}
@Override
@@ -60,4 +60,8 @@ public final class DRawSql implements SpiRawSql {
return columnMapping;
}
@Override
public String mapToColumn(String property) {
return columnMapping.mapToColumn(property);
}
}
@@ -5,13 +5,7 @@ import io.ebean.util.CamelCaseHelper;
import java.io.Serializable;
import java.sql.ResultSet;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.*;
/**
* Internal service API for Raw Sql.
@@ -31,6 +25,7 @@ public interface SpiRawSql extends RawSql {
SpiRawSql.ColumnMapping getColumnMapping();
String mapToColumn(String property);
/**
* Represents the sql part of the query. For parsed RawSql the sql is broken
@@ -363,7 +358,6 @@ public interface SpiRawSql extends RawSql {
* </p>
*/
public void tableAliasMapping(String tableAlias, String path) {
String startMatch = tableAlias + ".";
for (Map.Entry<String, Column> entry : dbColumnMap.entrySet()) {
if (entry.getKey().startsWith(startMatch)) {
@@ -372,6 +366,11 @@ public interface SpiRawSql extends RawSql {
}
}
public String mapToColumn(String property) {
final var column = propertyColumnMap.get(property);
return column == null ? null : column.getDbColumn();
}
/**
* A Column of the RawSql that is mapped to a bean property (or ignored).
*/
@@ -24,7 +24,7 @@ public class BeanDescriptor_registerTest {
config.setDdlExtra(false);
config.setRegister(false);
config.setDefaultServer(false);
config.getClasses().add(EBasic.class);
config.addClass(EBasic.class);
SpiEbeanServer ebeanServer = (SpiEbeanServer)DatabaseFactory.create(config);
try {
+4 -4
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.13.2</version>
<version>13.15.2</version>
</parent>
<artifactId>ebean-csv-reader</artifactId>
@@ -14,21 +14,21 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>test</scope>
</dependency>
+4 -4
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.13.2</version>
<version>13.15.2</version>
</parent>
<name>ebean ddl generation</name>
@@ -28,14 +28,14 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core-type</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>provided</scope>
</dependency>
@@ -72,7 +72,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-all</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>test</scope>
</dependency>
+1 -1
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.13.2</version>
<version>13.15.2</version>
</parent>
<name>ebean external mapping api</name>
+5 -5
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.13.2</version>
<version>13.15.2</version>
</parent>
<scm>
@@ -21,7 +21,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-externalmapping-api</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<!-- JAVAX-DEPENDENCY-START -->
@@ -68,21 +68,21 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-h2</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-ddl-generator</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>test</scope>
</dependency>
+2 -2
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.13.2</version>
<version>13.15.2</version>
</parent>
<artifactId>ebean-jackson-jsonnode</artifactId>
@@ -14,7 +14,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core-type</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>provided</scope>
</dependency>
+2 -2
View File
@@ -3,7 +3,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.13.2</version>
<version>13.15.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -14,7 +14,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core-type</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>provided</scope>
</dependency>
+2 -2
View File
@@ -3,7 +3,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.13.2</version>
<version>13.15.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -14,7 +14,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core-type</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>provided</scope>
</dependency>
+3 -3
View File
@@ -6,7 +6,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.13.2</version>
<version>13.15.2</version>
</parent>
<artifactId>ebean-kotlin</artifactId>
@@ -28,7 +28,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>provided</scope>
</dependency>
@@ -50,7 +50,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>test</scope>
</dependency>
+4 -4
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.13.2</version>
<version>13.15.2</version>
</parent>
<name>ebean postgis</name>
@@ -22,14 +22,14 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<!-- provided scope -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>provided</scope>
</dependency>
@@ -65,7 +65,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>test</scope>
</dependency>
+7 -7
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.13.2</version>
<version>13.15.2</version>
</parent>
<name>ebean querybean</name>
@@ -17,7 +17,7 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>provided</scope>
</dependency>
@@ -63,21 +63,21 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-ddl-generator</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>querybean-generator</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>test</scope>
</dependency>
@@ -103,11 +103,11 @@
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.24</version>
<version>2.34</version>
<extensions>true</extensions>
<configuration>
<tiles>
<tile>io.ebean.tile:enhancement:13.13.1</tile>
<tile>io.ebean.tile:enhancement:13.13.2</tile>
</tiles>
</configuration>
</plugin>
@@ -0,0 +1,162 @@
package io.ebean.typequery;
import io.avaje.lang.Nullable;
import java.util.Collection;
/**
* Base type for associated beans.
*
* @param <T> the entity bean type (normal entity bean type e.g. Customer)
* @param <R> the specific root query bean type (e.g. QCustomer)
*/
public abstract class TQAssoc<T, R> extends TQProperty<R, Object> {
/**
* Construct with a property name and root instance.
*
* @param name the name of the property
* @param root the root query bean instance
*/
public TQAssoc(String name, R root) {
this(name, root, null);
}
/**
* Construct with additional path prefix.
*/
public TQAssoc(String name, R root, String prefix) {
super(name, root, prefix);
}
/**
* Is equal to by ID property.
*/
public final R eq(T other) {
expr().eq(_name, other);
return _root;
}
/**
* Is EQUAL TO if value is non-null and otherwise no expression is added to the query.
* <p>
* This is effectively a helper method that allows a query to be built in fluid style where some predicates are
* effectively optional. We can use <code>eqIfPresent()</code> rather than having a separate if block.
*/
public final R eqIfPresent(@Nullable T other) {
expr().eqIfPresent(_name, other);
return _root;
}
/**
* Is equal to by ID property.
*/
public final R equalTo(T other) {
return eq(other);
}
/**
* Is not equal to by ID property.
*/
public final R ne(T other) {
expr().ne(_name, other);
return _root;
}
/**
* Is not equal to by ID property.
*/
public final R notEqualTo(T other) {
return ne(other);
}
/**
* Is in a list of values.
*
* @param values the list of values for the predicate
* @return the root query bean instance
*/
@SafeVarargs
public final R in(T... values) {
expr().in(_name, (Object[]) values);
return _root;
}
/**
* Is in a list of values.
*
* @param values the list of values for the predicate
* @return the root query bean instance
*/
public final R in(Collection<T> values) {
expr().in(_name, values);
return _root;
}
/**
* In where null or empty values means that no predicate is added to the query.
* <p>
* That is, only add the IN predicate if the values are not null or empty.
* <p>
* Without this we typically need to code an <code>if</code> block to only add
* the IN predicate if the collection is not empty like:
* </p>
*
* <h3>Without inOrEmpty()</h3>
* <pre>{@code
*
* List<String> names = Arrays.asList("foo", "bar");
*
* QCustomer query = new QCustomer()
* .registered.before(LocalDate.now())
*
* // conditionally add the IN expression to the query
* if (names != null && !names.isEmpty()) {
* query.name.in(names)
* }
*
* query.findList();
*
* }</pre>
*
* <h3>Using inOrEmpty()</h3>
* <pre>{@code
*
* List<String> names = Arrays.asList("foo", "bar");
*
* new QCustomer()
* .registered.before(LocalDate.now())
* .name.inOrEmpty(names)
* .findList();
*
* }</pre>
*/
public final R inOrEmpty(Collection<T> values) {
expr().inOrEmpty(_name, values);
return _root;
}
/**
* Is NOT in a list of values.
*
* @param values the list of values for the predicate
* @return the root query bean instance
*/
public final R notIn(Collection<T> values) {
expr().notIn(_name, values);
return _root;
}
/**
* Is NOT in a list of values.
*
* @param values the list of values for the predicate
* @return the root query bean instance
*/
@SafeVarargs
public final R notIn(T... values) {
expr().notIn(_name, (Object[]) values);
return _root;
}
}
@@ -1,6 +1,5 @@
package io.ebean.typequery;
import io.avaje.lang.Nullable;
import io.ebean.ExpressionList;
import io.ebean.FetchConfig;
import io.ebean.FetchGroup;
@@ -8,18 +7,18 @@ import io.ebeaninternal.api.SpiQueryFetch;
import io.ebeaninternal.server.querydefn.OrmQueryDetail;
import io.ebeaninternal.server.querydefn.SpiFetchGroup;
import java.util.Collection;
import java.util.LinkedHashSet;
import java.util.Set;
/**
* Base type for associated beans.
* Base type for associated beans that are not embeddable.
*
* @param <T> the entity bean type (normal entity bean type e.g. Customer)
* @param <R> the specific root query bean type (e.g. QCustomer)
* @param <QB> the query bean type
*/
@SuppressWarnings("rawtypes")
public abstract class TQAssocBean<T, R> extends TQProperty<R, Object> {
public abstract class TQAssocBean<T, R, QB> extends TQAssoc<T, R> {
private static final FetchConfig FETCH_DEFAULT = FetchConfig.ofDefault();
private static final FetchConfig FETCH_QUERY = FetchConfig.ofQuery();
@@ -110,38 +109,37 @@ public abstract class TQAssocBean<T, R> extends TQProperty<R, Object> {
}
/**
* Eagerly fetch this association fetching some of the properties.
* Eagerly fetch this association loading the specified properties.
*/
@SafeVarargs
protected final R fetchProperties(TQProperty<?, ?>... props) {
return fetchWithProperties(FETCH_DEFAULT, props);
@SafeVarargs @SuppressWarnings("varargs")
public final R fetch(TQProperty<QB,?>... properties) {
return fetchWithProperties(FETCH_DEFAULT, properties);
}
/**
* Eagerly fetch query this association fetching some of the properties.
* Eagerly fetch this association using a 'query join' loading the specified properties.
*/
@SafeVarargs
protected final R fetchQueryProperties(TQProperty<?, ?>... props) {
return fetchWithProperties(FETCH_QUERY, props);
@SafeVarargs @SuppressWarnings("varargs")
public final R fetchQuery(TQProperty<QB,?>... properties) {
return fetchWithProperties(FETCH_QUERY, properties);
}
/**
* Eagerly fetch this association using L2 bean cache.
* Eagerly fetch this association using L2 cache.
*/
@SafeVarargs
protected final R fetchCacheProperties(TQProperty<?, ?>... props) {
return fetchWithProperties(FETCH_CACHE, props);
@SafeVarargs @SuppressWarnings("varargs")
public final R fetchCache(TQProperty<QB,?>... properties) {
return fetchWithProperties(FETCH_CACHE, properties);
}
/**
* Eagerly fetch query this association fetching some of the properties.
* Use lazy loading for this association loading the specified properties.
*/
@SafeVarargs
protected final R fetchLazyProperties(TQProperty<?, ?>... props) {
return fetchWithProperties(FETCH_LAZY, props);
@SafeVarargs @SuppressWarnings("varargs")
public final R fetchLazy(TQProperty<QB,?>... properties) {
return fetchWithProperties(FETCH_LAZY, properties);
}
@SafeVarargs
private R fetchWithProperties(FetchConfig config, TQProperty<?, ?>... props) {
spiQuery().fetchProperties(_name, properties(props), config);
return _root;
@@ -178,7 +176,6 @@ public abstract class TQAssocBean<T, R> extends TQProperty<R, Object> {
return (SpiQueryFetch) ((TQRootBean) _root).query();
}
@SafeVarargs
private Set<String> properties(TQProperty<?, ?>... props) {
Set<String> set = new LinkedHashSet<>();
for (TQProperty<?, ?> prop : props) {
@@ -187,135 +184,6 @@ public abstract class TQAssocBean<T, R> extends TQProperty<R, Object> {
return set;
}
/**
* Is equal to by ID property.
*/
public final R eq(T other) {
expr().eq(_name, other);
return _root;
}
/**
* Is EQUAL TO if value is non-null and otherwise no expression is added to the query.
* <p>
* This is effectively a helper method that allows a query to be built in fluid style where some predicates are
* effectively optional. We can use <code>eqIfPresent()</code> rather than having a separate if block.
*/
public final R eqIfPresent(@Nullable T other) {
expr().eqIfPresent(_name, other);
return _root;
}
/**
* Is equal to by ID property.
*/
public final R equalTo(T other) {
return eq(other);
}
/**
* Is not equal to by ID property.
*/
public final R ne(T other) {
expr().ne(_name, other);
return _root;
}
/**
* Is not equal to by ID property.
*/
public final R notEqualTo(T other) {
return ne(other);
}
/**
* Is in a list of values.
*
* @param values the list of values for the predicate
* @return the root query bean instance
*/
@SafeVarargs
public final R in(T... values) {
expr().in(_name, (Object[]) values);
return _root;
}
/**
* Is in a list of values.
*
* @param values the list of values for the predicate
* @return the root query bean instance
*/
public final R in(Collection<T> values) {
expr().in(_name, values);
return _root;
}
/**
* In where null or empty values means that no predicate is added to the query.
* <p>
* That is, only add the IN predicate if the values are not null or empty.
* <p>
* Without this we typically need to code an <code>if</code> block to only add
* the IN predicate if the collection is not empty like:
* </p>
*
* <h3>Without inOrEmpty()</h3>
* <pre>{@code
*
* List<String> names = Arrays.asList("foo", "bar");
*
* QCustomer query = new QCustomer()
* .registered.before(LocalDate.now())
*
* // conditionally add the IN expression to the query
* if (names != null && !names.isEmpty()) {
* query.name.in(names)
* }
*
* query.findList();
*
* }</pre>
*
* <h3>Using inOrEmpty()</h3>
* <pre>{@code
*
* List<String> names = Arrays.asList("foo", "bar");
*
* new QCustomer()
* .registered.before(LocalDate.now())
* .name.inOrEmpty(names)
* .findList();
*
* }</pre>
*/
public final R inOrEmpty(Collection<T> values) {
expr().inOrEmpty(_name, values);
return _root;
}
/**
* Is NOT in a list of values.
*
* @param values the list of values for the predicate
* @return the root query bean instance
*/
public final R notIn(Collection<T> values) {
expr().notIn(_name, values);
return _root;
}
/**
* Is NOT in a list of values.
*
* @param values the list of values for the predicate
* @return the root query bean instance
*/
@SafeVarargs
public final R notIn(T... values) {
expr().notIn(_name, (Object[]) values);
return _root;
}
/**
* Apply a filter when fetching these beans.
@@ -2,15 +2,22 @@ package org.example.domain;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
@Inheritance
@DiscriminatorValue("CAT")
@Entity
public class ACat extends Animal {
private String catProp;
public ACat(String name) {
super(name);
}
public String getCatProp() {
return catProp;
}
public void setCatProp(String catProp) {
this.catProp = catProp;
}
}
@@ -0,0 +1,23 @@
package org.example.domain;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
@DiscriminatorValue("SCAT")
@Entity
public class ASuperCat extends ACat {
private String superCat;
public ASuperCat(String name) {
super(name);
}
public String getSuperCat() {
return superCat;
}
public void setSuperCat(String superCat) {
this.superCat = superCat;
}
}
@@ -0,0 +1,54 @@
package org.querytest;
import org.example.domain.ACat;
import org.example.domain.ADog;
import org.example.domain.Animal;
import org.example.domain.query.QACat;
import org.example.domain.query.QASuperCat;
import org.example.domain.query.QAnimal;
import org.junit.jupiter.api.Test;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
class InheritanceTest {
@Test
void query_setInheritType() {
ACat cat = new ACat("C1");
cat.save();
ACat cat2 = new ACat("C2");
cat2.save();
ADog dog = new ADog("D1", "D878");
dog.save();
List<Animal> animals = new QAnimal()
.id.greaterOrEqualTo(1L)
.setInheritType(ACat.class)
.findList();
assertThat(animals).isNotEmpty();
}
@Test
void query_onInheritedProperty() {
new QACat()
.name.eq("foo")
.catProp.eq("foo")
.findList();
}
@Test
void query_onInheritedProperty_whenParentOnlyHasDiscriminator() {
// the .name and .catProp properties exist on QASuperCat()
new QASuperCat()
.superCat.eq("foo")
.name.eq("foo")
.catProp.eq("foo")
.findList();
}
}
@@ -591,25 +591,7 @@ public class QCustomerTest {
.findList();
}
@Test
public void query_setInheritType() {
ACat cat = new ACat("C1");
cat.save();
ACat cat2 = new ACat("C2");
cat2.save();
ADog dog = new ADog("D1", "D878");
dog.save();
List<Animal> animals = new QAnimal()
.id.greaterOrEqualTo(1L)
.setInheritType(ACat.class)
.findList();
System.out.println(animals);
}
@Test
public void select_assocManyToOne() {
+6 -6
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.13.2</version>
<version>13.15.2</version>
</parent>
<artifactId>ebean-redis</artifactId>
@@ -22,35 +22,35 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>querybean-generator</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>test</scope>
</dependency>
+13
View File
@@ -0,0 +1,13 @@
# editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
spaces_around_operators = true
max_line_length = 130
+9
View File
@@ -0,0 +1,9 @@
*.sql
.classpath
.project
.settings/
target/
logs/
.idea/
*.iml
+201
View File
@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2012 Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+45
View File
@@ -0,0 +1,45 @@
[![Maven Central : ebean](https://maven-badges.herokuapp.com/maven-central/io.ebean/ebean-spring-txn/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.ebean/ebean-spring-txn)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/ebean-orm/ebean-spring-txn/blob/master/LICENSE)
ebean-spring-txn
=====================
Integration with Spring managed transactions.
This project provides an Ebean `ExternalTransactionManager` specifically
to integrate with Springs JDBC Transaction manager.
## To use
```java
DatabaseConfig config = new DatabaseConfig();
// set SpringJdbcTransactionManager ... as the external transaction manager
config.setExternalTransactionManager(new SpringJdbcTransactionManager());
...
Database database = DatabaseFactory.create(config);
```
## Notes
You can use Ebean in Spring/Spring Boot *without* this and that case Ebean
manages the Transactions itself. With Ebean managing the transactions there
are some benefits with more control over JDBC batch, getGeneratedKeys
and a simpler abstraction (as Spring transactions is designed to manage
multiple resources such as JDBC Transactions and JPA EntityManager and Ebean
only needs to manage JDBC Transactions).
## Java modules
Add `requires io.ebean.spring.txn` to module-info.
```java
module foo {
requires io.ebean.spring.txn;
...
}
```
+117
View File
@@ -0,0 +1,117 @@
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.15.2</version>
</parent>
<artifactId>ebean-spring-txn</artifactId>
<name>ebean-spring-txn</name>
<description>Ebean support for Spring transactions</description>
<properties>
<spring.framework.version>5.3.25</spring.framework.version>
<spring.boot.version>2.7.3</spring.boot.version>
<surefire.useModulePath>false</surefire.useModulePath>
</properties>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.32</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.15.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.14.1</version>
<scope>test</scope>
</dependency>
<!-- Provided: Spring, Spring Boot -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.framework.version}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.framework.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test</artifactId>
<version>${spring.boot.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-test</artifactId>
<version>13.15.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.avaje</groupId>
<artifactId>junit</artifactId>
<version>1.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>2.0.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:13.14.0</tile>
</tiles>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -0,0 +1,20 @@
package io.ebean.spring.txn;
import io.ebeaninternal.server.transaction.ExternalJdbcTransaction;
import io.ebeaninternal.server.transaction.TransactionManager;
import org.springframework.jdbc.datasource.ConnectionHolder;
final class SpringJdbcTransaction extends ExternalJdbcTransaction {
private final ConnectionHolder holder;
SpringJdbcTransaction(ConnectionHolder holder, TransactionManager manager) {
super(true, holder.getConnection(), manager);
this.holder = holder;
}
@Override
public boolean isActive() {
return holder.isSynchronizedWithTransaction();
}
}
@@ -0,0 +1,166 @@
package io.ebean.spring.txn;
import io.avaje.applog.AppLog;
import io.ebean.TxScope;
import io.ebean.config.ExternalTransactionManager;
import io.ebeaninternal.api.SpiTransaction;
import io.ebeaninternal.server.transaction.TransactionManager;
import org.springframework.jdbc.datasource.ConnectionHolder;
import org.springframework.transaction.support.TransactionSynchronization;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import javax.persistence.PersistenceException;
import javax.sql.DataSource;
import java.util.List;
import static java.lang.System.Logger.Level.DEBUG;
/**
* A Spring-aware {@link ExternalTransactionManager}.
* <p>
* Will look for Spring transactions and use them if they exist.
*
* @author E Mc Greal
* @since 18.05.2009
*/
public final class SpringJdbcTransactionManager implements ExternalTransactionManager {
private static final System.Logger log = AppLog.getLogger(SpringJdbcTransactionManager.class);
private DataSource dataSource;
private TransactionManager transactionManager;
/**
* Instantiates a new spring aware transaction scope manager.
*/
public SpringJdbcTransactionManager() {
}
/**
* Initialise this with the Ebean internal transaction manager.
*/
@Override
public void setTransactionManager(Object txnMgr) {
// RB: At this stage not exposing TransactionManager to
// the public API and hence the Object type and casting here
this.transactionManager = (TransactionManager) txnMgr;
this.dataSource = transactionManager.dataSource();
}
/**
* Looks for a current Spring managed transaction and wraps/returns that as a Ebean transaction.
* <p>
* Returns null if there is no current spring transaction (lazy loading outside a spring txn).
*/
@Override
public Object getCurrentTransaction() {
// Get the current Spring ConnectionHolder associated to the current spring managed transaction
ConnectionHolder holder = (ConnectionHolder) TransactionSynchronizationManager.getResource(dataSource);
if (holder == null || !holder.isSynchronizedWithTransaction()) {
// no current Spring transaction
SpiTransaction currentEbeanTransaction = transactionManager.inScope();
if (currentEbeanTransaction == null || !currentEbeanTransaction.isActive()) {
return null;
} else {
return currentEbeanTransaction;
}
}
SpringTxnListener springTxnLister = listener();
if (springTxnLister != null) {
// we have already seen this transaction
return springTxnLister.transaction();
} else {
// This is a new spring transaction that we have not seen before.
// "wrap" it in a SpringJdbcTransaction for use with Ebean
SpringJdbcTransaction newTrans = new SpringJdbcTransaction(holder, transactionManager);
// Create and register a Spring TransactionSynchronization for this transaction
springTxnLister = createListener(newTrans);
TransactionSynchronizationManager.registerSynchronization(springTxnLister);
return transactionManager.externalBeginTransaction(newTrans, TxScope.required());
}
}
/**
* Search for our specific transaction listener.
* <p>
* If it exists then we have already seen and "wrapped" this transaction.
*/
private SpringTxnListener listener() {
if (TransactionSynchronizationManager.isSynchronizationActive()) {
List<TransactionSynchronization> synchronizations = TransactionSynchronizationManager.getSynchronizations();
// search for our specific listener
for (TransactionSynchronization synchronization : synchronizations) {
if (synchronization instanceof SpringTxnListener) {
return (SpringTxnListener) synchronization;
}
}
}
return null;
}
/**
* Create a listener to enable Ebean to be notified when transactions commit and rollback.
*/
private SpringTxnListener createListener(SpringJdbcTransaction transaction) {
return new SpringTxnListener(transactionManager, transaction);
}
/**
* A Spring TransactionSynchronization that we register with Spring to get notified when
* a Spring managed transaction has been committed or rolled back.
* <p>
* When Ebean is notified (of the commit/rollback) it can then manage its cache, notify
* BeanPersistListeners etc.
*/
private static class SpringTxnListener implements TransactionSynchronization {
private final TransactionManager transactionManager;
private final SpringJdbcTransaction transaction;
private SpringTxnListener(TransactionManager transactionManager, SpringJdbcTransaction t) {
this.transactionManager = transactionManager;
this.transaction = t;
}
private SpringJdbcTransaction transaction() {
return transaction;
}
@Override
public void flush() {
transaction.flush();
}
@Override
public void beforeCommit(boolean readOnly) {
if (!readOnly) {
transaction.preCommit();
}
}
@Override
public void afterCompletion(int status) {
switch (status) {
case STATUS_COMMITTED:
log.log(DEBUG, "Spring Txn [{0}] committed", transaction.getId());
transaction.postCommit();
break;
case STATUS_ROLLED_BACK:
log.log(DEBUG, "Spring Txn [{0}] rollback", transaction.getId());
transaction.postRollback(null);
break;
default:
// this should never happen
throw new PersistenceException("Invalid status " + status);
}
// Remove this transaction object as it is completed
transactionManager.externalRemoveTransaction();
}
}
}
@@ -0,0 +1,9 @@
module io.ebean.spring.txn {
exports io.ebean.spring.txn;
requires io.ebean.api;
requires io.ebean.core;
requires spring.jdbc;
requires spring.tx;
}
@@ -0,0 +1,33 @@
package org.example;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Table;
@Table(name="o_account")
@Entity
public class Account {
@Id
private Long id;
@OneToOne
private User user;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
}
@@ -0,0 +1,67 @@
package org.example;
import io.ebean.Database;
import io.ebean.DatabaseFactory;
import io.ebean.annotation.PersistBatch;
import io.ebean.config.DatabaseConfig;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;
/**
* A Spring FactoryBean for constructing EbeanServer instances.
*
* @since 18.05.2009
* @author E Mc Greal
*/
public class EbeanServerFactoryBean implements InitializingBean, FactoryBean<Database> {
/**
* The Ebean server configuration.
*/
private DatabaseConfig serverConfig;
/**
* The EbeanServer instance.
*/
private Database ebeanServer;
public void afterPropertiesSet() throws Exception {
if (serverConfig == null) {
throw new Exception("No ServerConig set. You must define a ServerConfig bean");
}
serverConfig.setPersistBatch(PersistBatch.ALL);
// Create the new EbeanServer using the configuration
this.ebeanServer = DatabaseFactory.create(serverConfig);
}
public Database getObject() throws Exception {
return ebeanServer;
}
public Class<? extends Database> getObjectType() {
return Database.class;
}
/**
* Returns true for EbeanServer.
*/
public boolean isSingleton() {
return true;
}
/**
* Return the server configuration.
*/
public DatabaseConfig getServerConfig() {
return serverConfig;
}
/**
* Set the server configuration.
*/
public void setServerConfig(DatabaseConfig serverConfig) {
this.serverConfig = serverConfig;
}
}
@@ -0,0 +1,134 @@
package org.example;
import io.ebean.DB;
import io.ebean.Transaction;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
/**
* Unit test for Ebean Spring Module.
*
* @author E Mc Greal
* @since 18.05.2009
*/
@ExtendWith(SpringExtension.class)
@ContextConfiguration(locations = {"/init-database.xml"})
public class EbeanSpringModuleTest {
/**
* The Constant logger.
*/
private final static Logger logger = LoggerFactory.getLogger(EbeanSpringModuleTest.class);
/**
* The user service.
*/
@Autowired
private UserService userService;
/**
* Create the test case.
*/
public EbeanSpringModuleTest() {
super();
}
/**
* Test app.
*/
@Test
public void testInactiveTransaction() {
Transaction transaction = DB.beginTransaction();
long id;
try {
User user = new User();
user.setName("save with txn 1");
DB.save(user);
transaction.commit();
id = user.getOid();
} finally {
// don't end the transaction ...
//transaction.end();
}
DB.delete(User.class, id);
}
@Test
public void testBatchInsert() {
userService.batchInsert();
}
@Test
public void testRequiresNew() {
userService.requiresNew();
}
/**
* Test app.
*/
@Test
public void testSaveUser() {
logger.info("Saving new User...");
User user = new User();
user.setName("ebean");
userService.save(user);
logger.info("Saved new User");
assertThat(user.getOid()).isGreaterThan(0);
final User found = DB.find(User.class, user.getOid());
assertThat(found).isNotNull();
}
/**
* Test app.
*/
@Test
public void testFindUser() {
logger.info("Finding User with OID = 1 ...");
User user = userService.find(1);
assertNotNull(user);
assertTrue("ebean".equals(user.getName()));
logger.info("Found User with OID = 1");
}
@Test
public void testNonTransactional() {
userService.nonTransactional();
logger.info("nonTransactional done");
}
@Test
public void testFindNonTransactional() {
logger.info("Finding User with OID = 1 ...");
User user = userService.find(1);
User user2 = userService.findNoCurrentTransaction(2);
logger.info("nonTransactional find user1:{} user2:{}", user, user2);
}
/**
* Return the user service.
*/
public UserService getUserService() {
return userService;
}
/**
* Sets the user service.
*/
public void setUserService(UserService userService) {
this.userService = userService;
}
}
@@ -0,0 +1,34 @@
package org.example;
import java.util.Set;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
@Table(name="o_role")
@Entity
public class Role {
@Id
Long id;
@ManyToMany
private Set<User> users;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Set<User> getUsers() {
return users;
}
public void setUsers(Set<User> users) {
this.users = users;
}
}
@@ -0,0 +1,59 @@
package org.example;
import io.ebean.Model;
import javax.persistence.*;
import java.util.Set;
@Table(name="o_user")
@Entity
public class User extends Model {
@Id
long oid;
private String name;
@ManyToMany
private Set<Role> roles;
@OneToOne(mappedBy = "user")
private Account account;
public String toString() {
return "{user:" + oid + " name:" + name + "}";
}
public long getOid() {
return oid;
}
public void setOid(long oid) {
this.oid = oid;
}
public Set<Role> getRoles() {
return roles;
}
public void setRoles(Set<Role> roles) {
this.roles = roles;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Account getAccount() {
return account;
}
public void setAccount(Account account) {
this.account = account;
}
}
@@ -0,0 +1,19 @@
package org.example;
/**
* The Interface UserService.
*/
public interface UserService {
void save(User user);
User find(long id);
User findNoCurrentTransaction(long id);
void nonTransactional();
void batchInsert();
void requiresNew();
}
@@ -0,0 +1,98 @@
package org.example;
import io.ebean.Database;
import io.ebean.Transaction;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
/**
* The Class UserServiceImpl.
*
* @author E Mc Greal
* @since 18.05.2009
*/
public class UserServiceImpl implements UserService, ApplicationContextAware {
private ApplicationContext applicationContext;
/**
* The ebean server.
*/
@Autowired
private Database ebeanServer;
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
public void save(User user) {
ebeanServer.save(user);
}
@Transactional(readOnly = true, propagation = Propagation.REQUIRED)
public User find(long id) {
return ebeanServer.find(User.class, id);
}
public void nonTransactional() {
ebeanServer.currentTransaction();
}
public User findNoCurrentTransaction(long id) {
return ebeanServer.find(User.class, id);
}
@Transactional(propagation = Propagation.REQUIRED)
public void batchInsert() {
List<User> users = new ArrayList<>();
for (int i = 0; i < 25; i++) {
User user = new User();
user.setName("user" + i);
users.add(user);
}
System.out.println("---------before batch-------");
Transaction tx = ebeanServer.currentTransaction();
tx.setBatchSize(20);
ebeanServer.saveAll(users);
System.out.println("---------after batch-------");
applicationContext.getBean(UserService.class).requiresNew();
}
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void requiresNew() {
User user = new User();
user.setName("user_x0");
user.insert();
//ebeanServer.save(user);
}
/**
* Return the ebean server.
*/
public Database getEbeanServer() {
return ebeanServer;
}
/**
* Sets the ebean server.
*/
public void setEbeanServer(Database ebeanServer) {
this.ebeanServer = ebeanServer;
}
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
this.applicationContext = applicationContext;
}
}
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd">
<!-- Default abstract Ebean Server configuration -->
<bean id="defaultEbeanServerConfig" class="io.ebean.config.DatabaseConfig" abstract="true">
<property name="externalTransactionManager">
<bean class="io.ebean.spring.txn.SpringJdbcTransactionManager"/>
</property>
<property name="namingConvention">
<bean class="io.ebean.config.UnderscoreNamingConvention"/>
</property>
</bean>
</beans>
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd">
<import resource="classpath:default-ebean-server.xml"/>
<!-- Transaktionen via Annotation use Springs @Transactional -->
<tx:annotation-driven transaction-manager="transactionManager" />
<context:annotation-config />
<bean id="dataSource" class="org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy">
<constructor-arg>
<bean class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
<property name="driverClass" value="org.h2.Driver" />
<property name="url"
value="jdbc:h2:mem:ebean-testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=false" />
</bean>
</constructor-arg>
</bean>
<!-- Transaction Manager -->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<bean id="serverConfig" parent="defaultEbeanServerConfig">
<property name="name" value="test"/>
<property name="classes">
<list>
<value>org.example.User</value>
<value>org.example.Role</value>
<value>org.example.Account</value>
</list>
</property>
<property name="dataSource" ref="dataSource"/>
<property name="ddlGenerate" value="true"/>
<property name="ddlRun" value="true"/>
</bean>
<!-- Ebean server -->
<bean id="ebeanServer" class="org.example.EbeanServerFactoryBean">
<property name="serverConfig" ref="serverConfig"/>
</bean>
<bean id="userService" class="org.example.UserServiceImpl">
<property name="ebeanServer" ref="ebeanServer"/>
</bean>
</beans>
@@ -0,0 +1,29 @@
<configuration scan="true" scanPeriod="10 seconds">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="STDOUT"/>
</root>
<logger name="io.ebean" level="INFO"/>
<!-- sql and transaction logging -->
<logger name="io.ebean.SQL" level="TRACE"/>
<logger name="io.ebean.TXN" level="TRACE"/>
<logger name="io.ebean.SUM" level="TRACE"/>
<logger name="io.ebean.DDL" level="TRACE"/>
<!-- l2 cache logging -->
<logger name="io.ebean.cache.QUERY" level="TRACE"/>
<logger name="io.ebean.cache.BEAN" level="TRACE"/>
<logger name="io.ebean.cache.COLL" level="TRACE"/>
<logger name="io.ebean.cache.NATKEY" level="TRACE"/>
<!-- elasticSearch query logging -->
<!--<logger name="io.ebean.ELA" level="TRACE"/>-->
</configuration>
+8 -8
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.13.2</version>
<version>13.15.2</version>
</parent>
<name>ebean test</name>
@@ -28,20 +28,20 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-h2</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-ddl-generator</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
</dependency>
<dependency>
@@ -118,28 +118,28 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-joda-time</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-jackson-jsonnode</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-jackson-mapper</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-all</artifactId>
<version>13.13.2</version>
<version>13.15.2</version>
<scope>test</scope>
</dependency>
@@ -111,8 +111,8 @@ public class PlatformNoGeneratedKeysTest {
config.setRegister(false);
config.setDdlGenerate(true);
config.setDdlRun(true);
config.getClasses().add(EBasicVer.class);
config.getClasses().add(BasicDraftableBean.class);
config.addClass(EBasicVer.class);
config.addClass(BasicDraftableBean.class);
config.loadFromProperties(); // trigger auto config for H2 1.x
return DatabaseFactory.create(config);
@@ -3,9 +3,9 @@ package io.ebean.xtest.config;
import io.ebean.Database;
import io.ebean.DatabaseFactory;
import io.ebean.xtest.ForPlatform;
import io.ebean.annotation.Platform;
import io.ebean.config.DatabaseConfig;
import io.ebean.xtest.ForPlatform;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.tests.model.basic.EBasicVer;
@@ -36,7 +36,7 @@ public class ServerConfigSqlServerTest {
config.setDefaultServer(false);
config.setRegister(false);
config.getClasses().add(EBasicVer.class);
config.addClass(EBasicVer.class);
Database sqlServer = DatabaseFactory.create(config);
@@ -77,7 +77,7 @@ public class ServerConfigSqlServerTest {
config.setDdlGenerate(true);
config.setDdlRun(true);
config.loadFromProperties(props);
config.getClasses().add(EBasicVer.class);
config.addClass(EBasicVer.class);
Database sqlServer = DatabaseFactory.create(config);
@@ -103,7 +103,7 @@ public class ServerConfigSqlServerTest {
config.setName(name); // match dataSource
config.setDatabasePlatformName("sqlserver16");
config.loadFromProperties(props);
config.getClasses().add(EBasicVer.class);
config.addClass(EBasicVer.class);
Database sqlServer = DatabaseFactory.create(config);
@@ -1,6 +1,5 @@
package io.ebean.xtest.event;
import io.ebean.xtest.BaseTestCase;
import io.ebean.Database;
import io.ebean.DatabaseFactory;
import io.ebean.bean.BeanCollection;
@@ -8,6 +7,7 @@ import io.ebean.common.BeanList;
import io.ebean.config.DatabaseConfig;
import io.ebean.event.BeanFindController;
import io.ebean.event.BeanQueryRequest;
import io.ebean.xtest.BaseTestCase;
import org.junit.jupiter.api.Test;
import org.tests.example.ModUuidGenerator;
import org.tests.model.basic.EBasic;
@@ -37,8 +37,8 @@ public class BeanFindControllerTest extends BaseTestCase {
config.setRegister(false);
config.setDefaultServer(false);
config.add(new ModUuidGenerator());
config.getClasses().add(EBasic.class);
config.getClasses().add(ECustomId.class);
config.addClass(EBasic.class);
config.addClass(ECustomId.class);
EBasicFindController findController = new EBasicFindController();
config.getFindControllers().add(findController);
@@ -180,9 +180,9 @@ public class BeanFindControllerTest extends BaseTestCase {
config.setRegister(false);
config.setDefaultServer(false);
config.add(new ModUuidGenerator());
config.getClasses().add(FindControllerMain.class);
config.getClasses().add(SoftRefA.class);
config.getClasses().add(SoftRefB.class);
config.addClass(FindControllerMain.class);
config.addClass(SoftRefA.class);
config.addClass(SoftRefB.class);
config.getFindControllers().add(new TestBeanFindController());
@@ -4,7 +4,6 @@ package io.ebean.xtest.event;
import io.ebean.Database;
import io.ebean.DatabaseFactory;
import io.ebean.Transaction;
import io.ebean.ValuePair;
import io.ebean.config.DatabaseConfig;
import io.ebean.event.BeanDeleteIdRequest;
import io.ebean.event.BeanPersistAdapter;
@@ -14,7 +13,9 @@ import org.tests.model.basic.EBasicVer;
import org.tests.model.basic.UTDetail;
import org.tests.model.basic.UTMaster;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
@@ -148,9 +149,9 @@ public class BeanPersistControllerTest {
config.setRegister(false);
config.setDefaultServer(false);
config.getClasses().add(EBasicVer.class);
config.getClasses().add(UTMaster.class);
config.getClasses().add(UTDetail.class);
config.addClass(EBasicVer.class);
config.addClass(UTMaster.class);
config.addClass(UTDetail.class);
config.add(persistAdapter);
return DatabaseFactory.create(config);

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