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.
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
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.
* #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>
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).
- 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
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.
* 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
* 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
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.