Compare commits

...
579 Commits
Author SHA1 Message Date
Rob Bygrave 0128d64841 Version 14.1.0 2024-04-04 22:54:23 +13:00
Rob Bygrave 68b313f778 Update ebean-agent to 14.1.0
This version allows for removal of query bean setRoot() which is no longer needed.
2024-04-04 22:42:06 +13:00
Rob BygraveandGitHub fad32c58d8 Merge pull request #3384 from ebean-orm/feature/rename-iquerybean
Rename QueryBean interface to IQueryBean (because we want to rename TQRootBean)
2024-04-04 22:36:59 +13:00
Rob Bygrave 8f1ebdb89a Rename QueryBean interface to IQueryBean (because we want to rename TQRootBean)
We want to rename TQRootBean to QueryBean. I can't do that right now because we need to make ebean-agent aware of that first. So yes, perhaps not ideal with IQueryBean but I think it will make sense once TQRootBean is renamed to QueryBean.
2024-04-04 22:35:55 +13:00
Rob BygraveandGitHub f7703efde2 Merge pull request #3383 from ebean-orm/feature/orderById
#3379 Followup, Move orderById() to common QueryBuilder interface
2024-04-04 22:09:34 +13:00
Rob BygraveandGitHub c5ffccb649 Merge pull request #3382 from ebean-orm/fix/3381-pc-clear
Fix for #3381 - Empty OneToMany when overflowing LazyLoadBatchSize an…
2024-04-04 22:08:57 +13:00
Rob Bygrave 3e65705bf9 #3379 Followup, Move orderById() to common QueryBuilder interface
Effectively this adds it to QueryBeans (where it was missing)
2024-04-04 22:05:17 +13:00
Rob Bygrave 7469a38bbc #3375 Followup, Temporarily add back setRoot() method to allow time for IntelliJ plugin to be released
Adding this means that it will work with an old ebean-agent. It takes a few days to get a new IntelliJ plugin released and we can't wait due to wanting to release the bug fix for #3381
2024-04-04 21:53:18 +13:00
Rob Bygrave 7ea4311662 Fix for #3381 - Empty OneToMany when overflowing LazyLoadBatchSize and mixed queries
14.0.0 via #3295 introduced this bug.

 #3295 introduced a behaviour where bulk updates clear the persistence context. Now the lazy loading of a BeanCollection works with an assumption that the "parent bean" is in the persistence context (and this assumption is broken with that change for this test case). That is, the bulk update is clearing the persistence context - removing the parent bean BEFORE the lazy loading is invoked ... and that doesn't then work because the parent bean isn't in the persistence context.

 This fix means that when lazy loading many's, the parent beans are putIfAbsent into the persistence context.
2024-04-04 20:13:20 +13:00
Rob BygraveandGitHub f556e04f58 Merge pull request #3380 from ebean-orm/feature/deprecate-update-transaction
Deprecate update(transaction) and delete(transaction) - migrate to usingTransaction(transaction)
2024-04-01 20:57:58 +13:00
Rob Bygrave d9c75a60a5 Deprecate update(transaction) and delete(transaction) - migrate to usingTransaction(transaction)
Migrate to usingTransaction(transaction) to set the transaction explicitly on a delete or update query.
2024-04-01 20:35:59 +13:00
Rob BygraveandGitHub 225bec7b28 Merge pull request #3379 from ebean-orm/feature/query-builder-interface
Add QueryBuilder interface as common API for Query and QueryBean
2024-04-01 19:42:34 +13:00
Rob Bygrave da44f7e604 Add QueryBuilder interface as common API for Query and QueryBean 2024-04-01 18:58:57 +13:00
e0eda4f8be #3370 LimitOffsetPagedList add getTotalCount cache (#3373)
* #3370 LimitOffsetPagedList add getTotalCount cache

* Move totalRowCount check to inside the lock

* No change, format only on LimitOffsetPagedList

---------

Co-authored-by: Rob Bygrave <robin.bygrave@gmail.com>
2024-04-01 11:08:57 +13:00
Rob BygraveandGitHub e4e780588c Merge pull request #3378 from ebean-orm/feature/QueryBean-interface
Add QueryBean interface for query beans to implement
2024-04-01 10:59:38 +13:00
Rob Bygrave 7c8f235550 Add QueryBean interface for query beans to implement 2024-04-01 10:56:25 +13:00
Rob BygraveandGitHub 9a77ec1567 Merge pull request #3377 from ebean-orm/feature/3374
querybeans: #3374 - Add copy() method to TQRootBean
2024-04-01 09:09:24 +13:00
Rob Bygrave ff426319f5 Fix deprecated annotation for kotlin-querybean-generator 2024-04-01 09:02:13 +13:00
Rob Bygrave 7f56aff9dd Bump kotlin-querybean-generator 2024-03-31 11:49:58 +13:00
Rob Bygrave cdbdd98d36 querybeans: #3374 - Add copy() method to TQRootBean 2024-03-31 11:44:32 +13:00
Rob BygraveandGitHub 7bf030f59c Merge pull request #3376 from ebean-orm/feature/querybean-txn
Deprecate Query bean constructor that takes transaction - migrate to query.usingTransaction() instead
2024-03-31 11:38:26 +13:00
Rob Bygrave 16dca28831 Deprecate Query bean constructor that takes transaction - migrate to usingTransaction()
Migrate to query.usingTransaction() instead of the constructor that takes a transaction.
2024-03-31 11:37:32 +13:00
Rob BygraveandGitHub 678b43693d Merge pull request #3372 from ebean-orm/feature/1857-SlowQueryBindCapture
#1857 Add bind values capture for SlowQueryEvent / SlowQueryListener
2024-03-31 11:34:18 +13:00
Rob BygraveandGitHub 7ab93a0cdf Merge pull request #3375 from ebean-orm/feature/tidy-tqrootbean
Update TQRootBean with final methods, remove setRoot()
2024-03-31 11:32:54 +13:00
Rob Bygrave 951f942c73 Tidy TQRootBean constructor for alias.
Note that this requires the updated ebean-agent, where it will not longer use the setRoot() method which has now been removed.
2024-03-31 11:19:39 +13:00
Rob Bygrave cf2ec4b81d Modify TQRootBean making root final
Remove the unused setRoot() method
2024-03-31 10:02:41 +13:00
Rob Bygrave 7d1745ba53 Add final modifier to TQRootBean methods
As these are never expected to be overwritten
2024-03-31 09:57:42 +13:00
Rob BygraveandGitHub 7adbdbf532 feat: For SpringJdbcTransactionManager support using CurrentTenantProvider (#3368)
Note that this only works for Multi-Tenant PARTITION mode where the TenantId is a column on the tables (rather than schema or database multi-tenancy mode).
2024-03-26 22:45:39 +13:00
Rob Bygrave 40d9c88e34 #1857 Add bind values capture for SlowQueryEvent / SlowQueryListener
- changes SqlQueryEvent into an interface.
- captures the bind values the slow query used and makes those available via SlowQueryEvent
- also makes the query label and profileLocation available via SlowQueryEvent
2024-03-25 22:52:04 +13:00
Rob Bygrave ab45ad34e0 Version 14.0.2 2024-03-21 22:07:12 +13:00
Rob Bygrave 24b514f851 Bump ebean-agent, no effective change 2024-03-21 21:55:02 +13:00
Rob BygraveandGitHub 582fec7ce4 For #3363 disable flushOnQuery before BeanPersistAdapter post-processors (#3367) 2024-03-21 21:51:10 +13:00
Rob BygraveandGitHub 0b11c541c8 fix: #3142 Cascading a OneToMany, set the relationship when the child isn't new or dirty (#3366)
That is, previously the relationship back from the child to the parent was being updated when the child bean was new or dirty BUT NOT in the case when the child bean was loaded and unchanged.

This fix includes that case updating the ManyToOne side of the relationship on the child when the save is cascaded.
2024-03-21 00:14:54 +13:00
Rob BygraveandGitHub 540ceab96f feat: Add query.setHint() to support sql hint as inline comment in select queries (#3365)
* feat: Add query.setHint() to support sql hint as inline comment in select queries

This is for ORM queries only.

An ORM query like:

    new QCustomer()
      .setHint("FirstRows")
      .select(QCustomer.Alias.id, QCustomer.Alias.name)
      .findList();

Produces SQL that includes the hint as an inline comment like:

  select /*+ FirstRows */ t0.id, t0.name
  from customer t0

* Fix test QOrderTest
2024-03-20 21:48:43 +13:00
Rob BygraveandGitHub 8b858a073a feat: Add includeLabelInSql configuration option to include query label as inline comment in generated sql select (#3362)
* feat: Add includeLabelInSql configuration option to include query label as inline comment in generated sql select

The generated select queries can look like:

select /* MyInnerTest.insert_and_find */ t0.id, ...

Using either query.setLabel() or profile location (which all query beans get by default). This means that tooling looking at sql in the database can more easily relate that sql back to application code.

* More tests for labels with includeLabelInSql=true

* Remove trim when using profileLocation label
2024-03-18 07:38:30 +13:00
Rob BygraveandGitHub 02dafc9838 Merge pull request #3360 from ebean-orm/feature/refactor-DbExpressionRequest
Refactor extract DbExpressionRequest interface for db platform specific expressions
2024-03-08 00:53:56 +13:00
Rob Bygrave 0816810d3b Refactor extract DbExpressionRequest interface for db platform specific expressions
This provides a simpler DbExpressionRequest interface for db platform specific expression adapters (rather than the SpiExpressionRequest which has more features that we don't wish to expose to those expression adapters.
2024-03-07 22:45:21 +13:00
Rob Bygrave 1f6e2ee844 No effective change - update test only ClusterTest, increase wait to 200ms 2024-03-07 20:59:41 +13:00
Rob Bygrave dc00765a98 Merge branch 'fix-for-db2' 2024-03-07 20:45:57 +13:00
Rob Bygrave a48b2f4ebe #3354 Use 4000 for DB Lob detection with distinct query
- Use 4000 to match the DB2 logic for considering a column a lob (for distinct etc)
- Rename distinctNoLobs -> platformDistinctNoLobs
- Rename  isDbLob() -> isLobForPlatform()
- Rename unselectLobs() -> unselectLobsForPlatform()
2024-03-07 20:45:40 +13:00
Rob BygraveandGitHub 837563544f Merge pull request #3357 from ebean-orm/feature/avaje-config-dependency-ContainerConfig
Modify ContainerConfig to remove the avaje-config dependency
2024-03-07 20:23:36 +13:00
Rob Bygrave fd199f406b Modify ContainerConfig to remove the avaje-config dependency
This actually reverts a change that was made in commit:
https://github.com/ebean-orm/ebean/commit/803f1d86428ce3b653276d72207e5a0009b57d16
2024-03-05 21:18:27 +13:00
Roland Praml a48e96c7e9 FIX broken test for DB2 2024-03-04 10:02:05 +01:00
Rob Bygrave 7ba6e5f67d Add howto-deploy-to-central.md 2024-03-03 22:08:47 +13:00
Rob Bygrave 6ce42b1ca3 Version 14.0.1 2024-03-03 20:24:26 +13:00
Rob BygraveandGitHub 89617cefbe Merge pull request #3353 from ebean-orm/feature/bump-migration-14
dep: Bump ebean-migration to 14.0.0, no effective change
2024-03-03 20:19:40 +13:00
Rob Bygrave dd377621a4 dep: Bump ebean-migration to 14.0.0, no effective change
No effective change in that ebean-migration 14.0.0 has no change, it was released to align version numbers with 14.x
2024-03-03 20:19:17 +13:00
Rob Bygrave d844855462 Bump ebean-agent to 14.0.1 2024-03-03 18:32:14 +13:00
Rob BygraveandGitHub f68c25d5f3 Merge pull request #3352 from ebean-orm/feature/dep-common-components
dep: Update the common components to 14.0.0 ebean-joda-types, ebean-jackson-jsonnode
2024-03-03 18:29:15 +13:00
Rob Bygrave 61cfc7a979 dep: Update the common components to 14.0.0 ebean-joda-types, ebean-jackson-jsonnode 2024-03-03 17:01:36 +13:00
Rob BygraveandGitHub 3c98ee7f1b Merge pull request #3351 from ebean-orm/dep/bump-config
Bump test dependencies only - logback and ebean-test-containers
2024-03-03 16:54:56 +13:00
Rob Bygrave 0738316f15 Bump test dependencies only - logback and ebean-test-containers 2024-03-03 16:54:22 +13:00
Rob BygraveandGitHub ceb83befa3 Merge pull request #3350 from ebean-orm/dep/bump-config
dep: Bump avaje-config to 3.12 - supports AWS AppConfig & Dynamic Logback
2024-03-03 15:42:59 +13:00
Rob Bygrave a0b04cceda dep: Bump avaje-config to 3.12 - supports AWS AppConfig & Dynamic Logback
This version of avaje-config supports using AWS AppConfig as a configuration source (via avaje-aws-appconfig). It also supports dynamic changing Logback logging levels (via avaje-dynamic-logback).
2024-03-03 15:38:14 +13:00
Rob Bygrave 03edfb5454 git workflow trigger on push to master and pull_request 2024-03-03 15:33:39 +13:00
Rob BygraveandGitHub 62015451df Merge pull request #3349 from ebean-orm/feature/dep-ebean-datasource
dep: Bump ebean-datasource to 8.12
2024-03-03 15:32:36 +13:00
Rob Bygrave ed9113efe6 dep: Bump ebean-datasource to 8.12
This adds the option to register a JVM shutdown hook (which we generally will not use with ebean as the ebean io.ebean.Database shutdown wants to shutdown the DataSource after any background tasks have completed).

This also adds an experimental feature for use with AWS Lambda to check for old idle connections due to lambda suspension.
2024-03-03 15:24:44 +13:00
Rob Bygrave 334793667e Add deployment error message for ManyToMany with one of the related beans missing an @Id property 2024-03-03 14:14:23 +13:00
Rob BygraveandGitHub 351a1c4739 Merge pull request #3348 from ebean-orm/feature/3313-fetchGroup-with-config
#3313 Ability to configure fetch batch size when using FetchGroups and query beans
2024-03-03 13:53:52 +13:00
Rob Bygrave b2de333dcc #3313 Ability to configure fetch batch size when using FetchGroups and query beans
We can do this currently using string paths and properties, this adds support for doing this when using query beans and strong types
2024-03-03 13:47:49 +13:00
Rob Bygrave 6091f7b683 No effective change - tidy test TestJsonImplicitLoaded 2024-03-03 12:25:25 +13:00
Rob BygraveandGitHub 43fb84cbc0 Merge pull request #3345 from FOCONIS/jsonwrite-loaded-props
NEW: Allow control of jsonwrite-loadedprops
2024-03-03 12:23:17 +13:00
Rob BygraveandGitHub 52a4e9e19b Merge pull request #3347 from ebean-orm/feature/3337-querybean-imports
#3337 Fix querybean-generation to not import the entity bean type
2024-03-03 12:17:42 +13:00
Rob Bygrave a2cdea24ed #3337 Fix querybean-generation to not import the entity bean type
Use the full canonical name of the entity bean in the generated code.
2024-03-03 12:13:49 +13:00
Rob Bygrave cd780208e5 Javadoc format only for io.ebean.Database 2024-03-03 11:45:36 +13:00
Rob BygraveandGitHub 9ce0e923d7 Merge pull request #3346 from ebean-orm/feature/lengthCheck-postgres
#3341 String length validation with Postgres PGobject (JSON/JSONB)
2024-03-02 10:26:52 +13:00
Rob Bygrave 9e461e4708 #3341 String length validation with Postgres PGobject (JSON/JSONB) 2024-03-02 10:06:22 +13:00
Rob Bygrave 5fa09a6f90 #3341 String length validation with Postgres PGobject (JSON/JSONB) 2024-03-02 09:52:04 +13:00
Rob Bygrave 6babb2e6f5 Add ebean.lengthCheck for mariadb test run 2024-03-02 09:39:25 +13:00
Rob Bygrave 26abe27e42 Add ebean.lengthCheck for sqlserver17 test run 2024-03-02 09:38:33 +13:00
Rob Bygrave 9b18d46b78 Add ebean.lengthCheck for mysql test run 2024-03-02 09:27:05 +13:00
Roland Praml eed487ad26 NEW: Allow control of jsonwrite-loadedprops 2024-02-29 13:26:22 +01:00
Rob BygraveandGitHub c10865dfaf Merge pull request #3344 from ebean-orm/feature/bump-avaje-config-311
Bump avaje-config to 3.11
2024-02-27 21:22:38 +13:00
Rob Bygrave 2352df309c Bump avaje-config to 3.11 2024-02-27 21:21:58 +13:00
Rob Bygrave feb2bd1e15 String length validation tidy up 2024-02-27 21:04:19 +13:00
Rob Bygrave 11c9bdfc6f Squashed commit of the following:
commit 20152e16891582f8ff466a93ec2cf01871824d6d
Author: Rob Bygrave <robin.bygrave@gmail.com>
Date:   Tue Feb 27 20:59:51 2024 +1300

    #3341 Update DatabaseConfig for fluid style + javadoc

commit 1c495a7384
Author: Roland Praml <roland.praml@foconis.de>
Date:   Mon Feb 26 10:25:42 2024 +0100

    Fix: Compile errors

commit 574876b758
Merge: df7b04877 77634fc3e
Author: Roland Praml <roland.praml@foconis.de>
Date:   Fri Feb 23 16:16:39 2024 +0100

    Merge branch 'master-rob' into FOCONIS-string-length-validation

commit df7b04877d
Author: Rob Bygrave <robin.bygrave@gmail.com>
Date:   Mon Jun 26 21:16:32 2023 +1200

    #3121 BindMaxLength validation

    At deploy time derive a BindMaxLength property to use
    per BeanProperty

commit 4683877e0b
Merge: 9a4b9d4be d0020ab8c
Author: Rob Bygrave <robin.bygrave@gmail.com>
Date:   Fri Jun 23 16:51:34 2023 +1200

    Merge branch 'string-length-validation' of github.com:FOCONIS/ebean into FOCONIS-string-length-validation

commit d0020ab8ce
Author: Roland Praml <roland.praml@foconis.de>
Date:   Tue Jun 20 14:47:20 2023 +0200

    Length validation less invasive

commit 9b3b8ad46a
Author: Roland Praml <roland.praml@foconis.de>
Date:   Tue Jun 20 13:03:04 2023 +0200

    extended DataBind, so that it could return the last bound object

commit ca3c02bc1c
Author: Roland Praml <roland.praml@foconis.de>
Date:   Mon Jun 19 09:52:52 2023 +0200

    Failing test for SqlServer
2024-02-27 21:04:06 +13:00
Rob BygraveandGitHub 4a6fc98395 Merge pull request #3339 from ebean-orm/fix/3338
Fix for #3338 Potential shutdown hang with SpringContextShutdownHook …
2024-02-26 21:58:39 +13:00
Rob Bygrave 7322030e90 Fix for #3338 Potential shutdown hang with SpringContextShutdownHook and ebean ShutdownHook 2024-02-26 08:32:44 +13:00
Rob BygraveandGitHub 77634fc3eb Merge pull request #3336 from ebean-orm/feature/bump-postgresql-4272
Bump postgresql dependency to 42.7.2
2024-02-21 16:11:24 +13:00
robin.bygrave ed8d4b5fc4 Bump postgresql dependency to 42.7.2 2024-02-21 16:05:13 +13:00
Rob BygraveandGitHub 187cc0903d Merge pull request #3329 from ebean-orm/feature/bump-test-dependencies
Bump test dependencies for assertj and bytebuddy
2024-02-19 22:04:56 +13:00
Rob Bygrave 1d7a14c8f4 Bump test dependencies for assertj and bytebuddy 2024-02-19 21:51:38 +13:00
Rob Bygrave c58b7d3da3 Test ebean.properties config values 2024-02-15 22:51:26 +13:00
Rob Bygrave 6b2cdc14aa Version 14.0.0 2024-02-15 22:48:38 +13:00
Rob Bygrave 6d712a92a0 Bump ebean-agent to 14.0.0, no functional change 2024-02-15 22:21:09 +13:00
Rob BygraveandGitHub ea11b0c3b6 Merge pull request #3289 from FOCONIS/fix-nested-user-objects
Change semantic of userObjects in nested transaction
2024-02-15 22:10:45 +13:00
Rob BygraveandGitHub 08e8402d05 Merge pull request #3301 from ebean-orm/feature/3295-PC-clear-on-bulk-update
#3295 Clear PersistenceContext on execution of bulk updates or deletes
2024-02-15 22:09:16 +13:00
Rob BygraveandGitHub 006ad79379 Merge branch 'master' into feature/3295-PC-clear-on-bulk-update 2024-02-15 22:09:03 +13:00
Rob BygraveandGitHub 0e063549cd Merge pull request #3327 from ebean-orm/feature/remove-deprecated-commitTransaction
Remove deprecated database.commitTransaction(), migrate to transaction.commit()
2024-02-15 22:07:32 +13:00
Rob BygraveandGitHub 4f0d2cabfb Merge pull request #3325 from ebean-orm/feature/default-batchSize-100
Change default persistBatchSize from 20 to 100 (as a better default value)
2024-02-15 22:07:14 +13:00
Rob Bygrave 80b2d9f983 Remove deprecated database.commitTransaction(), migrate to transaction.commit()
Remove the deprecated methods:
- DB.commitTransaction()
- DB.rollbackTransaction()
- DB.endTransaction()
- database.commitTransaction()
- database.rollbackTransaction()
- database.endTransaction()

Migrate to using try-with-resources and transaction.commit(), transaction.rollback()
2024-02-15 21:56:57 +13:00
Rob Bygrave 287d0c467d #3326 Update the test example of Postgres DML with RETURNING clause to use explicit transactions and transaction.addModification() 2024-02-11 14:25:01 +13:00
Rob Bygrave a8835379e7 #3326 Add test as example of Postgres DML with RETURNING clause 2024-02-11 13:18:19 +13:00
Rob Bygrave e4df20b9dc Update test TestPersistCascade with default batch size 100 2024-02-10 13:28:04 +13:00
Rob Bygrave 261b13ef4b Version 13.26.1 2024-02-10 12:40:30 +13:00
Rob Bygrave 7639034d7c Bump ebean-agent to 13.26.1 (no functional change here) 2024-02-10 12:17:47 +13:00
Rob Bygrave e6e53e0d93 Change default persistBatchSize from 20 to 100 (as a better default value)
This is the batch size used with PreparedStatement executeBatch() with
batched inserts, updates and deletes. 20 is really on the low side and
bumping this default to 100 seems good and right.
2024-02-10 12:15:50 +13:00
Rob BygraveandGitHub c71971eb5c Merge pull request #3322 from ebean-orm/fix/3319
(fix) Future queries do not trigger flush on BatchedPstmtHolder for #3319
2024-02-10 12:12:47 +13:00
Rob BygraveandGitHub 357af58db4 Merge pull request #3324 from ebean-orm/feature/postgres_insertOnConflict
Add support for Postgres INSERT ON CONFLICT update | nothing
2024-02-10 12:08:44 +13:00
Rob BygraveandGitHub 0abdb1550a Merge pull request #3310 from Ichtil/one_to_many_list_clear_test
Previous entities are not deleted when replacing OneToMany collection with a new one
2024-02-10 12:03:16 +13:00
Rob Bygrave c32fc814f6 Add support for insert/insertAll with both options and explicit transaction 2024-02-10 12:00:32 +13:00
Rob Bygrave 8e035939dc Add support for Postgres INSERT ON CONFLICT update | nothing
Adds InsertOptions with ability to control the options used
for insert with Postgres around ON CONFLICT.
2024-02-10 01:07:44 +13:00
Rob Bygrave edf98ee250 Fix test OneToManyListMarkAsDirtyTest with some wait time 2024-02-09 15:46:34 +13:00
Rob Bygrave 5f0a75a130 No effective change, update test renaming internal variables 2024-02-09 15:26:28 +13:00
Rob Bygrave d2f16cbf6a #3310 Fix for orphanRemoval with updated parent and 'vanilla collection'
The issue fixed here is a timing one where the parent bean is being updated.
The updated parent bean has its internal state reset before the cascade down
to the SaveManyBeans where for this case it needs to identify is the 'vanilla'
collection has set (via setChildren(new ArrayList()).

This fix is a change that for updated beans the dirtyProperties is always obtained
and then use this for the isChangedProperty() check.
2024-02-09 15:24:47 +13:00
Rob Bygrave 04ba81d12f #3310 Update test only, reuse existing entity beans
- Reuse the existing OmBeanListParent and child
- Simplify the test setup code
- Rename test methods to maybe better reflect what I think is failing

Noting that markAsDirty doesn't specifically have anything to do with this bug but it's more on whether the parent bean is dirty or dirty (markAsDirty is just a way to make the parent bean dirty).
2024-02-09 08:30:42 +13:00
Rob Bygrave f63e7ed5af Add test only for orphan removal to TestOrphanRemovalOverwrite
Using clear() and add() when the same id value is used
2024-02-08 00:14:22 +13:00
Rob Bygrave 66940c0f14 Update tests only for BeanList BeanSet BeanMap
Use Product entity with equals/hashCode implementation added via ebean enhancement
2024-02-07 22:29:05 +13:00
Rob Bygrave 1f48b3a6b3 (fix) Future queries do not trigger flush on BatchedPstmtHolder for #3319
This change is that findFutureCount, findFutureList, findFutureIds do not trigger a flush on BatchedPstmtHolder.

This is to address the possible ConcurrentModificationException that could occur at BatchedPstmtHolder.closeStatements(BatchedPstmtHolder.java:153)
2024-02-03 08:20:58 +13:00
Rob BygraveandGitHub 7d368097e9 Merge pull request #3321 from ebean-orm/feature/tidy-OrmQueryRequest-readOnly
Tidy OrmQueryRequest isReadOnly, just use query.isReadOnly instead
2024-02-02 14:44:06 +13:00
Rob Bygrave c849e29316 Tidy OrmQueryRequest isReadOnly, just use query.isReadOnly instead 2024-02-02 14:43:31 +13:00
Rob BygraveandGitHub c78a3dd6c4 Merge pull request #3318 from FOCONIS/fix-db2-test
Exclude test for DB2
2024-01-31 22:57:49 +13:00
Noemi Praml a4455ddbf2 Exclude test for DB2 2024-01-31 10:17:16 +01:00
Rob BygraveandGitHub 9787af77e4 Merge pull request #3315 from FOCONIS/db2-select-for-update
ADD: DB2 supports select .. for update queries
2024-01-30 22:53:19 +13:00
Noemi Praml 3786fb09a5 ADD: DB2 supports select .. for update queries 2024-01-29 15:12:21 +01:00
Rob Bygrave f34e7b6003 Version 13.26.0 2024-01-20 22:01:30 +13:00
Rob BygraveandGitHub 089dd8e364 Merge pull request #3311 from ebean-orm/feature/findSingleAttributeOrEmpty
enh: Add findSingleAttributeOrEmpty() returning Optional
2024-01-19 15:23:27 +13:00
Rob Bygrave 44770382fb enh: Add findSingleAttributeOrEmpty() returning Optional 2024-01-19 10:41:54 +13:00
Rob Bygrave 6645e5b9ec Update the test comments in TestPersistenceContextQueryScope
To reflect the behaviour with #3295
2024-01-19 08:58:19 +13:00
Rob BygraveandGitHub 2a62d413cc Merge pull request #3308 from Incanus3/fix/querybean_or_with_exists
fix TQRootBean.exists() when used with .or()
2024-01-19 08:29:29 +13:00
Rob Bygrave 0046d983cb Adjust test such that table alias does not clash
The .raw("contact.customer_id = customer.id") clashes as "customer.id" is
a logical path from contact
2024-01-19 08:14:58 +13:00
Jan Klička 006e33cb3e One to many replacing collection failing test cases 2024-01-18 17:29:24 +01:00
Jan Klička e80e8e027a One to many replacing collection failing test cases 2024-01-18 16:49:04 +01:00
Jakub Kaláb 2e1b52d7d4 WIP: fix TQRootBean.exists() when used with .or() 2024-01-18 11:32:34 +01:00
Rob BygraveandGitHub 09d5163396 Merge pull request #3307 from ebean-orm/feature/bump-avaje-config-310
Bump avaje-config to version 3.10
2024-01-18 22:30:42 +13:00
Rob Bygrave a6a38b9a92 Bump avaje-config to version 3.10 2024-01-18 22:30:09 +13:00
Rob BygraveandGitHub bd4521b240 Merge pull request #3306 from ebean-orm/feature/querybean-deprecated
Add forRemoval=true for existing Deprecated methods in query beans
2024-01-18 22:28:23 +13:00
Rob Bygrave 8a7379879b Add forRemoval=true for existing Deprecated methods in query beans 2024-01-18 20:15:57 +13:00
Rob BygraveandGitHub b78dd6f79a Merge pull request #3304 from ebean-orm/feature/3296-querybean-copy
#3296 Add copy() method to query beans
2024-01-15 22:38:30 +13:00
Rob Bygrave 4ebb5fd112 #3296 Add copy() method to query beans 2024-01-15 22:30:17 +13:00
Rob Bygrave 487368976f Tidy SimpleQueryBeanWriter internals 2024-01-15 22:03:17 +13:00
Rob Bygrave c6defceec9 Add additional test for filterMany() with fetch() 2024-01-15 21:02:47 +13:00
Rob Bygrave 3576aafffc #3295 When isAutoPersistUpdates is used do NOT clear the PersistenceContext
Also make improvements to the test asserts in TestPersistenceContextQueryScope
2024-01-10 23:23:47 +13:00
Rob Bygrave 66234249c6 #3295 Clear PersistenceContext on execution of bulk updates or deletes
Using SqlUpdate or an ORM Update query clear the appropriate part of
the PersistenceContext. The effect is that ORM queries executed after
a bulk update will effectively load a fresh copy of the data from the
database and will not reuse an instance from the persistence context
if the bean in question had already been loaded.
2024-01-09 07:44:27 +13:00
Rob BygraveandGitHub 8ed3b765ec Merge pull request #3299 from ebean-orm/feature/3294-warnings
#3294 Suppress compiler warnings on generated query bean `filterMany()`
2023-12-22 08:33:31 +13:00
Rob BygraveandGitHub fcbcc53e27 Merge pull request #3298 from ebean-orm/feature/add-usingConnection-dtoQuery
Add usingConnection() to DtoQuery and SqlQuery
2023-12-22 08:25:48 +13:00
Rob Bygrave b377e1a618 #3294 Suppress compiler warnings on generated query bean filterMany() 2023-12-22 08:24:54 +13:00
Rob Bygrave a0f612ed71 Add usingConnection() to DtoQuery and SqlQuery
For the case where we have a java.sql.Connection and wish
to execute a DtoQuery or SqlQuery using that connection.
2023-12-21 21:24:02 +13:00
Roland Praml 6f64821584 Change semantic of userObjects in nested transaction 2023-12-08 14:50:30 +01:00
Rob Bygrave 47e97a77a8 Version 13.25.2 2023-12-07 20:18:40 +13:00
Rob Bygrave e8d3f50bb4 Bump ebean-agent to 13.25.2 2023-12-07 19:57:55 +13:00
Rob BygraveandGitHub 716cfaf938 Merge pull request #3286 from ebean-orm/feature/dbarray-instant-and-localdate
Add support for LocalDate and Instant with DbArray
2023-12-07 08:57:40 +13:00
robin.bygrave 7cd9e5ee03 Add support for LocalDate and Instant with DbArray 2023-12-06 14:54:30 +13:00
Rob Bygrave f9c9bea623 Follow up for #3248 - add betweenProperties on query bean 2023-12-06 00:40:57 +13:00
Rob Bygrave 720832122c Follow up for #3248 - add betweenProperties on query bean 2023-12-05 23:32:16 +13:00
Rob BygraveandGitHub 7b635acf56 Merge pull request #3284 from raphaelNguyen/master
Expose betweenProperties on query bean
2023-12-05 23:21:26 +13:00
Raphael Nguyen 6b7efe65d7 Expose betweenProperties on query bean 2023-12-05 15:08:16 +11:00
Rob BygraveandGitHub 03cd4000f0 Merge pull request #3282 from ebean-orm/dependabot/maven/ch.qos.logback-logback-classic-1.3.12
Bump ch.qos.logback:logback-classic from 1.2.11 to 1.3.12
2023-11-30 13:59:21 +13:00
Rob BygraveandGitHub dfd6434b59 Merge pull request #3281 from ebean-orm/dependabot/maven/tests/test-java16/ch.qos.logback-logback-classic-1.3.12
Bump ch.qos.logback:logback-classic from 1.2.11 to 1.3.12 in /tests/test-java16
2023-11-30 13:59:08 +13:00
Rob BygraveandGitHub 4e7480237b Merge pull request #3283 from ebean-orm/dependabot/maven/tests/test-kotlin/ch.qos.logback-logback-classic-1.3.12
Bump ch.qos.logback:logback-classic from 1.2.11 to 1.3.12 in /tests/test-kotlin
2023-11-30 13:58:52 +13:00
dependabot[bot]andGitHub 9bfcf07486 Bump ch.qos.logback:logback-classic in /tests/test-kotlin
Bumps [ch.qos.logback:logback-classic](https://github.com/qos-ch/logback) from 1.2.11 to 1.3.12.
- [Commits](https://github.com/qos-ch/logback/compare/v_1.2.11...v_1.3.12)

---
updated-dependencies:
- dependency-name: ch.qos.logback:logback-classic
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-29 22:15:53 +00:00
dependabot[bot]andGitHub b1f1344057 Bump ch.qos.logback:logback-classic from 1.2.11 to 1.3.12
Bumps [ch.qos.logback:logback-classic](https://github.com/qos-ch/logback) from 1.2.11 to 1.3.12.
- [Commits](https://github.com/qos-ch/logback/compare/v_1.2.11...v_1.3.12)

---
updated-dependencies:
- dependency-name: ch.qos.logback:logback-classic
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-29 22:13:26 +00:00
dependabot[bot]andGitHub 07201c1519 Bump ch.qos.logback:logback-classic in /tests/test-java16
Bumps [ch.qos.logback:logback-classic](https://github.com/qos-ch/logback) from 1.2.11 to 1.3.12.
- [Commits](https://github.com/qos-ch/logback/compare/v_1.2.11...v_1.3.12)

---
updated-dependencies:
- dependency-name: ch.qos.logback:logback-classic
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-29 22:13:04 +00:00
Rob BygraveandGitHub 455a9fdffc Merge pull request #3280 from ebean-orm/feature/typequery-imports-tqrootbean
QueryBean generation - use full class names for TQRootBean, TQAssocBean
2023-11-29 01:21:00 +13:00
Rob Bygrave 3f67425727 QueryBean generation - conditionally fully qualify the property types
If there is an entity bean short name clash like PString, PLong, etc then
fully qualify all the property types in the generated code, otherwise use
imports for the property types.
2023-11-29 00:46:56 +13:00
Rob Bygrave 3fd9ae06db QueryBean generation - use fully qualify use of DB 2023-11-29 00:22:45 +13:00
Rob Bygrave a8ce726e47 QueryBean generation - use full class names for TQRootBean, TQAssocBean
Rather than imports, such that these are not possible name clashes with
beans of the exact same name.
2023-11-28 21:51:07 +13:00
Rob BygraveandGitHub 29cd1a143d Merge pull request #3277 from ebean-orm/feature/bump-datasource2
Bump ebean-datasource to 8.11 with support for Driver by class
2023-11-23 23:34:23 +13:00
Rob Bygrave 6a19c6a0ce Bump ebean-datasource to 8.11 with support for Driver by class
- Can specify explicit driver by class or instance
- Can use a DataSource as connection source
2023-11-23 23:31:29 +13:00
Rob BygraveandGitHub eaec515cc1 Merge pull request #3276 from ebean-orm/feature/skipCheckForReadOnly
skipDataSourceCheck() when using readOnlyDatabase
2023-11-23 23:27:21 +13:00
Rob Bygrave 97709d3493 skipDataSourceCheck() when using readOnlyDatabase
As we don't want the warning logged in this case:
DataSource [{0}] has autoCommit defaulting to true!
2023-11-23 23:23:53 +13:00
Rob Bygrave 87ad874621 Read the readOnlyDatabase property via loadSettings() 2023-11-23 23:15:58 +13:00
Rob Bygrave dfe95f6fc0 Version 13.25.1 2023-11-22 17:50:09 +13:00
Rob Bygrave 05feccfeb6 Bump ebean-agent 2023-11-22 17:46:54 +13:00
Rob BygraveandGitHub 196cb09c66 Merge pull request #3274 from ebean-orm/feature/3269
#3268 - @DbComment on @ManyToOne fields are ignored (ddl-generator)
2023-11-21 23:54:26 +13:00
Rob Bygrave 589e198301 #3268 - @DbComment on @ManyToOne fields are ignored (ddl-generator) 2023-11-21 23:53:29 +13:00
Rob BygraveandGitHub b2b81677e8 Merge pull request #3273 from ebean-orm/feature/3269
#3269 - @JoinColumns set ForeignKey is none in ddl , but is not work
2023-11-21 23:42:06 +13:00
Rob Bygrave f032aad22e #3269 - @JoinColumns set ForeignKey is none in ddl , but is not work 2023-11-21 23:40:21 +13:00
Rob Bygrave c48e5428c5 #3265 Fix for Update Query logging to trim large values in bind log 2023-11-21 22:32:35 +13:00
Rob Bygrave cbca940611 Merge branch 'FOCONIS-findsingleattribute-beanfindcontroller' 2023-11-21 22:05:12 +13:00
Rob Bygrave 0da3772ae9 #3270 Fix for use with BeanFindController and attribute queries
The existence of a BeanFindController should not break the use of
single attribute queries + still allow auto-tuning.
2023-11-21 22:04:47 +13:00
Rob Bygrave 496ef36b11 Merge branch 'findsingleattribute-beanfindcontroller' of github.com:FOCONIS/ebean into FOCONIS-findsingleattribute-beanfindcontroller 2023-11-21 21:40:09 +13:00
Rob BygraveandGitHub a4a2aba56f Merge pull request #3272 from ebean-orm/feature/readOnlyDatabase
Refactor tidy internals of DbPrimary, DatabaseFactory, ContainerConfi…
2023-11-21 21:20:35 +13:00
Rob Bygrave 803f1d8642 Refactor tidy internals of DbPrimary, DatabaseFactory, ContainerConfig, ClusterManager 2023-11-20 22:18:53 +13:00
Rob BygraveandGitHub ff1c73e20d Merge pull request #3266 from ebean-orm/feature/readOnlyDatabase
Add read only database configuration/builder option
2023-11-17 14:10:51 +13:00
Noemi Praml 7afd37cd98 Failing Tests with CustomerFindController 2023-11-14 17:05:42 +01:00
Rob Bygrave 24bb364d40 Add read only database configuration/builder option
When using DatabaseBuilder.readOnlyDatabase(true) then
ebean will:
- Set the DataSourceBuilder to use autoCommit=true and readOnly=true
- Use the same DataSource instance for both dataSource and readOnlyDataSource

This is to simplify the setup/configuration for creating a Database that
will only have read-only use.

Note that readOnly=true is a JDBC hint and for example H2 database effectively
ignores that hint where as Postgres will enforce the read-only true nature.
2023-11-13 23:12:05 +13:00
Rob Bygrave 5d54a238bd Bump ebean-agent to 13.25.0 2023-11-06 20:09:35 +13:00
Rob Bygrave b50ce5fc3f Version 13.25.0 2023-11-06 20:08:00 +13:00
Rob Bygrave 624e92840c Adjust "for testing purposes" log messages 2023-11-06 12:55:22 +13:00
Rob Bygrave b03adc412c Adjust "for testing purposes" log messages 2023-11-06 12:52:35 +13:00
Rob BygraveandGitHub e794f5e916 Merge pull request #3264 from ebean-orm/feature/DatabaseBuilder_Settings
Fix to return DataSourceBuilder.Settings for getDataSourceConfig() an…
2023-11-06 12:50:37 +13:00
Rob Bygrave a2551ce718 Bump ebean-datasource to 8.9 2023-11-06 12:50:14 +13:00
Rob Bygrave 5b0a3607f6 Fix to return DataSourceBuilder.Settings for getDataSourceConfig() and getReadOnlyDataSourceConfig()
That is, existing code using DataSourceConfig has access to the getter
methods of DataSourceConfig. The DataSourceBuilder interface only has
the setter methods and DataSourceBuilder.Settings has both getters and
setter methods.

That is, the refactor to extract the DataSourceBuilder interface also
split off the getter methods to the DataSourceBuilder.Settings interface
(because most of the time when using the builder we only need the
setter methods and effectively hiding the getter methods behind the settings()
is useful to simplify the API for users).
2023-11-06 12:14:27 +13:00
Rob Bygrave bcf7bd17be Version 13.14.0-jakarta 2023-11-05 22:21:20 +13:00
Rob BygraveandGitHub 102d8d5979 Merge pull request #3263 from ebean-orm/feature/DatabaseBuilder-take-2
DatabaseBuilder take 2
2023-11-05 22:11:26 +13:00
Rob Bygrave 3edc232003 Update test BeanDescriptor_registerTest with DatabaseBuilder use 2023-11-05 22:03:25 +13:00
Rob Bygrave 043dc5c51f Add setters without the set prefix to DatabaseBuilder with deprecation
So add `name(String name)` as preferred to `setName(String name)` etc
2023-11-05 22:01:02 +13:00
Rob Bygrave e2d666df35 Use fluid setters for DatabaseConfig and DatabaseBuilder 2023-11-04 13:05:22 +13:00
Rob Bygrave 314e0a14b8 Move the internal serviceObjectKey() methods back into DatabaseConfig
They were incorrectly extracted to the interface as default methods
2023-11-03 23:00:29 +13:00
Rob Bygrave 1f9cf1e4b7 Split DatabaseBuilder interface separating the setters n getters adding DatabaseBuilder.Settings
So DatabaseBuilder.Settings has all the getters for code looking to read
the configuration that has been set. So DatabaseBuilder now just has the
setter methods.

Use DatabaseBuilder.settings() to access the settings and read the config
that has been set.
2023-11-03 22:58:11 +13:00
Rob Bygrave 12029ed06e Refactor extract interface DatabaseBuilder from DatabaseConfig
First step in supporting the builder pattern for creating Database
2023-11-03 21:17:55 +13:00
Rob BygraveandGitHub 89741b9312 Merge pull request #3262 from ebean-orm/feature/improve-javadoc-deprecated
Improve the javadoc for deprecated methods (to assist IDE quick-fix actions)
2023-11-03 20:05:41 +13:00
Rob Bygrave ae962c2e08 Improve the javadoc for deprecated methods (to assist IDE quick-fix actions) 2023-11-03 20:04:25 +13:00
Rob BygraveandGitHub 4e3501972a Merge pull request #3260 from ebean-orm/feature/bump-migration2
Bump ebean-migration to 13.11.1 (with fastMode option and index file support)
2023-11-03 19:52:00 +13:00
Rob Bygrave a65ba41850 Bump ebean-migration to 13.11.1 (with fastMode option and index file support) 2023-11-03 18:33:02 +13:00
Rob Bygrave 3b11c1cb6b Merge branch 'master' of github.com:ebean-orm/ebean 2023-11-03 18:31:31 +13:00
Rob Bygrave 41185eeb5c Bump ebean-datasource to 8.8 with DataSourceBuilder
First step in migrating the ebean-datasource API to use builder pattern.
DataSourceConfig (concrete type) migrating to DataSourceBuilder (interface).

A followup step will deprecate the use of DataSourceConfig.
2023-11-03 18:31:11 +13:00
Rob BygraveandGitHub e97ff54ab2 Merge pull request #3259 from ebean-orm/feature/loadMode_safer
Change loadMode to be 'safer' (for Grafana etc). e.g. change "(+lazy) " to "__lazy"
2023-11-02 09:00:38 +13:00
robin.bygrave 97fae09c52 Tidy SpiQuery.setProfilePath() internal implementation 2023-11-01 15:48:27 +13:00
robin.bygrave 8b0f58b3c2 Change loadMode to be 'safer' (for Grafana etc). e.g. change "(+lazy)" to "__lazy"
The loadMode ends up as a suffix to some query metrics.

For example "foo.findIt_baz(+lazy)", and the (+lazy) part isn't safe/friendly to tools
like Grafana. So change to instead of (+lazy) use __lazy.
2023-11-01 15:20:18 +13:00
Rob Bygrave 70eb557929 Version 13.23.2-jakarta 2023-10-27 22:13:05 +13:00
Rob Bygrave fdb3a3759b Bump ebean-agent to 13.23.2 2023-10-27 22:10:40 +13:00
Rob BygraveandGitHub 7a5e8d0e17 Merge pull request #3256 from ebean-orm/feature/upgrade-antlr4-4_13_1
Upgrade ANTLR4 from version 4.8-1 to 4.13.1
2023-10-27 21:45:37 +13:00
robin.bygrave a0748f8139 Upgrade ANTLR4 from version 4.8-1 to 4.13.1 2023-10-26 13:52:44 +13:00
Rob BygraveandGitHub 9f65673f54 Merge pull request #3255 from ebean-orm/feature/bump-junit-bytebuddy
Bump io.avaje:junit and bytebuddy version to support JDK 22+
2023-10-25 22:12:49 +13:00
Rob Bygrave 8f6a3c59d1 Bump io.avaje:junit and bytebuddy version to support JDK 22+ 2023-10-25 21:58:19 +13:00
Rob BygraveandGitHub 05210ec411 Merge pull request #3254 from ebean-orm/feature/query-plan-capture-yuga
Use DIST with query plan capture for Yugabyte plus simplify
2023-10-25 08:23:01 +13:00
Rob Bygrave faffda8318 Use DIST with query plan capture for Yugabyte plus simplify
Change QueryPlanLoggerExplain to take the options for PG, Yugabyte and others
2023-10-25 08:22:25 +13:00
Rob BygraveandGitHub af3901ce01 Merge pull request #3253 from ebean-orm/feature/3251
#3251 - QueryBeans: Entities can not have same name as some Ebean API…
2023-10-25 08:11:40 +13:00
Rob Bygrave acd538207f #3251 - QueryBeans: Entities can not have same name as some Ebean API classes 2023-10-24 23:08:30 +13:00
Rob Bygrave 84f0ef9fce Use querybean-generator via provided scope rather than maven compiler plugin
This is because when releasing both jakarta and javax versions these
need to have their versions adjusted
2023-10-24 23:07:14 +13:00
Rob BygraveandGitHub 7ab447b21c Merge pull request #3252 from ebean-orm/feature/querybean-generator-provided
Use querybean-generator via provided scope rather than maven compiler plugin
2023-10-24 22:23:56 +13:00
Rob Bygrave 6f8805a6b3 Use querybean-generator via provided scope rather than maven compiler plugin
This is because when releasing both jakarta and javax versions these
need to have their versions adjusted
2023-10-24 22:17:28 +13:00
Rob Bygrave 0171c1afef Version 13.23.1 2023-10-18 15:47:04 +13:00
Rob Bygrave 31c106f604 Bump ebean-agent to 13.23.1 2023-10-18 15:16:20 +13:00
Rob BygraveandGitHub 20d2838be4 Merge pull request #3250 from ebean-orm/feature/bump-parent
Make Jackson a transitive dependency of ebean-jackson-mapper
2023-10-17 23:25:43 +13:00
Rob Bygrave 4238a951ca Make Jackson a transitive dependency of ebean-jackson-mapper
So jackson-core and jackson-databind are both transitive dependencies
of ebean-jackson-mapper.
2023-10-17 23:25:09 +13:00
Rob BygraveandGitHub b5d4bed615 Merge pull request #3249 from ebean-orm/feature/bump-parent
Support native-image via querybean-generator
2023-10-17 23:18:17 +13:00
Rob Bygrave 3ef715ef64 Support native-image via querybean-generator 2023-10-17 23:09:18 +13:00
Rob BygraveandGitHub aea39528ab Merge pull request #3248 from ebean-orm/feature/bump-parent
Bump dependency for avaje-config to 3.9
2023-10-17 22:39:04 +13:00
Rob Bygrave dd498409e0 Bump dependency for avaje-config to 3.9 2023-10-17 22:38:33 +13:00
Rob BygraveandGitHub bae33101df Merge pull request #3247 from ebean-orm/feature/bump-parent
Bump parent pom
2023-10-17 22:37:53 +13:00
Rob Bygrave e1972ac544 Bump parent pom 2023-10-17 22:37:20 +13:00
Rob Bygrave c7241ba3dc Fix test for java 16+ annotation processor version 2023-10-16 23:30:45 +13:00
Rob Bygrave 73416ed65a For testing java 16+ include JDK 17 and 21 only 2023-10-16 23:19:48 +13:00
Rob Bygrave cd70c178f1 For testing java 16+ include JDK 17 and 21 only 2023-10-16 23:17:25 +13:00
Rob Bygrave aa298235f3 For testing java 16+ include JDK 21 and 22 2023-10-16 23:15:32 +13:00
Rob BygraveandGitHub 8733fed14b Merge pull request #3246 from ebean-orm/feature/annotation-processing-jdk-22
Explicit annotation processors required with JDK 22
2023-10-16 22:06:20 +13:00
Rob Bygrave 169d170247 Explicit annotation processors required with JDK 22
JDK 22 changes such that annotation processors are not found by default on
the classpath. As such they either need to be explicitly registered with
the compiler (e.g. maven-compiler-plugin) or use -proc:full
2023-10-16 21:54:32 +13:00
Rob Bygrave d0ee42e0de Include <compilerArgument>-proc:full</compilerArgument> for JDK 22 EA build 2023-10-16 20:32:41 +13:00
Rob BygraveandGitHub 91ecc074a7 Merge pull request #3243 from ebean-orm/feature/postgis-dependency
Fix ebean-bom dependencies for ebean-test
2023-10-11 20:04:12 +13:00
Rob Bygrave c2b381af1e Fix ebean-bom dependencies for ebean-test
Fix by removing the scopes test and provided in the ebean-bom
2023-10-11 20:03:12 +13:00
Rob BygraveandGitHub eeb0a15617 Merge pull request #3242 from ebean-orm/feature/postgis-dependency
Add missing dependency for ebean-postgis-types to ebean-postgis
2023-10-11 19:59:48 +13:00
Rob Bygrave 6abed0dd73 Add missing dependency for ebean-postgis-types to ebean-postgis 2023-10-11 19:58:12 +13:00
Rob BygraveandGitHub 1318cd706f Merge pull request #3241 from ebean-orm/feature/StdOperators-dep
Remove the Deprecated(experimental) from StdOperators
2023-10-10 23:43:29 +13:00
Rob Bygrave 1e8c609dec Remove the Deprecated(experimental) from StdOperators 2023-10-10 23:42:47 +13:00
Rob Bygrave 4506596379 Tidy remove old stylesheet.css from source 2023-10-10 23:41:42 +13:00
Rob Bygrave 0b2c016af2 Version 13.23.0 2023-10-10 22:46:30 +13:00
Rob Bygrave 29d946ec59 Bump ebean-agent 2023-10-10 22:33:35 +13:00
Rob Bygrave da76b422c8 Fix test with sql logging including executeBatch() for sqlserver 2023-10-10 22:26:25 +13:00
Rob Bygrave a1a3b33fc6 Fix test with sql logging including executeBatch() for sqlserver 2023-10-10 21:47:14 +13:00
Rob BygraveandGitHub 7ecd7877d5 Merge pull request #3240 from ebean-orm/feature/OneToOne-softDelete-join
OneToOne with SoftDelete join missing deleted predicate
2023-10-10 21:38:50 +13:00
Rob Bygrave e5f64f4211 Fix test with sql logging including executeBatch() 2023-10-10 21:38:17 +13:00
Rob Bygrave 90a6b71b7e #3240 followup no functional change, tidy use of ctx.joinAdded() 2023-10-10 21:33:23 +13:00
Rob Bygrave 131d531922 #3240 followup no functional change, tidy use of ctx.joinAdded() 2023-10-10 21:32:28 +13:00
Rob Bygrave 5684919a9f Fix for OneToOne with SoftDelete join missing deleted predicate 2023-10-10 21:27:26 +13:00
Rob Bygrave 80fc0723c8 Failing test for OneToOne with SoftDelete join missing deleted predicate 2023-10-10 21:24:35 +13:00
Rob BygraveandGitHub 3ae4c8981e Merge pull request #3238 from ebean-orm/feature/sql-log-executeBatch
Change SQL log to include executeBatch() via BatchedPstmt
2023-10-10 09:15:06 +13:00
Rob Bygrave b80c67286b Change SQL log to include executeBatch() via BatchedPstmt
Adjustments to tests to support this
2023-10-10 01:02:11 +13:00
Rob Bygrave 0bead4135e Change SQL log to include executeBatch() via BatchedPstmt
Adjustments to tests to support this
2023-10-10 00:59:25 +13:00
Rob Bygrave ac6473e039 Change SQL log to include executeBatch() via BatchedPstmt 2023-10-10 00:59:06 +13:00
Rob BygraveandGitHub 32188bdd54 Merge pull request #3237 from ebean-orm/feature/3233
#3234 - Query Bean Generator Generates Non-Compilable Code When Entit…
2023-10-09 22:04:05 +13:00
Rob Bygrave b3a577e3f9 #3234 - Query Bean Generator Generates Non-Compilable Code When Entity Uses @Embeddable Inner Class For Primary Key Type 2023-10-09 22:03:02 +13:00
Rob BygraveandGitHub 7d1774e2ed Merge pull request #3236 from ebean-orm/feature/3233
In version 13.22 if the entity definition is in a different package, …
2023-10-09 22:01:38 +13:00
Rob Bygrave 395edb62bf In version 13.22 if the entity definition is in a different package, the generated query bean cannot resolve the symbol erro 2023-10-09 21:10:56 +13:00
Rob BygraveandGitHub 716b7e7b93 Merge pull request #3232 from ebean-orm/feature/postgis-rename-types-add-composite
Add ebean-postgres-types to ebean-bom
2023-10-06 23:16:27 +13:00
Rob Bygrave 9aadc347d7 Add ebean-postgres-types to ebean-bom 2023-10-06 23:15:43 +13:00
Rob BygraveandGitHub d2d1423c88 Merge pull request #3231 from ebean-orm/feature/postgis-rename-types-add-composite
Rename ebean-postgis -> ebean-postgis-types + add new composite ebean…
2023-10-06 23:07:03 +13:00
Rob Bygrave 73cfea6053 For postgres dependency exclude checker framework dependency 2023-10-06 23:06:41 +13:00
Rob Bygrave 1614166d75 Rename ebean-postgis -> ebean-postgis-types + add new composite ebean-postgis
With this, people can depend on ebean-postgis (the composite) and get all the
dependencies they need (which is ebean-platform-postgres + ebean-postgis-types
+ others).

This should just make it easier for people in that currently we need both
ebean-postgis + ebean-postgres which isn't obvious enough.
2023-10-06 22:59:00 +13:00
Rob BygraveandGitHub 3d9b122a9f Merge pull request #3230 from ebean-orm/feature/deprecate-servletContextListener
Deprecate ServletContextListener (for shutdown in servlet container)
2023-10-06 22:40:07 +13:00
Rob Bygrave 1cc1d29c2f Deprecate ServletContextListener (for shutdown in servlet container)
Deprecated for removal - no intention to replace. Create your own
ServletContextListener if needed for your application.
2023-10-06 22:38:26 +13:00
Rob Bygrave 45467a3358 Bump ebean-agent 2023-10-06 22:07:01 +13:00
Rob Bygrave bdc236159b Bump avaje-config to 3.8 2023-10-06 22:03:45 +13:00
Rob BygraveandGitHub f0047ffd75 Merge pull request #3228 from ebean-orm/feature/3209
#3209 MetricsAsJson escape the SQL string content
2023-10-04 23:43:07 +13:00
Rob Bygrave 429843c358 #3209 MetricsAsJson escape the SQL string content 2023-10-04 23:15:14 +13:00
Rob Bygrave eab4f9c739 Add Java 21 to Multi-JDK Build 2023-09-20 23:12:04 +12:00
Rob BygraveandGitHub b445857227 Merge pull request #3224 from FOCONIS/use-glassfish-jaxb
use glassfish jaxb instead of old com.sun jaxb
2023-09-19 23:14:42 +12:00
Rob Bygrave dc7b73fc25 Follow up #3223 - modify test, could use @Column(insertable = false, updatable = false) instead of @Formula 2023-09-19 23:03:30 +12:00
Rob Bygrave d5048db2c6 Follow up #3223 - Add @IdClass example test 2023-09-19 23:02:31 +12:00
Rob Bygrave 0b0b7cbc67 Follow up #3223 - tidy test only
Make Embedded Id bean more immutable via final fields and constructor
2023-09-19 22:47:23 +12:00
Rob BygraveandGitHub 008f132453 Merge pull request #3223 from FOCONIS/fix-find-props-for-id-class
Regression of #3133 with formula properties
2023-09-19 22:39:29 +12:00
Roland Praml 6d2038355f use glassfish jaxb instead of old com.sun jaxb 2023-09-19 08:37:20 +02:00
Roland Praml 004f4deae3 Regression of #3133 with formula properties 2023-09-18 14:59:17 +02:00
Rob BygraveandGitHub 9223796f02 Merge pull request #3221 from ebean-orm/feature/jakarta-master
Move source to Jakarta (use ./jakarta-to-javax.sh)
2023-09-11 23:34:15 +12:00
Rob Bygrave ff43672f4e Move source to Jakarta (use ./jakarta-to-javax.sh)
Moving the master branch to use jakarta based code and
dependencies. Change to use ./jakarta-to-javax.sh to convert
back to javax when releasing that.
2023-09-11 23:31:01 +12:00
Rob Bygrave 811255200e Update jakarta-to-javax.sh for jakarta.transaction module name 2023-09-11 23:21:55 +12:00
Rob BygraveandGitHub 6db1b86e12 Merge pull request #3220 from ebean-orm/feature/3216
#3216 - Fix querybean generation for @Embedded beans (fix for 13.22.0…
2023-09-11 23:06:31 +12:00
Rob Bygrave 400e840c22 Fix test for MariaDB which does not support delete with subquery with limit
like:

delete from bbookmark_user where id in (select t0.id from bbookmark_user t0 where t0.name = ? limit 10)
2023-09-11 23:05:55 +12:00
Rob Bygrave f03892a4bd #3216 - Fix querybean generation for @Embedded beans (fix for 13.22.0 change)
Version 13.22.0 added a change to query bean generation that has an issue for
embedded beans. This fixes that issue.
2023-09-11 23:01:44 +12:00
Rob Bygrave 0842a3f3e2 Version 13.22.0 2023-08-30 22:17:31 +12:00
Rob Bygrave bd0cad723d Add test for Map @OneToMany without orphanRemoval
Without orphanRemoval then map.clear() does not invoke any lazy loading.
2023-08-29 22:16:37 +12:00
Rob BygraveandGitHub c83c85efc3 Merge pull request #3206 from ebean-orm/feature/3173-beanMap-clear
Map.clear() on a @OneToMany orphanRemoval=true invokes 1+N queries du…
2023-08-29 22:10:36 +12:00
Rob Bygrave b6b8f77213 Map.clear() on a @OneToMany orphanRemoval=true invokes 1+N queries due to MapKey
The fix is for LoadManyRequest to detect when a MapKey is on the collection
and include that in the lazy loading query (to avoid the N queries invoked)
2023-08-29 22:08:56 +12:00
Rob Bygrave 770eb06cab Add test for lazy loading @OneToMany using Map 2023-08-29 22:03:58 +12:00
Rob BygraveandGitHub 180b4d6e46 Merge pull request #3205 from ebean-orm/feature/3173-beanSet-clear
Follow up #3173 - Change BeanSet clear() to lazy load ALL properties
2023-08-29 22:02:07 +12:00
Rob Bygrave 5377454476 Follow up #3173 - Change BeanSet clear() to lazy load ALL properties
To avoid the 1+N lazy loading queries that are invoked due to the clear()
when the entity bean in the Set has a hashCode/equals implementation
2023-08-29 21:20:19 +12:00
Rob BygraveandGitHub dbbf6dd566 Merge pull request #3204 from ebean-orm/feature/3173-beanSet-clear
Follow up #3173 - Add test for BeanSet clear() when hashCode/equals used
2023-08-29 21:16:44 +12:00
Rob Bygrave 4b9d4d0a90 Follow up #3173 - Add test for BeanSet clear() when hashCode/equals used
This shows the extra lazy loading that is occurring when clear() is
called on the [Bean]Set DUE to the hashcode/equals implementation that
is present on the entity bean that is in the Set.
2023-08-29 21:13:19 +12:00
Rob Bygrave 90fc4466bf Follow up #3173 - Add test for BeanSet lazy loading OneToMany with hashCode/equals 2023-08-29 18:43:16 +12:00
Rob BygraveandGitHub 0d69377f8b Merge pull request #3203 from ebean-orm/feature/3173-BeanSet
#3173 - BeanSet lazy loading / Too many DataSource connections used
2023-08-29 18:32:04 +12:00
Rob Bygrave 359a55d7a5 #3173 - BeanSet lazy loading / Too many DataSource connections used
- The error reported was that a DataSource connection pool maxed out
- The symptom was that there was an additional lazy loading queries invoked via the hashCode/equals implementation of ManyToMany Set.
- The fix is for BeanSet init() to lazy load with onlyIds = false, that avoids the extra lazy loading query from being executed
2023-08-29 18:28:09 +12:00
Rob BygraveandGitHub b7804e7486 Merge pull request #3197 from ebean-orm/feature/parent-poms
Update ebean-agent to 13.22.0, required to support change in query bean generation
2023-08-27 22:48:17 +12:00
Rob Bygrave febb018036 Update ebean-agent to 13.22.0 2023-08-27 21:59:34 +12:00
Rob BygraveandGitHub dc0585246f Merge pull request #3196 from ebean-orm/feature/parent-poms
Use ebean-parent as parent pom for composites and platforms
2023-08-27 21:55:34 +12:00
Rob Bygrave 22c1848f58 Use ebean-parent as parent pom for composites and platforms 2023-08-27 21:53:11 +12:00
Rob BygraveandGitHub 054ea26893 Merge pull request #3195 from ebean-orm/feature/deprecate-database-commitTransaction
Deprecate for removal Database.commitTransaction() and Database.rollb…
2023-08-27 20:32:07 +12:00
Rob Bygrave 8c30b66d39 Add forRemoval = true on existing @Deprecated 2023-08-27 20:31:03 +12:00
Rob Bygrave 14f9fe68f7 Deprecate for removal Database.commitTransaction() and Database.rollbackTransaction() 2023-08-27 20:30:33 +12:00
Rob Bygrave d56ca5b841 Deprecate for removal Database.commitTransaction() and Database.rollbackTransaction()
Migrate to using try-with-resources and transaction.commit() and transaction.rollback()
2023-08-27 20:29:05 +12:00
Rob BygraveandGitHub 3f97f0f212 Merge pull request #3192 from ebean-orm/feature/spiEbeanServer
Refactor internal SpiEbeanServer API - transaction from SpiQuery
2023-08-26 00:19:16 +12:00
Rob Bygrave 60e0c552ab Fix test for MySql, which does not support delete statement with limit clause 2023-08-26 00:17:57 +12:00
Rob Bygrave f889628677 No functional change, tidy in persist.dml and dmlbind packages only 2023-08-26 00:15:37 +12:00
Rob Bygrave 128bd171f5 Refactor SpiEbeanServer for SpiSqlQuery with transaction (vs passing transaction) 2023-08-25 23:51:09 +12:00
Rob Bygrave 6402a346a1 Reuse via adding SpiOrmQueryRequest.isGetAllFromBeanCache() 2023-08-25 23:28:07 +12:00
Rob Bygrave 0ab0f9c569 Refactor internal SpiEbeanServer API - transaction from SpiQuery
Originally the API took explicit transactions but then the API changed
toward query.usingTransaction(), which means the SpiQuery holds the
explicit transaction.

This change is to update the SpiEbeanServer API to reflect that it can get
explicit transaction from SpiQuery.transaction() rather than pass transaction
around.

Doing this also identified a small bug where L2 cache could be hit when it should
not after there is some update on the transaction (hence the adjustment to the
test TestBeanCache missCount)
2023-08-25 23:15:51 +12:00
Rob BygraveandGitHub 19e21e17cc Merge pull request #3191 from ebean-orm/feature/spiEbeanServer
#3188 Fix findFutureCount() when there is a current transaction in scope
2023-08-25 21:15:15 +12:00
Rob Bygrave 7e60c66759 Follow up for #3188 Add tests for futures when creating new transaction 2023-08-25 21:05:14 +12:00
Rob Bygrave 4f18dc339f Follow up for #3188 Fix findFutureList() and findFutureIds() when txn in scope
Apply the same fix to findFutureList() and findFutureIds()
2023-08-25 20:56:55 +12:00
Rob Bygrave 60a2626f61 #3188 Fix findFutureCount() when there is a current transaction in scope 2023-08-25 20:32:48 +12:00
Rob BygraveandGitHub e3a6f12478 Merge pull request #3190 from ebean-orm/feature/spiEbeanServer
Refactor SpiEbeanServer to use SpiQuery
2023-08-25 20:31:29 +12:00
Rob Bygrave 2e980b06f6 Refactor SpiEbeanServer to use SpiQuery 2023-08-25 17:53:23 +12:00
Rob BygraveandGitHub b27b5512e3 Merge pull request #3189 from ebean-orm/feature/bump-datasource-dependency
Bump to ebean-datasource 8.7
2023-08-25 15:40:39 +12:00
Rob Bygrave 3a013d50d6 Bump to ebean-datasource 8.7 2023-08-25 15:40:09 +12:00
Rob Bygrave 3ebfd2e9e6 Update test only - TestDeleteCascadingOneToMany 2023-08-24 21:01:11 +12:00
Rob BygraveandGitHub f51b69445a Merge pull request #3187 from ebean-orm/feature/3183-deleteQueryIn
Update test only - TestDeleteCascadeById
2023-08-24 20:55:14 +12:00
Rob Bygrave 96904d525f Update test only - TestDeleteCascadeById 2023-08-24 20:54:43 +12:00
Rob BygraveandGitHub 26fa885adb Merge pull request #3186 from ebean-orm/feature/3183-deleteQueryIn
#3183 - Fix for: Wrong limit using setMaxRows on delete between calls
2023-08-24 20:38:32 +12:00
Rob Bygrave f4ca4ec476 #3183 - Fix for: Wrong limit using setMaxRows on delete between calls
Reproduces when the delete needs to perform a select due to caching or
cascading of the delete
2023-08-24 20:35:11 +12:00
Rob Bygrave 327995526e Fix tests for Postgres 2023-08-24 20:17:41 +12:00
Rob BygraveandGitHub dfbbdc7d58 Merge pull request #3182 from ebean-orm/feature/delete-batch-v2
When delete batching, use number of id properties
2023-08-23 10:54:21 +12:00
Rob Bygrave 35894b3d8f When delete batching, ALSO in deleteManyDetails use number of properties
Use int batch = maxDeleteBatch / targetDesc.idBinder().size()
2023-08-22 23:55:55 +12:00
Rob Bygrave 0f219b4cd0 When delete batching, use number of id properties 2023-08-22 23:49:38 +12:00
Rob Bygrave bfe94786de Merge branch 'FOCONIS-experimental-elliminate-not-in-with-too-many-params' 2023-08-22 23:43:41 +12:00
Rob Bygrave 6cab2498dc Merge branch 'experimental-elliminate-not-in-with-too-many-params' of github.com:FOCONIS/ebean into FOCONIS-experimental-elliminate-not-in-with-too-many-params 2023-08-22 23:22:11 +12:00
Rob BygraveandGitHub dbe81bdb6e Merge pull request #3180 from FOCONIS/bugfix/setId-or-idEq-in-subquery
BUG: Using a subquery with idEq or setId is missing the bind value
2023-08-22 22:35:31 +12:00
Jonas Pöhler 2e2b3844fe Tidy test 2023-08-22 11:36:44 +02:00
Jonas Pöhler 78b77dcd82 Potential Fix for using idEq or setId in subquery 2023-08-22 11:04:48 +02:00
Jonas Pöhler 90614adb2b ADD: Testcase to show missing bind values when using idEq or setId in subquery 2023-08-22 11:04:24 +02:00
Rob BygraveandGitHub 019ef43fe7 Merge pull request #3177 from ebean-orm/feature/remove-InTuples-literal-mode
#3166 Remove InTuples literal mode
2023-08-22 08:23:54 +12:00
Rob Bygrave cfb6f0a908 #3166 Remove InTuples literal mode, remove related plan useCache() 2023-08-22 08:18:19 +12:00
Roland Praml 77aeda1753 draft: elliminate the "not in" query that may 'explode' on SqlServer 2023-08-21 17:10:23 +02:00
Roland Praml 2a24ec3d49 Added some tests 2023-08-21 16:51:19 +02:00
Roland Praml d9d09b31b4 Refactored delete-by-id 2023-08-21 15:36:05 +02:00
Rob Bygrave 56550a9534 #3166 Remove InTuples literal mode 2023-08-21 23:16:55 +12:00
Rob BygraveandGitHub f40beb8234 Merge pull request #3175 from ebean-orm/feature/ListsPartition
For Lists.partition() fix for empty list input
2023-08-21 20:37:32 +12:00
Rob Bygrave cb06052c86 For Lists.partition() fix for empty list input
Fix such that empty list input produces an empty list
2023-08-21 20:19:59 +12:00
Rob BygraveandGitHub e09265fbc5 Merge pull request #3174 from FOCONIS/more-char-append
Use char-append instead of String-append
2023-08-21 19:58:42 +12:00
Roland Praml dede93ca62 Use char-append instead of String-append 2023-08-21 08:22:18 +02:00
Rob BygraveandGitHub caf8bd0c0f Merge pull request #3172 from ebean-orm/feature/filterManyRaw
Add filterManyRaw() and Deprecate filterMany( <string expressions> )
2023-08-21 11:30:43 +12:00
Rob Bygrave 01d89a01a5 Fix new test in QCustomerTest 2023-08-21 11:22:02 +12:00
Rob Bygrave b0da647b0e Fix javadoc for filterManyRaw() 2023-08-21 11:17:29 +12:00
Rob Bygrave fbcd4c3133 Add filterManyRaw() and Deprecate filterMany( <string expressions> )
The filterMany( <string expressions> ) uses the language parser which
ultimately will we probably remove in ebean 15.x

Code can migrate to filterManyRaw() instead or better yet change to
use the improved query beans filterMany( <closure> ) option that will
be included in this same ebean release.
2023-08-21 11:15:39 +12:00
Rob BygraveandGitHub 3e41c5973b Merge pull request #3171 from ebean-orm/feature/filterMany-raw-expression
FIX for filterMany with raw expression with single SQL query
2023-08-21 09:39:40 +12:00
Rob Bygrave 1933beed9b Tidy unused import in CQueryPredicates 2023-08-20 23:52:10 +12:00
Rob Bygrave defb35b258 FIX for filterMany with raw expression with single SQL query
Fix for the case where the filterMany is not executed on a separate
query but instead part of the origin query.

The fix is to use the appropriate DeployParser and also fix the path
alias like ${} -> ${contacts}
2023-08-20 23:32:55 +12:00
Rob Bygrave 8a4024ecfc FIX for filterMany with raw expression with single SQL query
Fix for the case where the filterMany is not executed on a separate
query but instead part of the origin query.

The fix is to use the appropriate DeployParser and also fix the path
alias like ${} -> ${contacts}
2023-08-19 13:54:38 +12:00
Rob Bygrave 9756c9133e Improve existing test for filterMany using raw with separate SQL query for filterMany 2023-08-19 13:46:45 +12:00
Rob BygraveandGitHub c07d5e2c97 Merge pull request #3170 from ebean-orm/feature/prefer-char-append
Refactor prefer char append
2023-08-19 11:11:35 +12:00
Rob Bygrave 00e594d4fa Refactor prefer char append 2023-08-19 11:01:15 +12:00
Rob Bygrave 3bf316af2b Update Test QCustomerTest removing extra space character in the SQL 2023-08-19 10:17:00 +12:00
Rob BygraveandGitHub b116d3da28 Merge pull request #3169 from ebean-orm/feature/filterMany-TQAssoc
Add Query bean filterMany() taking a closure
2023-08-19 10:11:46 +12:00
Rob BygraveandGitHub 804618d699 Merge pull request #3168 from ebean-orm/feature/like-extra-space
Remove extra space added to the generated SQL via the LIKE expression
2023-08-19 10:05:17 +12:00
Rob Bygrave 0e9fe6a096 Remove extra space added to the generated SQL via the LIKE expression 2023-08-19 09:29:19 +12:00
Rob Bygrave ded4b94e54 Add Query bean filterMany() taking a closure
Query beans also generate a "Assoc" query bean that is used
for the relationships. Previously these were generated into a
.query.assoc package and with this they are generated as an
inner class of the query bean.

This then allows the change where an additional filterMany()
is generated on the "Assoc" bean that takes a closure. This
simplifies the use of query beans for filterMany.

This change to the generated query beans needs a change to the
ebean-agent enhancement.
2023-08-18 22:12:30 +12:00
Rob Bygrave eb0812df16 Bump to next snapshot 2023-08-17 23:26:26 +12:00
Rob Bygrave 9ccaa824e0 Version 13.21.0 2023-08-17 22:51:00 +12:00
Rob BygraveandGitHub d6e46b15a3 Merge pull request #3167 from ebean-orm/feature/InTuples-Literal-skipCache
Change Lists.partition() argument order to match Guava's
2023-08-17 15:36:35 +12:00
robin.bygrave bab9be0228 Change Lists.partition() argument order to match Guava's
- May as well match what they have in terms of arg order
- Change from interface to class might be better
2023-08-17 15:36:03 +12:00
Rob BygraveandGitHub 9331050a43 Merge pull request #3166 from ebean-orm/feature/InTuples-Literal-skipCache
InTuples literal mode - don't cache ebean compiled query plan
2023-08-17 15:34:17 +12:00
robin.bygrave 9bcd189730 Test TestInTuplesWithLocalDate does not support SQLServer and DB2 yet 2023-08-17 15:24:28 +12:00
Rob BygraveandGitHub 428365ceb9 Merge pull request #3164 from FOCONIS/bugfix/drop_foreign_key_without_index
BUG: Include drop for foreign keys without index when dropping table
2023-08-17 15:12:19 +12:00
robin.bygrave 76c889c6d9 InTuples literal mode - don't cache ebean compiled query plan
- Don't cache ebean compiled query plan when InTuples goes into literal mode
- Postgres maxInBinding = 32_000;
- SQLite maxInBinding = 800;
- Note that not caching the compiled query plan means that metrics visitor isn't
  going to see it, we lose collection of that query execution metric. We might
  need a plan to fix this later.
2023-08-17 15:08:16 +12:00
Rob BygraveandGitHub 9e4007d25a Merge pull request #3165 from ebean-orm/feature/Lists-partitions
Add support for literal mode for InTuples with lots of entries
2023-08-17 10:31:03 +12:00
Rob Bygrave 9d7754b92d Add support for literal mode for InTuples with lots of entries
So as to not exceed the limit on bind values, the InTuples expression can
go into literal mode where it uses literal values for supported types -
Numbers, Strings, UUID, and LocalDate.
2023-08-17 00:33:56 +12:00
Rob BygraveandGitHub 3c80032063 Merge pull request #3163 from ebean-orm/feature/Lists-partitions
Add Lists.partition() helper method and use in DefaultPersister batch deletion
2023-08-17 00:32:04 +12:00
Jonas Pöhler 7dae937491 Generate working migration 2023-08-16 12:00:23 +02:00
Jonas Pöhler 6ce5e865ca FIX: also include foreign keys without index in drop statement 2023-08-16 11:59:50 +02:00
Jonas Pöhler b0d8fa0286 Generate failing migration 2023-08-16 11:58:57 +02:00
Jonas Pöhler 83c85adbde ADD: testcase 2023-08-16 11:57:34 +02:00
Rob Bygrave a1b51fd8ef For DefaultPersister batch deletion, use more explicit maxDeleteBatch 2023-08-16 17:55:41 +12:00
Rob Bygrave bcc4034371 Add Lists.partition() helper method and use in DefaultPersister batch deletion 2023-08-16 17:39:10 +12:00
Rob BygraveandGitHub 3dde07fc9f Merge pull request #3162 from ebean-orm/feature/3133-postgres
Tidy IdBinderEmbedded - merge use of getIdProperty() and idSelect()
2023-08-16 00:17:23 +12:00
Rob Bygrave 87ada9e999 IdBinder - refactor rename methods 2023-08-16 00:11:46 +12:00
Rob Bygrave ea55f25d44 Tidy IdBinderEmbedded - merge use of getIdProperty() and idSelect() to use idSelect()
Means we can remove getIdProperty()
2023-08-15 23:36:59 +12:00
Rob BygraveandGitHub 2231f723f8 Merge pull request #3161 from ebean-orm/feature/3133-postgres
Fix to #3133 changes for Postgres adding back support for MultiValue binding
2023-08-15 23:18:53 +12:00
Rob Bygrave 7c16694d4b Fix to #3133 changes for Postgres adding back support for MultiValue binding
The MultiValue binding that we use for Postgres, Yugabyte etc was lost with
the changes in #3133 and this puts that back.

We desire to use Postgres ANY Array binding for these cases.
2023-08-15 23:17:31 +12:00
Rob BygraveandGitHub ea60ff47cf Merge pull request #3160 from ebean-orm/feature/alsoIf
Add Query alsoIf() to conditionally apply changes to a query
2023-08-15 22:25:28 +12:00
Rob BygraveandGitHub 1f7912dab6 Merge pull request #3159 from ebean-orm/feature/idClass
Change IdClass property name to _$IdClass$
2023-08-15 21:59:56 +12:00
Rob Bygrave ec0c00eb72 Add Query alsoIf() to conditionally apply changes to a query 2023-08-15 21:56:50 +12:00
Rob Bygrave dd99e32cc6 Change IdClass property name to _$IdClass$ 2023-08-15 21:55:09 +12:00
Rob BygraveandGitHub 1decbe0152 Merge pull request #3147 from FOCONIS/rethrow-error-in-commit
FIX: Rethrow error in commit path of callbacks
2023-08-14 23:25:04 +12:00
Rob BygraveandGitHub d58e3d023f Merge pull request #3158 from ebean-orm/feature/tidy-idBinderEmbedded
Followup for #3133 - "Embedded id expansion on parentIds" for SQLServer and DB2
2023-08-14 23:06:28 +12:00
Rob Bygrave 1598b40c36 Followup for #3133 - "Embedded id expansion on parentIds" for SQLServer and DB2 2023-08-14 23:00:41 +12:00
Rob BygraveandGitHub 66ef667a0a Merge pull request #3157 from ebean-orm/feature/tidy-idBinderEmbedded
Tidy IdBinderEmbedded final fields, StringBuilder sizes and reuse code
2023-08-14 22:59:15 +12:00
Rob Bygrave e821d66268 Tidy IdBinderEmbedded final fields, StringBuilder sizes and reuse code 2023-08-14 15:10:00 +12:00
Rob BygraveandGitHub b8e164e04c Merge pull request #3148 from FOCONIS/fix-recursive-batch-flush
FIX: Recursive batch flush can save beans in wrong order
2023-08-14 13:55:50 +12:00
Rob BygraveandGitHub 9097466a7b Merge pull request #3145 from FOCONIS/m2m-where-formula
FIX: Query on formula m2o-property uses wrong alias:
2023-08-14 13:55:21 +12:00
Rob BygraveandGitHub 99604d8ec3 Merge pull request #3155 from ebean-orm/feature/3133-IdClass-match-on-name
#3133 - For IdClass match on property name
2023-08-14 13:53:58 +12:00
Rob Bygrave 95d37fc3dc Temporary ignore test TestCompositeForeignKey for DB2 and SQLServer 2023-08-14 13:41:34 +12:00
Rob Bygrave 76d85adc98 Fix tests for #3133 MySql and SQLServer which require column ordering of PK and FK to match 2023-08-14 11:14:43 +12:00
Rob Bygrave 2f233db465 #3133 - For IdClass match on property name 2023-08-10 23:22:57 +12:00
Rob Bygrave 1ca73ca6aa Test only - Update test IdClass CEPProductCategoryId to match expectations 2023-08-10 23:17:47 +12:00
Rob BygraveandGitHub d5e4c13fa8 Merge pull request #3154 from ebean-orm/feature/3134-idClass-delete
#3134 - String cannot be cast to class io.ebean.bean.EntityBean" when deleting entities that use cascade = [CascadeType.ALL] with composite keys
2023-08-10 21:15:09 +12:00
Rob Bygrave b5ac31838c #3134 Fix for - String cannot be cast to class io.ebean.bean.EntityBean" when deleting entities that use cascade = [CascadeType.ALL] with composite keys 2023-08-10 21:11:58 +12:00
Rob Bygrave e3e9412eea #3134 Failing test - String cannot be cast to class io.ebean.bean.EntityBean" when deleting entities that use cascade = [CascadeType.ALL] with composite keys 2023-08-10 20:50:40 +12:00
Roland PramlandRoland Praml d3427876b7 FIX: Recursive batch flush can save dependant beans in wrong order 2023-08-08 16:59:46 +02:00
Roland Praml 4b2976e31b Rethrow error in commit path of callbacks 2023-08-08 16:35:25 +02:00
Roland Praml 5720ee65b3 Ignored Postgres Platform 2023-08-08 14:02:49 +02:00
Roland Praml 7f441ce72e FIX: M2M Where Formula joins 2023-08-08 14:02:34 +02:00
Rob BygraveandGitHub 83e87b0c67 Merge pull request #3140 from ebean-orm/feature/bump-datasource
Bump ebean-datasource to 8.6, increases validation timeout default to 30 secs
2023-07-23 14:35:57 +12:00
Rob Bygrave 578feac87f Bump ebean-datasource to 8.6, increases validation timeout default to 30 secs 2023-07-21 17:02:08 +12:00
Rob BygraveandGitHub 42a64e715d Merge pull request #3138 from ebean-orm/feature/postgres-queryplan-capture-buffers
[Postgres] Include buffers in Postgres explain - explain (analyze, buffers)
2023-07-18 14:35:24 +12:00
robin.bygrave 12a3a180f4 [Postgres] Include buffers in Postgres explain - explain (analyze, buffers) 2023-07-18 13:52:21 +12:00
Rob BygraveandGitHub 8acd5bcb39 Merge pull request #3131 from ebean-orm/feature/h2-nonKeyWords
Modify ebean-test H2Database setup to default KEY,VALUE as non-keywords
2023-07-11 12:49:15 +12:00
Rob BygraveandGitHub eb71756c65 Merge pull request #3136 from ebean-orm/dependabot/maven/com.h2database-h2-2.2.220
Bump h2 from 2.1.214 to 2.2.220
2023-07-11 12:48:04 +12:00
dependabot[bot]andGitHub 8c8cadd471 Bump h2 from 2.1.214 to 2.2.220
Bumps [h2](https://github.com/h2database/h2database) from 2.1.214 to 2.2.220.
- [Release notes](https://github.com/h2database/h2database/releases)
- [Commits](https://github.com/h2database/h2database/compare/version-2.1.214...version-2.2.220)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-07 21:57:51 +00:00
Rob BygraveandGitHub 222c49c59b Merge pull request #3130 from ebean-orm/feature/3123-root-error-suppressed
#3123 Root cause error can be suppressed on initialisation
2023-07-05 23:47:11 +12:00
Rob Bygrave 1e860112e6 Modify ebean-test H2Database setup to default KEY,VALUE as non-keywords
H2Database 2.x changed KEY and VALUE to be deemed keywords for SQL compliance. This is actually a bit of a pain as all the other databases we test allow KEY and VALUE as column names.

This changes the setup for H2Database to treat KEY and VALUE as non keywords as before and be more consistent with the other databases.
2023-07-05 23:46:06 +12:00
Rob Bygrave ffc21daaba Bump to next snapshot 2023-07-05 23:28:49 +12:00
Rob Bygrave f9adcb2c5a #3123 Root cause error can be suppressed on initialisation 2023-07-05 23:16:00 +12:00
Rob Bygrave d051bba71f Version 13.20.1 2023-07-04 12:05:30 +12:00
Rob Bygrave f414f04033 Add note on lack of support for InTuples with SQLServer and DB2 2023-07-04 12:05:10 +12:00
Rob Bygrave ac466ecd79 #3125 Add query.usingMaster() for query beans 2023-07-03 23:30:02 +12:00
Rob Bygrave 262a7f9bab Bump ebean-agent version 2023-07-03 22:57:55 +12:00
Rob BygraveandGitHub bb02d74005 Merge pull request #3125 from ebean-orm/feature/query-usingMaster
Add query.usingMaster() to explicitly choose master data source
2023-07-03 22:48:47 +12:00
Rob BygraveandGitHub e9b2b8d266 Merge pull request #3017 from ebean-orm/feature/db2luw9
Initial DB2Luw9Platform using row_number() for row limiting sql
2023-07-03 22:43:55 +12:00
Rob Bygrave fc16bde227 Modify ImplicitReadOnlyTransaction, call deactivate in finally 2023-07-03 22:43:13 +12:00
Rob Bygrave d1775dfcc4 #3017 Change DB2LegacyPlatform to also use the row_number limiters 2023-07-03 22:35:46 +12:00
3d5937f6da Update platforms/db2/src/main/java/io/ebean/platform/db2/DB2RowNumberBasicLimiter.java
Bump StringBuilder to use 120

Co-authored-by: Roland Praml <roland.praml@foconis.de>
2023-07-03 22:31:01 +12:00
Rob BygraveandGitHub adca8cd8fa Merge branch 'master' into feature/db2luw9 2023-07-03 22:28:43 +12:00
Rob BygraveandGitHub 6d30e6310b Merge pull request #3127 from ebean-orm/feature/3126
#3126 - Incorrect complex indexes generation
2023-07-03 22:22:32 +12:00
Rob Bygrave 79ed0a5f8e #3126 - Incorrect complex indexes generation 2023-07-03 22:19:38 +12:00
Rob Bygrave 94b3a020d5 Modify ImplicitReadOnlyTransaction useCommit to check connection.getAutoCommit() 2023-07-03 21:40:21 +12:00
Rob Bygrave 3e241907e6 Modify internal ImplicitReadOnlyTransaction to also support calling commit()
Originally, ImplicitReadOnlyTransaction was built to support read-only DataSource where the connections are using autoCommit true. This change modified ImplicitReadOnlyTransaction to also support use with the main DataSource where the connection are not using autoCommit true.

This is also now needed for the query.usingMaster() case where we have an implicit read only transaction but use the main DataSource with underlying connection requiring explicit commit() at the end of the transaction.
2023-07-03 21:27:58 +12:00
Rob Bygrave c4af1d9b23 Add query.usingMaster() to explicitly choose master data source
When we have a read replica with potential for replication lag, and config a read only DataSource to use that read replica, by default a query executed without a current transaction will use the read replica.

We specify usingMaster() when we explicitly want to execute a query and use the master data source.
2023-07-03 16:41:22 +12:00
Rob BygraveandGitHub 7702169762 Merge pull request #3124 from ebean-orm/feature/InTuples
Add InTuples expression for multi-column IN expression
2023-07-03 12:48:21 +12:00
Rob Bygrave 8209d9e229 Add SpiInTuples to hide more details from InTuples 2023-07-03 12:41:31 +12:00
Rob Bygrave 664120f369 Add InTuples expression for multi-column IN expression 2023-07-03 11:54:38 +12:00
Rob Bygrave e952b555e0 Add InTuples expression for multi-column IN expression 2023-07-03 11:49:53 +12:00
Rob BygraveandGitHub d99c50da75 Merge pull request #3122 from ebean-orm/feature/3109-jta-txn-fix
#3109 Fix for JtaTransactionManager when no active transaction
2023-06-26 21:30:55 +12:00
Rob Bygrave d4bec166f7 #3109 Fix for JtaTransactionManager when no active transaction
The call to registry() can throw an exception so
pulling that inside the try catch block and handle
that as no active transaction returning null.
2023-06-26 21:30:01 +12:00
Rob Bygrave 9a4b9d4bec Bump to next snapshot version 2023-06-21 07:08:13 +12:00
Rob Bygrave 68a6e98292 Version 13.20.0 2023-06-20 20:35:04 +12:00
Rob Bygrave d61bdb028b Bump ebean-agent to 13.20.0 2023-06-20 20:32:29 +12:00
Rob BygraveandGitHub 9ddadb1338 Merge pull request #3118 from ebean-orm/feature/3109-JtaTransaction-currentTransaction
#3109 JtaTransactionManager - fix getCurrentTransaction()
2023-06-20 19:46:45 +12:00
Rob Bygrave fa1f225e67 #3109 follow up - refactor rename internal methods 2023-06-20 19:41:00 +12:00
Rob Bygrave 7a72adedfa #3109 JtaTransactionManager - fix getCurrentTransaction()
Fix for JtaTransactionManager to allow Wildfly (or other) to throw an Exception when TransactionSynchronizationRegistry.getResource() is called.
2023-06-20 19:39:08 +12:00
Rob BygraveandGitHub 3d3e5c2c34 Merge pull request #3117 from ebean-orm/feature/bump-test-containers
Bump ebean-test-containers to 7.1
2023-06-20 18:45:06 +12:00
Rob Bygrave 708f429c21 Bump ebean-test-containers to 7.1 2023-06-20 18:40:48 +12:00
Rob BygraveandGitHub bca49ed2e2 Merge pull request #3116 from ebean-orm/feature/bump-test-containers
Bump ebean-test-containers to 7.0
2023-06-20 17:47:15 +12:00
Rob Bygrave e103ec7706 Bump ebean-test-containers to 7.0 2023-06-20 17:46:36 +12:00
Rob BygraveandGitHub 9fc1bec6a9 Merge pull request #3046 from FOCONIS/bugfix/lazy_loading_findEach_garbage_collection
Bugfix for NPE when lazyLoading in findEach due to Garbage Collection
2023-06-17 11:56:25 +12:00
Rob BygraveandGitHub f712635860 Merge pull request #3107 from FOCONIS/json-tests
DB specific length support in JSONs/Varchars/binary data
2023-06-17 11:38:46 +12:00
Rob BygraveandGitHub 47a0e38eac Merge pull request #3114 from ebean-orm/feature/3113-followup
Followup to #3113, remove unused first BatchControl queue
2023-06-17 11:36:53 +12:00
Rob Bygrave 870d90d055 Followup to #3113, remove unused first BatchControl queue 2023-06-17 11:35:51 +12:00
Rob BygraveandGitHub ac1b30782a Merge pull request #3113 from FOCONIS/bugfix/batch_ordering_many2many_intersection
Bugfix for wrong batch statement ordering with many2many relations
2023-06-17 11:28:01 +12:00
Jonas Pöhler b63445e9c9 FIX: Put the delete statements into the correct flush-queue, so they do not conflict with the following inserts 2023-06-16 16:26:14 +02:00
Jonas Pöhler 09f616aae8 ADD: testcase for showing an issue with deleting and re-adding many-to-many elements (size > 20)
(cherry picked from commit e6a4bc4e0c31bb35ab5a13c958c7c4b1f68ca037)
2023-06-16 16:16:53 +02:00
Roland Praml 994fb267ad Merge branch 'master-upstream' into json-tests 2023-06-16 07:40:01 +02:00
Rob BygraveandGitHub 53b1e4d682 Merge pull request #3111 from ebean-orm/feature/3101-jpa-indexes
#3101 - Support JPA Indexes
2023-06-16 13:53:48 +12:00
robin.bygrave c7f6c508a6 #3101 - Support JPA Indexes 2023-06-16 13:44:03 +12:00
Rob BygraveandGitHub 9109fd356f Merge pull request #3108 from FOCONIS/regenerated-scripts
No code change: Regenerated scripts
2023-06-15 23:37:51 +12:00
Roland Praml 55477d4fab No code change: Regenerated scripts 2023-06-15 08:07:51 +02:00
Rob BygraveandGitHub 340281113f Merge pull request #3106 from focbenz/patch-1
Update CONFIGURATION.md with small corrections and comment for includeGeneratedFileComment
2023-06-15 08:05:26 +12:00
Roland Praml 77610672a9 Regenerated migration scripts again 2023-06-14 18:24:23 +02:00
Roland Praml d8238735c1 Fix also DbTypeMapTest, which uses the new varbinary type 2023-06-14 18:19:17 +02:00
Roland Praml f63b013ef9 Added and fixed tests 2023-06-14 18:14:12 +02:00
Roland Praml 6fe3ec9355 Migration scripts 2023-06-14 17:50:26 +02:00
Roland Praml d1c21bf50a Hana, NuoDb, SqlAnywhere: add limits (untested!) 2023-06-14 17:50:08 +02:00
Roland Praml 578560c2e2 Oracle: max varchar length = 4000, raw = 2000 2023-06-14 17:49:10 +02:00
Roland Praml 0f9462b7b5 Postgres: max varchar limit = 10MB 2023-06-14 17:32:00 +02:00
Roland Praml e89891038b Mysql: max varchar length = 4000, varbinary = 8000. Also refactored MySql(C|B)lob 2023-06-14 17:30:28 +02:00
Roland Praml 2a7a2d4dd4 DB2: max varchar length = 4000, varbinary = 8000 2023-06-14 17:27:58 +02:00
Roland Praml f499cc8c2c SQLSERVER: max nvarchar length = 4000, varbinary = 8000 (no longer using deprecated image type by default) 2023-06-14 17:19:48 +02:00
Roland Praml 0dc4c6b11b NEW: DbPlatformType supports fallback, when length exceeded (removed SqlServer workaround) 2023-06-14 17:18:06 +02:00
Roland Praml f5d0777b86 Added new test models with lengths 2023-06-14 17:17:31 +02:00
Roland Praml 81443b77bc Fixes for Clickhouse platform 2023-06-14 17:16:14 +02:00
Roland Praml 2867c50090 Do not convert explicit defined column definitions 2023-06-14 17:16:14 +02:00
Michael BenzandGitHub c04171c1a5 Update CONFIGURATION.md with small corrections
Updated configuration markdown with small corrections and removed TODO for includeGeneratedFileComment

See https://github.com/ebean-orm/ebean/issues/550
2023-06-14 14:34:09 +02:00
Rob BygraveandGitHub e19cbdc2f6 Merge pull request #3104 from FOCONIS/dbmigration-fixes
Fixed DbMigration classes (put them in the right place)
2023-06-14 07:58:50 +12:00
Roland Praml 3e2e84e8bf Fixed DbMigration classes (put them in the right place) 2023-06-13 17:20:02 +02:00
Rob Bygrave 462d30bbb7 Version 13.19.0 2023-06-07 17:56:19 +12:00
Rob BygraveandGitHub 5466b889a7 Merge pull request #3098 from ebean-orm/deprecated/BeanFinder-server
Refactor ebean-core internal API - getters -> accessors
2023-06-02 09:06:54 +12:00
Rob Bygrave d27d20dd1c Refactor ebean-core internal API - getters -> accessors 2023-06-02 09:03:29 +12:00
Rob BygraveandGitHub b6edc54cd9 Merge pull request #3097 from ebean-orm/deprecated/BeanFinder-server
Refactor ebean-core internal API - getters -> accessors and  tidy
2023-06-01 22:15:52 +12:00
Rob Bygrave 2929483b0d Refactor ebean-core internal API - getters -> accessors 2023-06-01 22:05:53 +12:00
Rob Bygrave 2ab7c3529a Tidy ebean-core internal API
- Remove unused BeanIdList
2023-06-01 21:27:55 +12:00
Rob BygraveandGitHub f409ea2431 Merge pull request #3096 from ebean-orm/deprecated/BeanFinder-server
Deprecate order() methods on Query, ExpressionList - migrate to orderBy()
2023-06-01 21:22:54 +12:00
Rob Bygrave e71be4e1b1 Deprecate order() methods on Query, ExpressionList - migrate to orderBy()
Unfortunately we have order() and orderBy() methods which do the
same thing. I have decided to deprecate the order() ones in
favour of the orderBy() methods so that ultimately we will end
up with less methods and I think orderBy() is the correct choice.

Apologies for the migration pain here.
2023-06-01 21:21:39 +12:00
Rob BygraveandGitHub 507aec20d9 Merge pull request #3095 from ebean-orm/deprecated/BeanFinder-server
No functional change, Expr internal reuse of factory() method
2023-06-01 20:57:55 +12:00
Rob Bygrave 6a2d0c233a No functional change, Expr internal reuse of factory() method 2023-06-01 20:56:13 +12:00
Rob BygraveandGitHub a1db8794bb Merge pull request #3094 from ebean-orm/deprecated/BeanFinder-server
Remove deprecated Query Bean fetchAll() - migrate to fetch()
2023-06-01 20:48:50 +12:00
Rob Bygrave bac7cd1ee7 Remove deprecated Query Bean fetchAll() - migrate to fetch()
```java

  /**
   * Deprecated in favor of fetch().
   */
  @Deprecated
  public final R fetchAll() {
    return fetch();
  }

```
2023-06-01 20:48:13 +12:00
Rob BygraveandGitHub 7ec0c72522 Merge pull request #3093 from ebean-orm/deprecated/BeanFinder-server
Remove deprecated Query setLoadBeanCache() - migrate to setBeanCacheM…
2023-06-01 20:45:34 +12:00
Rob Bygrave 430926c5a9 Remove deprecated Query setLoadBeanCache() - migrate to setBeanCacheMode()
Typically migrate to `.setBeanCacheMode(CacheMode.PUT)` or `.setBeanCacheMode(CacheMode.OFF)`

```java

  /**
   * Deprecated - migrate to use setBeanCacheMode(CacheMode.PUT) or other CacheMode.
   * <p>
   * When set to true all the beans from this query are loaded into the bean cache.
   */
  @Deprecated
  Query<T> setLoadBeanCache(boolean loadBeanCache);

```
2023-06-01 20:44:31 +12:00
Rob BygraveandGitHub a2389be4aa Merge pull request #3092 from ebean-orm/deprecated/BeanFinder-server
Remove deprecated ExpressionList.setOrderBy() - migrate to orderBy()
2023-06-01 20:34:44 +12:00
Rob Bygrave f21caa0755 Remove deprecated ExpressionList.setOrderBy() - migrate to orderBy()
Migrate to `.orderBy(String orderBy)`

```java

  /**
   * Deprecated migrate to {@link #orderBy(String)}
   */
  @Deprecated
  Query<T> setOrderBy(String orderBy);

```
2023-06-01 20:34:04 +12:00
Rob BygraveandGitHub e42d3dac18 Merge pull request #3091 from ebean-orm/deprecated/BeanFinder-server
Remove deprecated DatabaseConfig.defaultOrderById
2023-06-01 20:11:51 +12:00
Rob Bygrave 4c47a84daf Remove deprecated DatabaseConfig.defaultOrderById
Should no longer be used / set to true.

```java

  /**
   * Deprecated - look to have explicit order by. Sets the default orderById setting for queries.
   */
  @Deprecated
  public void setDefaultOrderById(boolean defaultOrderById) {
    this.defaultOrderById = defaultOrderById;
  }

```
2023-06-01 20:09:14 +12:00
Rob BygraveandGitHub 42aaceaafa Merge pull request #3090 from ebean-orm/deprecated/BeanFinder-server
Remove deprecated methods from ProfileLocation
2023-06-01 20:07:01 +12:00
Rob Bygrave e5f7a28d80 Remove deprecated methods from ProfileLocation
These methods are no longer used.
2023-06-01 20:00:50 +12:00
Rob BygraveandGitHub 074a3bacc7 Merge pull request #3089 from ebean-orm/deprecated/BeanFinder-server
Remove deprecated BeanFinder.server, migrate to BeanFinder.database
2023-06-01 19:56:34 +12:00
Rob Bygrave f52a18989c Remove deprecated BeanFinder.server, migrate to BeanFinder.database 2023-06-01 19:54:39 +12:00
Rob Bygrave f415ee22b8 Update javadoc for ExtendedServer 2023-06-01 19:51:31 +12:00
Rob Bygrave 4878ca47b5 Remove deprecated ExtendedServer query methods - use query.usingTransaction() instead
Removing all the deprecated query methods from ExtendedServer. Migrate to passing
the explicit transaction to the query using query.usingTransaction() instead.
2023-06-01 19:45:17 +12:00
Rob BygraveandGitHub 59a3766a53 Merge pull request #3087 from ebean-orm/deprecated/collectMetricsAsJson
Remove deprecated MetaInfoManager.collectMetricsAsJson() - move to co…
2023-06-01 19:36:04 +12:00
Rob Bygrave 15de44eef8 Remove deprecated MetaInfoManager.collectMetricsAsJson() - move to collectMetrics().asJson()
Removing these deprecated methods:
- collectMetricsAsJson() -> collectMetrics().asJson();
- collectMetricsAsData() -> collectMetrics().asData()

```java
  /**
   * Deprecated migrate to collectMetrics().asJson().
   */
  @Deprecated
  default ServerMetricsAsJson collectMetricsAsJson() {
    return collectMetrics().asJson();
  }

  /**
   * Deprecated migrate to collectMetrics().asData().
   */
  @Deprecated
  default List<MetricData> collectMetricsAsData() {
    return collectMetrics().asData();
  }
```
2023-06-01 19:35:03 +12:00
Rob Bygrave 5ae9942dd5 Remove unused and empty ebean-kotlin module
It never got used, may as well clean up and remove it.
2023-06-01 19:26:17 +12:00
Rob BygraveandGitHub bf375f1065 Merge pull request #3086 from ebean-orm/feature/move-components
Remove unused and empty ebean-kotlin module
2023-06-01 19:22:45 +12:00
Rob Bygrave 510e129ff6 Remove unused and empty ebean-kotlin module
It never got used, may as well clean up and remove it.
2023-06-01 19:22:16 +12:00
Rob BygraveandGitHub 1c32b9b0bc Merge pull request #3085 from ebean-orm/feature/move-components
Moved - ebean-autotune, ebean-csv-reader, ebean-joda-time, ebean-jack…
2023-06-01 19:19:39 +12:00
Rob Bygrave f25a20ff90 Moved - ebean-autotune, ebean-csv-reader, ebean-joda-time, ebean-jackson-jsonnode, ebean-externalmapping-xml
These modules have all been moved to ebean-component git repo.
These are all optional modules and will be released at a
slower cadence.
2023-06-01 19:17:14 +12:00
Rob BygraveandGitHub 0ba6753c8c Merge pull request #3084 from ebean-orm/fix/jakarta-transaction
Fix javax-to-jakarta support for jakarta.transaction
2023-06-01 08:26:54 +12:00
Rob Bygrave 7efef027c0 Fix javax-to-jakarta support for jakarta.transaction 2023-06-01 08:24:14 +12:00
Rob Bygrave 3a84695130 Version 13.18.0 2023-05-31 22:06:30 +12:00
Rob BygraveandGitHub 3f6d6908e2 Merge pull request #3081 from ebean-orm/feature/bump-migration-2
Bump ebean-migration to 13.9.0 - changes API for checkState()
2023-05-31 20:53:24 +12:00
Rob Bygrave 9f4bf6103f Bump ebean-migration to 13.9.0 - changes API for checkState()
Code using ebean-migration checkState() methods needs to change
as those methods now return a new MigrationResource interface type
2023-05-31 20:51:28 +12:00
Rob BygraveandGitHub ad7bb7063d Merge pull request #3079 from ebean-orm/feature/bump-migration
Bump ebean-migration to 13.8.0 and ebean-ddl-runner to 2.3
2023-05-29 16:28:44 +12:00
Rob Bygrave 04b4fea559 Bump ebean-migration to 13.8.0 and ebean-ddl-runner to 2.3 2023-05-29 16:27:54 +12:00
Rob BygraveandGitHub eb824949fe Merge pull request #3078 from ebean-orm/feature/refactor-renameDtoMethodUsingAccessors
Refactor internal dto methods to use accessors
2023-05-26 15:24:40 +12:00
robin.bygrave 34db4d0c1f Refactor internal dto methods to use accessors 2023-05-26 15:09:11 +12:00
Rob BygraveandGitHub 54a3113dbc Merge pull request #3077 from ebean-orm/feature/3062-dtoQuery
Use Statement for truncate table and postgres version query
2023-05-26 15:03:52 +12:00
robin.bygrave 7635630808 Use Statement for truncate table and postgres version query 2023-05-26 15:03:13 +12:00
Rob BygraveandGitHub e4018864ac Merge pull request #3075 from ebean-orm/feature/3062-dtoQuery
#3062 - DtoQuery may match the wrong constructor
2023-05-25 21:58:52 +12:00
robin.bygrave 75e69a0a23 #3062 - DtoQuery may match the wrong constructor
When 2 or more Dto constructors clash by argument count
then we need to ignore those constructors.
2023-05-25 21:57:54 +12:00
Rob BygraveandGitHub 6061f80dcc Merge pull request #3074 from ebean-orm/feature/toString_roundBrackets
Change toString to use (trimmed) with round brackets
2023-05-25 21:15:31 +12:00
robin.bygrave c60525a685 Change toString to use (trimmed) with round brackets
Change from use <> angle brackets as with json logger these are escaped which is a little ugly
2023-05-25 21:14:51 +12:00
Rob BygraveandGitHub eef628531a Merge pull request #3073 from ebean-orm/feature/bump-yugabyte
Bump yugabyte version to 2.18.0.0
2023-05-25 21:04:07 +12:00
robin.bygrave 33d9257a61 Bump yugabyte version to 2.18.0.0 2023-05-25 20:56:10 +12:00
robin.bygrave 7b032351b1 Bump yugabyte version to 2.18.0.0 2023-05-25 20:48:50 +12:00
robin.bygrave 265f865a7d Postgres DDL - Use IF NOT EXISTS with ADD COLUMN
Update generated hashes
2023-05-25 20:30:47 +12:00
Rob BygraveandGitHub 73d30310fd Merge pull request #3072 from ebean-orm/feature/postgres-dll-addColumn-ifNotExists
Postgres DDL - Use IF NOT EXISTS with ADD COLUMN
2023-05-25 20:28:41 +12:00
Rob BygraveandGitHub e26fbbb11f Merge branch 'master' into feature/postgres-dll-addColumn-ifNotExists 2023-05-25 20:25:54 +12:00
Rob BygraveandGitHub a548c16789 Merge pull request #3071 from ebean-orm/feature/postres-ddl-varchar-changeSize
Postgres DDL - Don't use cast when just changing varchar column size
2023-05-25 20:23:04 +12:00
robin.bygrave ecf650c9bc Postgres DDL - Use IF NOT EXISTS with ADD COLUMN 2023-05-25 20:22:18 +12:00
robin.bygrave b27b4e7038 Postgres DDL - Don't use cast when just changing varchar column size 2023-05-25 20:00:36 +12:00
Rob BygraveandGitHub 58d190ef12 Merge pull request #3070 from ebean-orm/dependabot/maven/ebean-test/org.xerial-sqlite-jdbc-3.41.2.2
Bump sqlite-jdbc from 3.36.0.3 to 3.41.2.2 in /ebean-test
2023-05-24 09:28:05 +12:00
dependabot[bot]andGitHub bffc9108f9 Bump sqlite-jdbc from 3.36.0.3 to 3.41.2.2 in /ebean-test
Bumps [sqlite-jdbc](https://github.com/xerial/sqlite-jdbc) from 3.36.0.3 to 3.41.2.2.
- [Release notes](https://github.com/xerial/sqlite-jdbc/releases)
- [Changelog](https://github.com/xerial/sqlite-jdbc/blob/master/CHANGELOG)
- [Commits](https://github.com/xerial/sqlite-jdbc/compare/3.36.0.3...3.41.2.2)

---
updated-dependencies:
- dependency-name: org.xerial:sqlite-jdbc
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-23 20:15:29 +00:00
Rob BygraveandGitHub 114a715432 Merge pull request #3068 from FOCONIS/throw-exceptions
DB.refrence throws EntityNotFoundException instead returning null
2023-05-23 19:29:51 +12:00
Rob BygraveandGitHub 67d98954b2 Merge pull request #3069 from ebean-orm/feature/bump-avaje-config
Bump avaje-config to 3.4
2023-05-23 19:28:47 +12:00
Rob Bygrave 53e7aafb06 Bump avaje-config to 3.4 2023-05-23 19:26:29 +12:00
Roland Praml e207b4720b DB.refrence throws EntityNotFoundException instead returning null 2023-05-23 08:37:52 +02:00
Rob BygraveandGitHub af6da23411 Merge pull request #3067 from ebean-orm/feature/2064-jakarta-transaction
#3064 - JtaTransaction does not use jarkarta prefix for javax.transaction classes
2023-05-23 17:11:38 +12:00
robin.bygrave 21f274fd34 #3064 - JtaTransaction does not use jarkarta prefix for javax.transaction classes 2023-05-23 17:09:53 +12:00
Rob BygraveandGitHub 1b8df12a01 Merge pull request #3066 from ebean-orm/feature/3060-part2
From #3060 - Add missing @Nullable to ExpressionList.findSingleAttribute()
2023-05-23 17:00:14 +12:00
robin.bygrave b210d1a6a7 From #3060 - Add missing @Nullable to ExpressionList.findSingleAttribute() 2023-05-23 16:12:13 +12:00
Rob BygraveandGitHub d53ca87d43 Merge pull request #3057 from FOCONIS/property-value-intercept
Property.value use intercept to trigger lazy load
2023-05-23 13:36:09 +12:00
Rob BygraveandGitHub 635820cab5 Merge pull request #3058 from ebean-orm/feature/BeanProperty-value-to-getValue
No functional change, change use of BeanProperty.value() to BeanProperty.getValue()
2023-05-19 16:09:37 +12:00
Rob BygraveandGitHub aedb0fdcac Merge pull request #3063 from ebean-orm/feature/improve-error-message-no-join-columns
Use DeployBeanProperty toString() removing getFullBeanName()
2023-05-19 16:08:54 +12:00
robin.bygrave 4db1925328 No functional change, change use of BeanProperty.value() to BeanProperty.getValue()
Noting that value() currently calls through to getValue() hence
this is no real change. This is done because value() is also
a public method Property.value() [and this should probably
change to use getValueIntercept() rather than getValue()]
2023-05-17 15:31:52 +12:00
Roland Praml 6f2a444954 Property.value use intercept 2023-05-16 15:28:30 +02:00
Rob BygraveandGitHub 59b6621077 Merge pull request #3055 from ebean-orm/feature/queryPlanCaptureMicros
ENH: Add captureMicros and whenCaptured to MetaQueryPlan
2023-05-16 15:38:05 +12:00
Rob BygraveandGitHub 15a39f62e6 Merge pull request #3056 from ebean-orm/bump/yugabyte
Testing - Bump YugabyteDB version for testing to 2.17.3.0-b152
2023-05-16 15:37:29 +12:00
robin.bygrave 40489706ce Testing - Bump YugabyteDB version for testing to 2.17.3.0-b152 2023-05-16 14:39:46 +12:00
robin.bygrave 742f3b6dc4 ENH: Add captureMicros and whenCaptured to MetaQueryPlan
- captureMicros is the time taken to capture the specific query plan
- whenCaptured is the time when the bind values were taken

The DefaultQueryPlanListener logging will include these in the
output it logs
2023-05-16 13:47:27 +12:00
Rob BygraveandGitHub 753617a616 Merge pull request #3039 from FOCONIS/detailed-error-message
Throw excepction when trying to create unregistered bean
2023-05-10 16:37:18 +12:00
Rob BygraveandGitHub 114da00d98 Merge pull request #3040 from FOCONIS/correct-quotes
FIX: Use correct quotes when logging
2023-05-10 16:36:27 +12:00
Rob BygraveandGitHub 283ab7a1ac Merge pull request #3038 from FOCONIS/fix-javadoc-plugin
FIX build on system without JAVA_HOME set
2023-05-10 16:35:39 +12:00
Rob BygraveandGitHub 096988c19f Merge pull request #3052 from ebean-orm/feature/dep-config
Bump jackson dependency to 2.15.0
2023-05-10 16:34:06 +12:00
Rob Bygrave baf727e8ea Bump jackson dependency to 2.15.0 2023-05-10 16:33:38 +12:00
Rob BygraveandGitHub 2eb6558145 Merge pull request #3051 from ebean-orm/feature/dep-config
Bump avaje-config dependency to 3.2
2023-05-10 16:30:39 +12:00
Rob Bygrave d946504503 Bump avaje-config dependency to 3.2 2023-05-10 16:30:03 +12:00
Rob Bygrave ed94edd96b Bump to next snapshot version 2023-05-10 16:26:03 +12:00
Rob BygraveandGitHub 6441030161 Merge pull request #3030 from ebean-orm/feature/bump-avaje-config
Included ebean-migration as a dependency of ebean, ebean-postgres etc
2023-05-10 16:24:54 +12:00
Rob Bygrave 588527a5b9 Version 13.17.4 2023-05-10 00:34:53 +12:00
Rob Bygrave 06cad500c1 #3031 Improve error message 2023-05-10 00:34:27 +12:00
Rob Bygrave e29b57811b Update README add end 2023-05-10 00:30:07 +12:00
Rob Bygrave e6bf46e8c4 Improve error message for #3031 2023-05-09 23:37:05 +12:00
Rob BygraveandGitHub 646f8cc66b Merge pull request #3050 from ebean-orm/feature/LoadBeanRequest
Fix SqlTreeLoadBean to only register new beans into load context
2023-05-09 23:23:31 +12:00
Rob Bygrave 4c9f0f23f0 Fix SqlTreeLoadBean to only register new beans into load context
Additionally, refactor LoadBeanRequest moving the MarkedAsDeleted logging
2023-05-09 22:49:17 +12:00
Rob Bygrave ecfd831603 #3049 - Support for ebean.test.containers.mirror 2023-05-08 17:22:41 +12:00
Rob BygraveandGitHub b8324905ae Merge pull request #3036 from Ryszard-Trojnacki/postgis
Implemented missing cache functions for Postgis module.
2023-05-08 17:15:14 +12:00
Rob BygraveandGitHub 8cbcd1afad Merge pull request #3049 from ebean-orm/feature/ebean.test.containers.mirror
[ebean-test] Add support for ebean.test.containers.mirror
2023-05-08 17:12:22 +12:00
Rob Bygrave 7970ea39f3 Bump to next snapshot version 2023-05-08 17:11:24 +12:00
robin.bygrave a399d4f2cd [ebean-test] Add support for ebean.test.containers.mirror
Can use this property to specify a mirror to use for test images when running in CI

Currently, we assume that for local builds we actually prefer to not use the mirror (for Arm64 support etc)
2023-05-08 14:35:14 +12:00
Jonas Pöhler edb3759b3d Potential fix for NPE in lazyLoad under HeapPressure
(cherry picked from commit 5aa163bb75)
2023-05-05 09:58:01 +02:00
Jonas Pöhler 7ee0610db1 ADD: Test for reproducing NPE with lazyloaing in findEach under HeapPressure
(cherry picked from commit 96f071e08b)
2023-05-05 09:57:43 +02:00
Roland Praml 82a6ec6957 Fix also other places 2023-04-26 11:11:12 +02:00
Roland Praml cf1c08c4ac FIX: Use correct quotes when logging 2023-04-26 10:59:41 +02:00
Roland Praml d32df16137 Throw excepction when trying to create unregistered bean 2023-04-26 10:56:14 +02:00
Roland Praml 2bcbc6fa07 FIX also other plugin versions 2023-04-26 10:39:18 +02:00
Roland Praml ba9158ec9c Javadoc POM fixes 2023-04-26 10:22:27 +02:00
Ryszard Trojnacki 40a6693a4c Implemented missing cache functions for Postgis module. 2023-04-21 08:58:44 +02:00
Rob Bygrave 1ec389864d Included ebean-migration as a dependency of ebean, ebean-postgres etc
Include ebean-migration as a dependency of all the composites. The thinking here is that we now expect to prefer ebean-migration over flyway or liquibase as the migration runner of choice. Including it means one less thing for folks to worry about in terms of syncing the versions to use etc.
2023-04-18 00:12:44 +12:00
Rob Bygrave 63a23904ac Update for DB2Luw9 with rn column as last column 2023-04-13 21:52:09 +12:00
Rob Bygrave 1807fc201e Initial DB2Luw9Platform using row_number() for row limiting sql 2023-03-30 22:56:55 +13:00
Rob Bygrave 2d03421de4 Use DeployBeanProperty toString() removing getFullBeanName() 2023-03-28 18:44:00 +13:00
2105 changed files with 26044 additions and 22147 deletions
+4 -1
View File
@@ -1,7 +1,10 @@
name: Build
on: [push, pull_request]
on:
pull_request:
push:
branches: master
jobs:
build:
+3 -1
View File
@@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java_version: [11, 17]
java_version: [11, 17, 21]
os: [ubuntu-latest]
steps:
@@ -34,6 +34,8 @@ jobs:
path:
~/.m2
key: build-${{ env.cache-name }}
- name: Maven version
run: mvn --version
- name: Build with Maven
run: mvn package
+1
View File
@@ -11,6 +11,7 @@ ebean-profiling*.xml
/db
/mydb.db
profiling/
.DS_Store
# Intellij project files
*.iml
+11 -12
View File
@@ -4,13 +4,13 @@ Overview of ebean.properties file
### DbMigration options
You can set individual values for different platforms when generating migrations
You can set individual values for different platforms when generating migrations.
`dbmigration.platform.<PLATFORM>.databaseSequenceBatchSize`
For DB's using sequences this is the number of sequence values prefetched.
`dbmigration.platform.<PLATFORM>.dbuuid`
Control, how UUID generation should work - it affects DDL which column type is generated. Possible values:
Control, how UUID generation should work - it affects which column type is generated in DDL. Possible values:
- BINARY enforces binary UUID
- VARCHAR enforces varchar UUID
- BINARY_OPTIMIZED enforces binary-optimized UUID (makes sense only with Type1 ID)
@@ -19,7 +19,7 @@ Control, how UUID generation should work - it affects DDL which column type is g
- AUTO_VARCHAR (default) use varchar when platform does not support UUID
`dbmigration.platform.<PLATFORM>.uuidStoreAsBinary`
Same as setting dbuuid to BINARY
Same as setting dbuuid to BINARY.
`dbmigration.platform.<PLATFORM>.geometrySRID`
The Geometry SRID value (default 4326).
@@ -30,7 +30,6 @@ The ID type (IDENTITY, SEQUENCE, GENERATOR, EXTERNAL)
`dbmigration.platform.<PLATFORM>.mapping`
Adjust the mapping. For example `BOOLEAN=integer(32);BIT=tinyint(3)`
`ebean.migration.applyPrefix`
Set this to "V" to be compatible with FlywayDB.
@@ -50,7 +49,7 @@ Set to true if the DB migration should be generated on server start.
The version of a pending drop that should be generated as the next migration.
`ebean.migration.includeGeneratedFileComment`
TODO
Adds the header about the migration files being generated when true. Reading 'THIS IS A GENERATED FILE - DO NOT MODIFY'
`ebean.migration.metaTable`
For running migration the DB table that holds migration execution status. Default 'db_migration'
@@ -65,17 +64,17 @@ Subdirectory the model xml files go into. Default 'model'
Suffix. Default '.model.xml'
`ebean.migration.name`
Description text that can be appended to the version to become the ddl script file name
Description text that can be appended to the version to become the ddl script file name.
`ebean.migration.patchInsertOn`
migration versions that should be added to history without running.
Migration versions that should be added to history without running.
`ebean.migration.patchResetChecksumOn`
migration versions that should have their checksum reset and not run.
Use this if you get a 'Checksum mismatch' error.
`ebean.migration.placeholders`
A comma and equals delimited placeholders that are substituted in SQL scripts when running migration (used by DB Migration runner only).
A comma and equals delimited map of placeholders that are substituted in SQL scripts when running migration (used by DB Migration runner only).
`ebean.migration.platform`
The database platform to generate migration DDL for.
@@ -90,7 +89,7 @@ The migration version name (typically FlywayDb compatible). Example: 1.1.1_2
### Ebean UUID options
`ebean.uuidVersion`
Controls, how the UUIDs are generated. Possible values
Controls how the UUIDs are generated. Possible values:
- VERSION4 (default) generate random V4 UUIDs,
- VERSION1 generate rfc4122 compliant Type 1 UUIDs (requires a state file)
- VERSION1RND generate fake Type 1 UUIDs
@@ -98,7 +97,7 @@ Controls, how the UUIDs are generated. Possible values
Note, that V1 UUIDs in conjunction with AUTO_BINARY_OPTIMIZED will give you the best index performance, but you MUST understand how this works to avoid collisions.
`ebean.uuidStateFile`
The state file that is Required to generate V1 UUIDs
The state file that is required to generate V1 UUIDs.
### DocStoreConfig
@@ -107,7 +106,7 @@ The state file that is Required to generate V1 UUIDs
True when the Document store integration is active/on.
`ebean.docstore.allowAllCertificates`
Set to true such that the client allows connections to invalid/self signed SSL certificates.
Set to true such that the client allows connections to invalid/self-signed SSL certificates.
`ebean.docstore.bulkBatchSize`
The default batch size to use for the Bulk API calls.
@@ -192,7 +191,7 @@ Suffix appended to the base table to derive the view that contains the union of
Set to true if the DataSource uses autoCommit. Indicates that Ebean should use autoCommit friendly Transactions and TransactionManager.
`ebean.autoReadOnlyDataSource`
When true create a read only DataSource using readOnlyDataSourceConfig defaulting values from dataSourceConfig
When true create a read only DataSource using readOnlyDataSourceConfig defaulting values from dataSourceConfig.
`ebean.autostart`
Should the server start all
+1
View File
@@ -120,3 +120,4 @@ To set this option as the global default for IntelliJ use:
`Run - Edit Configurations -> Edit configuration templates -> JUnit -> modify options - Do not use module-path option`
end
+13 -6
View File
@@ -2,9 +2,10 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>composites</artifactId>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.17.3</version>
<version>14.1.0</version>
<relativePath>../..</relativePath>
</parent>
<name>ebean-clickhouse</name>
@@ -16,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
@@ -31,17 +32,23 @@
<version>${ebean-datasource.version}</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-migration</artifactId>
<version>${ebean-migration.version}</version>
</dependency>
<!-- Technically optional but most expected to use query beans -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-clickhouse</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
</dependencies>
+13 -6
View File
@@ -2,9 +2,10 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>composites</artifactId>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.17.3</version>
<version>14.1.0</version>
<relativePath>../..</relativePath>
</parent>
<name>ebean-cockroach</name>
@@ -16,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
@@ -31,17 +32,23 @@
<version>${ebean-datasource.version}</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-migration</artifactId>
<version>${ebean-migration.version}</version>
</dependency>
<!-- Technically optional but most expected to use query beans -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
</dependencies>
+13 -6
View File
@@ -2,9 +2,10 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>composites</artifactId>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.17.3</version>
<version>14.1.0</version>
<relativePath>../..</relativePath>
</parent>
<name>ebean-db2</name>
@@ -16,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
@@ -31,17 +32,23 @@
<version>${ebean-datasource.version}</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-migration</artifactId>
<version>${ebean-migration.version}</version>
</dependency>
<!-- Technically optional but most expected to use query beans -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-db2</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
</dependencies>
+13 -6
View File
@@ -2,9 +2,10 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>composites</artifactId>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.17.3</version>
<version>14.1.0</version>
<relativePath>../..</relativePath>
</parent>
<name>ebean-h2</name>
@@ -16,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
@@ -31,17 +32,23 @@
<version>${ebean-datasource.version}</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-migration</artifactId>
<version>${ebean-migration.version}</version>
</dependency>
<!-- Technically optional but most expected to use query beans -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-h2</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
</dependencies>
+13 -6
View File
@@ -2,9 +2,10 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>composites</artifactId>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.17.3</version>
<version>14.1.0</version>
<relativePath>../..</relativePath>
</parent>
<name>ebean-hana</name>
@@ -16,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
@@ -31,17 +32,23 @@
<version>${ebean-datasource.version}</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-migration</artifactId>
<version>${ebean-migration.version}</version>
</dependency>
<!-- Technically optional but most expected to use query beans -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-hana</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
</dependencies>
+13 -6
View File
@@ -2,9 +2,10 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>composites</artifactId>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.17.3</version>
<version>14.1.0</version>
<relativePath>../..</relativePath>
</parent>
<name>ebean-mariadb</name>
@@ -16,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
@@ -31,17 +32,23 @@
<version>${ebean-datasource.version}</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-migration</artifactId>
<version>${ebean-migration.version}</version>
</dependency>
<!-- Technically optional but most expected to use query beans -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-mariadb</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
</dependencies>
+13 -6
View File
@@ -2,9 +2,10 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>composites</artifactId>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.17.3</version>
<version>14.1.0</version>
<relativePath>../..</relativePath>
</parent>
<name>ebean-mysql</name>
@@ -16,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
@@ -31,17 +32,23 @@
<version>${ebean-datasource.version}</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-migration</artifactId>
<version>${ebean-migration.version}</version>
</dependency>
<!-- Technically optional but most expected to use query beans -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-mysql</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
</dependencies>
+13 -6
View File
@@ -2,9 +2,10 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>composites</artifactId>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.17.3</version>
<version>14.1.0</version>
<relativePath>../..</relativePath>
</parent>
<name>ebean-nuodb</name>
@@ -16,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
@@ -31,17 +32,23 @@
<version>${ebean-datasource.version}</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-migration</artifactId>
<version>${ebean-migration.version}</version>
</dependency>
<!-- Technically optional but most expected to use query beans -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-nuodb</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
</dependencies>
+13 -6
View File
@@ -2,9 +2,10 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>composites</artifactId>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.17.3</version>
<version>14.1.0</version>
<relativePath>../..</relativePath>
</parent>
<name>ebean-oracle</name>
@@ -16,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
@@ -31,17 +32,23 @@
<version>${ebean-datasource.version}</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-migration</artifactId>
<version>${ebean-migration.version}</version>
</dependency>
<!-- Technically optional but most expected to use query beans -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-oracle</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
</dependencies>
+85
View File
@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>14.1.0</version>
<relativePath>../..</relativePath>
</parent>
<name>ebean-postgis</name>
<description>ebean-postgis composite</description>
<artifactId>ebean-postgis</artifactId>
<properties>
<postgis.jdbc.version>2.5.1</postgis.jdbc.version>
<postgres.jdbc.version>42.7.2</postgres.jdbc.version>
</properties>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-datasource</artifactId>
<version>${ebean-datasource.version}</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-migration</artifactId>
<version>${ebean-migration.version}</version>
</dependency>
<!-- Technically optional but most expected to use query beans -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-postgis-types</artifactId>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgres.jdbc.version}</version>
<exclusions>
<!-- exclude unnecessary checker framework -->
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.postgis</groupId>
<artifactId>postgis-jdbc</artifactId>
<version>${postgis.jdbc.version}</version>
</dependency>
</dependencies>
</project>
@@ -0,0 +1,7 @@
package io.ebean.postgis.assembly;
/**
* Nothing interesting here - required placeholder for javadoc.
*/
public class Assembly {
}
@@ -0,0 +1,10 @@
module io.ebean.postgis {
requires transitive io.ebean.api;
requires transitive io.ebean.core;
requires transitive io.ebean.datasource;
requires transitive io.ebean.querybean;
requires transitive io.ebean.platform.postgres;
// requires transitive io.ebean.postgis.types;
}
+13 -6
View File
@@ -2,9 +2,10 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>composites</artifactId>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.17.3</version>
<version>14.1.0</version>
<relativePath>../..</relativePath>
</parent>
<name>ebean-postgres</name>
@@ -16,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
@@ -31,17 +32,23 @@
<version>${ebean-datasource.version}</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-migration</artifactId>
<version>${ebean-migration.version}</version>
</dependency>
<!-- Technically optional but most expected to use query beans -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
</dependencies>
+13 -6
View File
@@ -2,9 +2,10 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>composites</artifactId>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.17.3</version>
<version>14.1.0</version>
<relativePath>../..</relativePath>
</parent>
<name>ebean-sqlite</name>
@@ -16,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
@@ -31,17 +32,23 @@
<version>${ebean-datasource.version}</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-migration</artifactId>
<version>${ebean-migration.version}</version>
</dependency>
<!-- Technically optional but most expected to use query beans -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-sqlite</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
</dependencies>
+13 -6
View File
@@ -2,9 +2,10 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>composites</artifactId>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.17.3</version>
<version>14.1.0</version>
<relativePath>../..</relativePath>
</parent>
<name>ebean-sqlserver</name>
@@ -16,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
@@ -31,17 +32,23 @@
<version>${ebean-datasource.version}</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-migration</artifactId>
<version>${ebean-migration.version}</version>
</dependency>
<!-- Technically optional but most expected to use query beans -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-sqlserver</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
</dependencies>
+13 -6
View File
@@ -2,9 +2,10 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>composites</artifactId>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.17.3</version>
<version>14.1.0</version>
<relativePath>../..</relativePath>
</parent>
<name>ebean-yugabyte</name>
@@ -16,13 +17,13 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
@@ -31,17 +32,23 @@
<version>${ebean-datasource.version}</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-migration</artifactId>
<version>${ebean-migration.version}</version>
</dependency>
<!-- Technically optional but most expected to use query beans -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-postgres</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
</dependencies>
+16 -9
View File
@@ -2,9 +2,10 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>composites</artifactId>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.17.3</version>
<version>14.1.0</version>
<relativePath>../..</relativePath>
</parent>
<name>ebean (all platforms)</name>
@@ -16,31 +17,31 @@
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-api</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-joda-time</artifactId>
<version>13.17.3</version>
<version>14.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-jackson-jsonnode</artifactId>
<version>13.17.3</version>
<version>14.0.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-jackson-mapper</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
@@ -49,17 +50,23 @@
<version>${ebean-datasource.version}</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-migration</artifactId>
<version>${ebean-migration.version}</version>
</dependency>
<!-- Technically optional but most expected to use query beans -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-all</artifactId>
<version>13.17.3</version>
<version>14.1.0</version>
</dependency>
</dependencies>
+2 -1
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.17.3</version>
<version>14.1.0</version>
</parent>
<artifactId>composites</artifactId>
@@ -23,6 +23,7 @@
<module>ebean-nuodb</module>
<module>ebean-oracle</module>
<module>ebean-postgres</module>
<module>ebean-postgis</module>
<!-- <module>sqlanywhere</module>-->
<module>ebean-sqlite</module>
<module>ebean-sqlserver</module>
+7 -14
View File
@@ -4,7 +4,7 @@
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.17.3</version>
<version>14.1.0</version>
</parent>
<name>ebean api</name>
@@ -39,12 +39,12 @@
<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-config</artifactId>
<version>3.1</version>
<version>3.12</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>persistence-api</artifactId>
<artifactId>jakarta-persistence-api</artifactId>
<version>${ebean-persistence-api.version}</version>
</dependency>
@@ -90,29 +90,22 @@
<optional>true</optional>
</dependency>
<!-- JAVAX-DEPENDENCY-START -->
<!-- JAVAX-DEPENDENCY-START ___
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<optional>true</optional>
</dependency>
<!-- JAVAX-DEPENDENCY-END -->
<!-- JAKARTA-DEPENDENCY-START ___
____ JAVAX-DEPENDENCY-END -->
<!-- JAKARTA-DEPENDENCY-START -->
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>6.0.0</version>
<optional>true</optional>
</dependency>
____ JAKARTA-DEPENDENCY-END -->
<dependency>
<groupId>io.avaje</groupId>
<artifactId>junit</artifactId>
<version>1.1</version>
<scope>test</scope>
</dependency>
<!-- JAKARTA-DEPENDENCY-END -->
</dependencies>
@@ -1,6 +1,6 @@
package io.ebean;
import javax.persistence.PessimisticLockException;
import jakarta.persistence.PessimisticLockException;
/**
* Thrown when failing to acquire a pessimistic lock.
@@ -33,11 +33,6 @@ import java.util.Optional;
@NonNullApi
public abstract class BeanFinder<I,T> {
/**
* Migrate to using database rather than server.
*/
@Deprecated
protected final Database server;
protected final Database database;
protected final Class<T> type;
@@ -50,7 +45,6 @@ public abstract class BeanFinder<I,T> {
protected BeanFinder(Class<T> type, Database database) {
this.type = type;
this.database = database;
this.server = database;
}
/**
+2 -45
View File
@@ -7,8 +7,8 @@ import io.ebean.cache.ServerCacheManager;
import io.ebean.plugin.Property;
import io.ebean.text.json.JsonContext;
import javax.persistence.OptimisticLockException;
import javax.persistence.PersistenceException;
import jakarta.persistence.OptimisticLockException;
import jakarta.persistence.PersistenceException;
import java.util.Collection;
import java.util.List;
import java.util.Map;
@@ -266,49 +266,6 @@ public final class DB {
getDefault().register(transactionCallback);
}
/**
* Commit the current transaction.
*/
public static void commitTransaction() {
getDefault().commitTransaction();
}
/**
* Rollback the current transaction.
*/
public static void rollbackTransaction() {
getDefault().rollbackTransaction();
}
/**
* If the current transaction has already been committed do nothing otherwise
* rollback the transaction.
* <p>
* It is preferable to use <em>try with resources</em> rather than this.
* <p>
* Useful to put in a finally block to ensure the transaction is ended, rather
* than a rollbackTransaction() in each catch block.
* <p>
* Code example:
*
* <pre>{@code
* DB.beginTransaction();
* try {
* // do some fetching and or persisting
*
* // commit at the end
* DB.commitTransaction();
*
* } finally {
* // if commit didn't occur then rollback the transaction
* DB.endTransaction();
* }
* }</pre>
*/
public static void endTransaction() {
getDefault().endTransaction();
}
/**
* Mark the current transaction as rollback only.
*/
@@ -0,0 +1,49 @@
package io.ebean;
import io.ebean.service.SpiInTuples;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* Default implementation of SpiInTuples.
*/
final class DInTuples implements SpiInTuples {
private final String[] properties;
private final int propertyCount;
private final List<Object[]> entries = new ArrayList<>();
DInTuples(String[] properties) {
this.properties = properties;
this.propertyCount = properties.length;
}
@Override
public InTuples add(Object... values) {
if (values.length != propertyCount) {
throw new IllegalArgumentException("Require " + propertyCount + " values but got " + values.length);
}
entries.add(values);
return this;
}
/**
* Return the first property name.
*/
@Override
public String[] properties() {
return properties;
}
/**
* Return all the value pairs.
*/
@Override
public List<Object[]> entries() {
return Collections.unmodifiableList(entries);
}
}
@@ -0,0 +1,104 @@
package io.ebean;
final class DInsertOptionsBuilder implements InsertOptions.Builder {
private Boolean getGeneratedKeys;
private boolean onConflictUpdate;
private boolean onConflictNothing;
private String constraint;
private String uniqueColumns;
private String updateSet;
@Override
public InsertOptions.Builder onConflictNothing() {
this.onConflictNothing = true;
return this;
}
@Override
public InsertOptions.Builder onConflictUpdate() {
this.onConflictUpdate = true;
return this;
}
@Override
public InsertOptions.Builder constraint(String constraint) {
this.constraint = constraint;
return this;
}
@Override
public InsertOptions.Builder uniqueColumns(String uniqueColumns) {
this.uniqueColumns = uniqueColumns;
return this;
}
@Override
public InsertOptions.Builder updateSet(String updateSet) {
this.updateSet = updateSet;
return this;
}
@Override
public InsertOptions.Builder getGeneratedKeys(boolean getGeneratedKeys) {
this.getGeneratedKeys = getGeneratedKeys;
return this;
}
@Override
public InsertOptions build() {
return new Options(constraint, uniqueColumns, updateSet, onConflictUpdate, onConflictNothing, getGeneratedKeys);
}
static final class Options implements InsertOptions {
private static final String UPDATE = "U";
private static final String NOTHING = "N";
private static final String NORMAL = "_";
private final String key;
private final Boolean getGeneratedKeys;
private final String constraint;
private final String uniqueColumns;
private final String updateSet;
Options(String constraint, String uniqueColumns, String updateSet, boolean onConflictUpdate, boolean onConflictNothing, Boolean getGeneratedKeys) {
this.constraint = constraint;
this.uniqueColumns = uniqueColumns;
this.updateSet = updateSet;
this.getGeneratedKeys = getGeneratedKeys;
this.key = (onConflictUpdate ? UPDATE : onConflictNothing ? NOTHING : NORMAL)
+ '+' + plus(constraint)
+ '+' + plus(uniqueColumns)
+ '+' + plus(updateSet);
}
private String plus(String val) {
return val == null ? "" : val;
}
@Override
public String key() {
return key;
}
@Override
public String constraint() {
return constraint;
}
@Override
public String uniqueColumns() {
return uniqueColumns;
}
@Override
public String updateSet() {
return updateSet;
}
@Override
public Boolean getGetGeneratedKeys() {
return getGeneratedKeys;
}
}
}
@@ -1,9 +1,9 @@
package io.ebean;
import javax.persistence.PersistenceException;
import jakarta.persistence.PersistenceException;
/**
* Thrown when a foreign key constraint is enforced.
* Thrown when a foreign key constraint is enforced or a field is too large.
*/
public class DataIntegrityException extends PersistenceException {
private static final long serialVersionUID = -6740171949170180970L;
@@ -14,4 +14,11 @@ public class DataIntegrityException extends PersistenceException {
public DataIntegrityException(String message, Throwable cause) {
super(message, cause);
}
/**
* Create with message only.
*/
public DataIntegrityException(String message) {
super(message);
}
}
+53 -42
View File
@@ -11,8 +11,8 @@ import io.ebean.plugin.Property;
import io.ebean.plugin.SpiServer;
import io.ebean.text.json.JsonContext;
import javax.persistence.OptimisticLockException;
import javax.persistence.PersistenceException;
import jakarta.persistence.OptimisticLockException;
import jakarta.persistence.PersistenceException;
import javax.sql.DataSource;
import java.util.Collection;
import java.util.List;
@@ -35,14 +35,14 @@ import java.util.concurrent.Callable;
* <h5>The 'default' Database</h5>
* <p>
* One Database can be designated as the 'default' or 'primary' Database
* (see {@link DatabaseConfig#setDefaultServer(boolean)}. Many methods on DB
* (see {@link DatabaseConfig#setDefaultServer(boolean)}). Many methods on DB
* such as {@link DB#find(Class)} etc are actually just a convenient way to
* call methods on the 'default/primary' Database.
*
* <h5>Constructing a Database</h5>
* <p>
* Databases are constructed by the DatabaseFactory. They can be created
* programmatically via {@link DatabaseFactory#create(DatabaseConfig)} or they
* programmatically via {@link DatabaseFactory#create(DatabaseBuilder)} or they
* can be automatically constructed on demand using configuration information in
* the application.properties file.
*
@@ -86,6 +86,23 @@ import java.util.concurrent.Callable;
@NonNullApi
public interface Database {
/**
* Return a new database builder.
* <pre>{@code
*
* // build the 'default' database using configuration
* // from application.properties / application.yaml
*
* Database db = Database.builder()
* .loadFromProperties()
* .build();
*
* }</pre>
*/
static DatabaseBuilder builder() {
return new DatabaseConfig();
}
/**
* Shutdown the Database instance.
*/
@@ -166,7 +183,7 @@ public interface Database {
/**
* Return the BeanState for a given entity bean.
* <p>
* This will return null if the bean is not an enhanced entity bean.
* This will throw an IllegalArgumentException if the bean is not an enhanced entity bean.
*/
BeanState beanState(Object bean);
@@ -649,43 +666,6 @@ public interface Database {
*/
void flush();
/**
* Commit the current transaction.
*/
void commitTransaction();
/**
* Rollback the current transaction.
*/
void rollbackTransaction();
/**
* If the current transaction has already been committed do nothing otherwise
* rollback the transaction.
* <p>
* Useful to put in a finally block to ensure the transaction is ended, rather
* than a rollbackTransaction() in each catch block.
* <p>
* Code example:
* <p>
* <pre>{@code
*
* database.beginTransaction();
* try {
* // do some fetching and or persisting ...
*
* // commit at the end
* database.commitTransaction();
*
* } finally {
* // if commit didn't occur then rollback the transaction
* database.endTransaction();
* }
*
* }</pre>
*/
void endTransaction();
/**
* Refresh the values of a bean.
* <p>
@@ -1204,22 +1184,53 @@ public interface Database {
*/
void insert(Object bean);
/**
* Insert the bean with options (ON CONFLICT DO UPDATE | DO NOTHING).
* <p>
* Currently, this is limited to use with Postgres only,
* <p>
* When using this ebean will look to determine the unique columns by looking at
* the mapping like {@code @Column(unique=true} and {@code @Index(unique=true}.
*/
void insert(Object bean, InsertOptions insertOptions);
/**
* Insert the bean with a transaction.
*/
void insert(Object bean, Transaction transaction);
/**
* Insert the beans with options (ON CONFLICT DO UPDATE | DO NOTHING) and transaction.
* <p>
* Currently, this is limited to use with Postgres only,
*/
void insert(Object bean, InsertOptions insertOptions, Transaction transaction);
/**
* Insert a collection of beans. If there is no current transaction one is created and used to
* insert all the beans in the collection.
*/
void insertAll(Collection<?> beans);
/**
* Insert the beans with options - typically ON CONFLICT DO UPDATE | DO NOTHING.
* <p>
* Currently, this is limited to use with Postgres only,
*/
void insertAll(Collection<?> beans, InsertOptions options);
/**
* Insert a collection of beans with an explicit transaction.
*/
void insertAll(Collection<?> beans, Transaction transaction);
/**
* Insert the beans with options (ON CONFLICT DO UPDATE | DO NOTHING) and transaction.
* <p>
* Currently, this is limited to use with Postgres only,
*/
void insertAll(Collection<?> beans, InsertOptions options, Transaction transaction);
/**
* Execute explicitly passing a transaction.
*/
File diff suppressed because it is too large Load Diff
@@ -1,13 +1,11 @@
package io.ebean;
import io.ebean.config.ContainerConfig;
import io.ebean.config.DatabaseConfig;
import io.ebean.service.SpiContainer;
import io.ebean.service.SpiContainerFactory;
import jakarta.persistence.PersistenceException;
import javax.persistence.PersistenceException;
import java.util.Iterator;
import java.util.Properties;
import java.util.ServiceLoader;
import java.util.concurrent.locks.ReentrantLock;
@@ -76,9 +74,10 @@ public final class DatabaseFactory {
*
* }</pre>
*/
public static Database create(DatabaseConfig config) {
public static Database create(DatabaseBuilder builder) {
lock.lock();
try {
var config = builder.settings();
if (config.getName() == null) {
throw new PersistenceException("The name is null (it is required)");
}
@@ -102,7 +101,7 @@ public final class DatabaseFactory {
/**
* Create using the DatabaseConfig additionally specifying a classLoader to use as the context class loader.
*/
public static Database createWithContextClassLoader(DatabaseConfig config, ClassLoader classLoader) {
public static Database createWithContextClassLoader(DatabaseBuilder config, ClassLoader classLoader) {
lock.lock();
try {
ClassLoader currentContextLoader = Thread.currentThread().getContextClassLoader();
@@ -132,7 +131,7 @@ public final class DatabaseFactory {
}
}
private static Database createInternal(DatabaseConfig config) {
private static Database createInternal(DatabaseBuilder.Settings config) {
return container(config.getContainerConfig()).createServer(config);
}
@@ -146,12 +145,9 @@ public final class DatabaseFactory {
if (container != null) {
return container;
}
if (containerConfig == null) {
// effectively load configuration from ebean.properties
Properties properties = DbPrimary.getProperties();
containerConfig = new ContainerConfig();
containerConfig.loadFromProperties(properties);
}
container = createContainer(containerConfig);
return container;
@@ -160,7 +156,7 @@ public final class DatabaseFactory {
/**
* Create the container instance using the configuration.
*/
protected static SpiContainer createContainer(ContainerConfig containerConfig) {
private static SpiContainer createContainer(ContainerConfig containerConfig) {
Iterator<SpiContainerFactory> factories = ServiceLoader.load(SpiContainerFactory.class).iterator();
if (factories.hasNext()) {
return factories.next().create(containerConfig);
@@ -3,7 +3,7 @@ package io.ebean;
import io.ebean.config.BeanNotEnhancedException;
import io.ebean.datasource.DataSourceConfigurationException;
import javax.persistence.PersistenceException;
import jakarta.persistence.PersistenceException;
import java.util.HashMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.locks.ReentrantLock;
@@ -38,12 +38,15 @@ final class DbContext {
}
}
} catch (BeanNotEnhancedException e) {
String msg = "Bean is not enhanced? See https://ebean.io/docs/trouble-shooting#not-enhanced";
log.log(ERROR, msg, e);
throw e;
} catch (DataSourceConfigurationException e) {
String msg = "Configuration error creating DataSource for the default Database." +
" This typically means a missing application-test.yaml or missing ebean-test dependency." +
" See https://ebean.io/docs/trouble-shooting#datasource";
log.log(ERROR, msg, e);
throw new DataSourceConfigurationException(msg, e);
} catch (Throwable e) {
@@ -44,25 +44,12 @@ final class DbPrimary {
* Return the default database name.
*/
static String getDefaultServerName() {
lock.lock();
try {
getProperties();
return defaultServerName;
} finally {
lock.unlock();
}
}
/**
* Return the default configuration Properties.
*/
static Properties getProperties() {
lock.lock();
try {
if (defaultServerName == null) {
defaultServerName = determineDefaultServerName();
}
return Config.asProperties();
return defaultServerName;
} finally {
lock.unlock();
}
@@ -3,6 +3,8 @@ package io.ebean;
import io.avaje.lang.NonNullApi;
import io.avaje.lang.Nullable;
import javax.sql.DataSource;
import java.sql.Connection;
import java.util.Collection;
import java.util.List;
import java.util.Optional;
@@ -205,4 +207,21 @@ public interface DtoQuery<T> extends CancelableQuery {
* Use the explicit transaction to execute the query.
*/
DtoQuery<T> usingTransaction(Transaction transaction);
/**
* Execute the query using the given connection.
*/
DtoQuery<T> usingConnection(Connection connection);
/**
* Ensure that the master DataSource is used if there is a read only data source
* being used (that is using a read replica database potentially with replication lag).
* <p>
* When the database is configured with a read-only DataSource via
* say {@link io.ebean.DatabaseBuilder#readOnlyDataSource(DataSource)} then
* by default when a query is run without an active transaction, it uses the read-only data
* source. We use {@code usingMaster()} to instead ensure that the query is executed
* against the master data source.
*/
DtoQuery<T> usingMaster();
}
+39 -39
View File
@@ -41,14 +41,14 @@ public final class Expr {
* Equal To - property equal to the given value.
*/
public static Expression eq(String propertyName, Object value) {
return DB.expressionFactory().eq(propertyName, value);
return factory().eq(propertyName, value);
}
/**
* Not Equal To - property not equal to the given value.
*/
public static Expression ne(String propertyName, Object value) {
return DB.expressionFactory().ne(propertyName, value);
return factory().ne(propertyName, value);
}
/**
@@ -56,7 +56,7 @@ public final class Expr {
* using a lower() function to make it case insensitive).
*/
public static Expression ieq(String propertyName, String value) {
return DB.expressionFactory().ieq(propertyName, value);
return factory().ieq(propertyName, value);
}
/**
@@ -66,28 +66,28 @@ public final class Expr {
* </p>
*/
public static Expression inRange(String propertyName, Object value1, Object value2) {
return DB.expressionFactory().inRange(propertyName, value1, value2);
return factory().inRange(propertyName, value1, value2);
}
/**
* Between - property between the two given values.
*/
public static Expression between(String propertyName, Object value1, Object value2) {
return DB.expressionFactory().between(propertyName, value1, value2);
return factory().between(propertyName, value1, value2);
}
/**
* Between - value between two given properties.
*/
public static Expression between(String lowProperty, String highProperty, Object value) {
return DB.expressionFactory().betweenProperties(lowProperty, highProperty, value);
return factory().betweenProperties(lowProperty, highProperty, value);
}
/**
* Greater Than - property greater than the given value.
*/
public static Expression gt(String propertyName, Object value) {
return DB.expressionFactory().gt(propertyName, value);
return factory().gt(propertyName, value);
}
/**
@@ -95,42 +95,42 @@ public final class Expr {
* value.
*/
public static Expression ge(String propertyName, Object value) {
return DB.expressionFactory().ge(propertyName, value);
return factory().ge(propertyName, value);
}
/**
* Less Than - property less than the given value.
*/
public static Expression lt(String propertyName, Object value) {
return DB.expressionFactory().lt(propertyName, value);
return factory().lt(propertyName, value);
}
/**
* Less Than or Equal to - property less than or equal to the given value.
*/
public static Expression le(String propertyName, Object value) {
return DB.expressionFactory().le(propertyName, value);
return factory().le(propertyName, value);
}
/**
* Is Null - property is null.
*/
public static Expression isNull(String propertyName) {
return DB.expressionFactory().isNull(propertyName);
return factory().isNull(propertyName);
}
/**
* Is Not Null - property is not null.
*/
public static Expression isNotNull(String propertyName) {
return DB.expressionFactory().isNotNull(propertyName);
return factory().isNotNull(propertyName);
}
/**
* Case insensitive {@link #exampleLike(Object)}
*/
public static ExampleExpression iexampleLike(Object example) {
return DB.expressionFactory().iexampleLike(example);
return factory().iexampleLike(example);
}
/**
@@ -138,14 +138,14 @@ public final class Expr {
* LikeType.RAW (you need to add you own wildcards % and _).
*/
public static ExampleExpression exampleLike(Object example) {
return DB.expressionFactory().exampleLike(example);
return factory().exampleLike(example);
}
/**
* Create the query by Example expression specifying more options.
*/
public static ExampleExpression exampleLike(Object example, boolean caseInsensitive, LikeType likeType) {
return DB.expressionFactory().exampleLike(example, caseInsensitive, likeType);
return factory().exampleLike(example, caseInsensitive, likeType);
}
/**
@@ -153,7 +153,7 @@ public final class Expr {
* characters % (percentage) and _ (underscore).
*/
public static Expression like(String propertyName, String value) {
return DB.expressionFactory().like(propertyName, value);
return factory().like(propertyName, value);
}
/**
@@ -162,14 +162,14 @@ public final class Expr {
* a lower() function to make the expression case insensitive.
*/
public static Expression ilike(String propertyName, String value) {
return DB.expressionFactory().ilike(propertyName, value);
return factory().ilike(propertyName, value);
}
/**
* Starts With - property like value%.
*/
public static Expression startsWith(String propertyName, String value) {
return DB.expressionFactory().startsWith(propertyName, value);
return factory().startsWith(propertyName, value);
}
/**
@@ -177,14 +177,14 @@ public final class Expr {
* lower() function to make the expression case insensitive.
*/
public static Expression istartsWith(String propertyName, String value) {
return DB.expressionFactory().istartsWith(propertyName, value);
return factory().istartsWith(propertyName, value);
}
/**
* Ends With - property like %value.
*/
public static Expression endsWith(String propertyName, String value) {
return DB.expressionFactory().endsWith(propertyName, value);
return factory().endsWith(propertyName, value);
}
/**
@@ -192,14 +192,14 @@ public final class Expr {
* function to make the expression case insensitive.
*/
public static Expression iendsWith(String propertyName, String value) {
return DB.expressionFactory().iendsWith(propertyName, value);
return factory().iendsWith(propertyName, value);
}
/**
* Contains - property like %value%.
*/
public static Expression contains(String propertyName, String value) {
return DB.expressionFactory().contains(propertyName, value);
return factory().contains(propertyName, value);
}
/**
@@ -207,42 +207,42 @@ public final class Expr {
* function to make the expression case insensitive.
*/
public static Expression icontains(String propertyName, String value) {
return DB.expressionFactory().icontains(propertyName, value);
return factory().icontains(propertyName, value);
}
/**
* For collection properties that are empty (have not existing elements).
*/
public static Expression isEmpty(String propertyName) {
return DB.expressionFactory().isEmpty(propertyName);
return factory().isEmpty(propertyName);
}
/**
* For collection properties that are not empty (have existing elements).
*/
public static Expression isNotEmpty(String propertyName) {
return DB.expressionFactory().isNotEmpty(propertyName);
return factory().isNotEmpty(propertyName);
}
/**
* In - property has a value in the array of values.
*/
public static Expression in(String propertyName, Object[] values) {
return DB.expressionFactory().in(propertyName, values);
return factory().in(propertyName, values);
}
/**
* In - using a subQuery.
*/
public static Expression in(String propertyName, Query<?> subQuery) {
return DB.expressionFactory().in(propertyName, subQuery);
return factory().in(propertyName, subQuery);
}
/**
* In - property has a value in the collection of values.
*/
public static Expression in(String propertyName, Collection<?> values) {
return DB.expressionFactory().in(propertyName, values);
return factory().in(propertyName, values);
}
/**
@@ -279,14 +279,14 @@ public final class Expr {
* }</pre>
*/
public static Expression inOrEmpty(String propertyName, Collection<?> values) {
return DB.expressionFactory().inOrEmpty(propertyName, values);
return factory().inOrEmpty(propertyName, values);
}
/**
* Id Equal to - ID property is equal to the value.
*/
public static Expression idEq(Object value) {
return DB.expressionFactory().idEq(value);
return factory().idEq(value);
}
/**
@@ -299,7 +299,7 @@ public final class Expr {
* @param propertyMap a map keyed by property names.
*/
public static Expression allEq(Map<String, Object> propertyMap) {
return DB.expressionFactory().allEq(propertyMap);
return factory().allEq(propertyMap);
}
/**
@@ -310,7 +310,7 @@ public final class Expr {
* </p>
*/
public static Expression raw(String raw, Object value) {
return DB.expressionFactory().raw(raw, value);
return factory().raw(raw, value);
}
/**
@@ -321,48 +321,48 @@ public final class Expr {
* </p>
*/
public static Expression raw(String raw, Object[] values) {
return DB.expressionFactory().raw(raw, values);
return factory().raw(raw, values);
}
/**
* Add raw expression with no parameters.
*/
public static Expression raw(String raw) {
return DB.expressionFactory().raw(raw);
return factory().raw(raw);
}
/**
* And - join two expressions with a logical and.
*/
public static Expression and(Expression expOne, Expression expTwo) {
return DB.expressionFactory().and(expOne, expTwo);
return factory().and(expOne, expTwo);
}
/**
* Or - join two expressions with a logical or.
*/
public static Expression or(Expression expOne, Expression expTwo) {
return DB.expressionFactory().or(expOne, expTwo);
return factory().or(expOne, expTwo);
}
/**
* Negate the expression (prefix it with NOT).
*/
public static Expression not(Expression exp) {
return DB.expressionFactory().not(exp);
return factory().not(exp);
}
/**
* Return a list of expressions that will be joined by AND's.
*/
public static <T> Junction<T> conjunction(Query<T> query) {
return DB.expressionFactory().conjunction(query);
return factory().conjunction(query);
}
/**
* Return a list of expressions that will be joined by OR's.
*/
public static <T> Junction<T> disjunction(Query<T> query) {
return DB.expressionFactory().disjunction(query);
return factory().disjunction(query);
}
}
@@ -36,6 +36,11 @@ import java.util.Map;
*/
public interface ExpressionFactory {
/**
* Return a new ExpressionList.
*/
<T> ExpressionList<T> expressionList();
/**
* Path exists - for the given path in a JSON document.
*/
@@ -369,6 +374,11 @@ public interface ExpressionFactory {
*/
Expression inPairs(Pairs pairs);
/**
* In expression using multiple columns.
*/
Expression inTuples(InTuples pairs);
/**
* In - property has a value in the array of values.
*/
@@ -4,7 +4,7 @@ import io.avaje.lang.NonNullApi;
import io.avaje.lang.Nullable;
import io.ebean.search.*;
import javax.persistence.NonUniqueResultException;
import jakarta.persistence.NonUniqueResultException;
import java.sql.Connection;
import java.sql.Timestamp;
import java.util.*;
@@ -54,14 +54,12 @@ public interface ExpressionList<T> {
Query<T> orderById(boolean orderById);
/**
* Set the order by clause replacing the existing order by clause if there is
* one.
* <p>
* This follows SQL syntax using commas between each property with the
* optional asc and desc keywords representing ascending and descending order
* respectively.
* @deprecated migrate to {@link #orderBy(String)}
*/
ExpressionList<T> order(String orderByClause);
@Deprecated(since = "13.19", forRemoval = true)
default ExpressionList<T> order(String orderByClause) {
return orderBy(orderByClause);
}
/**
* Set the order by clause replacing the existing order by clause if there is
@@ -74,15 +72,12 @@ public interface ExpressionList<T> {
ExpressionList<T> orderBy(String orderBy);
/**
* Return the OrderBy so that you can append an ascending or descending
* property to the order by clause.
* <p>
* This will never return a null. If no order by clause exists then an 'empty'
* OrderBy object is returned.
* <p>
* This is the same as <code>orderBy()</code>
* @deprecated migrate to {@link #orderBy()}.
*/
OrderBy<T> order();
@Deprecated(forRemoval = true)
default OrderBy<T> order() {
return orderBy();
}
/**
* Return the OrderBy so that you can append an ascending or descending
@@ -95,12 +90,6 @@ public interface ExpressionList<T> {
*/
OrderBy<T> orderBy();
/**
* Deprecated migrate to {@link #orderBy(String)}
*/
@Deprecated
Query<T> setOrderBy(String orderBy);
/**
* Apply the path properties to the query replacing the select and fetch clauses.
*/
@@ -233,6 +222,8 @@ public interface ExpressionList<T> {
int delete();
/**
* @deprecated migrate to {@link #usingTransaction(Transaction)} then delete().
* <p>
* Execute as a delete query deleting the 'root level' beans that match the predicates
* in the query.
* <p>
@@ -242,6 +233,7 @@ public interface ExpressionList<T> {
*
* @return the number of rows that were deleted.
*/
@Deprecated(forRemoval = true, since = "13.1.0")
int delete(Transaction transaction);
/**
@@ -253,11 +245,14 @@ public interface ExpressionList<T> {
int update();
/**
* @deprecated migrate to {@link #usingTransaction(Transaction)} then update().
* <p>
* Execute as a update query with the given transaction.
*
* @return the number of rows that were updated.
* @see UpdateQuery
*/
@Deprecated(forRemoval = true, since = "13.1.0")
int update(Transaction transaction);
/**
@@ -404,6 +399,7 @@ public interface ExpressionList<T> {
*
* }</pre>
*/
@Nullable
default <A> A findSingleAttribute() {
List<A> list = findSingleAttributeList();
return !list.isEmpty() ? list.get(0) : null;
@@ -518,6 +514,8 @@ public interface ExpressionList<T> {
ExpressionList<T> filterMany(String manyProperty);
/**
* @deprecated for removal - migrate to {@link #filterManyRaw(String, String, Object...)}.
* <p>
* Add filter expressions to the many property.
*
* <pre>{@code
@@ -534,8 +532,29 @@ public interface ExpressionList<T> {
* @param expressions Filter expressions with and, or and ? or ?1 type bind parameters
* @param params Bind parameters used in the expressions
*/
@Deprecated(forRemoval = true)
ExpressionList<T> filterMany(String manyProperty, String expressions, Object... params);
/**
* Add filter expressions for the many path. The expressions can include SQL functions if
* desired and the property names are translated to column names.
* <p>
* The expressions can contain placeholders for bind values using <code>?</code> or <code>?1</code> style.
*
* <pre>{@code
*
* new QCustomer()
* .name.startsWith("Postgres")
* .contacts.filterManyRaw("status = ? and firstName like ?", Contact.Status.NEW, "Rob%")
* .findList();
*
* }</pre>
*
* @param rawExpressions The raw expressions which can include ? and ?1 style bind parameter placeholders
* @param params The parameter values to bind
*/
ExpressionList<T> filterManyRaw(String manyProperty, String rawExpressions, Object... params);
/**
* Specify specific properties to fetch on the main/root bean (aka partial
* object).
@@ -1141,6 +1160,11 @@ public interface ExpressionList<T> {
*/
ExpressionList<T> inPairs(Pairs pairs);
/**
* In expression using multiple columns.
*/
ExpressionList<T> inTuples(InTuples pairs);
/**
* EXISTS a raw SQL SubQuery.
*
@@ -1,26 +1,9 @@
package io.ebean;
import io.avaje.lang.Nullable;
import java.time.Clock;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.function.Consumer;
import java.util.function.Predicate;
import java.util.stream.Stream;
/**
* The extended API for Database.
* <p>
* Deprecated in favour of using {@link Query#usingTransaction(Transaction)} instead.
* <p>
* This provides the finder methods that take an explicit transaction rather than obtaining
* the transaction from the usual mechanism (which is ThreadLocal based).
* <p>
* Note that in all cases the transaction supplied can be null and in this case the Database
* will use the normal mechanism to obtain the transaction to use.
*/
public interface ExtendedServer {
@@ -35,162 +18,4 @@ public interface ExtendedServer {
@Deprecated
void setClock(Clock clock);
/**
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
*/
@Deprecated
<T> boolean exists(Query<T> ormQuery, Transaction transaction);
/**
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
*/
@Deprecated
<T> int findCount(Query<T> query, Transaction transaction);
/**
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
*/
@Deprecated
<A, T> List<A> findIds(Query<T> query, Transaction transaction);
/**
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
*/
@Deprecated
<T> QueryIterator<T> findIterate(Query<T> query, Transaction transaction);
/**
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
*/
@Deprecated
<T> Stream<T> findStream(Query<T> query, Transaction transaction);
/**
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
*/
@Deprecated
<T> void findEach(Query<T> query, Consumer<T> consumer, Transaction transaction);
/**
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
*/
@Deprecated
<T> void findEach(Query<T> query, int batch, Consumer<List<T>> consumer, Transaction t);
/**
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
*/
@Deprecated
<T> void findEachWhile(Query<T> query, Predicate<T> consumer, Transaction transaction);
/**
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
*/
@Deprecated
<T> List<Version<T>> findVersions(Query<T> query, Transaction transaction);
/**
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
*/
@Deprecated
<T> List<T> findList(Query<T> query, Transaction transaction);
/**
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
*/
@Deprecated
<T> FutureRowCount<T> findFutureCount(Query<T> query, Transaction transaction);
/**
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
*/
@Deprecated
<T> FutureIds<T> findFutureIds(Query<T> query, Transaction transaction);
/**
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
*/
@Deprecated
<T> FutureList<T> findFutureList(Query<T> query, Transaction transaction);
/**
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
*/
@Deprecated
<T> PagedList<T> findPagedList(Query<T> query, Transaction transaction);
/**
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
*/
@Deprecated
<T> Set<T> findSet(Query<T> query, Transaction transaction);
/**
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
*/
@Deprecated
<K, T> Map<K, T> findMap(Query<T> query, Transaction transaction);
/**
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
*/
@Deprecated
<A, T> List<A> findSingleAttributeList(Query<T> query, Transaction transaction);
/**
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
*/
@Deprecated
<A, T> Set<A> findSingleAttributeSet(Query<T> query, Transaction transaction);
/**
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
*/
@Deprecated
@Nullable
<T> T findOne(Query<T> query, Transaction transaction);
/**
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
*/
@Deprecated
<T> Optional<T> findOneOrEmpty(Query<T> query, Transaction transaction);
/**
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
*/
@Deprecated
<T> int delete(Query<T> query, Transaction transaction);
/**
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
*/
@Deprecated
<T> int update(Query<T> query, Transaction transaction);
/**
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
*/
@Deprecated
List<SqlRow> findList(SqlQuery query, Transaction transaction);
/**
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
*/
@Deprecated
void findEach(SqlQuery query, Consumer<SqlRow> consumer, Transaction transaction);
/**
* Deprecated migrate to using {@link Query#usingTransaction(Transaction)}.
*/
@Deprecated
void findEachWhile(SqlQuery query, Predicate<SqlRow> consumer, Transaction transaction);
/**
* Deprecated migrate to using {@link SqlQuery#usingTransaction(Transaction)}.
*/
@Deprecated
@Nullable
SqlRow findOne(SqlQuery query, Transaction transaction);
}
@@ -1,6 +1,6 @@
package io.ebean;
import javax.persistence.PersistenceException;
import jakarta.persistence.PersistenceException;
import java.util.List;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
@@ -0,0 +1,36 @@
package io.ebean;
/**
* IN expression using multiple columns.
* <p>
* Currently this is not supported with SQLServer or DB2.
* <p>
* Produces SQL expression in the form of (A,B,C) IN ((a0,b0,c0), (a1,b1,c1), ... )
* where A,B,C are the properties in the tuples.
*/
public interface InTuples {
/**
* Create given the properties in the tuples.
*/
static InTuples of(String... properties) {
return new DInTuples(properties);
}
/**
* Create given the properties in the tuples.
*/
static InTuples of(Query.Property<?>... properties) {
String[] props = new String[properties.length];
for (int i = 0; i < properties.length; i++) {
props[i] = properties[i].toString();
}
return new DInTuples(props);
}
/**
* Add a tuple entry. All values must be non-null.
*/
InTuples add(Object... values);
}
@@ -0,0 +1,119 @@
package io.ebean;
import io.avaje.lang.Nullable;
/**
* Options to be used with insert such as ON CONFLICT DO UPDATE | NOTHING.
*/
public interface InsertOptions {
/**
* Use ON CONFLICT UPDATE with automatic determination of the unique columns to conflict on.
* <p>
* Uses mapping to determine the unique columns - {@code @Column(unique=true)} and {@code @Index(unique=true)} .
*/
InsertOptions ON_CONFLICT_UPDATE = InsertOptions.builder()
.onConflictUpdate()
.build();
/**
* Use ON CONFLICT DO NOTHING with automatic determination of the unique columns to conflict on.
* <p>
* Uses mapping to determine the unique columns - {@code @Column(unique=true)} and {@code @Index(unique=true)} .
*/
InsertOptions ON_CONFLICT_NOTHING = InsertOptions.builder()
.onConflictNothing()
.build();
/**
* Return a builder for InsertOptions.
*/
static Builder builder() {
return new DInsertOptionsBuilder();
}
/**
* Return the constraint name that is used for ON CONFLICT.
*/
@Nullable
String constraint();
/**
* Return the unique columns that is used for ON CONFLICT.
* <p>
* When not explicitly set will use mapping like {@code @Column(unique=true)} to determine the
* non-unique columns.
*/
@Nullable
String uniqueColumns();
/**
* Return the ON CONFLICT UPDATE SET clause.
* <p>
* When not set will use the non-unique columns.
*/
@Nullable
String updateSet();
/**
* Return if GetGeneratedKeys should be used to fetch the generated keys after insert.
*/
@Nullable
Boolean getGetGeneratedKeys();
/**
* Return the key for these build options.
*/
String key();
/**
* The builder for InsertOptions.
*/
interface Builder {
/**
* Use a ON CONFLICT UPDATE automatically determining the unique columns.
*/
Builder onConflictUpdate();
/**
* Use a ON CONFLICT DO NOTHING automatically determining the unique columns.
*/
Builder onConflictNothing();
/**
* Specify an explicit conflict constraint name.
* <p>
* When this is used then unique columns will not be used.
*/
Builder constraint(String constraint);
/**
* Specify the unique columns for the conflict target.
* <p>
* When not specified and constraint is also not specified then
* it will automatically determine the unique columns
* based on mapping like {@code @Column(unique=true)} and
* {@code @Index(unique=true)} .
*/
Builder uniqueColumns(String uniqueColumns);
/**
* Specify the ON CONFLICT DO UPDATE SET clause.
* <p>
* When not specified ebean will include all the non-unique columns.
*/
Builder updateSet(String updateSet);
/**
* Specify if GetGeneratedKeys should be used to return generated keys.
*/
Builder getGeneratedKeys(boolean getGeneratedKeys);
/**
* Build and return the insert options.
*/
InsertOptions build();
}
}
@@ -0,0 +1,42 @@
package io.ebean;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* Helper methods for Lists.
*/
public final class Lists {
private Lists() {
}
/**
* Partition the source List into sub-lists with a maximum size.
* <p>
* The sub-lists will all be the max size except for the last sub-list
* which can potentially be smaller.
*
* @param source The source list
* @param max The max size of each partition
* @param <T> The list element type
* @return List of sub-list partitions
*/
public static <T> List<List<T>> partition(List<T> source, int max) {
final int totalCount = source.size();
if (totalCount == 0) {
return Collections.emptyList();
} else if (totalCount <= max) {
return List.of(source);
}
final int numOfPartitions = (totalCount + max - 1) / max; // round up
final var dest = new ArrayList<List<T>>(numOfPartitions);
for (int i = 0; i < numOfPartitions; i++) {
final int from = i * max;
final int to = Math.min(from + max, totalCount);
dest.add(source.subList(from, to));
}
return dest;
}
}
@@ -333,10 +333,10 @@ public class OrderBy<T> implements Serializable {
sb.append(property);
}
if (!ascending) {
sb.append(" ").append("desc");
sb.append(' ').append("desc");
}
if (nulls != null) {
sb.append(" ").append(nulls).append(" ").append(highLow);
sb.append(' ').append(nulls).append(' ').append(highLow);
}
return sb.toString();
}
@@ -1,6 +1,6 @@
package io.ebean;
import javax.persistence.PersistenceException;
import jakarta.persistence.PersistenceException;
/**
* Captures and wraps IOException's occurring during ElasticSearch processing etc.
@@ -30,23 +30,6 @@ public interface ProfileLocation {
return XServiceProvider.profileLocationFactory().create(label);
}
/**
* Deprecated in favor of {@link #create(String)}.
*/
@Deprecated
static ProfileLocation create(int lineNumber, String label) {
return create(label);
}
/**
* Deprecated for removal - not used.
* Create and return a new ProfileLocation with a given location.
*/
@Deprecated
static ProfileLocation createAt(String location) {
return XServiceProvider.profileLocationFactory().createAt(location);
}
/**
* Obtain the description returning true if this is the initial call.
*/
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,975 @@
package io.ebean;
import io.avaje.lang.Nullable;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.Timestamp;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.function.BooleanSupplier;
import java.util.function.Consumer;
import java.util.function.Predicate;
import java.util.stream.Stream;
/**
* Build and execute an ORM query.
*
* @param <SELF> The type of the builder
* @param <T> The entity bean type
*/
public interface QueryBuilder<SELF, T> extends QueryBuilderProjection<SELF, T> {
/**
* Set root table alias.
*/
SELF alias(String alias);
/**
* Apply changes to the query conditional on the supplied predicate.
* <p>
* Typically, the changes are extra predicates etc.
*
* @param predicate The predicate which when true the changes are applied
* @param apply The changes to apply to the query
*/
SELF alsoIf(BooleanSupplier predicate, Consumer<SELF> apply);
/**
* Perform an 'As of' query using history tables to return the object graph
* as of a time in the past.
* <p>
* To perform this query the DB must have underlying history tables.
*
* @param asOf the date time in the past at which you want to view the data
*/
SELF asOf(Timestamp asOf);
/**
* Execute the query against the draft set of tables.
*/
SELF asDraft();
/**
* Convert the query to a DTO bean query.
* <p>
* We effectively use the underlying ORM query to build the SQL and then execute
* and map it into DTO beans.
*/
<D> DtoQuery<D> asDto(Class<D> dtoClass);
/**
* Convert the query to a UpdateQuery.
* <p>
* Typically this is used with query beans to covert a query bean
* query into an UpdateQuery like the examples below.
* </p>
*
* <pre>{@code
*
* int rowsUpdated = new QCustomer()
* .name.startsWith("Rob")
* .asUpdate()
* .set("active", false)
* .update();;
*
* }</pre>
*
* <pre>{@code
*
* int rowsUpdated = new QContact()
* .notes.note.startsWith("Make Inactive")
* .email.endsWith("@foo.com")
* .customer.id.equalTo(42)
* .asUpdate()
* .set("inactive", true)
* .setRaw("email = lower(email)")
* .update();
*
* }</pre>
*/
UpdateQuery<T> asUpdate();
/**
* Return a copy of the query.
* <p>
* This is so that you can use a Query as a "prototype" for creating other
* query instances. You could create a Query with various where expressions
* and use that as a "prototype" - using this copy() method to create a new
* instance that you can then add other expressions then execute.
* </p>
*/
SELF copy();
/**
* Execute the query using the given transaction.
*/
SELF usingTransaction(Transaction transaction);
/**
* Execute the query using the given connection.
*/
SELF usingConnection(Connection connection);
/**
* Execute the query using the given database.
*/
SELF usingDatabase(Database database);
/**
* Ensure that the master DataSource is used if there is a read only data source
* being used (that is using a read replica database potentially with replication lag).
* <p>
* When the database is configured with a read-only DataSource via
* say {@link io.ebean.config.DatabaseConfig#setReadOnlyDataSource(DataSource)} then
* by default when a query is run without an active transaction, it uses the read-only data
* source. We we use {@code usingMaster()} to instead ensure that the query is executed
* against the master data source.
*/
SELF usingMaster();
/**
* Set the base table to use for this query.
* <p>
* Typically this is used when a table has partitioning and we wish to specify a specific
* partition/table to query against.
* </p>
* <pre>{@code
*
* QOrder()
* .setBaseTable("order_2019_05")
* .status.equalTo(Status.NEW)
* .findList();
*
* }</pre>
*/
SELF setBaseTable(String baseTable);
/**
* Specify the PersistenceContextScope to use for this query.
* <p>
* When this is not set the 'default' configured on {@link io.ebean.config.DatabaseConfig#setPersistenceContextScope(PersistenceContextScope)}
* is used - this value defaults to {@link PersistenceContextScope#TRANSACTION}.
* <p>
* Note that the same persistence Context is used for subsequent lazy loading and query join queries.
* <p>
* Note that #findEach uses a 'per object graph' PersistenceContext so this scope is ignored for
* queries executed as #findIterate, #findEach, #findEachWhile.
*
* @param scope The scope to use for this query and subsequent lazy loading.
*/
SELF setPersistenceContextScope(PersistenceContextScope scope);
/**
* Explicitly specify whether to use AutoTune for this query.
* <p>
* If you do not call this method on a query the "Implicit AutoTune mode" is
* used to determine if AutoTune should be used for a given query.
* <p>
* AutoTune can add additional fetch paths to the query and specify which
* properties are included for each path. If you have explicitly defined some
* fetch paths AutoTune will not remove them.
*/
SELF setAutoTune(boolean autoTune);
/**
* Execute the query allowing properties with invalid JSON to be collected and not fail the query.
* <pre>{@code
*
* // fetch a bean with JSON content
* EBasicJsonList bean= DB.find(EBasicJsonList.class)
* .setId(42)
* .setAllowLoadErrors() // collect errors into bean state if we have invalid JSON
* .findOne();
*
*
* // get the invalid JSON errors from the bean state
* Map<String, Exception> errors = server().getBeanState(bean).getLoadErrors();
*
* // If this map is not empty tell we have invalid JSON
* // and should try and fix the JSON content or inform the user
*
* }</pre>
*/
SELF setAllowLoadErrors();
/**
* Set the default lazy loading batch size to use.
* <p>
* When lazy loading is invoked on beans loaded by this query then this sets the
* batch size used to load those beans.
*
* @param lazyLoadBatchSize the number of beans to lazy load in a single batch
*/
SELF setLazyLoadBatchSize(int lazyLoadBatchSize);
/**
* Set a label on the query.
* <p>
* This label can be used to help identify query performance metrics but we can also use
* profile location enhancement on Finders so for some that would be a better option.
*/
SELF setLabel(String label);
/**
* Set a SQL query hint.
* <p>
* This results in an inline comment that immediately follows
* after the select keyword in the form: {@code /*+ hint *\/ }
*/
SELF setHint(String hint);
/**
* Set the index(es) to search for a document store which uses partitions.
* <p>
* For example, when executing a query against ElasticSearch with daily indexes we can
* explicitly specify the indexes to search against.
* </p>
* <pre>{@code
*
* // explicitly specify the indexes to search
* query.setDocIndexName("logstash-2016.11.5,logstash-2016.11.6")
*
* // search today's index
* query.setDocIndexName("$today")
*
* // search the last 3 days
* query.setDocIndexName("$last-3")
*
* }</pre>
* <p>
* If the indexName is specified with ${daily} e.g. "logstash-${daily}" ... then we can use
* $today and $last-x as the search docIndexName like the examples below.
* </p>
* <pre>{@code
*
* // search today's index
* query.setDocIndexName("$today")
*
* // search the last 3 days
* query.setDocIndexName("$last-3")
*
* }</pre>
*
* @param indexName The index or indexes to search against
* @return This query
*/
SELF setDocIndexName(String indexName);
/**
* Execute the query including soft deleted rows.
* <p>
* This means that Ebean will not add any predicates to the query for filtering out
* soft deleted rows. You can still add your own predicates for the deleted properties
* and effectively you have full control over the query to include or exclude soft deleted
* rows as needed for a given use case.
*/
SELF setIncludeSoftDeletes();
/**
* Disable read auditing for this query.
* <p>
* This is intended to be used when the query is not a user initiated query and instead
* part of the internal processing in an application to load a cache or document store etc.
* In these cases we don't want the query to be part of read auditing.
*/
SELF setDisableReadAuditing();
/**
* Set true if you want to disable lazy loading.
* <p>
* That is, once the object graph is returned further lazy loading is disabled.
*/
SELF setDisableLazyLoading(boolean disableLazyLoading);
/**
* Set whether this query uses DISTINCT.
*/
SELF setDistinct(boolean distinct);
/**
* Restrict the query to only return subtypes of the given inherit type.
* <pre>{@code
*
* List<Animal> animals =
* new QAnimal()
* .name.startsWith("Fluffy")
* .setInheritType(Cat.class)
* .findList();
*
* }</pre>
*/
SELF setInheritType(Class<? extends T> type);
/**
* Set the first row to return for this query.
*
* @param firstRow the first row to include in the query result.
*/
SELF setFirstRow(int firstRow);
/**
* Set the maximum number of rows to return in the query.
*
* @param maxRows the maximum number of rows to return in the query.
*/
SELF setMaxRows(int maxRows);
/**
* Set RawSql to use for this query.
*/
SELF setRawSql(RawSql rawSql);
/**
* Extended version for setDistinct in conjunction with "findSingleAttributeList";
*
* <pre>{@code
*
* List<CountedValue<Order.Status>> orderStatusCount =
*
* DB.find(Order.class)
* .select("status")
* .where()
* .gt("orderDate", LocalDate.now().minusMonths(3))
*
* // fetch as single attribute with a COUNT
* .setCountDistinct(CountDistinctOrder.COUNT_DESC_ATTR_ASC)
* .findSingleAttributeList();
*
* for (CountedValue<Order.Status> entry : orderStatusCount) {
* System.out.println(" count:" + entry.getCount()+" orderStatus:" + entry.getValue() );
* }
*
* // produces
*
* count:3 orderStatus:NEW
* count:1 orderStatus:SHIPPED
* count:1 orderStatus:COMPLETE
*
* }</pre>
*/
SELF setCountDistinct(CountDistinctOrder orderBy);
/**
* Set the property to use as keys for a map.
* <p>
* If no property is set then the id property is used.
* </p>
* <pre>{@code
*
* // Assuming sku is unique for products...
*
* Map<String,Product> productMap = DB.find(Product.class)
* .setMapKey("sku") // sku map keys...
* .findMap();
*
* }</pre>
*
* @param mapKey the property to use as keys for a map.
*/
SELF setMapKey(String mapKey);
/**
* Set to true if this query should execute against the doc store.
* <p>
* When setting this you may also consider disabling lazy loading.
*/
SELF setUseDocStore(boolean useDocStore);
/**
* When set to true when you want the returned beans to be read only.
*/
SELF setReadOnly(boolean readOnly);
/**
* Set a timeout on this query.
* <p>
* This will typically result in a call to setQueryTimeout() on a
* preparedStatement. If the timeout occurs an exception will be thrown - this
* will be a SQLException wrapped up in a PersistenceException.
* </p>
*
* @param secs the query timeout limit in seconds. Zero means there is no limit.
*/
SELF setTimeout(int secs);
/**
* A hint which for JDBC translates to the Statement.fetchSize().
* <p>
* Gives the JDBC driver a hint as to the number of rows that should be
* fetched from the database when more rows are needed for ResultSet.
* </p>
* <p>
* Note that internally findEach and findEachWhile will set the fetch size
* if it has not already as these queries expect to process a lot of rows.
* If we didn't then Postgres and MySql for example would eagerly pull back
* all the row data and potentially consume a lot of memory in the process.
* </p>
* <p>
* As findEach and findEachWhile automatically set the fetch size we don't have
* to do so generally but we might still wish to for tuning a specific use case.
* </p>
*/
SELF setBufferFetchSizeHint(int fetchSize);
/**
* Set the mode to use the bean cache when executing this query.
* <p>
* By default, "find by id" and "find by natural key" will use the bean cache
* when bean caching is enabled. Setting this to false means that the query
* will not use the bean cache and instead hit the database.
* <p>
* By default, findList() with natural keys will not use the bean cache. In that
* case we need to explicitly use the bean cache.
*/
SELF setBeanCacheMode(CacheMode beanCacheMode);
/**
* Set the {@link CacheMode} to use the query for executing this query.
*/
SELF setUseQueryCache(CacheMode cacheMode);
/**
* Set this to false to not use the bean cache.
* <p>
* This method is now superseded by {@link #setBeanCacheMode(CacheMode)}
* which provides more explicit options controlled bean cache use.
* <p>
* This method is likely to be deprecated in the future with migration
* over to setUseBeanCache().
*/
default SELF setUseCache(boolean useCache) {
return setBeanCacheMode(useCache ? CacheMode.ON : CacheMode.OFF);
}
/**
* Calls {@link #setUseQueryCache(CacheMode)} with <code>ON</code> or <code>OFF</code>.
*/
default SELF setUseQueryCache(boolean enabled) {
return setUseQueryCache(enabled ? CacheMode.ON : CacheMode.OFF);
}
/**
* Set the order by clause replacing the existing order by clause if there is
* one.
* <p>
* This follows SQL syntax using commas between each property with the
* optional asc and desc keywords representing ascending and descending order
* respectively.
*/
SELF orderBy(String orderByClause);
/**
* Set an OrderBy object to replace any existing OrderBy clause.
*/
SELF setOrderBy(OrderBy<T> orderBy);
/**
* Controls, if paginated queries should always append an 'order by id' statement at the end to
* guarantee a deterministic sort result. This may affect performance.
* If this is not enabled, and an orderBy is set on the query, it's up to the programmer that
* this query provides a deterministic result.
*/
SELF orderById(boolean orderById);
/**
* Execute the query with the given lock type and WAIT.
* <p>
* Note that <code>forUpdate()</code> is the same as
* <code>withLock(LockType.UPDATE)</code>.
* <p>
* Provides us with the ability to explicitly use Postgres
* SHARE, KEY SHARE, NO KEY UPDATE and UPDATE row locks.
*/
SELF withLock(Query.LockType lockType);
/**
* Execute the query with the given lock type and lock wait.
* <p>
* Note that <code>forUpdateNoWait()</code> is the same as
* <code>withLock(LockType.UPDATE, LockWait.NOWAIT)</code>.
* <p>
* Provides us with the ability to explicitly use Postgres
* SHARE, KEY SHARE, NO KEY UPDATE and UPDATE row locks.
*/
SELF withLock(Query.LockType lockType, Query.LockWait lockWait);
/**
* Execute using "for update" clause which results in the DB locking the record.
* <p>
* The same as <code>withLock(LockType.UPDATE, LockWait.WAIT)</code>.
*/
SELF forUpdate();
/**
* Execute using "for update" clause with "no wait" option.
* <p>
* This is typically a Postgres and Oracle only option at this stage.
* <p>
* The same as <code>withLock(LockType.UPDATE, LockWait.NOWAIT)</code>.
*/
SELF forUpdateNoWait();
/**
* Execute using "for update" clause with "skip locked" option.
* <p>
* This is typically a Postgres and Oracle only option at this stage.
* <p>
* The same as <code>withLock(LockType.UPDATE, LockWait.SKIPLOCKED)</code>.
*/
SELF forUpdateSkipLocked();
/**
* Returns the set of properties or paths that are unknown (do not map to known properties or paths).
* <p>
* Validate the query checking the where and orderBy expression paths to confirm if
* they represent valid properties or paths for the given bean type.
*/
Set<String> validate();
/**
* Return the sql that was generated for executing this query.
* <p>
* This is only available after the query has been executed and provided only
* for informational purposes.
*/
String getGeneratedSql();
/**
* Return the type of beans being queried.
*/
Class<T> getBeanType();
/**
* Execute as a delete query deleting the 'root level' beans that match the predicates
* in the query.
* <p>
* Note that if the query includes joins then the generated delete statement may not be
* optimal depending on the database platform.
*
* @return the number of beans/rows that were deleted.
*/
int delete();
/**
* Execute the query returning true if a row is found.
* <p>
* The query is executed using max rows of 1 and will only select the id property.
* This method is really just a convenient way to optimise a query to perform a
* 'does a row exist in the db' check.
*
* <h2>Example using a query bean:</h2>
* <pre>{@code
*
* boolean userExists =
* new QContact()
* .email.equalTo("rob@foo.com")
* .exists();
*
* }</pre>
*
* <h2>Example:</h2>
* <pre>{@code
*
* boolean userExists = query()
* .where().eq("email", "rob@foo.com")
* .exists();
*
* }</pre>
*
* @return True if the query finds a matching row in the database
*/
boolean exists();
/**
* Execute the query returning either a single bean or null (if no matching
* bean is found).
* <p>
* If more than 1 row is found for this query then a PersistenceException is
* thrown.
* <p>
* This is useful when your predicates dictate that your query should only
* return 0 or 1 results.
* <p>
* <pre>{@code
*
* // assuming the sku of products is unique...
* Product product =
* new QProduct()
* .sku.equalTo("aa113")
* .findOne();
* ...
* }</pre>
* <p>
* It is also useful with finding objects by their id when you want to specify
* further join information to optimise the query.
* <p>
* <pre>{@code
*
* // Fetch order 42 and additionally fetch join its order details...
* Order order =
* new QOrder()
* .fetch("details") // eagerly load the order details
* .id.equalTo(42)
* .findOne();
*
* // the order details were eagerly loaded
* List<OrderDetail> details = order.getDetails();
* ...
* }</pre>
*/
@Nullable
T findOne();
/**
* Execute the query returning an optional bean.
*/
Optional<T> findOneOrEmpty();
/**
* Execute the query returning the list of objects.
* <p>
* This query will execute against the EbeanServer that was used to create it.
* <p>
* <pre>{@code
*
* List<Customer> customers =
* new QCustomer()
* .name.ilike("rob%")
* .findList();
*
* }</pre>
*
* @see Query#findList()
*/
List<T> findList();
/**
* Execute the query returning the result as a Stream.
* <p>
* Note that this can support very large queries iterating
* any number of results. To do so internally it can use
* multiple persistence contexts.
* </p>
* <pre>{@code
*
* // use try with resources to ensure Stream is closed
*
* try (Stream<Customer> stream = query.findStream()) {
* stream
* .map(...)
* .collect(...);
* }
*
* }</pre>
*/
Stream<T> findStream();
/**
* Execute the query returning the set of objects.
* <p>
* This query will execute against the EbeanServer that was used to create it.
* <p>
* <pre>{@code
*
* Set<Customer> customers =
* new QCustomer()
* .name.ilike("rob%")
* .findSet();
*
* }</pre>
*
* @see Query#findSet()
*/
Set<T> findSet();
/**
* Execute the query returning the list of Id's.
* <p>
* This query will execute against the EbeanServer that was used to create it.
*
* @see Query#findIds()
*/
<A> List<A> findIds();
/**
* Execute the query returning a map of the objects.
* <p>
* This query will execute against the EbeanServer that was used to create it.
* <p>
* You can use setMapKey() or asMapKey() to specify the property to be used as keys
* on the map. If one is not specified then the id property is used.
* <p>
* <pre>{@code
*
* Map<String, Product> map =
* new QProduct()
* .sku.asMapKey()
* .findMap();
*
* }</pre>
*
* @see Query#findMap()
*/
<K> Map<K, T> findMap();
/**
* Execute the query iterating over the results.
* <p>
* Note that findIterate (and findEach and findEachWhile) uses a "per graph"
* persistence context scope and adjusts jdbc fetch buffer size for large
* queries. As such it is better to use findList for small queries.
* <p>
* Remember that with {@link QueryIterator} you must call {@link QueryIterator#close()}
* when you have finished iterating the results (typically in a finally block).
* <p>
* findEach() and findEachWhile() are preferred to findIterate() as they ensure
* the jdbc statement and resultSet are closed at the end of the iteration.
* <p>
* This query will execute against the EbeanServer that was used to create it.
* </p>
* <pre>{@code
*
* Query<Customer> query =
* new QCustomer()
* .status.equalTo(Customer.Status.NEW)
* .orderBy()
* id.asc()
* .query();
*
* try (QueryIterator<Customer> it = query.findIterate()) {
* while (it.hasNext()) {
* Customer customer = it.next();
* // do something with customer ...
* }
* }
*
* }</pre>
*/
QueryIterator<T> findIterate();
/**
* Execute the query returning a list of values for a single property.
* <p>
* <h3>Example</h3>
* <pre>{@code
*
* List<String> names =
* new QCustomer()
* .setDistinct(true)
* .select(name)
* .findSingleAttributeList();
*
* }</pre>
*
* @return the list of values for the selected property
*/
<A> List<A> findSingleAttributeList();
/**
* Execute the query returning a single value or null for a single property.
* <p>
* <h3>Example</h3>
* <pre>{@code
*
* LocalDate maxDate =
* new QCustomer()
* .select("max(startDate)")
* .findSingleAttribute();
*
* }</pre>
*
* @return a single value or null for the selected property
*/
@Nullable
<A> A findSingleAttribute();
/**
* Execute the query returning a single optional attribute value.
* <p>
* <h3>Example</h3>
* <pre>{@code
*
* Optional<String> maybeName =
* new QCustomer()
* .select(name)
* .id.eq(42)
* .status.eq(NEW)
* .findSingleAttributeOrEmpty();
*
* }</pre>
*
* @return an optional value for the selected property
*/
<A> Optional<A> findSingleAttributeOrEmpty();
/**
* Execute the query returning a hashset of values for a single property.
*/
<A> Set<A> findSingleAttributeSet();
/**
* Execute the query processing the beans one at a time.
* <p>
* This method is appropriate to process very large query results as the
* beans are consumed one at a time and do not need to be held in memory
* (unlike #findList #findSet etc)
* <p>
* Note that internally Ebean can inform the JDBC driver that it is expecting larger
* resultSet and specifically for MySQL this hint is required to stop it's JDBC driver
* from buffering the entire resultSet. As such, for smaller resultSets findList() is
* generally preferable.
* <p>
* Compared with #findEachWhile this will always process all the beans where as
* #findEachWhile provides a way to stop processing the query result early before
* all the beans have been read.
* <p>
* This method is functionally equivalent to findIterate() but instead of using an
* iterator uses the Consumer interface which is better suited to use with closures.
*
* <pre>{@code
*
* new QCustomer()
* .status.equalTo(Status.NEW)
* .orderBy().id.asc()
* .findEach((Customer customer) -> {
*
* // do something with customer
* System.out.println("-- visit " + customer);
* });
*
* }</pre>
*
* @param consumer the consumer used to process the queried beans.
*/
void findEach(Consumer<T> consumer);
/**
* Execute findEach streaming query batching the results for consuming.
* <p>
* This query execution will stream the results and is suited to consuming
* large numbers of results from the database.
* <p>
* Typically, we use this batch consumer when we want to do further processing on
* the beans and want to do that processing in batch form, for example - 100 at
* a time.
*
* @param batch The number of beans processed in the batch
* @param consumer Process the batch of beans
*/
void findEach(int batch, Consumer<List<T>> consumer);
/**
* Execute the query using callbacks to a visitor to process the resulting
* beans one at a time.
* <p>
* This method is functionally equivalent to findIterate() but instead of using an
* iterator uses the Predicate interface which is better suited to use with closures.
*
* <pre>{@code
*
* new QCustomer()
* .status.equalTo(Status.NEW)
* .orderBy().id.asc()
* .findEachWhile((Customer customer) -> {
*
* // do something with customer
* System.out.println("-- visit " + customer);
*
* // return true to continue processing or false to stop
* return (customer.getId() < 40);
* });
*
* }</pre>
*
* @param consumer the consumer used to process the queried beans.
*/
void findEachWhile(Predicate<T> consumer);
/**
* Return versions of a @History entity bean.
* <p>
* Generally this query is expected to be a find by id or unique predicates query.
* It will execute the query against the history returning the versions of the bean.
*/
List<Version<T>> findVersions();
/**
* Return versions of a @History entity bean between a start and end timestamp.
* <p>
* Generally this query is expected to be a find by id or unique predicates query.
* It will execute the query against the history returning the versions of the bean.
*/
List<Version<T>> findVersionsBetween(Timestamp start, Timestamp end);
/**
* Return the count of entities this query should return.
* <p>
* This is the number of 'top level' or 'root level' entities.
*/
int findCount();
/**
* Execute find row count query in a background thread.
* <p>
* This returns a Future object which can be used to cancel, check the
* execution status (isDone etc) and get the value (with or without a
* timeout).
*
* @return a Future object for the row count query
*/
FutureRowCount<T> findFutureCount();
/**
* Execute find Id's query in a background thread.
* <p>
* This returns a Future object which can be used to cancel, check the
* execution status (isDone etc) and get the value (with or without a
* timeout).
*
* @return a Future object for the list of Id's
*/
FutureIds<T> findFutureIds();
/**
* Execute find list query in a background thread.
* <p>
* This query will execute in it's own PersistenceContext and using its own transaction.
* What that means is that it will not share any bean instances with other queries.
*
* @return a Future object for the list result of the query
*/
FutureList<T> findFutureList();
/**
* Return a PagedList for this query using firstRow and maxRows.
* <p>
* The benefit of using this over findList() is that it provides functionality to get the
* total row count etc.
* <p>
* If maxRows is not set on the query prior to calling findPagedList() then a
* PersistenceException is thrown.
* <p>
* <pre>{@code
*
* PagedList<Order> pagedList =
* new QOrder()
* .setFirstRow(50)
* .setMaxRows(20)
* .findPagedList();
*
* // fetch the total row count in the background
* pagedList.loadRowCount();
*
* List<Order> orders = pagedList.getList();
* int totalRowCount = pagedList.getTotalRowCount();
*
* }</pre>
*
* @return The PagedList
*/
PagedList<T> findPagedList();
}
@@ -0,0 +1,242 @@
package io.ebean;
/**
* Builder for ORM Query projection (the select and fetch part).
*
* @param <SELF> The builder type
* @param <T> The entity bean type
*/
public interface QueryBuilderProjection<SELF, T> {
/**
* Apply the path properties replacing the select and fetch clauses.
* <p>
* This is typically used when the FetchPath is applied to both the query and the JSON output.
*/
SELF apply(FetchPath fetchPath);
/**
* Specify the properties to fetch on the root level entity bean in comma delimited format.
* <p>
* The Id property is automatically included in the properties to fetch unless setDistinct(true)
* is set on the query.
* </p>
* <p>
* Use {@link #fetch(String, String)} to specify specific properties to fetch
* on other non-root level paths of the object graph.
* </p>
* <pre>{@code
*
* List<Customer> customers = DB.find(Customer.class)
* // Only fetch the customer id, name and status.
* // This is described as a "Partial Object"
* .select("name, status")
* .where.ilike("name", "rob%")
* .findList();
*
* }</pre>
*
* @param fetchProperties the properties to fetch for this bean (* = all properties).
*/
SELF select(String fetchProperties);
/**
* Apply the fetchGroup which defines what part of the object graph to load.
*/
SELF select(FetchGroup<T> fetchGroup);
/**
* Specify a path to fetch eagerly including specific properties.
* <p>
* Ebean will endeavour to fetch this path using a SQL join. If Ebean determines that it can
* not use a SQL join (due to maxRows or because it would result in a cartesian product) Ebean
* will automatically convert this fetch query into a "query join" - i.e. use fetchQuery().
* </p>
* <pre>{@code
*
* // query orders...
* List<Order> orders = DB.find(Order.class)
* // fetch the customer...
* // ... getting the customers name and phone number
* .fetch("customer", "name, phoneNumber")
*
* // ... also fetch the customers billing address (* = all properties)
* .fetch("customer.billingAddress", "*")
* .findList();
* }</pre>
* <p>
* If columns is null or "*" then all columns/properties for that path are fetched.
* </p>
* <pre>{@code
*
* // fetch customers (their id, name and status)
* List<Customer> customers = DB.find(Customer.class)
* .select("name, status")
* .fetch("contacts", "firstName,lastName,email")
* .findList();
*
* }</pre>
*
* @param path the property path we wish to fetch eagerly.
* @param fetchProperties properties of the associated bean that you want to include in the
* fetch (* means all properties, null also means all properties).
*/
SELF fetch(String path, String fetchProperties);
/**
* Fetch the path and properties using a "query join" (separate SQL query).
* <p>
* This is the same as:
* </p>
* <pre>{@code
*
* fetch(path, fetchProperties, FetchConfig.ofQuery())
*
* }</pre>
* <p>
* This would be used instead of a fetch() when we use a separate SQL query to fetch this
* part of the object graph rather than a SQL join.
* <p>
* We might typically get a performance benefit when the path to fetch is a OneToMany
* or ManyToMany, the 'width' of the 'root bean' is wide and the cardinality of the many
* is high.
*
* @param path the property path we wish to fetch eagerly.
* @param fetchProperties properties of the associated bean that you want to include in the
* fetch (* means all properties, null also means all properties).
*/
SELF fetchQuery(String path, String fetchProperties);
/**
* Fetch the path and properties using L2 bean cache.
*
* @param path The path of the beans we are fetching from L2 cache.
* @param fetchProperties The properties that should be loaded.
*/
SELF fetchCache(String path, String fetchProperties);
/**
* Fetch the path and properties lazily (via batch lazy loading).
* <p>
* This is the same as:
*
* <pre>{@code
*
* fetch(path, fetchProperties, FetchConfig.ofLazy())
*
* }</pre>
* <p>
* The reason for using fetchLazy() is to either:
* <ul>
* <li>Control/tune what is fetched as part of lazy loading</li>
* <li>Make use of the L2 cache, build this part of the graph from L2 cache</li>
* </ul>
*
* @param path the property path we wish to fetch lazily.
* @param fetchProperties properties of the associated bean that you want to include in the
* fetch (* means all properties, null also means all properties).
*/
SELF fetchLazy(String path, String fetchProperties);
/**
* Additionally specify a FetchConfig to use a separate query or lazy loading
* to load this path.
* <pre>{@code
*
* // fetch customers (their id, name and status)
* List<Customer> customers = DB.find(Customer.class)
* .select("name, status")
* .fetch("contacts", "firstName,lastName,email", FetchConfig.ofLazy(10))
* .findList();
*
* }</pre>
*
* @param path the property path we wish to fetch eagerly.
*/
SELF fetch(String path, String fetchProperties, FetchConfig fetchConfig);
/**
* Specify a path to fetch eagerly including all its properties.
* <p>
* Ebean will endeavour to fetch this path using a SQL join. If Ebean determines that it can
* not use a SQL join (due to maxRows or because it would result in a cartesian product) Ebean
* will automatically convert this fetch query into a "query join" - i.e. use fetchQuery().
* </p>
* <pre>{@code
*
* // fetch customers (their id, name and status)
* List<Customer> customers = DB.find(Customer.class)
* // eager fetch the contacts
* .fetch("contacts")
* .findList();
*
* }</pre>
*
* @param path the property path we wish to fetch eagerly.
*/
SELF fetch(String path);
/**
* Fetch the path eagerly using a "query join" (separate SQL query).
* <p>
* This is the same as:
* <pre>{@code
*
* fetch(path, FetchConfig.ofQuery())
*
* }</pre>
* <p>
* This would be used instead of a fetch() when we use a separate SQL query to fetch this
* part of the object graph rather than a SQL join.
* <p>
* We might typically get a performance benefit when the path to fetch is a OneToMany
* or ManyToMany, the 'width' of the 'root bean' is wide and the cardinality of the many
* is high.
*
* @param path the property path we wish to fetch eagerly
*/
SELF fetchQuery(String path);
/**
* Fetch the path eagerly using L2 cache.
*/
SELF fetchCache(String path);
/**
* Fetch the path lazily (via batch lazy loading).
* <p>
* This is the same as:
* </p>
* <pre>{@code
*
* fetch(path, FetchConfig.ofLazy())
*
* }</pre>
* <p>
* The reason for using fetchLazy() is to either:
* </p>
* <ul>
* <li>Control/tune what is fetched as part of lazy loading</li>
* <li>Make use of the L2 cache, build this part of the graph from L2 cache</li>
* </ul>
*
* @param path the property path we wish to fetch lazily.
*/
SELF fetchLazy(String path);
/**
* Additionally specify a JoinConfig to specify a "query join" and or define
* the lazy loading query.
* <pre>{@code
*
* // fetch customers (their id, name and status)
* List<Customer> customers = DB.find(Customer.class)
* // lazy fetch contacts with a batch size of 100
* .fetch("contacts", FetchConfig.ofLazy(100))
* .findList();
*
* }</pre>
*/
SELF fetch(String path, FetchConfig fetchConfig);
}
@@ -1,6 +1,6 @@
package io.ebean;
import javax.persistence.OptimisticLockException;
import jakarta.persistence.OptimisticLockException;
/**
* Thrown at SERIALIZABLE isolation level for non-recoverable concurrent conflict.
@@ -3,7 +3,9 @@ package io.ebean;
import io.avaje.lang.NonNullApi;
import io.avaje.lang.Nullable;
import javax.sql.DataSource;
import java.io.Serializable;
import java.sql.Connection;
import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;
@@ -45,6 +47,23 @@ public interface SqlQuery extends Serializable, CancelableQuery {
*/
SqlQuery usingTransaction(Transaction transaction);
/**
* Execute the query using the given connection.
*/
SqlQuery usingConnection(Connection connection);
/**
* Ensure that the master DataSource is used if there is a read only data source
* being used (that is using a read replica database potentially with replication lag).
* <p>
* When the database is configured with a read-only DataSource via
* say {@link io.ebean.DatabaseBuilder#readOnlyDataSource(DataSource)}then
* by default when a query is run without an active transaction, it uses the read-only data
* source. We use {@code usingMaster()} to instead ensure that the query is executed
* against the master data source.
*/
SqlQuery usingMaster();
/**
* Execute the query returning a list.
*/
@@ -9,7 +9,6 @@ import java.util.Collection;
* <p>
* This is currently deemed to be experimental and subject to change.
*/
@Deprecated(since = "experimental")
public final class StdOperators {
// ---- Functions ---- //
@@ -77,9 +76,9 @@ public final class StdOperators {
StringBuilder expression = new StringBuilder(50);
expression.append("concat(").append(property.toString());
for (Object value : values) {
expression.append(",").append(sqlConcatString(value));
expression.append(',').append(sqlConcatString(value));
}
expression.append(")");
expression.append(')');
return Property.of(expression.toString());
}
@@ -5,7 +5,7 @@ import io.ebean.annotation.PersistBatch;
import io.ebean.config.DatabaseConfig;
import io.ebean.config.DocStoreConfig;
import javax.persistence.PersistenceException;
import jakarta.persistence.PersistenceException;
import java.sql.Connection;
/**
@@ -4,8 +4,8 @@ import io.ebean.DB;
import io.ebean.Database;
import io.ebean.ValuePair;
import javax.persistence.EntityNotFoundException;
import javax.persistence.PersistenceException;
import jakarta.persistence.EntityNotFoundException;
import jakarta.persistence.PersistenceException;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
@@ -45,7 +45,7 @@ public final class ToStringBuilder {
id.putIfAbsent(bean, 0);
}
if (counter <= MAX) {
sb.append(bean.getClass().getSimpleName()).append("@").append(counter).append("(");
sb.append(bean.getClass().getSimpleName()).append('@').append(counter).append('(');
}
}
@@ -77,7 +77,7 @@ public final class ToStringBuilder {
*/
public void end() {
if (counter <= MAX) {
sb.append(")");
sb.append(')');
}
}
@@ -90,7 +90,7 @@ public final class ToStringBuilder {
} else {
sb.append(", ");
}
sb.append(name).append(":");
sb.append(name).append(':');
}
private void value(Object value) {
@@ -110,7 +110,7 @@ public final class ToStringBuilder {
} else {
String content = String.valueOf(value);
if (content.length() > TRIM_LENGTH) {
content = content.substring(0, TRIM_LENGTH) + " <trimmed>";
content = content.substring(0, TRIM_LENGTH) + " (trimmed)";
}
sb.append(content);
if (sb.length() >= MAX_TOTAL_CONTENT) {
@@ -125,20 +125,20 @@ public final class ToStringBuilder {
sb.append("{}");
} else {
boolean firstElement = true;
sb.append("{");
sb.append('{');
for (Map.Entry<?, ?> entry : map.entrySet()) {
if (firstElement) {
firstElement = false;
} else {
sb.append(", ");
}
sb.append(entry.getKey()).append(":");
sb.append(entry.getKey()).append(':');
value(entry.getValue());
if (counter > MAX) {
return;
}
}
sb.append("}");
sb.append('}');
}
}
@@ -151,7 +151,7 @@ public final class ToStringBuilder {
return;
}
boolean firstElement = true;
sb.append("[");
sb.append('[');
for (Object o : c) {
if (firstElement) {
firstElement = false;
@@ -163,7 +163,7 @@ public final class ToStringBuilder {
return;
}
}
sb.append("]");
sb.append(']');
}
private boolean push(Object bean) {
@@ -178,7 +178,7 @@ public final class ToStringBuilder {
Integer idx = id.putIfAbsent(bean, counter++);
if (idx != null) {
--counter;
sb.append(bean.getClass().getSimpleName()).append("@").append(idx);
sb.append(bean.getClass().getSimpleName()).append('@').append(idx);
return false;
}
first = true;
@@ -1,6 +1,6 @@
package io.ebean.cache;
import io.ebean.config.DatabaseConfig;
import io.ebean.DatabaseBuilder;
/**
* Plugin that provides a ServerCacheNotify implementation.
@@ -12,5 +12,5 @@ public interface ServerCacheNotifyPlugin {
/**
* Create a ServerCacheNotify implementation given the server configuration.
*/
ServerCacheNotify create(DatabaseConfig config);
ServerCacheNotify create(DatabaseBuilder config);
}
@@ -1,7 +1,7 @@
package io.ebean.cache;
import io.ebean.BackgroundExecutor;
import io.ebean.config.DatabaseConfig;
import io.ebean.DatabaseBuilder;
/**
* The plugin interface that creates a ServerCacheFactory.
@@ -11,5 +11,5 @@ public interface ServerCachePlugin {
/**
* Create the ServerCacheFactory given the server config and background executor service.
*/
ServerCacheFactory create(DatabaseConfig config, BackgroundExecutor executor);
ServerCacheFactory create(DatabaseBuilder config, BackgroundExecutor executor);
}
+1 -1
View File
@@ -69,7 +69,7 @@ public class TenantAwareKey {
public String toString() {
StringBuilder sb = new StringBuilder(key.toString());
if (tenantId != null) {
sb.append(":").append(tenantId);
sb.append(':').append(tenantId);
}
return sb.toString();
}
@@ -119,7 +119,7 @@ public final class BeanSet<E> extends AbstractBeanCollection<E> implements Set<E
try {
if (set == null) {
if (!disableLazyLoad && modifyListening) {
lazyLoadCollection(true);
lazyLoadCollection(false);
} else {
set = new LinkedHashSet<>();
}
@@ -136,7 +136,7 @@ public final class BeanSet<E> extends AbstractBeanCollection<E> implements Set<E
if (disableLazyLoad) {
set = new LinkedHashSet<>();
} else {
lazyLoadCollection(true);
lazyLoadCollection(false);
}
}
} finally {
@@ -3,9 +3,9 @@ package io.ebean.config;
import io.ebean.config.dbplatform.DatabasePlatform;
import io.ebean.util.AnnotationUtil;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Inheritance;
import javax.persistence.Table;
import jakarta.persistence.DiscriminatorValue;
import jakarta.persistence.Inheritance;
import jakarta.persistence.Table;
import static io.ebean.util.StringHelper.isNull;
@@ -228,7 +228,7 @@ public abstract class AbstractNamingConvention implements NamingConvention {
public TableName getM2MJoinTableName(TableName lhsTable, TableName rhsTable) {
StringBuilder buffer = new StringBuilder();
buffer.append(unQuote(lhsTable.getName()));
buffer.append("_");
buffer.append('_');
String rhsTableName = unQuote(rhsTable.getName());
if (rhsTableName.indexOf('_') < rhsPrefixLength) {
@@ -271,10 +271,10 @@ public abstract class AbstractNamingConvention implements NamingConvention {
public String getTableName(String catalog, String schema, String name) {
StringBuilder sb = new StringBuilder();
if (!isNull(catalog)) {
sb.append(quoteIdentifiers(catalog)).append(".");
sb.append(quoteIdentifiers(catalog)).append('.');
}
if (!isNull(schema)) {
sb.append(quoteIdentifiers(schema)).append(".");
sb.append(quoteIdentifiers(schema)).append('.');
}
return sb.append(quoteIdentifiers(name)).toString();
}
@@ -1,5 +1,7 @@
package io.ebean.config;
import io.ebean.DatabaseBuilder;
/**
* Used to provide some automatic configuration early in the creation of a Database.
*/
@@ -8,11 +10,11 @@ public interface AutoConfigure {
/**
* Perform configuration for the DatabaseConfig prior to properties load.
*/
void preConfigure(DatabaseConfig config);
void preConfigure(DatabaseBuilder config);
/**
* Provide some configuration the DatabaseConfig prior to server creation but after properties have been applied.
*/
void postConfigure(DatabaseConfig config);
void postConfigure(DatabaseBuilder config);
}
@@ -15,7 +15,6 @@ public class ContainerConfig {
private String namespace;
private String podName;
private int port;
private Properties properties;
/**
@@ -123,5 +122,4 @@ public class ContainerConfig {
protected boolean getProperty(Properties properties, String key, boolean defaultValue) {
return "true".equalsIgnoreCase(properties.getProperty(key, Boolean.toString(defaultValue)));
}
}
File diff suppressed because it is too large Load Diff
@@ -1,5 +1,7 @@
package io.ebean.config;
import io.ebean.DatabaseBuilder;
/**
* Provides a ServiceLoader based mechanism to configure a DatabaseConfig.
* <p>
@@ -35,5 +37,5 @@ public interface DatabaseConfigProvider {
* Typically we explicitly register entity bean classes and thus avoid classpath scanning.
* </p>
*/
void apply(DatabaseConfig config);
void apply(DatabaseBuilder config);
}
@@ -135,16 +135,16 @@ public class DbConstraintNaming {
*/
protected String joinColumnNames(String[] columns) {
if (columns.length == 1) {
return normaliseColumn(columns[0]);
return normaliseColumn(columns[0]).replace(" ", "_");
}
StringBuilder sb = new StringBuilder();
for (int i = 0; i < columns.length; i++) {
if (i > 0) {
sb.append("_");
sb.append('_');
}
sb.append(normaliseColumn(columns[i]));
}
return sb.toString();
return sb.toString().replace(" ", "_");
}
/**
@@ -27,7 +27,6 @@ public class DbConstraintNormalise {
* quoted identifier characters (",',[,] etc).
*/
public String normaliseTable(String tableName) {
tableName = trimQuotes(tableName);
int lastPeriod = tableName.lastIndexOf('.');
if (lastPeriod > -1) {
@@ -59,7 +58,6 @@ public class DbConstraintNormalise {
* Trim off the platform quoted identifier quotes like [ ' and ".
*/
public String trimQuotes(String identifier) {
if (identifier == null) {
return "";
}
@@ -0,0 +1,22 @@
package io.ebean.config;
/**
* Defines the length-check mode.
*
* @author Roland Praml, FOCONIS AG
*/
public enum LengthCheck {
/**
* By default, length checking is off. This means, strings/jsons and files are passed to the DB and the DB might or might not check the length.
* The DB has to check the data length. Note this is not possible for certain datatypes (e.g. clob without size)
*/
OFF,
/**
* When enabling length check, ebean validates strings/json strings and files before saving them to DB.
*/
ON,
/**
* Same as "ON", but take the UTF8-bytelength for validation. This may be useful, if you have an UTF8 based charset (default for DB2)
*/
UTF8
}
@@ -1,7 +1,7 @@
package io.ebean.config;
/**
* Matches the functionality of javax.persistence.AttributeConverter
* Matches the functionality of jakarta.persistence.AttributeConverter
* <p>
* In general AttributeConverter should be used in preference to this
* ScalarTypeConverter as it is JPA standard and offers the same functionality.
@@ -1,50 +1,29 @@
package io.ebean.config;
import io.ebean.ProfileLocation;
import io.ebean.bean.ObjectGraphNode;
import java.util.List;
/**
* Slow query event.
* The data for the slow query.
*/
public class SlowQueryEvent {
private final String sql;
private final long timeMillis;
private final int rowCount;
private final ObjectGraphNode originNode;
/**
* Construct with the SQL and execution time in millis.
*/
public SlowQueryEvent(String sql, long timeMillis, int rowCount, ObjectGraphNode originNode) {
this.sql = sql;
this.timeMillis = timeMillis;
this.rowCount = rowCount;
this.originNode = originNode;
}
public interface SlowQueryEvent {
/**
* Return the SQL for the slow query.
*/
public String getSql() {
return sql;
}
String getSql();
/**
* Return the execution time in millis.
*/
public long getTimeMillis() {
return timeMillis;
}
long getTimeMillis();
/**
* Return the total row count associated with the query.
*/
public int getRowCount() {
return rowCount;
}
int getRowCount();
/**
* Return the origin point for the root query.
@@ -53,7 +32,20 @@ public class SlowQueryEvent {
* shows the code that invoked the query.
* </p>
*/
public ObjectGraphNode getOriginNode() {
return originNode;
}
ObjectGraphNode getOriginNode();
/**
* Return the bind parameters.
*/
List<Object> getBindParams();
/**
* Return the label.
*/
String getLabel();
/**
* Return the profile location.
*/
ProfileLocation getProfileLocation();
}
@@ -117,12 +117,12 @@ public final class TableName {
// Add schema
if (schema != null) {
if (buffer.length() > 0) {
buffer.append(".");
buffer.append('.');
}
buffer.append(schema);
}
if (buffer.length() > 0) {
buffer.append(".");
buffer.append('.');
}
return buffer.append(name).toString();
}
@@ -23,11 +23,11 @@ public class BasicSqlLimitOffset implements BasicSqlLimiter {
sb.append(dbSql);
if (maxRows > 0) {
sb.append(" ").append(LIMIT);
sb.append(" ").append(maxRows);
sb.append(' ').append(LIMIT);
sb.append(' ').append(maxRows);
}
if (firstRow > 0) {
sb.append(" ").append(OFFSET).append(" ");
sb.append(' ').append(OFFSET).append(' ');
sb.append(firstRow);
}
return sb.toString();
@@ -9,7 +9,7 @@ import io.ebean.config.CustomDbTypeMapping;
import io.ebean.config.PlatformConfig;
import io.ebean.util.JdbcClose;
import javax.persistence.PersistenceException;
import jakarta.persistence.PersistenceException;
import javax.sql.DataSource;
import java.sql.*;
@@ -673,7 +673,7 @@ public class DatabasePlatform {
protected String withForUpdate(String sql, Query.LockWait lockWait, Query.LockType lockType) {
// silently assume the database does not support the "for update" clause.
log.log(INFO, "it seems your database does not support the 'for update' clause");
log.log(INFO, "it seems your database does not support the ''for update'' clause");
return sql;
}
@@ -769,4 +769,15 @@ public class DatabasePlatform {
public boolean supportsNativeJavaTime() {
return supportsNativeJavaTime;
}
public String inlineSqlComment(String label) {
if (label == null) {
return "";
}
return "/* " + label + " */ ";
}
public String inlineSqlHint(String hint) {
return "/*+ " + hint + " */ ";
}
}
@@ -28,6 +28,16 @@ public class DbPlatformType implements ExtraDbTypes {
*/
private final boolean canHaveLength;
/**
* The maximum length supported by this platform type. If length is too big, fallback is used.
*/
private final int maxLength;
/**
* Use this platform type if length exceedes
*/
private final DbPlatformType fallback;
/**
* Parse a type definition into a DbPlatformType.
* <p>
@@ -53,6 +63,41 @@ public class DbPlatformType implements ExtraDbTypes {
this(name, defaultLength, 0);
}
/**
* Construct without length, but with a max length limit and a fallback type, that is used if maxLength is exceeded.
* This can be used to use <ul>
* <li>"longtext" for unspecified length</li>
* <li>"text" for length up to 2^16-1</li>
* <li>"mediumtext" for length up to 2^24-1</li>
* <li>"longtext" else</li>
* </ul>
*/
public DbPlatformType(String name, int maxLength, DbPlatformType fallback) {
this.name = name;
this.defaultLength = 0;
this.defaultScale = 0;
this.canHaveLength = false;
this.maxLength = maxLength;
this.fallback = fallback;
}
/**
* Construct with a given default length, a max length limit and a fallback type, that is used if maxLength is exceeded.
* This can be used to use <ul>
* <li>"varchar(255)" for unspecified length</li>
* <li>"varchar(N)" for N <= maxLength</li>
* <li>"varchar(max)" else</li>
* </ul>
*/
public DbPlatformType(String name, int defaultPrecision, int maxLength, DbPlatformType fallback) {
this.name = name;
this.defaultLength = defaultPrecision;
this.defaultScale = 0;
this.canHaveLength = true;
this.maxLength = maxLength;
this.fallback = fallback;
}
/**
* Construct for Decimal with precision and scale.
*/
@@ -61,6 +106,8 @@ public class DbPlatformType implements ExtraDbTypes {
this.defaultLength = defaultPrecision;
this.defaultScale = defaultScale;
this.canHaveLength = true;
this.maxLength = Integer.MAX_VALUE;
this.fallback = null;
}
/**
@@ -74,6 +121,8 @@ public class DbPlatformType implements ExtraDbTypes {
this.defaultLength = 0;
this.defaultScale = 0;
this.canHaveLength = canHaveLength;
this.maxLength = Integer.MAX_VALUE;
this.fallback = null;
}
/**
@@ -124,33 +173,33 @@ public class DbPlatformType implements ExtraDbTypes {
*/
public String renderType(int deployLength, int deployScale, boolean strict) {
StringBuilder sb = new StringBuilder();
sb.append(name);
if (canHaveLength || !strict) {
renderLengthScale(deployLength, deployScale, sb);
}
int len = deployLength != 0 ? deployLength : defaultLength;
if (len > maxLength) {
return fallback.renderType(deployLength, deployScale, strict);
} else {
StringBuilder sb = new StringBuilder();
sb.append(name);
if ((canHaveLength || !strict) && len > 0) {
renderLengthScale(len, deployScale, sb);
}
return sb.toString();
return sb.toString();
}
}
/**
* Render the length and scale part of the column definition.
*/
protected void renderLengthScale(int deployLength, int deployScale, StringBuilder sb) {
protected void renderLengthScale(int len, int deployScale, StringBuilder sb) {
// see if there is a precision/scale to add (or not)
int len = deployLength != 0 ? deployLength : defaultLength;
if (len == Integer.MAX_VALUE) {
sb.append("(max)"); // TODO: this is sqlserver specific
} else if (len > 0) {
sb.append("(");
sb.append(len);
int scale = deployScale != 0 ? deployScale : defaultScale;
if (scale > 0) {
sb.append(",");
sb.append(scale);
}
sb.append(")");
sb.append('(');
sb.append(len);
int scale = deployScale != 0 ? deployScale : defaultScale;
if (scale > 0) {
sb.append(',');
sb.append(scale);
}
sb.append(')');
}
/**
@@ -5,7 +5,7 @@ import io.ebean.BackgroundExecutor;
import io.ebean.Transaction;
import io.ebean.util.JdbcClose;
import javax.persistence.PersistenceException;
import jakarta.persistence.PersistenceException;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.PreparedStatement;
@@ -3,7 +3,7 @@ package io.ebean.config.dbplatform;
import io.ebean.Transaction;
import io.ebean.util.JdbcClose;
import javax.persistence.PersistenceException;
import jakarta.persistence.PersistenceException;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.PreparedStatement;
@@ -5,7 +5,7 @@ import io.ebean.DataIntegrityException;
import io.ebean.DuplicateKeyException;
import io.ebean.SerializableConflictException;
import javax.persistence.PersistenceException;
import jakarta.persistence.PersistenceException;
import java.sql.SQLException;
import java.util.Collections;
import java.util.Map;
@@ -1,6 +1,6 @@
package io.ebean.config.dbplatform;
import javax.persistence.PersistenceException;
import jakarta.persistence.PersistenceException;
import java.sql.SQLException;
/**
@@ -1,6 +1,6 @@
package io.ebean.event;
import io.ebean.config.DatabaseConfig;
import io.ebean.DatabaseBuilder;
/**
* Used to configure the server on startup.
@@ -13,6 +13,6 @@ public interface ServerConfigStartup {
/**
* On starting configure the DatabaseConfig.
*/
void onStart(DatabaseConfig config);
void onStart(DatabaseBuilder config);
}
@@ -1,8 +1,11 @@
package io.ebean.event;
import javax.servlet.ServletContextEvent;
import jakarta.servlet.ServletContextEvent;
/**
* Deprecated for removal - no intention to replace. Create your own copy of this
* ServletContextListener if needed for your application.
* <p>
* Listens for webserver server starting and stopping events.
* <p>
* This should be used when the deployment is into a servlet container where the webapp
@@ -15,7 +18,8 @@ import javax.servlet.ServletContextEvent;
* hook that Ebean registers.
* </p>
*/
public class ServletContextListener implements javax.servlet.ServletContextListener {
@Deprecated(forRemoval = true)
public class ServletContextListener implements jakarta.servlet.ServletContextListener {
/**
* The servlet container is stopping.
@@ -8,6 +8,7 @@ import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
import java.util.List;
import java.util.concurrent.locks.ReentrantLock;
@@ -23,7 +24,7 @@ public final class ShutdownManager {
private static final System.Logger log = EbeanVersion.log;
private static final ReentrantLock lock = new ReentrantLock();
private static final List<Database> databases = new ArrayList<>();
private static final List<Database> databases = Collections.synchronizedList(new ArrayList<>());
private static final ShutdownHook shutdownHook = new ShutdownHook();
private static boolean stopping;
@@ -177,12 +178,7 @@ public final class ShutdownManager {
* Register an ebeanServer to be shutdown when the JVM is shutdown.
*/
public static void registerDatabase(Database server) {
lock.lock();
try {
databases.add(server);
} finally {
lock.unlock();
}
databases.add(server);
}
/**
@@ -192,12 +188,7 @@ public final class ShutdownManager {
* </p>
*/
public static void unregisterDatabase(Database server) {
lock.lock();
try {
databases.remove(server);
} finally {
lock.unlock();
}
databases.remove(server);
}
private static class ShutdownHook extends Thread {
@@ -16,22 +16,6 @@ public interface MetaInfoManager {
*/
ServerMetrics collectMetrics();
/**
* Deprecated migrate to collectMetrics().asJson().
*/
@Deprecated
default ServerMetricsAsJson collectMetricsAsJson() {
return collectMetrics().asJson();
}
/**
* Deprecated migrate to collectMetrics().asData().
*/
@Deprecated
default List<MetricData> collectMetricsAsData() {
return collectMetrics().asData();
}
/**
* Visit the metrics resetting and collecting/reporting as desired.
*/
@@ -2,6 +2,8 @@ package io.ebean.meta;
import io.ebean.ProfileLocation;
import java.time.Instant;
/**
* Meta data for captured query plan.
*/
@@ -51,4 +53,14 @@ public interface MetaQueryPlan {
* Return the total count of times bind capture has occurred.
*/
long captureCount();
/**
* Return the time taken to capture this plan in microseconds.
*/
long captureMicros();
/**
* Return the instant when the bind values were captured.
*/
Instant whenCaptured();
}
@@ -118,28 +118,28 @@ final class MetricsAsJson implements ServerMetricsAsJson {
private void objStart() throws IOException {
objKeyCounter = 0;
writer.append("{");
writer.append('{');
}
private void objEnd() throws IOException {
writer.append("}");
writer.append('}');
}
private void listStart() throws IOException {
listCounter = 0;
writer.append("[");
writer.append('[');
writer.append(newLine);
}
private void listEnd() throws IOException {
writer.append("]");
writer.append(']');
}
private void key(String key) throws IOException {
if (objKeyCounter++ > 0) {
writer.append(", ");
}
writer.append("\"").append(key).append("\":");
writer.append('"').append(key).append("\":");
}
private void val(long count) throws IOException {
@@ -147,12 +147,12 @@ final class MetricsAsJson implements ServerMetricsAsJson {
}
private void val(String val) throws IOException {
writer.append("\"").append(val).append("\"");
writer.append('"').append(val).append('"');
}
private void metricStart(MetaMetric metric) throws IOException {
if (listCounter++ > 0) {
writer.append(",").append(newLine);
writer.append(',').append(newLine);
}
objStart();
key("name");
@@ -187,11 +187,22 @@ final class MetricsAsJson implements ServerMetricsAsJson {
}
if (isIncludeDetail(metric)) {
append("loc", metric.location());
append("sql", metric.sql());
append("sql", escape(metric.sql()));
}
metricEnd();
}
static String escape(String sql) {
return sql == null ? null : sql
.replace("\\", "\\\\")
.replace("\"", "\\\"")
.replace("\b", "\\b")
.replace("\f", "\\f")
.replace("\n", "\\n")
.replace("\r", "\\r")
.replace("\t", "\\t");
}
private boolean isIncludeDetail(MetaTimedMetric metric) {
return includeExtraAttributes == 2 || includeExtraAttributes == 1 && metric.initialCollection();
}
@@ -3,7 +3,7 @@ package io.ebean.plugin;
import io.ebean.Database;
import io.ebean.bean.BeanLoader;
import io.ebean.bean.EntityBeanIntercept;
import io.ebean.config.DatabaseConfig;
import io.ebean.DatabaseBuilder;
import io.ebean.config.dbplatform.DatabasePlatform;
import java.util.List;
@@ -16,7 +16,7 @@ public interface SpiServer extends Database {
/**
* Return the DatabaseConfig.
*/
DatabaseConfig config();
DatabaseBuilder.Settings config();
/**
* Return the DatabasePlatform for this database.
@@ -1,7 +1,7 @@
package io.ebean.service;
import io.ebean.Database;
import io.ebean.config.DatabaseConfig;
import io.ebean.DatabaseBuilder;
/**
* Creates the Database implementations. This is used internally by the EbeanServerFactory and is not currently
@@ -14,7 +14,7 @@ public interface SpiContainer {
*
* @param configuration The configuration information for this database.
*/
Database createServer(DatabaseConfig configuration);
Database createServer(DatabaseBuilder configuration);
/**
* Create an EbeanServer just using the name.
@@ -0,0 +1,22 @@
package io.ebean.service;
import io.ebean.InTuples;
import java.util.List;
/**
* Internal extension to InTuples.
*/
public interface SpiInTuples extends InTuples {
/**
* Return the properties of the tuples.
*/
String[] properties();
/**
* Return all the tuple entries.
*/
List<Object[]> entries();
}
@@ -1,91 +0,0 @@
/* Javadoc style sheet */
/* Define colors, fonts and other style attributes here to override the defaults */
/* Page background color */
body {
background-color: #FFFFFF;
font-family: Arial, Helvetica, sans-serif;
font-size: 10pt;
}
pre.code {
padding: 1em;
margin-left: 2em;
border: 1px solid #ccc;
background-color: #eee;
}
/* Headings */
h1 {
font-size: 14pt
}
#overviewexamples h3 {
font-size: 10pt
}
/* Table colors */
.TableHeadingColor {
background: #CCCCFF
}
/* Dark mauve */
.TableSubHeadingColor {
background: #EEEEFF
}
/* Light mauve */
.TableRowColor {
background: #FFFFFF
}
/* White */
/* Font used in left-hand frame lists */
.FrameTitleFont {
font-size: 12pt;
font-family: Helvetica, Arial, sans-serif
}
.FrameHeadingFont {
font-size: 10pt;
font-family: Helvetica, Arial, sans-serif
}
.FrameItemFont {
font-size: 10pt;
font-family: Helvetica, Arial, sans-serif
}
/* Navigation bar fonts and colors */
.NavBarCell1 {
background-color: #EEEEFF;
}
/* Light mauve */
.NavBarCell1Rev {
background-color: #00008B;
}
/* Dark Blue */
.NavBarFont1 {
font-family: Arial, Helvetica, sans-serif;
color: #000000;
}
.NavBarFont1Rev {
font-family: Arial, Helvetica, sans-serif;
color: #FFFFFF;
}
.NavBarCell2 {
font-family: Arial, Helvetica, sans-serif;
background-color: #FFFFFF;
}
.NavBarCell3 {
font-family: Arial, Helvetica, sans-serif;
background-color: #FFFFFF;
}
@@ -205,7 +205,7 @@ public class PathProperties implements FetchPath {
sb.append(it.next());
hasNext = it.hasNext();
if (hasNext) {
sb.append(",");
sb.append(',');
}
}
return sb.toString();
@@ -22,6 +22,8 @@ public class JsonWriteOptions {
protected JsonConfig.Include include;
protected boolean includeLoadedImplicit = true;
protected Map<String, JsonWriteBeanVisitor<?>> visitorMap;
/**
@@ -73,6 +75,20 @@ public class JsonWriteOptions {
this.include = include;
}
/**
* Should loaded properties be included implicit, if no other fetch path is specified (default = true).
*/
public boolean isIncludeLoadedImplicit() {
return includeLoadedImplicit;
}
/**
* Set include loaded properties implicit (default = true).
*/
public void setIncludeLoadedImplicit(boolean includeLoadedImplicit) {
this.includeLoadedImplicit = includeLoadedImplicit;
}
/**
* Register a JsonWriteBeanVisitor for the root level.
*/
@@ -25,14 +25,14 @@ public final class CamelCaseHelper {
lastUpper = i;
} else if (Character.isDigit(c)) {
if (i > lastUpper + 1 && !digitsCompressed) {
sb.append("_");
sb.append('_');
lastUpper = i;
}
sb.append(c);
} else if (Character.isUpperCase(c)) {
if (i > lastUpper + 1) {
sb.append("_");
sb.append('_');
}
sb.append(Character.toLowerCase(c));
lastUpper = i;
+2 -2
View File
@@ -12,7 +12,7 @@ module io.ebean.api {
requires transitive java.sql;
requires transitive io.avaje.config;
requires transitive io.avaje.lang;
requires transitive persistence.api;
requires transitive jakarta.persistence.api;
requires transitive io.ebean.annotation;
requires transitive io.ebean.datasource.api;
requires transitive io.avaje.applog;
@@ -21,7 +21,7 @@ module io.ebean.api {
requires static io.ebean.types;
requires static com.fasterxml.jackson.core;
requires static com.fasterxml.jackson.databind;
requires static javax.servlet.api;
requires static jakarta.servlet;
exports io.ebean;
exports io.ebean.bean;
@@ -21,9 +21,4 @@ class DbPrimaryTest {
assertEquals("h2", DbPrimary.getDefaultServerName());
}
@Test
void testLoadProperties() {
Properties properties = DbPrimary.getProperties();
assertFalse(properties.isEmpty());
}
}
@@ -0,0 +1,82 @@
package io.ebean;
import org.junit.jupiter.api.Test;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
class ListsTest {
@Test
void partition_empty() {
List<List<Integer>> partitions = Lists.partition(List.of(), 5);
assertThat(partitions).isEmpty();
}
@Test
void partition_lt() {
List<List<Integer>> partitions = Lists.partition(List.of(1, 2, 3, 4), 5);
assertThat(partitions).hasSize(1);
assertThat(partitions.get(0)).hasSize(4);
}
@Test
void partition_eq() {
List<List<Integer>> partitions = Lists.partition(List.of(1, 2, 3, 4, 5), 5);
assertThat(partitions).hasSize(1);
assertThat(partitions.get(0)).hasSize(5);
}
@Test
void partition_gt() {
List<List<Integer>> partitions = Lists.partition(List.of(1, 2, 3, 4, 5, 6), 5);
assertThat(partitions).hasSize(2);
assertThat(partitions.get(0)).hasSize(5);
assertThat(partitions.get(1)).hasSize(1);
assertThat(partitions.get(0)).containsExactly(1, 2, 3, 4, 5);
assertThat(partitions.get(1)).containsExactly(6);
}
@Test
void partition_gt1_letters() {
var partitions = Lists.partition(List.of("a", "b", "c", "d"), 3);
assertThat(partitions).hasSize(2);
assertThat(partitions.get(0)).hasSize(3);
assertThat(partitions.get(1)).hasSize(1);
assertThat(partitions.get(0)).containsExactly("a", "b", "c");
assertThat(partitions.get(1)).containsExactly("d");
}
@Test
void partition_gt1a_letters() {
var partitions = Lists.partition(List.of("a", "b", "c", "d", "e"), 3);
assertThat(partitions).hasSize(2);
assertThat(partitions.get(0)).hasSize(3);
assertThat(partitions.get(1)).hasSize(2);
assertThat(partitions.get(0)).containsExactly("a", "b", "c");
assertThat(partitions.get(1)).containsExactly("d", "e");
}
@Test
void partition_eq2_letters() {
var partitions = Lists.partition(List.of("a", "b", "c", "d", "e", "f"), 3);
assertThat(partitions).hasSize(2);
assertThat(partitions.get(0)).hasSize(3);
assertThat(partitions.get(1)).hasSize(3);
assertThat(partitions.get(0)).containsExactly("a", "b", "c");
assertThat(partitions.get(1)).containsExactly("d", "e", "f");
}
@Test
void partition_gt2_letters() {
var partitions = Lists.partition(List.of("a", "b", "c", "d", "e", "f", "g"), 3);
assertThat(partitions).hasSize(3);
assertThat(partitions.get(0)).hasSize(3);
assertThat(partitions.get(1)).hasSize(3);
assertThat(partitions.get(2)).hasSize(1);
assertThat(partitions.get(0)).containsExactly("a", "b", "c");
assertThat(partitions.get(1)).containsExactly("d", "e", "f");
assertThat(partitions.get(2)).containsExactly("g");
}
}
@@ -1,6 +1,7 @@
package io.ebean.config;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.ebean.DatabaseBuilder;
import io.ebean.annotation.MutationDetection;
import io.ebean.annotation.PersistBatch;
import io.ebean.config.dbplatform.IdType;
@@ -17,7 +18,7 @@ class DatabaseConfigTest {
@Test
void testLoadFromEbeanProperties() {
DatabaseConfig config = new DatabaseConfig();
var config = new DatabaseConfig().settings();
config.loadFromProperties();
assertEquals(PersistBatch.NONE, config.getPersistBatch());
@@ -32,7 +33,7 @@ class DatabaseConfigTest {
Properties props = new Properties();
props.setProperty("ddl.initSql", "${user.home}" + fileSeparator + "initSql");
DatabaseConfig config = new DatabaseConfig();
var config = new DatabaseConfig().settings();
config.loadFromProperties(props);
String ddlInitSql = config.getDdlInitSql();
@@ -41,7 +42,7 @@ class DatabaseConfigTest {
@Test
void testLoadWithProperties() {
DatabaseConfig config = new DatabaseConfig();
DatabaseBuilder config = new DatabaseConfig();
config.setPersistBatch(PersistBatch.NONE);
config.setPersistBatchOnCascade(PersistBatch.NONE);
config.setAutoReadOnlyDataSource(false);
@@ -73,6 +74,9 @@ class DatabaseConfigTest {
props.setProperty("forUpdateNoKey", "true");
props.setProperty("defaultServer", "false");
props.setProperty("skipDataSourceCheck", "true");
props.setProperty("readOnlyDatabase", "true");
props.setProperty("lengthCheck", "ON");
props.setProperty("includeLabelInSql", "true");
props.setProperty("queryPlan.enable", "true");
props.setProperty("queryPlan.thresholdMicros", "10000");
@@ -83,49 +87,56 @@ class DatabaseConfigTest {
config.loadFromProperties(props);
assertFalse(config.isDefaultServer());
assertTrue(config.isDisableL2Cache());
assertTrue(config.isNotifyL2CacheInForeground());
assertTrue(config.isDbOffline());
assertTrue(config.isAutoReadOnlyDataSource());
assertTrue(config.isAutoLoadModuleInfo());
assertTrue(config.isLoadModuleInfo());
assertTrue(config.skipDataSourceCheck());
var settings = config.settings();
assertFalse(settings.isDefaultServer());
assertTrue(settings.isDisableL2Cache());
assertTrue(settings.isNotifyL2CacheInForeground());
assertTrue(settings.isDbOffline());
assertTrue(settings.isAutoReadOnlyDataSource());
assertTrue(settings.isAutoLoadModuleInfo());
assertTrue(settings.isLoadModuleInfo());
assertTrue(settings.skipDataSourceCheck());
assertTrue(settings.readOnlyDatabase());
assertTrue(settings.isIncludeLabelInSql());
assertThat(settings.getLengthCheck()).isEqualTo(LengthCheck.ON);
assertTrue(config.isIdGeneratorAutomatic());
assertFalse(config.getPlatformConfig().isCaseSensitiveCollation());
assertTrue(config.getPlatformConfig().isForUpdateNoKey());
assertTrue(settings.isIdGeneratorAutomatic());
assertFalse(settings.getPlatformConfig().isCaseSensitiveCollation());
assertTrue(settings.getPlatformConfig().isForUpdateNoKey());
assertThat(config.getNamingConvention()).isInstanceOf(MatchingNamingConvention.class);
assertThat(settings.getNamingConvention()).isInstanceOf(MatchingNamingConvention.class);
assertEquals(MutationDetection.NONE, config.getJsonMutationDetection());
assertEquals(MutationDetection.NONE, settings.getJsonMutationDetection());
config.setJsonMutationDetection(MutationDetection.SOURCE);
assertEquals(MutationDetection.SOURCE, config.getJsonMutationDetection());
assertEquals(IdType.SEQUENCE, config.getIdType());
assertEquals(PersistBatch.ALL, config.getPersistBatch());
assertEquals(PersistBatch.ALL, config.getPersistBatchOnCascade());
Assertions.assertEquals(PlatformConfig.DbUuid.BINARY, config.getPlatformConfig().getDbUuid());
Assertions.assertEquals(JsonConfig.DateTime.MILLIS, config.getJsonDateTime());
assertEquals(JsonConfig.Date.MILLIS, config.getJsonDate());
assertEquals(MutationDetection.SOURCE, settings.getJsonMutationDetection());
assertEquals(IdType.SEQUENCE, settings.getIdType());
assertEquals(PersistBatch.ALL, settings.getPersistBatch());
assertEquals(PersistBatch.ALL, settings.getPersistBatchOnCascade());
Assertions.assertEquals(PlatformConfig.DbUuid.BINARY, settings.getPlatformConfig().getDbUuid());
Assertions.assertEquals(JsonConfig.DateTime.MILLIS, settings.getJsonDateTime());
assertEquals(JsonConfig.Date.MILLIS, settings.getJsonDate());
assertEquals("r0,users,orgs", config.getEnabledL2Regions());
assertEquals("r0,users,orgs", settings.getEnabledL2Regions());
assertEquals(42, config.getJdbcFetchSizeFindEach());
assertEquals(43, config.getJdbcFetchSizeFindList());
assertEquals(4, config.getBackgroundExecutorSchedulePoolSize());
assertEquals(98, config.getBackgroundExecutorShutdownSecs());
assertEquals(42, settings.getJdbcFetchSizeFindEach());
assertEquals(43, settings.getJdbcFetchSizeFindList());
assertEquals(4, settings.getBackgroundExecutorSchedulePoolSize());
assertEquals(98, settings.getBackgroundExecutorShutdownSecs());
assertTrue(config.isQueryPlanEnable());
assertEquals(10000, config.getQueryPlanThresholdMicros());
assertTrue(config.isQueryPlanCapture());
assertEquals(42, config.getQueryPlanCapturePeriodSecs());
assertEquals(560, config.getQueryPlanCaptureMaxTimeMillis());
assertEquals(7, config.getQueryPlanCaptureMaxCount());
assertTrue(settings.isQueryPlanEnable());
assertEquals(10000, settings.getQueryPlanThresholdMicros());
assertTrue(settings.isQueryPlanCapture());
assertEquals(42, settings.getQueryPlanCapturePeriodSecs());
assertEquals(560, settings.getQueryPlanCaptureMaxTimeMillis());
assertEquals(7, settings.getQueryPlanCaptureMaxCount());
assertThat(config.getMappingLocations()).containsExactly("classpath:/foo","bar");
assertThat(settings.getMappingLocations()).containsExactly("classpath:/foo","bar");
config.persistBatch(PersistBatch.NONE)
.persistBatchOnCascade(PersistBatch.NONE)
.lengthCheck(LengthCheck.ON)
.lengthCheck(LengthCheck.UTF8);
config.setPersistBatch(PersistBatch.NONE);
config.setPersistBatchOnCascade(PersistBatch.NONE);
Properties props1 = new Properties();
props1.setProperty("ebean.persistBatch", "ALL");
@@ -137,19 +148,20 @@ class DatabaseConfigTest {
props1.setProperty("ebean.notifyL2CacheInForeground", "false");
config.loadFromProperties(props1);
assertFalse(config.isDisableL2Cache());
assertFalse(config.isNotifyL2CacheInForeground());
assertFalse(settings.isDisableL2Cache());
assertFalse(settings.isNotifyL2CacheInForeground());
assertEquals(PersistBatch.ALL, config.getPersistBatch());
assertEquals(PersistBatch.ALL, config.getPersistBatchOnCascade());
assertEquals(PersistBatch.ALL, settings.getPersistBatch());
assertEquals(PersistBatch.ALL, settings.getPersistBatchOnCascade());
assertEquals(LengthCheck.UTF8, settings.getLengthCheck());
config.setEnabledL2Regions("r0,orgs");
assertEquals("r0,orgs", config.getEnabledL2Regions());
assertEquals("r0,orgs", settings.getEnabledL2Regions());
}
@Test
void test_defaults() {
DatabaseConfig config = new DatabaseConfig();
DatabaseBuilder.Settings config = new DatabaseConfig().settings();
assertTrue(config.isIdGeneratorAutomatic());
assertTrue(config.isDefaultServer());
assertFalse(config.isAutoPersistUpdates());
@@ -170,6 +182,8 @@ class DatabaseConfigTest {
assertEquals(600, config.getQueryPlanCapturePeriodSecs());
assertEquals(10000L, config.getQueryPlanCaptureMaxTimeMillis());
assertEquals(10, config.getQueryPlanCaptureMaxCount());
assertThat(config.getLengthCheck()).isEqualTo(LengthCheck.OFF);
assertFalse(config.isIncludeLabelInSql());
config.setLoadModuleInfo(false);
assertFalse(config.isAutoLoadModuleInfo());
@@ -184,7 +198,7 @@ class DatabaseConfigTest {
void test_putServiceObject() {
ObjectMapper objectMapper = new ObjectMapper();
DatabaseConfig config = new DatabaseConfig();
var config = new DatabaseConfig().settings();
config.putServiceObject(objectMapper);
ObjectMapper mapper0 = config.getServiceObject(ObjectMapper.class);
@@ -0,0 +1,25 @@
package io.ebean.meta;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
class MetricsAsJsonTest {
@Test
void trimIt() {
assertThat(MetricsAsJson.escape(null)).isNull();
assertThat(MetricsAsJson.escape("abc")).isEqualTo("abc");
}
@Test
void escape() {
assertThat(MetricsAsJson.escape("a\"bc")).isEqualTo("a\\\"bc");
assertThat(MetricsAsJson.escape("a\tbc")).isEqualTo("a\\tbc");
assertThat(MetricsAsJson.escape("a\bbc")).isEqualTo("a\\bbc");
assertThat(MetricsAsJson.escape("a\bc")).isEqualTo("a\\bc");
assertThat(MetricsAsJson.escape("a\rbc")).isEqualTo("a\\rbc");
assertThat(MetricsAsJson.escape("a\nbc")).isEqualTo("a\\nbc");
assertThat(MetricsAsJson.escape("a\\bc")).isEqualTo("a\\\\bc");
}
}
-101
View File
@@ -1,101 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>ebean-parent</artifactId>
<groupId>io.ebean</groupId>
<version>13.17.3</version>
</parent>
<!-- <parent>-->
<!-- <groupId>org.avaje</groupId>-->
<!-- <artifactId>java8-oss</artifactId>-->
<!-- <version>2.2</version>-->
<!-- </parent>-->
<scm>
<developerConnection>scm:git:git@github.com:ebean-orm/ebean.git</developerConnection>
<tag>HEAD</tag>
</scm>
<name>ebean autotune</name>
<description>ebean automatic query tuning module</description>
<artifactId>ebean-autotune</artifactId>
<dependencies>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-core</artifactId>
<version>13.17.3</version>
<scope>provided</scope>
</dependency>
<!-- JAVAX-DEPENDENCY-START -->
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.6</version>
<scope>provided</scope>
</dependency>
<!-- JAVAX-DEPENDENCY-END -->
<!-- JAKARTA-DEPENDENCY-START ___
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>4.0.0</version>
<scope>runtime</scope>
</dependency>
____ JAKARTA-DEPENDENCY-END -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-datasource</artifactId>
<version>${ebean-datasource.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-ddl-generator</artifactId>
<version>13.17.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.avaje</groupId>
<artifactId>junit</artifactId>
<version>1.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-platform-h2</artifactId>
<version>13.17.3</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>io.repaint.maven</groupId>
<artifactId>tiles-maven-plugin</artifactId>
<version>2.34</version>
<extensions>true</extensions>
<configuration>
<tiles>
<tile>io.ebean.tile:enhancement:13.17.1</tile>
</tiles>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -1,133 +0,0 @@
package io.ebeaninternal.server.autotune.model;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import java.util.ArrayList;
import java.util.List;
/**
* Java class for anonymous complex type.
* <p>
* The following schema fragment specifies the expected content contained within this class.
* <p>
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element ref="{http://ebean-orm.github.io/xml/ns/autotune}origin" maxOccurs="unbounded" minOccurs="0"/>
* &lt;element ref="{http://ebean-orm.github.io/xml/ns/autotune}profileDiff" minOccurs="0"/>
* &lt;element ref="{http://ebean-orm.github.io/xml/ns/autotune}profileNew" minOccurs="0"/>
* &lt;element ref="{http://ebean-orm.github.io/xml/ns/autotune}profileEmpty" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"origin",
"profileDiff",
"profileNew",
"profileEmpty"
})
@XmlRootElement(name = "autotune")
public class Autotune {
protected List<Origin> origin;
protected ProfileDiff profileDiff;
protected ProfileNew profileNew;
protected ProfileEmpty profileEmpty;
/**
* Gets the value of the origin property.
* <p>
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the origin property.
* <p>
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getOrigin().add(newItem);
* </pre>
* <p>
* <p>
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Origin }
*/
public List<Origin> getOrigin() {
if (origin == null) {
origin = new ArrayList<>();
}
return this.origin;
}
/**
* Gets the value of the profileDiff property.
*
* @return possible object is
* {@link ProfileDiff }
*/
public ProfileDiff getProfileDiff() {
return profileDiff;
}
/**
* Sets the value of the profileDiff property.
*
* @param value allowed object is
* {@link ProfileDiff }
*/
public void setProfileDiff(ProfileDiff value) {
this.profileDiff = value;
}
/**
* Gets the value of the profileNew property.
*
* @return possible object is
* {@link ProfileNew }
*/
public ProfileNew getProfileNew() {
return profileNew;
}
/**
* Sets the value of the profileNew property.
*
* @param value allowed object is
* {@link ProfileNew }
*/
public void setProfileNew(ProfileNew value) {
this.profileNew = value;
}
/**
* Gets the value of the profileEmpty property.
*
* @return possible object is
* {@link ProfileEmpty }
*/
public ProfileEmpty getProfileEmpty() {
return profileEmpty;
}
/**
* Sets the value of the profileEmpty property.
*
* @param value allowed object is
* {@link ProfileEmpty }
*/
public void setProfileEmpty(ProfileEmpty value) {
this.profileEmpty = value;
}
}
@@ -1,64 +0,0 @@
package io.ebeaninternal.server.autotune.model;
import javax.xml.bind.annotation.XmlRegistry;
/**
* This object contains factory methods for each
* Java content interface and Java element interface
* generated in the io.ebeaninternal.server.autotune.model package.
* <p>An ObjectFactory allows you to programatically
* construct new instances of the Java representation
* for XML content. The Java representation of XML
* content can consist of schema derived interfaces
* and classes representing the binding of schema
* type definitions, element declarations and model
* groups. Factory methods for each of these are
* provided in this class.
*/
@XmlRegistry
public class ObjectFactory {
/**
* Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: io.ebeaninternal.server.autotune.model
*/
public ObjectFactory() {
}
/**
* Create an instance of {@link ProfileNew }
*/
public ProfileNew createProfileNew() {
return new ProfileNew();
}
/**
* Create an instance of {@link Origin }
*/
public Origin createOrigin() {
return new Origin();
}
/**
* Create an instance of {@link ProfileEmpty }
*/
public ProfileEmpty createProfileEmpty() {
return new ProfileEmpty();
}
/**
* Create an instance of {@link Autotune }
*/
public Autotune createAutotune() {
return new Autotune();
}
/**
* Create an instance of {@link ProfileDiff }
*/
public ProfileDiff createProfileDiff() {
return new ProfileDiff();
}
}
@@ -1,148 +0,0 @@
package io.ebeaninternal.server.autotune.model;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
* <p>
* <p>The following schema fragment specifies the expected content contained within this class.
* <p>
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="callStack" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;/sequence>
* &lt;attribute name="key" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="beanType" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="detail" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="original" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"callStack"
})
@XmlRootElement(name = "origin")
public class Origin {
protected String callStack;
@XmlAttribute(name = "key", required = true)
protected String key;
@XmlAttribute(name = "beanType")
protected String beanType;
@XmlAttribute(name = "detail")
protected String detail;
@XmlAttribute(name = "original")
protected String original;
/**
* Gets the value of the callStack property.
*
* @return possible object is
* {@link String }
*/
public String getCallStack() {
return callStack;
}
/**
* Sets the value of the callStack property.
*
* @param value allowed object is
* {@link String }
*/
public void setCallStack(String value) {
this.callStack = value;
}
/**
* Gets the value of the key property.
*
* @return possible object is
* {@link String }
*/
public String getKey() {
return key;
}
/**
* Sets the value of the key property.
*
* @param value allowed object is
* {@link String }
*/
public void setKey(String value) {
this.key = value;
}
/**
* Gets the value of the beanType property.
*
* @return possible object is
* {@link String }
*/
public String getBeanType() {
return beanType;
}
/**
* Sets the value of the beanType property.
*
* @param value allowed object is
* {@link String }
*/
public void setBeanType(String value) {
this.beanType = value;
}
/**
* Gets the value of the detail property.
*
* @return possible object is
* {@link String }
*/
public String getDetail() {
return detail;
}
/**
* Sets the value of the detail property.
*
* @param value allowed object is
* {@link String }
*/
public void setDetail(String value) {
this.detail = value;
}
/**
* Gets the value of the original property.
*
* @return possible object is
* {@link String }
*/
public String getOriginal() {
return original;
}
/**
* Sets the value of the original property.
*
* @param value allowed object is
* {@link String }
*/
public void setOriginal(String value) {
this.original = value;
}
}

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