@Formula2 is a logical-path alternative to @Formula and a full replacement for it.
Where @Formula requires physical SQL (${ta} placeholders and hand-written joins),
@Formula2 takes a property-path expression and resolves the required joins
automatically:
@Formula2("coalesce(familyName, parent.familyName)")
String derivedFamilyName;
The path prefixes (parent, parent.parent, ...) define the joins needed to
satisfy the formula. Supported everywhere @Formula is:
- select() — root and nested-fetch paths, auto-joined
- where() — predicate paths trigger the extra joins
- orderBy() — order-by paths trigger the extra joins
- having()
- DDL — excluded from generated columns (read-only, like @Formula)
Default behaviour matches @Formula: included in the default select unless marked
@Transient, in which case it is opt-in but still auto-joins when selected.
Implementation:
- Parse @Formula2 after associations are wired, into a logical select fragment
plus the set of join paths (BeanDescriptor/BeanProperty).
- DeployPropertyParser registers formula2 join paths into query includes so the
existing predicate-include -> extra-join machinery builds the LEFT JOINs.
- ElPropertyChain prefixes all ${}/${path} placeholders for nested-path use.
- SqlTreeBuilder accumulates formula2 joins for select paths.
* Enhance ProfileStream to support Open Telemetry
* Add ebean-opentelemetry module
* Add the sql query text as span attribute.
Note: This is a breaking API change here but I'm pretty confident
that no one is using the ProfileStream API - hmmm.
* Otel: Use the query label and transaction label in span name if available
* SpiProfileHandler: Change such that if service loaded, doesn't need ProfileConfig
---------
Co-authored-by: Rob Bygrave <robin.bygrave@gmail.com>
Default prepared statement cache increased from 100 to 300. This could have the
effect of increased memory consumption for applications traded off with potentially
improved performance due to me cached prepared statements for larger applications.
Note that the Postgres itself has a default of 250.
Docker changed and that broke how ebean-test-containers detected the
currently assigned port for a container. That was fixed in 7.18 but
thinking its a good idea to mark that relatively important bug fix
with a bump of the major version to 8.0.
Everyone using ebean-test-containers should consider updating the
ebean-test-containers dependency to 8.0 or 7.18 (both have the fix).
* Update the kotlin-maven-plugin for tests
* Add a profile for EA that excludes kotlin-querybean-generator
* For build workflow use maven profile "default"
To ensure the kotlin-querybean-generator, test modules run
* For build workflow use maven profile "default"
To ensure the kotlin-querybean-generator, test modules run